├── packages ├── core │ ├── test │ │ ├── deno │ │ │ └── .gitkeep │ │ └── result-eager.test.ts │ ├── .eslintignore │ ├── .npmignore │ ├── tsconfig.build.json │ ├── .gitignore │ ├── tsconfig.json │ ├── src │ │ ├── internal │ │ │ ├── bolt-agent │ │ │ │ ├── index.ts │ │ │ │ ├── deno │ │ │ │ │ └── index.ts │ │ │ │ ├── node │ │ │ │ │ └── index.ts │ │ │ │ └── browser │ │ │ │ │ └── index.ts │ │ │ ├── resolver │ │ │ │ ├── index.ts │ │ │ │ └── base-host-name-resolver.ts │ │ │ └── pool │ │ │ │ └── index.ts │ │ └── gql-constants.ts │ ├── esdoc.json │ └── README.md ├── testkit-backend │ ├── .gitignore │ ├── src │ │ ├── feature │ │ │ ├── rx.js │ │ │ ├── deno.js │ │ │ ├── async.js │ │ │ └── index.js │ │ ├── infrastructure │ │ │ └── index.js │ │ ├── stringify.js │ │ ├── neo4j.js │ │ ├── mock │ │ │ └── fake-time.js │ │ ├── controller │ │ │ ├── index.js │ │ │ └── interface.js │ │ ├── channel │ │ │ ├── index.js │ │ │ └── interface.js │ │ ├── skipped-tests │ │ │ ├── index.js │ │ │ ├── deno.js │ │ │ ├── rx.js │ │ │ └── browser.js │ │ ├── console.remote.js │ │ └── console.configurable.js │ ├── deno │ │ ├── tsconfig.json │ │ ├── domain.ts │ │ ├── deps.ts │ │ └── README.md │ ├── public │ │ └── index.html │ └── rollup.config.js ├── neo4j-driver-deno │ ├── .gitignore │ ├── deno.json │ ├── package.json │ ├── copyright.txt │ ├── lib │ │ ├── core │ │ │ ├── internal │ │ │ │ ├── bolt-agent │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── deno │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── node │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── browser │ │ │ │ │ │ └── index.ts │ │ │ │ ├── resolver │ │ │ │ │ ├── index.ts │ │ │ │ │ └── base-host-name-resolver.ts │ │ │ │ └── pool │ │ │ │ │ └── index.ts │ │ │ └── gql-constants.ts │ │ ├── version.ts │ │ ├── bolt-connection │ │ │ ├── lang │ │ │ │ ├── index.js │ │ │ │ └── object.js │ │ │ ├── buf │ │ │ │ └── index.js │ │ │ ├── bolt │ │ │ │ ├── bolt-protocol-v3.transformer.js │ │ │ │ ├── bolt-protocol-v4x0.transformer.js │ │ │ │ ├── bolt-protocol-v4x1.transformer.js │ │ │ │ ├── bolt-protocol-v4x2.transformer.js │ │ │ │ ├── bolt-protocol-v4x3.transformer.js │ │ │ │ ├── bolt-protocol-v4x4.transformer.js │ │ │ │ ├── bolt-protocol-v5x1.transformer.js │ │ │ │ ├── bolt-protocol-v5x2.transformer.js │ │ │ │ ├── bolt-protocol-v5x3.transformer.js │ │ │ │ ├── bolt-protocol-v5x4.transformer.js │ │ │ │ ├── bolt-protocol-v5x5.transformer.js │ │ │ │ ├── bolt-protocol-v5x6.transformer.js │ │ │ │ ├── bolt-protocol-v5x7.transformer.js │ │ │ │ ├── bolt-protocol-v5x8.transformer.js │ │ │ │ └── index.js │ │ │ ├── channel │ │ │ │ ├── deno │ │ │ │ │ ├── deno-client-certificates-loader.js │ │ │ │ │ └── deno-host-name-resolver.js │ │ │ │ ├── browser │ │ │ │ │ ├── browser-client-certificates-loader.js │ │ │ │ │ └── browser-host-name-resolver.js │ │ │ │ └── index.js │ │ │ ├── rediscovery │ │ │ │ └── index.js │ │ │ ├── packstream │ │ │ │ └── index.js │ │ │ ├── load-balancing │ │ │ │ └── index.js │ │ │ ├── index.js │ │ │ ├── connection-provider │ │ │ │ ├── index.js │ │ │ │ └── connection-provider-single.js │ │ │ ├── types │ │ │ │ └── index.d.ts │ │ │ └── connection │ │ │ │ └── index.js │ │ └── logging.ts │ ├── current.version.ts │ └── versioning.ts ├── neo4j-driver │ ├── .eslintignore │ ├── test │ │ ├── resources │ │ │ ├── boltstub │ │ │ │ ├── v3 │ │ │ │ │ ├── supports_protocol_version.script │ │ │ │ │ ├── write_dead.script │ │ │ │ │ ├── read_dead.script │ │ │ │ │ ├── write_tx_dead.script │ │ │ │ │ ├── write.script │ │ │ │ │ ├── read_tx_dead.script │ │ │ │ │ ├── return_x.script │ │ │ │ │ ├── acquire_endpoints_dead.script │ │ │ │ │ ├── write_not_a_leader.script │ │ │ │ │ ├── connection_error_on_commit.script │ │ │ │ │ ├── write_tx.script │ │ │ │ │ ├── read.script │ │ │ │ │ ├── write_tx_not_a_leader.script │ │ │ │ │ ├── read_and_exit.script │ │ │ │ │ ├── no_auth.script │ │ │ │ │ ├── read_database_unavailable.script │ │ │ │ │ ├── write_twice.script │ │ │ │ │ ├── acquire_endpoints_no_records.script │ │ │ │ │ ├── query_with_error.script │ │ │ │ │ ├── write_database_unavailable.script │ │ │ │ │ ├── reset_error.script │ │ │ │ │ ├── acquire_endpoints_no_servers.script │ │ │ │ │ ├── acquire_endpoints_not_supported.script │ │ │ │ │ ├── write_tx_with_bookmarks.script │ │ │ │ │ ├── read_with_bookmark.script │ │ │ │ │ ├── read_tx.script │ │ │ │ │ ├── write_with_server_version.script │ │ │ │ │ ├── read_tx_with_bookmarks.script │ │ │ │ │ ├── hello_run_exit.script │ │ │ │ │ ├── acquire_endpoints_no_routers.script │ │ │ │ │ ├── acquire_endpoints_no_readers.script │ │ │ │ │ ├── read_with_server_version.script │ │ │ │ │ ├── write_tx_with_multiple_bookmarks.script │ │ │ │ │ ├── acquire_endpoints_one_router.script │ │ │ │ │ ├── acquire_endpoints_short_ttl.script │ │ │ │ │ ├── acquire_endpoints_three_servers_set_2.script │ │ │ │ │ ├── acquire_endpoints_unparsable_ttl.script │ │ │ │ │ ├── acquire_endpoints_no_writers.script │ │ │ │ │ ├── acquire_endpoints_no_ttl_field.script │ │ │ │ │ ├── acquire_endpoints_three_servers_set_3.script │ │ │ │ │ ├── acquire_endpoints.script │ │ │ │ │ ├── acquire_endpoints_and_exit.script │ │ │ │ │ ├── acquire_endpoints_no_servers_field.script │ │ │ │ │ ├── acquire_endpoints_three_servers_set_1.script │ │ │ │ │ ├── acquire_endpoints_unparsable_servers.script │ │ │ │ │ ├── acquire_endpoints_template.script │ │ │ │ │ ├── discover_servers_and_read.script │ │ │ │ │ ├── write_read_tx_with_bookmarks.script │ │ │ │ │ ├── discover_ipv6_servers_and_read.script │ │ │ │ │ ├── acquire_endpoints_multiple_records.script │ │ │ │ │ ├── acquire_endpoints_with_context.script │ │ │ │ │ ├── acquire_endpoints_two_servers_set_1.script │ │ │ │ │ ├── acquire_endpoints_self_as_reader.script │ │ │ │ │ ├── acquire_endpoints_rediscover.script │ │ │ │ │ └── acquire_endpoints_zero_ttl.script │ │ │ │ ├── v4.2 │ │ │ │ │ ├── supports_protocol_version.script │ │ │ │ │ ├── read_dead.script │ │ │ │ │ ├── write.script │ │ │ │ │ ├── return_x.script │ │ │ │ │ ├── write_to_aDatabase.script │ │ │ │ │ ├── read.script │ │ │ │ │ ├── query_with_error.script │ │ │ │ │ ├── read_from_aDatabase.script │ │ │ │ │ ├── reset_error.script │ │ │ │ │ ├── read_discard.script │ │ │ │ │ ├── read_in_batch.script │ │ │ │ │ ├── write_tx_with_bookmarks.script │ │ │ │ │ ├── hello_custom_user_agent.script │ │ │ │ │ ├── acquire_endpoints_aDatabase_no_servers.script │ │ │ │ │ ├── acquire_endpoints_db_not_found.script │ │ │ │ │ ├── read_from_aDatabase_with_bookmark.script │ │ │ │ │ ├── hello_run_exit.script │ │ │ │ │ ├── read_tx_discard.script │ │ │ │ │ ├── read_tx_with_bookmarks.script │ │ │ │ │ ├── hello_routing_disabled.script │ │ │ │ │ ├── hello_routing_disabled copy.script │ │ │ │ │ ├── acquire_endpoints_aDatabase.script │ │ │ │ │ ├── acquire_endpoints_default_database.script │ │ │ │ │ ├── write_read_tx_with_bookmarks.script │ │ │ │ │ ├── acquire_endpoints_aDatabase_with_bookmark.script │ │ │ │ │ ├── acquire_endpoints_with_context.script │ │ │ │ │ ├── acquire_endpoints_with_context copy.script │ │ │ │ │ ├── hello_routing_enabled.script │ │ │ │ │ ├── hello_routing_enabled copy.script │ │ │ │ │ ├── hello_routing_context.script │ │ │ │ │ └── hello_routing_context copy.script │ │ │ │ ├── v4 │ │ │ │ │ ├── supports_protocol_version.script │ │ │ │ │ ├── read_dead.script │ │ │ │ │ ├── write.script │ │ │ │ │ ├── return_x.script │ │ │ │ │ ├── write_to_aDatabase.script │ │ │ │ │ ├── read.script │ │ │ │ │ ├── query_with_error.script │ │ │ │ │ ├── read_from_aDatabase.script │ │ │ │ │ ├── read_discard.script │ │ │ │ │ ├── reset_error.script │ │ │ │ │ ├── read_in_batch.script │ │ │ │ │ ├── write_tx_with_bookmarks.script │ │ │ │ │ ├── hello_custom_user_agent.script │ │ │ │ │ ├── acquire_endpoints_aDatabase_no_servers.script │ │ │ │ │ ├── acquire_endpoints_db_not_found.script │ │ │ │ │ ├── read_from_aDatabase_with_bookmark.script │ │ │ │ │ ├── hello_run_exit.script │ │ │ │ │ ├── read_tx_discard.script │ │ │ │ │ ├── read_tx_with_bookmarks.script │ │ │ │ │ ├── acquire_endpoints_aDatabase.script │ │ │ │ │ ├── acquire_endpoints_default_database.script │ │ │ │ │ ├── write_read_tx_with_bookmarks.script │ │ │ │ │ └── acquire_endpoints_aDatabase_with_bookmark.script │ │ │ │ ├── v4.4 │ │ │ │ │ └── supports_protocol_version.script │ │ │ │ └── v4.1 │ │ │ │ │ ├── hello_routing_disabled.script │ │ │ │ │ ├── acquire_endpoints_with_context.script │ │ │ │ │ ├── hello_routing_enabled.script │ │ │ │ │ └── hello_routing_context.script │ │ │ ├── random_known_hosts │ │ │ └── random.certificate │ │ ├── internal │ │ │ └── node │ │ │ │ └── testcontainer.js │ │ ├── browser.resolver.js │ │ └── routing-driver.test.js │ ├── .babelrc │ ├── spec │ │ └── support │ │ │ └── jasmine.json │ ├── .gitignore │ ├── .npmignore │ ├── tsconfig.json │ ├── docs │ │ ├── README.md │ │ └── embed-docs.plugin.js │ ├── jest.browser.config.ts │ ├── types │ │ ├── transaction-managed-rx.d.ts │ │ ├── query-runner.d.ts │ │ ├── result-rx.d.ts │ │ └── transaction-rx.d.ts │ └── src │ │ └── version.js ├── bolt-connection │ ├── .eslintignore │ ├── .npmignore │ ├── .gitignore │ ├── tsconfig.json │ ├── src │ │ ├── lang │ │ │ ├── index.js │ │ │ └── object.js │ │ ├── buf │ │ │ └── index.js │ │ ├── bolt │ │ │ ├── bolt-protocol-v3.transformer.js │ │ │ ├── bolt-protocol-v4x0.transformer.js │ │ │ ├── bolt-protocol-v4x1.transformer.js │ │ │ ├── bolt-protocol-v4x2.transformer.js │ │ │ ├── bolt-protocol-v4x3.transformer.js │ │ │ ├── bolt-protocol-v4x4.transformer.js │ │ │ ├── bolt-protocol-v5x1.transformer.js │ │ │ ├── bolt-protocol-v5x2.transformer.js │ │ │ ├── bolt-protocol-v5x3.transformer.js │ │ │ ├── bolt-protocol-v5x4.transformer.js │ │ │ ├── bolt-protocol-v5x5.transformer.js │ │ │ ├── bolt-protocol-v5x6.transformer.js │ │ │ ├── bolt-protocol-v5x7.transformer.js │ │ │ ├── bolt-protocol-v5x8.transformer.js │ │ │ └── index.js │ │ ├── channel │ │ │ ├── deno │ │ │ │ ├── deno-client-certificates-loader.js │ │ │ │ └── deno-host-name-resolver.js │ │ │ ├── browser │ │ │ │ ├── browser-client-certificates-loader.js │ │ │ │ └── browser-host-name-resolver.js │ │ │ └── index.js │ │ ├── rediscovery │ │ │ └── index.js │ │ ├── packstream │ │ │ └── index.js │ │ ├── index.js │ │ ├── load-balancing │ │ │ └── index.js │ │ ├── connection-provider │ │ │ ├── index.js │ │ │ └── connection-provider-single.js │ │ └── connection │ │ │ └── index.js │ ├── test │ │ └── bolt │ │ │ └── behaviour │ │ │ └── index.js │ └── types │ │ └── index.d.ts ├── neo4j-driver-lite │ ├── .eslintignore │ ├── .npmignore │ ├── tsconfig.build.json │ ├── buildDependencies.sh │ ├── tsconfig.spec.json │ ├── jest.integration.config.ts │ ├── test │ │ ├── integration │ │ │ ├── browser │ │ │ │ └── testcontainer.js │ │ │ ├── node │ │ │ │ └── testcontainer.js │ │ │ └── browser.resolver.js │ │ └── unit │ │ │ └── version.test.ts │ ├── jest.browser.config.ts │ ├── .gitignore │ ├── tsconfig.json │ ├── rollup.config.js │ └── src │ │ ├── logging.ts │ │ └── version.ts └── benchkit-backend │ ├── src │ ├── error.js │ ├── config.js │ ├── ready.router.js │ └── workload.store.js │ ├── resources │ └── create.requests.http │ └── package.json ├── testkit ├── .dockerignore ├── testkit.json ├── firefox_profile │ └── prefs.js ├── unittests.py ├── stress.py ├── integration.py ├── build.py └── backend.py ├── .husky └── pre-commit ├── lerna.json ├── .gitattributes ├── .snyk ├── .semgrepignore ├── .gitignore ├── .github ├── ISSUE_TEMPLATE │ └── feature.md └── PULL_REQUEST_TEMPLATE.md ├── runTests.sh └── runTests.ps1 /packages/core/test/deno/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testkit/.dockerignore: -------------------------------------------------------------------------------- 1 | *.py 2 | 3 | -------------------------------------------------------------------------------- /packages/testkit-backend/.gitignore: -------------------------------------------------------------------------------- 1 | public/index.js 2 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | lib2/ 3 | -------------------------------------------------------------------------------- /packages/neo4j-driver/.eslintignore: -------------------------------------------------------------------------------- 1 | build 2 | docs 3 | lib 4 | node_modules -------------------------------------------------------------------------------- /packages/bolt-connection/.eslintignore: -------------------------------------------------------------------------------- 1 | build 2 | docs 3 | lib 4 | node_modules 5 | types -------------------------------------------------------------------------------- /packages/core/.eslintignore: -------------------------------------------------------------------------------- 1 | build 2 | docs 3 | lib 4 | node_modules 5 | lib6 6 | types -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run lint-staged 5 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/.eslintignore: -------------------------------------------------------------------------------- 1 | build 2 | docs 3 | lib 4 | node_modules 5 | lib6 6 | types -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "6.0.0-dev" 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | src/ 3 | build/ 4 | test/ 5 | lib6/ 6 | .gitignore 7 | node_modules/ 8 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/feature/rx.js: -------------------------------------------------------------------------------- 1 | const features = [ 2 | 3 | ] 4 | 5 | export default features 6 | -------------------------------------------------------------------------------- /packages/bolt-connection/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | src/ 3 | build/ 4 | test/ 5 | lib6/ 6 | .gitignore 7 | node_modules/ 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/supports_protocol_version.script: -------------------------------------------------------------------------------- 1 | !: AUTO GOODBYE 2 | !: BOLT 3 3 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/supports_protocol_version.script: -------------------------------------------------------------------------------- 1 | !: AUTO GOODBYE 2 | !: BOLT 4 3 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/supports_protocol_version.script: -------------------------------------------------------------------------------- 1 | !: AUTO GOODBYE 2 | !: BOLT 4 3 | -------------------------------------------------------------------------------- /packages/testkit-backend/deno/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/infrastructure/index.js: -------------------------------------------------------------------------------- 1 | export { HttpStaticServer } from './http-static.server.js' 2 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/deno.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noImplicitOverride": false 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | src/ 3 | build/ 4 | test/ 5 | lib6/ 6 | .gitignore 7 | node_modules/ 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.4/supports_protocol_version.script: -------------------------------------------------------------------------------- 1 | !: AUTO GOODBYE 2 | !: BOLT 4.4 3 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # configure github not to display generated files 2 | /packages/neo4j-driver-deno/lib/** linguist-generated=true 3 | -------------------------------------------------------------------------------- /.snyk: -------------------------------------------------------------------------------- 1 | # Snyk (https://snyk.io) policy file 2 | exclude: 3 | code: 4 | - packages/*/test/** 5 | - packages/testkit-backend/** 6 | -------------------------------------------------------------------------------- /testkit/testkit.json: -------------------------------------------------------------------------------- 1 | { 2 | "testkit": { 3 | "uri": "https://github.com/neo4j-drivers/testkit.git", 4 | "ref": "6.x" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/feature/deno.js: -------------------------------------------------------------------------------- 1 | const features = [ 2 | 'Feature:TLS:1.2', 3 | 'Feature:TLS:1.3' 4 | ] 5 | 6 | export default features 7 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/buildDependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ../core 4 | npm ci 5 | npm run build 6 | cd ../bolt-connection 7 | npm ci 8 | npm run build 9 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": ["jest", "node"] 4 | }, 5 | "typeAcquisition": { "include": ["jest"] } 6 | } 7 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_dead.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CREATE ()" {} {} 6 | C: PULL_ALL 7 | S: 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env" 5 | ] 6 | ], 7 | "plugins": [ 8 | "@babel/plugin-transform-runtime", 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_dead.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 6 | C: PULL_ALL 7 | S: 8 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/stringify.js: -------------------------------------------------------------------------------- 1 | export default function stringify (json) { 2 | return JSON.stringify(json, (_, value) => 3 | typeof value === 'bigint' ? `${value}n` : value 4 | ) 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": [ 4 | "src/**/*.ts", 5 | ], 6 | "exclude": [ 7 | "src/internal/bolt-agent/deno/*.ts" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "test", 3 | "spec_files": ["**/*.test.js", "!**/browser/*.js"], 4 | "stopSpecOnExpectationFailure": false, 5 | "random": true 6 | } 7 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read_dead.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 6 | C: PULL {"n": 1000} 7 | S: 8 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/feature/async.js: -------------------------------------------------------------------------------- 1 | const features = [ 2 | 'Feature:API:Result.List', 3 | 'Feature:API:Result.Peek', 4 | 'Optimization:PullPipelining' 5 | ] 6 | 7 | export default features 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/jest.integration.config.ts: -------------------------------------------------------------------------------- 1 | import jestConfig from './jest.config' 2 | 3 | jestConfig.testMatch = ['**/test/integration/?(*.)+(spec|test).[tj]s?(x)'] 4 | 5 | export default jestConfig 6 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read_dead.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 6 | C: PULL {"n": 1000} 7 | S: 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_tx_dead.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | RUN "CREATE (n {name:'Bob'})" {} {} 7 | PULL_ALL 8 | S: SUCCESS {} 9 | 10 | -------------------------------------------------------------------------------- /packages/testkit-backend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

Example

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": []} 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/test/integration/browser/testcontainer.js: -------------------------------------------------------------------------------- 1 | export class GenericContainer { 2 | 3 | } 4 | 5 | export class DockerImageName { 6 | 7 | } 8 | 9 | export class Wait { 10 | static forLogMessage () { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_tx_dead.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {"mode": "r"} 6 | RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": []} 9 | 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/write.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": []} 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/write.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": []} 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/return_x.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "RETURN $x" {"x": 1} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["x"]} 9 | RECORD [1] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_dead.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 6 | PULL_ALL 7 | S: 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/return_x.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "RETURN $x" {"x": 1} {} 7 | PULL { "n": 1000 } 8 | S: SUCCESS {"fields": ["x"]} 9 | RECORD [1] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/return_x.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "RETURN $x" {"x": 1} {} 7 | PULL { "n": 1000 } 8 | S: SUCCESS {"fields": ["x"]} 9 | RECORD [1] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | .DS_Store 4 | pids 5 | *.pid 6 | *.seed 7 | .lock-wscript 8 | build 9 | node_modules 10 | .idea 11 | docs/build 12 | .npmrc 13 | *.iml 14 | /lib 15 | .nyc_output 16 | coverage 17 | .vscode 18 | *.code-workspace 19 | /testkit/CAs -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/write_to_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {"db": "aDatabase"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": []} 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/write_to_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {"db": "aDatabase"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": []} 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /testkit/firefox_profile/prefs.js: -------------------------------------------------------------------------------- 1 | /* global user_pref */ 2 | user_pref('network.dnsCacheExpiration', 0); 3 | user_pref('network.dnsCacheExpirationGracePeriod', 0); 4 | user_pref('network.websocket.delay-failed-reconnects', false); 5 | user_pref('network.websocket.max-connections', 10000); 6 | -------------------------------------------------------------------------------- /.semgrepignore: -------------------------------------------------------------------------------- 1 | :include .gitignore 2 | 3 | .git 4 | .github 5 | .husky 6 | 7 | # Package manager files 8 | */node_modules/ 9 | .npm/ 10 | */package-lock.json 11 | 12 | packages/benchkit-backend 13 | packages/testkit-backend 14 | packages/*/test 15 | testkit/ 16 | benchkit/ 17 | 18 | -------------------------------------------------------------------------------- /packages/bolt-connection/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | .DS_Store 4 | pids 5 | *.pid 6 | *.seed 7 | .lock-wscript 8 | build 9 | node_modules 10 | .idea 11 | docs/build 12 | .npmrc 13 | *.iml 14 | /lib 15 | .nyc_output 16 | coverage 17 | .vscode 18 | /docs 19 | /lib6 20 | *.code-workspace -------------------------------------------------------------------------------- /packages/core/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | .DS_Store 4 | pids 5 | *.pid 6 | *.seed 7 | .lock-wscript 8 | build 9 | node_modules 10 | .idea 11 | docs/build 12 | .npmrc 13 | *.iml 14 | /lib 15 | .nyc_output 16 | coverage 17 | .vscode 18 | /types 19 | /docs 20 | /lib6 21 | *.code-workspace -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/jest.browser.config.ts: -------------------------------------------------------------------------------- 1 | import jestConfig from './jest.integration.config' 2 | 3 | export default { 4 | ...jestConfig, 5 | resolver: '/test/integration/browser.resolver.js', 6 | testEnvironment: '/test/integration/browser.environment.js' 7 | } 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/internal/node/testcontainer.js: -------------------------------------------------------------------------------- 1 | const { GenericContainer, Wait } = require('testcontainers') 2 | const { DockerImageName } = require('testcontainers/dist/docker-image-name') 3 | 4 | module.exports = { 5 | GenericContainer, 6 | Wait, 7 | DockerImageName 8 | } 9 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/test/integration/node/testcontainer.js: -------------------------------------------------------------------------------- 1 | const { GenericContainer, Wait } = require('testcontainers') 2 | const { DockerImageName } = require('testcontainers/dist/docker-image-name') 3 | 4 | module.exports = { 5 | GenericContainer, 6 | Wait, 7 | DockerImageName 8 | } 9 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_not_a_leader.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE ()" {} {} 7 | PULL_ALL 8 | S: FAILURE {"code": "Neo.ClientError.Cluster.NotALeader", "message": "blabla"} 9 | IGNORED 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/.npmignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | src/ 3 | core/ 4 | bolt-connection/ 5 | neo4j-driver-lite/ 6 | testkit/ 7 | testkit-backend/ 8 | build/ 9 | test/ 10 | .gitignore 11 | esdoc.json 12 | gulpfile.babel.js 13 | runTests.sh 14 | runTests.ps1 15 | buildDependencies.sh 16 | node_modules/ 17 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/connection_error_on_commit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n {name: 'Bob'})" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | SUCCESS {} 11 | C: COMMIT 12 | S: 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | .DS_Store 4 | pids 5 | *.pid 6 | *.seed 7 | .lock-wscript 8 | build 9 | node_modules 10 | .idea 11 | docs/build 12 | .npmrc 13 | *.iml 14 | /lib 15 | .nyc_output 16 | coverage 17 | .vscode 18 | /types 19 | /docs 20 | /lib6 21 | *.code-workspace -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/random_known_hosts: -------------------------------------------------------------------------------- 1 | # Used by tests to ensure we get proper error if we already have 2 | # a known certificate for a given url. 3 | localhost:7687 f6468f97639f16b148141d613bf991fcb96bf4b31c55c4607901b53943a6b53da58eb21bdbb1e85de7c9aeb8ef6e6f53a023a8c4ffd02cad81a18d179fc869ea 4 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/neo4j.js: -------------------------------------------------------------------------------- 1 | import neo4jDriver from 'neo4j-driver' 2 | import neo4jDriverLite from 'neo4j-driver-lite' 3 | 4 | const isLite = ['TRUE', '1'].includes((process.env.TEST_DRIVER_LITE || 'False').toUpperCase()) 5 | const neo4j = isLite ? neo4jDriverLite : neo4jDriver 6 | 7 | export default neo4j 8 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_tx.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {} 7 | RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | *.log 3 | .DS_Store 4 | pids 5 | *.pid 6 | *.seed 7 | .lock-wscript 8 | build 9 | node_modules 10 | .idea 11 | docs/build 12 | .npmrc 13 | .npm 14 | *.iml 15 | /lib 16 | .nyc_output 17 | coverage 18 | .vscode 19 | *.code-workspace 20 | /testkit/CAs 21 | /testkit/CustomCAs 22 | /testkit/firefox_profile/* 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_tx_not_a_leader.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {} 7 | RUN "CREATE ()" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | FAILURE {"code": "Neo.ClientError.Cluster.NotALeader", "message": "blabla"} 11 | IGNORED 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_and_exit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 6 | PULL_ALL 7 | S: SUCCESS {"fields": ["n.name"]} 8 | RECORD ["Bob"] 9 | RECORD ["Alice"] 10 | RECORD ["Tina"] 11 | SUCCESS {} 12 | 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for the Neo4j Javascript Driver 4 | labels: "feature request" 5 | --- 6 | 7 | # Feature Request 8 | 9 | 10 | # Pitch 11 | 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/no_auth.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: FAILURE {"code": "Neo.ClientError.Security.Unauthorized", "message": "Some server auth error message"} 6 | S: 7 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_database_unavailable.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "RETURN 1" {} {"mode": "r"} 7 | C: PULL_ALL 8 | S: FAILURE {"code": "Neo.TransientError.General.DatabaseUnavailable", "message": "Database is busy doing store copy"} 9 | S: IGNORED 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_twice.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": []} 9 | SUCCESS {} 10 | C: RUN "CREATE ()" {} {} 11 | PULL_ALL 12 | S: SUCCESS {"fields": []} 13 | SUCCESS {} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_no_records.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/query_with_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO GOODBYE 4 | 5 | C: RUN "RETURN 10 / 0" {} {} 6 | C: PULL_ALL 7 | S: FAILURE {"code": "Neo.ClientError.Statement.ArithmeticError", "message": "/ by zero"} 8 | S: IGNORED 9 | C: RESET 10 | S: SUCCESS {} 11 | C: RESET 12 | S: SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_database_unavailable.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {} 7 | C: PULL_ALL 8 | S: FAILURE {"code": "Neo.TransientError.General.DatabaseUnavailable", "message": "Database is busy doing store copy"} 9 | S: IGNORED 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/query_with_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO GOODBYE 4 | 5 | C: RUN "RETURN 10 / 0" {} {} 6 | C: PULL {"n": 1000} 7 | S: FAILURE {"code": "Neo.ClientError.Statement.ArithmeticError", "message": "/ by zero"} 8 | S: IGNORED 9 | C: RESET 10 | S: SUCCESS {} 11 | C: RESET 12 | S: SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/query_with_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO GOODBYE 4 | 5 | C: RUN "RETURN 10 / 0" {} {} 6 | C: PULL {"n": 1000} 7 | S: FAILURE {"code": "Neo.ClientError.Statement.ArithmeticError", "message": "/ by zero"} 8 | S: IGNORED 9 | C: RESET 10 | S: SUCCESS {} 11 | C: RESET 12 | S: SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/reset_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO GOODBYE 4 | 5 | C: RUN "RETURN 42 AS answer" {} {} 6 | PULL_ALL 7 | S: SUCCESS {"fields": ["answer"]} 8 | RECORD [42] 9 | SUCCESS {} 10 | C: RESET 11 | S: FAILURE {"code": "Neo.TransientError.General.DatabaseUnavailable", "message": "Unable to reset"} 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read_from_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r", "db": "aDatabase"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read_from_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r", "db": "aDatabase"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} 13 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/mock/fake-time.js: -------------------------------------------------------------------------------- 1 | import sinon from 'sinon' 2 | 3 | export default class FakeTime { 4 | constructor (time) { 5 | this._clock = sinon.useFakeTimers(time || new Date().getTime()) 6 | } 7 | 8 | tick (incrementMs) { 9 | this._clock.tick(incrementMs) 10 | } 11 | 12 | restore () { 13 | this._clock.restore() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/reset_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO GOODBYE 4 | 5 | C: RUN "RETURN 42 AS answer" {} {} 6 | PULL {"n": 1000} 7 | S: SUCCESS {"fields": ["answer"]} 8 | RECORD [42] 9 | SUCCESS {} 10 | C: RESET 11 | S: FAILURE {"code": "Neo.TransientError.General.DatabaseUnavailable", "message": "Unable to reset"} 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read_discard.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL {"n": 2} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | SUCCESS {"has_more":true} 12 | C: DISCARD {"n": -1} 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/reset_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO GOODBYE 4 | 5 | C: RUN "RETURN 42 AS answer" {} {} 6 | PULL {"n": 1000} 7 | S: SUCCESS {"fields": ["answer"]} 8 | RECORD [42] 9 | SUCCESS {} 10 | C: RESET 11 | S: FAILURE {"code": "Neo.TransientError.General.DatabaseUnavailable", "message": "Unable to reset"} 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read_discard.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL {"n": 2} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | SUCCESS {"has_more":true} 12 | C: DISCARD {"n": -1} 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_no_servers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, []] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_not_supported.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | C: PULL_ALL 8 | S: FAILURE {"code": "Neo.ClientError.Procedure.ProcedureNotFound", "message": "blabla"} 9 | S: IGNORED 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "es6", 4 | "target": "es6", 5 | "noImplicitAny": true, 6 | "noImplicitReturns": true, 7 | "strictNullChecks": true, 8 | "moduleResolution": "node", 9 | "esModuleInterop": true, 10 | "allowJs": true 11 | }, 12 | "include": ["types/**/*.ts", "test/types/**/*.ts", "*.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read_in_batch.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL {"n": 2} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | SUCCESS {"has_more":true} 12 | C: PULL {"n": 2} 13 | S: RECORD ["Tina"] 14 | SUCCESS {} 15 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"]} 7 | C: RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read_in_batch.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL {"n": 2} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | SUCCESS {"has_more":true} 12 | C: PULL {"n": 2} 13 | S: RECORD ["Tina"] 14 | SUCCESS {} 15 | -------------------------------------------------------------------------------- /packages/neo4j-driver/docs/README.md: -------------------------------------------------------------------------------- 1 | # Documentation for Neo4j Bolt Driver for JavaScript 2 | The docs are generated with [esdoc](https://github.com/esdoc/esdoc), which is added 3 | as a devDependency to this project. 4 | 5 | ## Generate docs 6 | Execute in project root. 7 | 8 | ``` 9 | npm install 10 | npm run docs 11 | ``` 12 | 13 | ## Read docs 14 | Point your web browser to `docs/build/index.html`. 15 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/write_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"]} 7 | C: RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/write_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"]} 7 | C: RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_with_bookmark.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r", "bookmarks": ["system:1111", "aDatabase:5555"]} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS { "bookmark": "aDatabase:6666" } 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/jest.browser.config.ts: -------------------------------------------------------------------------------- 1 | import jestConfig from './jest.config' 2 | 3 | export default { 4 | ...jestConfig, 5 | resolver: '/test/browser.resolver.js', 6 | testEnvironment: '/test/browser.environment.js', 7 | testPathIgnorePatterns: ['/test/examples.test.js', '/test/bolt-v3.test.js', '/test/stress.test.js'], 8 | testNamePattern: '#integration *' 9 | } 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_tx.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"mode": "r"} 7 | S: SUCCESS {} 8 | C: RUN "MATCH (n) RETURN n.name" {} {} 9 | PULL_ALL 10 | S: SUCCESS {"fields": ["n.name"]} 11 | RECORD ["Bob"] 12 | RECORD ["Alice"] 13 | RECORD ["Tina"] 14 | SUCCESS {} 15 | C: COMMIT 16 | S: SUCCESS {"bookmark": "ABookmark"} 17 | -------------------------------------------------------------------------------- /packages/benchkit-backend/src/error.js: -------------------------------------------------------------------------------- 1 | import { StatusCodes } from 'http-status-codes' 2 | 3 | export class BadRequestError extends Error { 4 | constructor (message) { 5 | super(message) 6 | this.statusCode = StatusCodes.BAD_REQUEST 7 | } 8 | } 9 | 10 | export class NotFoundError extends Error { 11 | constructor (message) { 12 | super(message) 13 | this.statusCode = StatusCodes.NOT_FOUND 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_with_server_version.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO RESET 3 | !: AUTO GOODBYE 4 | 5 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 6 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 7 | C: RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL_ALL 9 | S: SUCCESS {"fields": []} 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/hello_custom_user_agent.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "custom user agent", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | SUCCESS {} 10 | S: 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_custom_user_agent.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "custom user agent", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | SUCCESS {} 10 | S: 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/acquire_endpoints_aDatabase_no_servers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database":"aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, []] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/acquire_endpoints_aDatabase_no_servers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database":"aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, []] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/acquire_endpoints_db_not_found.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: FAILURE {"code": "Neo.ClientError.Database.DatabaseNotFound", "message": "database not found"} 9 | IGNORED 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/acquire_endpoints_db_not_found.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: FAILURE {"code": "Neo.ClientError.Database.DatabaseNotFound", "message": "database not found"} 9 | IGNORED 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read_from_aDatabase_with_bookmark.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r", "db": "aDatabase", "bookmarks": ["system:1111", "aDatabase:5555"]} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS { "bookmark": "aDatabase:6666" } 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read_from_aDatabase_with_bookmark.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r", "db": "aDatabase", "bookmarks": ["system:1111", "aDatabase:5555"]} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS { "bookmark": "aDatabase:6666" } 13 | -------------------------------------------------------------------------------- /packages/bolt-connection/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES5", 4 | "lib": ["ES6"], 5 | "noImplicitAny": true, 6 | "noImplicitReturns": true, 7 | "strictNullChecks": true, 8 | "esModuleInterop": true, 9 | "moduleResolution": "node", 10 | "downlevelIteration": true, 11 | "outDir": "lib", 12 | "allowJs": true, 13 | "isolatedModules": true 14 | }, 15 | "include": ["src/**/*.js", "types/**/*.ts"] 16 | } 17 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"], "mode": "r"} 7 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | SUCCESS {"fields": ["name"]} 11 | RECORD ["Bob"] 12 | RECORD ["Alice"] 13 | SUCCESS {} 14 | C: COMMIT 15 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 16 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/hello_run_exit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Foo"] 10 | RECORD ["Bar"] 11 | SUCCESS {} 12 | S: 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_no_routers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"},{"addresses": ["127.0.0.1:9001"], "role": "READ"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/hello_run_exit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Foo"] 10 | RECORD ["Bar"] 11 | SUCCESS {} 12 | S: 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read_tx_discard.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"mode": "r"} 7 | RUN "MATCH (n) RETURN n.name" {} {} 8 | PULL {"n": 2} 9 | S: SUCCESS {} 10 | SUCCESS {"fields": ["n.name"]} 11 | RECORD ["Bob"] 12 | RECORD ["Alice"] 13 | SUCCESS {"has_more":true} 14 | C: DISCARD {"n": -1} 15 | S: SUCCESS {} 16 | C: COMMIT 17 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 18 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/read_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"], "mode": "r"} 7 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 8 | PULL { "n": 1000 } 9 | S: SUCCESS {} 10 | SUCCESS {"fields": ["name"]} 11 | RECORD ["Bob"] 12 | RECORD ["Alice"] 13 | SUCCESS {} 14 | C: COMMIT 15 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 16 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_run_exit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Foo"] 10 | RECORD ["Bar"] 11 | SUCCESS {} 12 | S: 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read_tx_discard.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"mode": "r"} 7 | RUN "MATCH (n) RETURN n.name" {} {} 8 | PULL {"n": 2} 9 | S: SUCCESS {} 10 | SUCCESS {"fields": ["n.name"]} 11 | RECORD ["Bob"] 12 | RECORD ["Alice"] 13 | SUCCESS {"has_more":true} 14 | C: DISCARD {"n": -1} 15 | S: SUCCESS {} 16 | C: COMMIT 17 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 18 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/read_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"], "mode": "r"} 7 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 8 | PULL { "n": 1000 } 9 | S: SUCCESS {} 10 | SUCCESS {"fields": ["name"]} 11 | RECORD ["Bob"] 12 | RECORD ["Alice"] 13 | SUCCESS {} 14 | C: COMMIT 15 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 16 | -------------------------------------------------------------------------------- /runTests.sh: -------------------------------------------------------------------------------- 1 | npm install -g gulp typescript jest 2 | 3 | npm ci 4 | npm run build -- --no-private 5 | 6 | if [ -n "$2" ]; then 7 | export NEOCTRL_ARGS="$2" 8 | fi 9 | 10 | trap "npm run stop-neo4j" EXIT 11 | 12 | npm run start-neo4j 13 | 14 | if [ $? -ne 0 ]; then 15 | echo "Unable to start neo4j" 16 | exit 1 17 | fi 18 | 19 | npm test -- --no-private 20 | 21 | if [ $? -eq 0 ]; then 22 | echo "Exit with code 0" 23 | else 24 | echo "Exit with code 1" 25 | exit 1 26 | fi 27 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.1/hello_routing_disabled.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Foo"] 10 | RECORD ["Bar"] 11 | SUCCESS {} 12 | S: 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_routing_disabled.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Foo"] 10 | RECORD ["Bar"] 11 | SUCCESS {} 12 | S: 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_routing_disabled copy.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Foo"] 10 | RECORD ["Bar"] 11 | SUCCESS {} 12 | S: 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/docs/embed-docs.plugin.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | let option; 3 | 4 | class EmbebDocsPlugin { 5 | onStart(ev) { 6 | option = ev.data.option 7 | } 8 | 9 | onHandleDocs(ev) { 10 | if (option.enabled) { 11 | const data = fs.readFileSync(option.path + '/index.json', 'utf-8') 12 | const embedDocs = JSON.parse(data.toString()) 13 | ev.data.docs = [...ev.data.docs, ...embedDocs] 14 | } 15 | }; 16 | 17 | } 18 | 19 | module.exports = new EmbebDocsPlugin(); -------------------------------------------------------------------------------- /packages/benchkit-backend/src/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | backendPort: process.env.TEST_BACKEND_PORT || 9000, 3 | username: process.env.TEST_NEO4J_USER || 'neo4j', 4 | password: process.env.TEST_NEO4J_PASS || 'password', 5 | hostname: process.env.TEST_NEO4J_HOST || 'localhost', 6 | scheme: process.env.TEST_NEO4J_SCHEME || 'neo4j', 7 | boltPort: process.env.TEST_NEO4J_BOLT_PORT || 7687, 8 | logLevel: process.env.TEST_NEO4J_LOG_LEVEL, 9 | workloadRoute: '/workload', 10 | readyRoute: '/ready' 11 | } 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_no_readers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES5", 4 | "lib": ["ES6"], 5 | "noImplicitAny": true, 6 | "noImplicitReturns": true, 7 | "strictNullChecks": true, 8 | "esModuleInterop": true, 9 | "moduleResolution": "node", 10 | "downlevelIteration": true, 11 | "outDir": "lib", 12 | "declaration": true, 13 | "declarationDir": "types", 14 | "isolatedModules": true 15 | }, 16 | "include": [ 17 | "src/**/*.ts", 18 | "test/**/*.ts" 19 | ], 20 | } 21 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/read_with_server_version.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO RESET 3 | !: AUTO GOODBYE 4 | 5 | C: HELLO {"credentials": "password", "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 6 | S: SUCCESS {"server": "Neo4j/8.8.8", "connection_id": "bolt-123456789"} 7 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 8 | PULL_ALL 9 | S: SUCCESS {"fields": ["n.name"]} 10 | RECORD ["Bob"] 11 | RECORD ["Alice"] 12 | RECORD ["Tina"] 13 | SUCCESS {} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES5", 4 | "lib": ["ES6"], 5 | "noImplicitAny": true, 6 | "noImplicitReturns": true, 7 | "strictNullChecks": true, 8 | "esModuleInterop": true, 9 | "moduleResolution": "node", 10 | "downlevelIteration": true, 11 | "outDir": "lib", 12 | "declaration": true, 13 | "declarationDir": "types", 14 | "isolatedModules": true 15 | }, 16 | "include": [ 17 | "src/**/*.ts", 18 | "test/**/*.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_tx_with_multiple_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx5", "neo4j:bookmark:v1:tx29", "neo4j:bookmark:v1:tx94", "neo4j:bookmark:v1:tx56", "neo4j:bookmark:v1:tx16", "neo4j:bookmark:v1:tx68"]} 7 | C: RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {"bookmark": "neo4j:bookmark:v1:tx95"} 12 | C: COMMIT 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_one_router.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001","127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9003","127.0.0.1:9004"], "role": "READ"},{"addresses": ["127.0.0.1:9005"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_short_ttl.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [0, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9004"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_three_servers_set_2.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO GOODBYE 4 | 5 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 6 | PULL_ALL 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9010"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9011"], "role": "READ"},{"addresses": ["127.0.0.1:9004"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | C: RESET 11 | S: SUCCESS {} 12 | 13 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_unparsable_ttl.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [{ttl: 9223372036854775807}, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_no_writers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": [],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | 12 | -------------------------------------------------------------------------------- /packages/benchkit-backend/src/ready.router.js: -------------------------------------------------------------------------------- 1 | import { Router } from 'express' 2 | import { StatusCodes } from 'http-status-codes' 3 | 4 | export default function ReadyRouter (executeHealthCheck) { 5 | const router = Router() 6 | 7 | router.get('/', (_, res) => { 8 | executeHealthCheck() 9 | .then(() => res.status(StatusCodes.OK).end()) 10 | .catch(error => { 11 | console.error(error) 12 | res.status(StatusCodes.INTERNAL_SERVER_ERROR) 13 | .send(error.message) 14 | .end() 15 | }) 16 | }) 17 | 18 | return router 19 | } 20 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_no_ttl_field.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["notTtl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_three_servers_set_3.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 6 | PULL_ALL 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9009"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_and_exit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 6 | PULL_ALL 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_no_servers_field.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["notTtl", "noServers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_three_servers_set_1.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9002"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_unparsable_servers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"notAddresses": ["127.0.0.1:9001"],"memberRole": "WRITER"}, {"notAddresses": ["127.0.0.1:9002","127.0.0.1:9003"], "memberRole": "READER"},{"notAddresses": ["127.0.0.1:9001","127.0.0.1:9002"], "memberRole": "ROUTER"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/controller/index.js: -------------------------------------------------------------------------------- 1 | import Controller from './interface.js' 2 | import LocalController from './local.js' 3 | import RemoteController from './remote.js' 4 | 5 | /** 6 | * Controllers are pieces of code responsible for redirecting requests to the correct handler. 7 | * 8 | * {@link LocalController} delegates the requests to be handled by local handlers. 9 | * {@link RemoteController} delegates the requests to be handled by remote clients by forwarding the requests over websockets. 10 | */ 11 | export default Controller 12 | export { 13 | LocalController, 14 | RemoteController 15 | } 16 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_template.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": {{{writers}}},"role": "WRITE"}, {"addresses": {{{readers}}}, "role": "READ"},{"addresses": {{{routers}}}, "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["n.name"]} 14 | SUCCESS {} 15 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/channel/index.js: -------------------------------------------------------------------------------- 1 | import Channel from './interface.js' 2 | import SocketChannel from './socket.js' 3 | import WebSocketChannel from './websocket.js' 4 | /** 5 | * Channels are the pieces of code responsible for communicating with testkit. 6 | * 7 | * {@link SocketChannel} is a server socket implementation meant to be used to talk directly to the 8 | * testkit server. 9 | * 10 | * {@link WebSocketChannel} is a client implementation used for connection to other testkit-backend for receiving 11 | * messages. 12 | */ 13 | export default Channel 14 | export { 15 | SocketChannel, 16 | WebSocketChannel 17 | } 18 | -------------------------------------------------------------------------------- /packages/testkit-backend/deno/domain.ts: -------------------------------------------------------------------------------- 1 | // deno-lint-ignore-file no-explicit-any 2 | import Context from "../src/context.js"; 3 | import { FakeTime } from "./deps.ts"; 4 | 5 | export interface TestkitRequest { 6 | name: string; 7 | data?: any; 8 | } 9 | 10 | export interface TestkitResponse { 11 | name: string; 12 | data?: any; 13 | } 14 | 15 | export interface Mock { 16 | FakeTime: typeof FakeTime; 17 | } 18 | 19 | export interface RequestHandler { 20 | (service: { neo4j: any; mock: Mock }, c: Context, data: any, wire: any): void; 21 | } 22 | 23 | export interface RequestHandlerMap { 24 | [key: string]: RequestHandler; 25 | } 26 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/rollup.config.js: -------------------------------------------------------------------------------- 1 | import nodeResolve from '@rollup/plugin-node-resolve' 2 | import commonjs from '@rollup/plugin-commonjs' 3 | import polyfillNode from 'rollup-plugin-polyfill-node' 4 | 5 | export default { 6 | input: 'lib/index.js', 7 | output: [{ 8 | file: 'lib/browser/neo4j-lite-web.js', 9 | format: 'umd', 10 | name: 'neo4j' 11 | }, { 12 | file: 'lib/browser/neo4j-lite-web.esm.js', 13 | format: 'esm' 14 | }], 15 | plugins: [ 16 | nodeResolve({ 17 | browser: true, 18 | preferBuiltins: false 19 | }), 20 | commonjs(), 21 | polyfillNode({ 22 | }) 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /testkit/unittests.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in Javascript driver container. 3 | Responsible for running unit tests. 4 | Assumes driver has been setup by build script prior to this. 5 | """ 6 | from common import is_deno, run_in_driver_repo, is_lite 7 | 8 | 9 | if __name__ == "__main__": 10 | if is_lite() or is_deno(): 11 | ignore = "--ignore=neo4j-driver" 12 | else: 13 | ignore = "--ignore=neo4j-driver-@(lite|deno)" 14 | 15 | run_in_driver_repo(["npm", "run", "lint"]) 16 | run_in_driver_repo(["npm", "run", "test::unit", "--", ignore]) 17 | 18 | if is_deno(): 19 | run_in_driver_repo(["npm" "run", "test::deno"]) 20 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/acquire_endpoints_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/acquire_endpoints_default_database.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": null} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/acquire_endpoints_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/acquire_endpoints_default_database.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": null} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "neo4j-driver-deno", 3 | "version": "6.0.0-dev", 4 | "description": "Package just used for running scripts", 5 | "private": true, 6 | "main": "index.js", 7 | "directories": { 8 | "lib": "lib", 9 | "test": "test" 10 | }, 11 | "scripts": { 12 | "test": "npm run test::integration", 13 | "test::integration": "deno test --allow-all ./test", 14 | "set_version": "deno run --allow-read --allow-write ./versioning.ts --output=. --filename=current.version.ts", 15 | "build": "deno run --allow-read --allow-write --allow-net ./generate.ts" 16 | }, 17 | "author": "Neo4j", 18 | "license": "Apache-2.0" 19 | } 20 | -------------------------------------------------------------------------------- /packages/testkit-backend/deno/deps.ts: -------------------------------------------------------------------------------- 1 | export { iterateReader } from "https://deno.land/std@0.119.0/streams/conversion.ts"; 2 | export { FakeTime } from "https://deno.land/std@0.165.0/testing/time.ts"; 3 | export { default as Context } from "../src/context.js"; 4 | export { getShouldRunTest } from "../src/skipped-tests/index.js"; 5 | export { default as neo4j } from "../../neo4j-driver-deno/lib/mod.ts"; 6 | export { createGetFeatures } from "../src/feature/index.js"; 7 | export * as handlers from "../src/request-handlers.js"; 8 | export { default as CypherNativeBinders } from "../src/cypher-native-binders.js"; 9 | export { default as configurableConsole } from "../src/console.configurable.js"; 10 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/discover_servers_and_read.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["n.name"]} 14 | SUCCESS {} 15 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/write_read_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"]} 7 | RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 14 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx4242"]} 15 | RUN "MATCH (n) RETURN n.name AS name" {} {} 16 | PULL_ALL 17 | S: SUCCESS {} 18 | SUCCESS {"fields": ["name"]} 19 | RECORD ["Bob"] 20 | SUCCESS {} 21 | C: COMMIT 22 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx424242"} 23 | 24 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/feature/index.js: -------------------------------------------------------------------------------- 1 | import commonFeatures from './common.js' 2 | import rxFeatures from './rx.js' 3 | import asyncFeatures from './async.js' 4 | import denoFeatures from './deno.js' 5 | 6 | const featuresByContext = new Map([ 7 | ['async', asyncFeatures], 8 | ['rx', rxFeatures], 9 | ['deno', denoFeatures] 10 | ]) 11 | 12 | export function createGetFeatures (contexts, extraFeatures = []) { 13 | const features = contexts 14 | .filter(context => featuresByContext.has(context)) 15 | .map(context => featuresByContext.get(context)) 16 | .reduce((previous, current) => [...previous, ...current], [...commonFeatures, ...extraFeatures]) 17 | 18 | return () => features 19 | } 20 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/random.certificate: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBpTCCAQ6gAwIBAgIILUs34gik1BQwDQYJKoZIhvcNAQENBQAwFDESMBAGA1UE 3 | AwwJbG9jYWxob3N0MCAXDTE1MDMxNjE3MTkzMFoYDzk5OTkxMjMxMjM1OTU5WjAU 4 | MRIwEAYDVQQDDAlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB 5 | AIL/o9nJFxqq19qB3bW4Ww40e0FIApVqXR3sMQUutaCbA26iVtOA9LjVeCANMh+g 6 | TbNBXhc5zj4yDAh5yCEjq1e6W/mzaVLlrNKf9MUI5qlzje/r9F9hMB82pfUi1XfK 7 | ilXSueAgnzOTUZfR4kQL588YP9y6E0NCLgmIm1UijINzAgMBAAEwDQYJKoZIhvcN 8 | AQENBQADgYEAV6C5vcNBdV73esO6sFZbITgw4umg3TYttB/148xeTxORQjqkohRh 9 | qFML+Xb2YZCXqK5POKLxcN4IJsw+JJI29erNHEhDOURuoQo5p4dvmjP+1fbCDaIY 10 | P4RVWf7oaNiZBNoCeTF4vLMRfVVwSo4PmSFMgczWJVb51okq3ecLBCo= 11 | -----END CERTIFICATE----- 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/write_read_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"]} 7 | RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 14 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx4242"]} 15 | RUN "MATCH (n) RETURN n.name AS name" {} {} 16 | PULL {"n": 1000} 17 | S: SUCCESS {} 18 | SUCCESS {"fields": ["name"]} 19 | RECORD ["Bob"] 20 | SUCCESS {} 21 | C: COMMIT 22 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx424242"} 23 | 24 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/write_read_tx_with_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx42"]} 7 | RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {} 10 | SUCCESS {"fields": []} 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx4242"} 14 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx4242"]} 15 | RUN "MATCH (n) RETURN n.name AS name" {} {} 16 | PULL {"n": 1000} 17 | S: SUCCESS {} 18 | SUCCESS {"fields": ["name"]} 19 | RECORD ["Bob"] 20 | SUCCESS {} 21 | C: COMMIT 22 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx424242"} 23 | 24 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/copyright.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | -------------------------------------------------------------------------------- /runTests.ps1: -------------------------------------------------------------------------------- 1 | npm install -g gulp typescript jest 2 | 3 | npm ci 4 | npm run build -- --no-private 5 | 6 | $ErrorFound = $False 7 | 8 | try 9 | { 10 | If ($args.Length -gt 0) 11 | { 12 | $env:NEOCTRL_ARGS="$args" 13 | } 14 | 15 | npm run start-neo4j 16 | if($LastExitCode -ne 0) #failed to execute npm test without error 17 | { 18 | Write-Host "Unable to start neo4j" 19 | exit 1 20 | } 21 | 22 | npm test -- --no-private 23 | if($LastExitCode -ne 0) #failed to execute npm test without error 24 | { 25 | $ErrorFound = $True 26 | } 27 | } 28 | finally 29 | { 30 | npm run stop-neo4j 31 | if($ErrorFound) 32 | { 33 | Write-Host "Exit with code 1" 34 | exit 1 35 | } 36 | Write-Host "Exit with code 0" 37 | } 38 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4/acquire_endpoints_aDatabase_with_bookmark.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address":"127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system", "bookmarks": ["system:1111", "aDatabase:5555"]} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS { "bookmark": "system:2222"} 11 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/acquire_endpoints_aDatabase_with_bookmark.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address":"127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system", "bookmarks": ["system:1111", "aDatabase:5555"]} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS { "bookmark": "system:2222"} 11 | -------------------------------------------------------------------------------- /testkit/stress.py: -------------------------------------------------------------------------------- 1 | import os 2 | from common import ( 3 | is_browser, 4 | is_deno, 5 | is_lite, 6 | run_in_driver_repo, 7 | ) 8 | 9 | 10 | if __name__ == "__main__": 11 | os.environ["STRESS_TEST_MODE"] = "fastest" 12 | os.environ["TEST_CONTAINERS_DISABLED"] = "True" 13 | os.environ["RUNNING_TIME_IN_SECONDS"] = \ 14 | os.environ.get("TEST_NEO4J_STRESS_DURATION", 0) 15 | 16 | if not is_browser(): 17 | if is_lite(): 18 | ignore = "--ignore=neo4j-driver" 19 | else: 20 | ignore = "--ignore=neo4j-driver-@(lite|deno)" 21 | 22 | if not is_deno(): 23 | run_in_driver_repo(["npm", "run", "test::stress", "--", ignore], 24 | env=os.environ) 25 | -------------------------------------------------------------------------------- /packages/core/src/internal/bolt-agent/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './node' 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/discover_ipv6_servers_and_read.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "[::1]:9001"],"role": "READ"}, {"addresses": ["[2001:db8:a0b:12f0::1]:9002","[3731:54:65fe:2::a7]:9003"], "role": "WRITE"},{"addresses": ["[ff02::1]:9001","[684D:1111:222:3333:4444:5555:6:77]:9002","[::1]:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["n.name"]} 14 | SUCCESS {} 15 | -------------------------------------------------------------------------------- /testkit/integration.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | from common import ( 4 | is_browser, 5 | is_deno, 6 | is_lite, 7 | run_in_driver_repo, 8 | ) 9 | 10 | if __name__ == "__main__": 11 | os.environ["TEST_NEO4J_IPV6_ENABLED"] = "False" 12 | os.environ["TEST_CONTAINERS_DISABLED"] = "True" 13 | 14 | if is_lite(): 15 | ignore = "--ignore=neo4j-driver" 16 | else: 17 | ignore = "--ignore=neo4j-driver-@(lite|deno)" 18 | 19 | if is_deno(): 20 | pass 21 | elif is_browser(): 22 | run_in_driver_repo(["npm", "run", "test::browser", 23 | "--", ignore], env=os.environ) 24 | else: 25 | run_in_driver_repo( 26 | ["npm", "run", "test::integration", "--", ignore], env=os.environ) 27 | -------------------------------------------------------------------------------- /packages/core/src/internal/bolt-agent/deno/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './bolt-agent' 19 | -------------------------------------------------------------------------------- /packages/core/src/internal/bolt-agent/node/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './bolt-agent' 19 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/controller/interface.js: -------------------------------------------------------------------------------- 1 | import { EventEmitter } from 'events' 2 | 3 | /** 4 | * Controller is the unit responsible for redirecting the requests to the correct handler and managing the 5 | * creation and destruction of the request contexts. 6 | * 7 | * @event response Event triggered whith response to the request handled. 8 | */ 9 | export default class Controller extends EventEmitter { 10 | start () { 11 | 12 | } 13 | 14 | stop () { 15 | 16 | } 17 | 18 | openContext (contextId) { 19 | throw new Error('not implemented') 20 | } 21 | 22 | closeContext (contextId) { 23 | throw new Error('not implemented') 24 | } 25 | 26 | async handle (contextId, request) { 27 | throw new Error('not implemented') 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/core/src/gql-constants.ts: -------------------------------------------------------------------------------- 1 | import { NumberOrInteger } from './graph-types' 2 | 3 | /** 4 | * Class for the DiagnosticRecord in a {@link Neo4jError}, including commonly used fields. 5 | */ 6 | export interface DiagnosticRecord { 7 | OPERATION: string 8 | OPERATION_CODE: string 9 | CURRENT_SCHEMA: string 10 | _severity?: string 11 | _classification?: string 12 | _position?: { 13 | offset: NumberOrInteger 14 | line: NumberOrInteger 15 | column: NumberOrInteger 16 | } 17 | _status_parameters?: Record 18 | [key: string]: unknown 19 | } 20 | 21 | export const rawPolyfilledDiagnosticRecord = { 22 | OPERATION: '', 23 | OPERATION_CODE: '0', 24 | CURRENT_SCHEMA: '/' 25 | } 26 | 27 | Object.freeze(rawPolyfilledDiagnosticRecord) 28 | -------------------------------------------------------------------------------- /packages/core/src/internal/bolt-agent/browser/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './bolt-agent' 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/internal/bolt-agent/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './deno/index.ts' 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_multiple_records.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002"], "role": "ROUTE"}]] 10 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002","127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002"], "role": "ROUTE"}]] 11 | SUCCESS {} 12 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/internal/bolt-agent/deno/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './bolt-agent.ts' 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/internal/bolt-agent/node/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './bolt-agent.ts' 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_with_context.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"policy": "my_policy", "region": "china", "address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["name"]} 14 | RECORD ["Alice"] 15 | RECORD ["Bob"] 16 | SUCCESS {} 17 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/gql-constants.ts: -------------------------------------------------------------------------------- 1 | import { NumberOrInteger } from './graph-types.ts' 2 | 3 | /** 4 | * Class for the DiagnosticRecord in a {@link Neo4jError}, including commonly used fields. 5 | */ 6 | export interface DiagnosticRecord { 7 | OPERATION: string 8 | OPERATION_CODE: string 9 | CURRENT_SCHEMA: string 10 | _severity?: string 11 | _classification?: string 12 | _position?: { 13 | offset: NumberOrInteger 14 | line: NumberOrInteger 15 | column: NumberOrInteger 16 | } 17 | _status_parameters?: Record 18 | [key: string]: unknown 19 | } 20 | 21 | export const rawPolyfilledDiagnosticRecord = { 22 | OPERATION: '', 23 | OPERATION_CODE: '0', 24 | CURRENT_SCHEMA: '/' 25 | } 26 | 27 | Object.freeze(rawPolyfilledDiagnosticRecord) 28 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/internal/bolt-agent/browser/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './bolt-agent.ts' 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_two_servers_set_1.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | 4 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 5 | PULL_ALL 6 | S: SUCCESS {"fields": ["ttl", "servers"]} 7 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 8 | SUCCESS {} 9 | C: RESET 10 | S: SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name AS name" {} {"mode": "r"} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["name"]} 14 | RECORD ["Alice"] 15 | RECORD ["Bob"] 16 | RECORD ["Eve"] 17 | SUCCESS {} 18 | S: 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/version.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export default "6.0.2" // Specified using --version when running generate.ts 19 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/lang/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * as functional from './functional' 19 | export * as object from './object' 20 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/current.version.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export default "6.0.2" // Specified using --version when running generate.ts 19 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/browser.resolver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | const resolver = require('browser-resolve') 18 | 19 | module.exports = resolver.sync 20 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/buf/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import BaseBuffer from './base-buf' 19 | 20 | export default BaseBuffer 21 | export { BaseBuffer } 22 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_self_as_reader.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001","127.0.0.1:9009","127.0.0.1:9010"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9011"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: BEGIN {"mode": "r"} 12 | RUN "MATCH (n) RETURN n.name AS name" {} {} 13 | PULL_ALL 14 | S: SUCCESS {} 15 | SUCCESS {"fields": ["name"]} 16 | RECORD ["Bob"] 17 | RECORD ["Alice"] 18 | SUCCESS {} 19 | C: COMMIT 20 | S: SUCCESS {} 21 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/test/integration/browser.resolver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | const resolver = require('browser-resolve') 18 | 19 | module.exports = resolver.sync 20 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/lang/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * as functional from './functional.js' 19 | export * as object from './object.js' 20 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_rediscover.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["ttl", "servers"]} 14 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9004"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005"], "role": "READ"},{"addresses": ["127.0.0.1:9002","127.0.0.1:9003","127.0.0.1:9004"], "role": "ROUTE"}]] 15 | SUCCESS {} 16 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v3.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v2 from './bolt-protocol-v2.transformer' 19 | 20 | export default { 21 | ...v2 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v4x0.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v3 from './bolt-protocol-v3.transformer' 19 | 20 | export default { 21 | ...v3 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/buf/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import BaseBuffer from './base-buf.js' 19 | 20 | export default BaseBuffer 21 | export { BaseBuffer } 22 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v4x1.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x0 from './bolt-protocol-v4x0.transformer' 19 | 20 | export default { 21 | ...v4x0 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v4x2.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x1 from './bolt-protocol-v4x1.transformer' 19 | 20 | export default { 21 | ...v4x1 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v4x3.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x2 from './bolt-protocol-v4x2.transformer' 19 | 20 | export default { 21 | ...v4x2 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v4x4.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x3 from './bolt-protocol-v4x3.transformer' 19 | 20 | export default { 21 | ...v4x3 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x1.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x0 from './bolt-protocol-v5x0.transformer' 19 | 20 | export default { 21 | ...v5x0 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x2.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x1 from './bolt-protocol-v5x1.transformer' 19 | 20 | export default { 21 | ...v5x1 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x3.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x2 from './bolt-protocol-v5x2.transformer' 19 | 20 | export default { 21 | ...v5x2 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x4.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x3 from './bolt-protocol-v5x3.transformer' 19 | 20 | export default { 21 | ...v5x3 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x5.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x4 from './bolt-protocol-v5x4.transformer' 19 | 20 | export default { 21 | ...v5x4 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x6.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x5 from './bolt-protocol-v5x5.transformer' 19 | 20 | export default { 21 | ...v5x5 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x7.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x6 from './bolt-protocol-v5x6.transformer' 19 | 20 | export default { 21 | ...v5x6 22 | } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/bolt-protocol-v5x8.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x7 from './bolt-protocol-v5x7.transformer' 19 | 20 | export default { 21 | ...v5x7 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.1/acquire_endpoints_with_context.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"policy": "my_policy", "region": "china", "address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["name"]} 14 | RECORD ["Alice"] 15 | RECORD ["Bob"] 16 | SUCCESS {} 17 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/acquire_endpoints_with_context.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"policy": "my_policy", "region": "china", "address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["name"]} 14 | RECORD ["Alice"] 15 | RECORD ["Bob"] 16 | SUCCESS {} 17 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/acquire_endpoints_with_context copy.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"policy": "my_policy", "region": "china", "address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["name"]} 14 | RECORD ["Alice"] 15 | RECORD ["Bob"] 16 | SUCCESS {} 17 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/channel/deno/deno-client-certificates-loader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | export default { 18 | async load (clientCertificate) { 19 | return clientCertificate 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/bolt-connection/test/bolt/behaviour/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * as notificationFilterBehaviour from './notification-filter' 19 | export * as telemetryBehaviour from './telemetry' 20 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/channel/browser/browser-client-certificates-loader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | export default { 18 | async load (clientCertificate) { 19 | return clientCertificate 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v3.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v2 from './bolt-protocol-v2.transformer.js' 19 | 20 | export default { 21 | ...v2 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v4x0.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v3 from './bolt-protocol-v3.transformer.js' 19 | 20 | export default { 21 | ...v3 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v4x1.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x0 from './bolt-protocol-v4x0.transformer.js' 19 | 20 | export default { 21 | ...v4x0 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v4x2.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x1 from './bolt-protocol-v4x1.transformer.js' 19 | 20 | export default { 21 | ...v4x1 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v4x3.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x2 from './bolt-protocol-v4x2.transformer.js' 19 | 20 | export default { 21 | ...v4x2 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v4x4.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v4x3 from './bolt-protocol-v4x3.transformer.js' 19 | 20 | export default { 21 | ...v4x3 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x1.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x0 from './bolt-protocol-v5x0.transformer.js' 19 | 20 | export default { 21 | ...v5x0 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x2.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x1 from './bolt-protocol-v5x1.transformer.js' 19 | 20 | export default { 21 | ...v5x1 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x3.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x2 from './bolt-protocol-v5x2.transformer.js' 19 | 20 | export default { 21 | ...v5x2 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x4.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x3 from './bolt-protocol-v5x3.transformer.js' 19 | 20 | export default { 21 | ...v5x3 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x5.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x4 from './bolt-protocol-v5x4.transformer.js' 19 | 20 | export default { 21 | ...v5x4 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x6.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x5 from './bolt-protocol-v5x5.transformer.js' 19 | 20 | export default { 21 | ...v5x5 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x7.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x6 from './bolt-protocol-v5x6.transformer.js' 19 | 20 | export default { 21 | ...v5x6 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v5x8.transformer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import v5x7 from './bolt-protocol-v5x7.transformer.js' 19 | 20 | export default { 21 | ...v5x7 22 | } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/channel/deno/deno-client-certificates-loader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | export default { 18 | async load (clientCertificate) { 19 | return clientCertificate 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/channel/browser/browser-client-certificates-loader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | export default { 18 | async load (clientCertificate) { 19 | return clientCertificate 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/benchkit-backend/resources/create.requests.http: -------------------------------------------------------------------------------- 1 | ### Single query with default params 2 | POST http://localhost:8080/workload/ 3 | Content-Type: application/json 4 | 5 | { 6 | "queries": [{ 7 | "text": "RETURN 1" 8 | }] 9 | } 10 | 11 | #### Executing 12 | GET http://localhost:8080/workload/0 13 | 14 | 15 | ### Updating 16 | PATCH http://localhost:8080/workload/0 17 | Content-Type: application/json 18 | 19 | { 20 | "database": "neo4j", 21 | "mode": "parallelSessions", 22 | "queries": [{ 23 | "text": "RETURN 1" 24 | }, 25 | { 26 | "text": "RETURN 1" 27 | }, 28 | { 29 | "text": "RETURN 1" 30 | }] 31 | } 32 | 33 | 34 | #### Executing 35 | GET http://localhost:8080/workload/0 36 | 37 | 38 | #### Deleting 39 | DELETE http://localhost:8080/workload/0 40 | 41 | #### Health probe endpoint 42 | GET http://localhost:9000/ready -------------------------------------------------------------------------------- /packages/bolt-connection/src/rediscovery/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import Rediscovery from './rediscovery' 19 | import RoutingTable from './routing-table' 20 | 21 | export default Rediscovery 22 | export { Rediscovery, RoutingTable } 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/test/unit/version.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import version from '../../src/version' 18 | 19 | describe('version', () => { 20 | it('should be define', () => { 21 | expect(version).toBeDefined() 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/skipped-tests/index.js: -------------------------------------------------------------------------------- 1 | import commonSkippedTests from './common.js' 2 | import browserSkippedTests from './browser.js' 3 | import rxSessionSkippedTests from './rx.js' 4 | import denoSkippedTests from './deno.js' 5 | 6 | const skippedTestsByContext = new Map([ 7 | ['browser', browserSkippedTests], 8 | ['rx', rxSessionSkippedTests], 9 | ['deno', denoSkippedTests] 10 | ]) 11 | 12 | export function getShouldRunTest (contexts) { 13 | const skippedTests = contexts 14 | .filter(context => skippedTestsByContext.has(context)) 15 | .map(context => skippedTestsByContext.get(context)) 16 | .reduce((previous, current) => [...previous, ...current], commonSkippedTests) 17 | 18 | return (testName, { onRun, onSkip }) => { 19 | const { reason } = 20 | skippedTests.find(({ predicate }) => predicate(testName)) || {} 21 | !reason ? onRun() : onSkip(reason) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/core/src/internal/resolver/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import BaseHostNameResolver from './base-host-name-resolver' 18 | import ConfiguredCustomResolver from './configured-custom-resolver' 19 | 20 | export { BaseHostNameResolver, ConfiguredCustomResolver } 21 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/rediscovery/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import Rediscovery from './rediscovery.js' 19 | import RoutingTable from './routing-table.js' 20 | 21 | export default Rediscovery 22 | export { Rediscovery, RoutingTable } 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/packstream/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import * as v1 from './packstream-v1' 19 | import * as v2 from './packstream-v2' 20 | import * as structure from './structure' 21 | 22 | export { v1, v2, structure } 23 | 24 | export default v2 25 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/channel/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './node' 19 | export * from './chunking' 20 | export { default as ChannelConfig } from './channel-config' 21 | export { alloc } from './channel-buf' 22 | export { default as utf8 } from './utf8' 23 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/internal/resolver/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import BaseHostNameResolver from './base-host-name-resolver.ts' 18 | import ConfiguredCustomResolver from './configured-custom-resolver.ts' 19 | 20 | export { BaseHostNameResolver, ConfiguredCustomResolver } 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 11 | 12 | 18 | 19 | 24 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/packstream/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import * as v1 from './packstream-v1.js' 19 | import * as v2 from './packstream-v2.js' 20 | import * as structure from './structure.js' 21 | 22 | export { v1, v2, structure } 23 | 24 | export default v2 25 | -------------------------------------------------------------------------------- /packages/core/src/internal/pool/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import PoolConfig, { 19 | DEFAULT_ACQUISITION_TIMEOUT, 20 | DEFAULT_MAX_SIZE 21 | } from './pool-config' 22 | import Pool from './pool' 23 | 24 | export default Pool 25 | export { Pool, PoolConfig, DEFAULT_ACQUISITION_TIMEOUT, DEFAULT_MAX_SIZE } 26 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * as loadBalancing from './load-balancing' 19 | export * as bolt from './bolt' 20 | export * as buf from './buf' 21 | export * as channel from './channel' 22 | export * as packstream from './packstream' 23 | 24 | export * from './connection-provider' 25 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/channel/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * from './deno/index.js' 19 | export * from './chunking.js' 20 | export { default as ChannelConfig } from './channel-config.js' 21 | export { alloc } from './channel-buf.js' 22 | export { default as utf8 } from './utf8.js' 23 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/skipped-tests/deno.js: -------------------------------------------------------------------------------- 1 | import skip, { ifEndsWith, ifStartsWith, ifEquals } from './skip.js' 2 | 3 | const skippedTests = [ 4 | skip('DenoJS fails hard on certificate error', 5 | ifEndsWith('test_trusted_ca_expired_server_correct_hostname'), 6 | ifEndsWith('test_trusted_ca_wrong_hostname'), 7 | ifEndsWith('test_unencrypted'), 8 | ifEndsWith('test_untrusted_ca_correct_hostname'), 9 | ifEndsWith('test_1_1') 10 | ), 11 | skip('DenoJS does not support client certificates', 12 | ifStartsWith('tls.test_client_certificate.') 13 | ), 14 | skip('Trust All is not available as configuration', 15 | ifStartsWith('tls.test_self_signed_scheme.TestTrustAllCertsConfig.'), 16 | ifStartsWith('tls.test_self_signed_scheme.TestSelfSignedScheme.') 17 | ), 18 | skip('Takes a bit longer to complete in TeamCity', 19 | ifEquals('neo4j.test_session_run.TestSessionRun.test_long_string') 20 | ) 21 | ] 22 | 23 | export default skippedTests 24 | -------------------------------------------------------------------------------- /packages/neo4j-driver/types/transaction-managed-rx.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { Parameters } from './query-runner' 18 | import RxResult from './result-rx' 19 | 20 | declare class RxManagedTransaction { 21 | run: (query: string, parameters?: Parameters) => RxResult 22 | } 23 | 24 | export default RxManagedTransaction 25 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.1/hello_routing_enabled.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "routing": {}, "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["n.name"]} 14 | RECORD ["Foo"] 15 | RECORD ["Bar"] 16 | SUCCESS {} 17 | S: 18 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_routing_enabled.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "routing": {}, "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["n.name"]} 14 | RECORD ["Foo"] 15 | RECORD ["Bar"] 16 | SUCCESS {} 17 | S: 18 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/channel/interface.js: -------------------------------------------------------------------------------- 1 | import { EventEmitter } from 'events' 2 | 3 | /** 4 | * Defines the interface used for receiving commands form teskit. 5 | * 6 | * This is a thin layer only responsible for receiving and sending messages from and to testkit. 7 | * 8 | * @event contextOpen This event is triggered when a new testkit client starts its work. 9 | * @event contextClose This event is triggered when an existing client finishes it work 10 | * @event request This event is triggered when the channel receives a request 11 | */ 12 | export default class Channel extends EventEmitter { 13 | start () { 14 | throw Error('Not implemented') 15 | } 16 | 17 | stop () { 18 | throw Error('Not implemented') 19 | } 20 | 21 | writeResponse (contextId, response) { 22 | throw Error('Not implemented') 23 | } 24 | 25 | writeBackendError (contextId, error) { 26 | this.writeResponse(contextId, { name: 'BackendError', data: { msg: error } }) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_routing_enabled copy.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "routing": {}, "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["n.name"]} 14 | RECORD ["Foo"] 15 | RECORD ["Bar"] 16 | SUCCESS {} 17 | S: 18 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/internal/pool/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import PoolConfig, { 19 | DEFAULT_ACQUISITION_TIMEOUT, 20 | DEFAULT_MAX_SIZE 21 | } from './pool-config.ts' 22 | import Pool from './pool.ts' 23 | 24 | export default Pool 25 | export { Pool, PoolConfig, DEFAULT_ACQUISITION_TIMEOUT, DEFAULT_MAX_SIZE } 26 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/console.remote.js: -------------------------------------------------------------------------------- 1 | import { response } from './responses.js' 2 | 3 | const originalConsole = console 4 | 5 | export default { 6 | install: (channel) => { 7 | // eslint-disable-next-line no-global-assign 8 | console = new Proxy({}, { 9 | get: (_, method) => (...args) => { 10 | originalConsole[method].apply(originalConsole, args) 11 | channel.writeResponse(null, response('Console', { 12 | method, 13 | args 14 | }), true) 15 | } 16 | }) 17 | }, 18 | handleConsole: (message) => { 19 | if (message.response.name === 'Console') { 20 | const { method, args } = message.response.data 21 | args[0] = typeof args[0] === 'string' ? `[RemoteConsole] ${args[0]}` : args[0] 22 | console[method].apply(console, args) 23 | return true 24 | } 25 | return false 26 | }, 27 | uninstall: () => { 28 | // eslint-disable-next-line no-global-assign 29 | console = originalConsole 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/testkit-backend/rollup.config.js: -------------------------------------------------------------------------------- 1 | import nodeResolve from '@rollup/plugin-node-resolve' 2 | import commonjs from '@rollup/plugin-commonjs' 3 | import polyfillNode from 'rollup-plugin-polyfill-node' 4 | import injectProcessEnv from 'rollup-plugin-inject-process-env' 5 | 6 | function getDescriptor () { 7 | const currentDescriptor = process.env.DRIVER_DESCRIPTOR || '' 8 | return currentDescriptor + ',browser' 9 | } 10 | 11 | export default { 12 | input: 'src/index.js', 13 | output: { 14 | dir: 'public', 15 | format: 'umd', 16 | name: 'testkitbackend' 17 | }, 18 | plugins: [ 19 | nodeResolve({ 20 | browser: true, 21 | preferBuiltins: false 22 | }), 23 | commonjs(), 24 | polyfillNode({ 25 | }), 26 | injectProcessEnv({ 27 | ...process.env, 28 | TEST_ENVIRONMENT: 'LOCAL', 29 | CHANNEL_TYPE: 'WEBSOCKET', 30 | DRIVER_DESCRIPTOR: getDescriptor(), 31 | BACKEND_PORT: process.env.WEB_SERVER_PORT || 8000 32 | }) 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /packages/neo4j-driver/types/query-runner.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import { Result, types } from 'neo4j-driver-core' 19 | 20 | declare type Parameters = types.Parameters 21 | declare interface QueryRunner { 22 | run: (query: string, parameters?: Parameters) => Result 23 | } 24 | 25 | export { Parameters } 26 | 27 | export default QueryRunner 28 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/load-balancing/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import LoadBalancingStrategy from './load-balancing-strategy' 18 | import LeastConnectedLoadBalancingStrategy from './least-connected-load-balancing-strategy' 19 | 20 | export default LeastConnectedLoadBalancingStrategy 21 | export { LoadBalancingStrategy, LeastConnectedLoadBalancingStrategy } 22 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/channel/deno/deno-host-name-resolver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { internal } from 'neo4j-driver-core' 18 | 19 | const { 20 | resolver: { BaseHostNameResolver } 21 | } = internal 22 | 23 | export default class DenoHostNameResolver extends BaseHostNameResolver { 24 | resolve (address) { 25 | return this._resolveToItself(address) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/load-balancing/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import LoadBalancingStrategy from './load-balancing-strategy.js' 18 | import LeastConnectedLoadBalancingStrategy from './least-connected-load-balancing-strategy.js' 19 | 20 | export default LeastConnectedLoadBalancingStrategy 21 | export { LoadBalancingStrategy, LeastConnectedLoadBalancingStrategy } 22 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export * as loadBalancing from './load-balancing/index.js' 19 | export * as bolt from './bolt/index.js' 20 | export * as buf from './buf/index.js' 21 | export * as channel from './channel/index.js' 22 | export * as packstream from './packstream/index.js' 23 | 24 | export * from './connection-provider/index.js' 25 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/channel/browser/browser-host-name-resolver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import { internal } from 'neo4j-driver-core' 19 | 20 | const { 21 | resolver: { BaseHostNameResolver } 22 | } = internal 23 | 24 | export default class BrowserHostNameResolver extends BaseHostNameResolver { 25 | resolve (address) { 26 | return this._resolveToItself(address) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/channel/deno/deno-host-name-resolver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { internal } from '../../../core/index.ts' 18 | 19 | const { 20 | resolver: { BaseHostNameResolver } 21 | } = internal 22 | 23 | export default class DenoHostNameResolver extends BaseHostNameResolver { 24 | resolve (address) { 25 | return this._resolveToItself(address) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.1/hello_routing_context.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "routing": {"policy": "my_policy", "region": "china"}, "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"policy": "my_policy", "region": "china", "address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["n.name"]} 14 | RECORD ["Foo"] 15 | RECORD ["Bar"] 16 | SUCCESS {} 17 | S: 18 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_routing_context.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "routing": {"policy": "my_policy", "region": "china"}, "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"policy": "my_policy", "region": "china", "address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["n.name"]} 14 | RECORD ["Foo"] 15 | RECORD ["Bar"] 16 | SUCCESS {} 17 | S: 18 | -------------------------------------------------------------------------------- /packages/benchkit-backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "benchkit-backend", 3 | "version": "6.0.0-dev", 4 | "description": "The Neo4j Driver Benchkit Backend", 5 | "main": "src/index.js", 6 | "private": true, 7 | "type": "module", 8 | "scripts": { 9 | "start": "node --version | grep -q v10. && node -r esm src/index.js || node --experimental-specifier-resolution=node src/index.js", 10 | "clean": "rm -fr node_modules" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/neo4j/neo4j-javascript-driver.git" 15 | }, 16 | "keywords": [ 17 | "javascript", 18 | "node", 19 | "neo4j", 20 | "benchmark", 21 | "driver" 22 | ], 23 | "author": "Neo4j", 24 | "license": "Apache-2.0", 25 | "bugs": { 26 | "url": "https://github.com/neo4j/neo4j-javascript-driver/issues" 27 | }, 28 | "homepage": "https://github.com/neo4j/neo4j-javascript-driver#readme", 29 | "dependencies": { 30 | "express": "^4.18.2", 31 | "http-status-codes": "^2.3.0", 32 | "neo4j-driver": "6.0.0-dev" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v4.2/hello_routing_context copy.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4.1 2 | !: AUTO RESET 3 | 4 | C: HELLO {"credentials": "password", "routing": {"policy": "my_policy", "region": "china"}, "scheme": "basic", "user_agent": "neo4j-javascript/0.0.0-dev", "principal": "neo4j"} 5 | S: SUCCESS {"server": "Neo4j/9.9.9", "connection_id": "bolt-123456789"} 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"policy": "my_policy", "region": "china", "address": "127.0.0.1:9001"}, "database":null} {"db": "system", "mode": "r"} 7 | C: PULL {"n": -1 } 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name" {} {} 12 | PULL {"n": 1000} 13 | S: SUCCESS {"fields": ["n.name"]} 14 | RECORD ["Foo"] 15 | RECORD ["Bar"] 16 | SUCCESS {} 17 | S: 18 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/skipped-tests/rx.js: -------------------------------------------------------------------------------- 1 | import { skip, ifEquals, ifStartsWith } from './skip.js' 2 | 3 | const skippedTests = [ 4 | skip( 5 | 'Throws after run insted of the first next because of the backend implementation', 6 | ifEquals('stub.disconnects.test_disconnects.TestDisconnects.test_disconnect_on_tx_begin') 7 | ), 8 | skip( 9 | 'Reactive driver does not send DISCARD on consume if records stream has been subscribed to', 10 | ifStartsWith('stub.summary.test_summary.TestSummaryPlanDiscard'), 11 | ifStartsWith('stub.summary.test_summary.TestSummaryCountersDiscard'), 12 | ifStartsWith('stub.summary.test_summary.TestSummaryBasicInfoDiscard'), 13 | ifStartsWith('stub.summary.test_summary.TestSummaryGqlStatusObjects4x4Discard'), 14 | ifStartsWith('stub.summary.test_summary.TestSummaryGqlStatusObjects5x6Discard'), 15 | ifStartsWith('stub.summary.test_summary.TestSummaryNotifications4x4Discard'), 16 | ifStartsWith('stub.summary.test_summary.TestSummaryNotifications5x6Discard') 17 | ) 18 | ] 19 | 20 | export default skippedTests 21 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/connection-provider/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | export { default as SingleConnectionProvider } from './connection-provider-single' 18 | export { default as PooledConnectionProvider } from './connection-provider-pooled' 19 | export { default as DirectConnectionProvider } from './connection-provider-direct' 20 | export { default as RoutingConnectionProvider } from './connection-provider-routing' 21 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/channel/browser/browser-host-name-resolver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import { internal } from '../../../core/index.ts' 19 | 20 | const { 21 | resolver: { BaseHostNameResolver } 22 | } = internal 23 | 24 | export default class BrowserHostNameResolver extends BaseHostNameResolver { 25 | resolve (address) { 26 | return this._resolveToItself(address) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/logging.ts: -------------------------------------------------------------------------------- 1 | import { types as coreTypes } from './core/index.ts' 2 | 3 | type LogLevel = coreTypes.LogLevel 4 | 5 | /** 6 | * Object containing predefined logging configurations. These are expected to be used as values of the driver config's `logging` property. 7 | * @property {function(level: ?string): object} console the function to create a logging config that prints all messages to `console.log` with 8 | * timestamp, level and message. It takes an optional `level` parameter which represents the maximum log level to be logged. Default value is 'info'. 9 | */ 10 | export const logging = { 11 | console: (level: LogLevel) => { 12 | return { 13 | level, 14 | logger: (level: LogLevel, message: string) => 15 | console.log(`${Date.now()} ${level.toUpperCase()} ${message}`) 16 | // Note: This 'logging' object is in its own file so we can easily access the global Date object here without conflicting 17 | // with the Neo4j Date class, and without relying on 'globalThis' which isn't compatible with Node 10. 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/benchkit-backend/src/workload.store.js: -------------------------------------------------------------------------------- 1 | import { NotFoundError } from './error' 2 | 3 | export default function WorkloadStore () { 4 | let index = 0 5 | const map = new Map() 6 | 7 | return { 8 | create (workload) { 9 | const key = index.toString() 10 | index++ 11 | map.set(key, workload) 12 | return key 13 | }, 14 | patchValidated (key, patch, validate) { 15 | if (!map.has(key)) { 16 | throw new NotFoundError(`workload ${key} doesn't exist.`) 17 | } 18 | 19 | const patched = { 20 | ...map.get(key), 21 | ...patch 22 | } 23 | 24 | return validate(patched).then(p => { 25 | map.set(key, patched) 26 | }) 27 | }, 28 | get (key) { 29 | if (!map.has(key)) { 30 | throw new NotFoundError(`workload ${key} doesn't exist.`) 31 | } 32 | 33 | return map.get(key) 34 | }, 35 | delete (key) { 36 | if (!map.has(key)) { 37 | throw new NotFoundError(`workload ${key} doesn't exist.`) 38 | } 39 | map.delete(key) 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/src/logging.ts: -------------------------------------------------------------------------------- 1 | import { types as coreTypes } from 'neo4j-driver-core' 2 | 3 | type LogLevel = coreTypes.LogLevel 4 | 5 | /** 6 | * Object containing predefined logging configurations. These are expected to be used as values of the driver config's `logging` property. 7 | * @property {function(level: ?string): object} console the function to create a logging config that prints all messages to `console.log` with 8 | * timestamp, level and message. It takes an optional `level` parameter which represents the maximum log level to be logged. Default value is 'info'. 9 | */ 10 | export const logging = { 11 | console: (level: LogLevel) => { 12 | return { 13 | level, 14 | logger: (level: LogLevel, message: string) => 15 | console.log(`${Date.now()} ${level.toUpperCase()} ${message}`) 16 | // Note: This 'logging' object is in its own file so we can easily access the global Date object here without conflicting 17 | // with the Neo4j Date class, and without relying on 'globalThis' which isn't compatible with Node 10. 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/neo4j-driver/src/version.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | // DO NOT CHANGE THE VERSION BELOW HERE 19 | // This is set by the build system at release time, using 20 | // 21 | // gulp set --x 22 | // 23 | // This is set up this way to keep the version in the code in 24 | // sync with the npm package version, and to allow the build 25 | // system to control version names at packaging time. 26 | export default '0.0.0-dev' 27 | -------------------------------------------------------------------------------- /packages/neo4j-driver-lite/src/version.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | // DO NOT CHANGE THE VERSION BELOW HERE 19 | // This is set by the build system at release time, using 20 | // 21 | // gulp set --x 22 | // 23 | // This is set up this way to keep the version in the code in 24 | // sync with the npm package version, and to allow the build 25 | // system to control version names at packaging time. 26 | export default '0.0.0-dev' 27 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | export { default as SingleConnectionProvider } from './connection-provider-single.js' 18 | export { default as PooledConnectionProvider } from './connection-provider-pooled.js' 19 | export { default as DirectConnectionProvider } from './connection-provider-direct.js' 20 | export { default as RoutingConnectionProvider } from './connection-provider-routing.js' 21 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/bolt/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import handshake from './handshake' 18 | import create from './create' 19 | import _BoltProtocol from './bolt-protocol-v4x3' 20 | import _RawRoutingTable from './routing-table-raw' 21 | 22 | export * from './stream-observers' 23 | 24 | export const BoltProtocol = _BoltProtocol 25 | export const RawRoutingTable = _RawRoutingTable 26 | 27 | export default { 28 | handshake, 29 | create 30 | } 31 | -------------------------------------------------------------------------------- /packages/bolt-connection/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { 18 | ConnectionProvider 19 | } from 'neo4j-driver-core' 20 | 21 | declare class DirectConnectionProvider extends ConnectionProvider { 22 | constructor (config: any) 23 | } 24 | 25 | declare class RoutingConnectionProvider extends ConnectionProvider { 26 | constructor (config: any) 27 | } 28 | 29 | export { 30 | DirectConnectionProvider, 31 | RoutingConnectionProvider 32 | } 33 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/resources/boltstub/v3/acquire_endpoints_zero_ttl.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [0, [{"addresses": ["127.0.0.1:9091","127.0.0.1:9092","127.0.0.1:9093","127.0.0.1:9999"],"role": "ROUTE"}, {"addresses": ["127.0.0.1:9999"], "role": "READ"},{"addresses": ["127.0.0.1:9999"], "role": "WRITE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n" {} {} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["n"]} 14 | SUCCESS {} 15 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {} 16 | PULL_ALL 17 | S: SUCCESS {"fields": ["ttl", "servers"]} 18 | RECORD [0, [{"addresses": ["127.0.0.1:9999"],"role": "ROUTE"}, {"addresses": ["127.0.0.1:9999"], "role": "READ"},{"addresses": ["127.0.0.1:9999"], "role": "WRITE"}]] 19 | SUCCESS {} 20 | C: RUN "MATCH (n) RETURN n" {} {} 21 | PULL_ALL 22 | S: SUCCESS {"fields": ["n"]} 23 | SUCCESS {} 24 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { 18 | ConnectionProvider 19 | } from '../../core/index.ts' 20 | 21 | declare class DirectConnectionProvider extends ConnectionProvider { 22 | constructor (config: any) 23 | } 24 | 25 | declare class RoutingConnectionProvider extends ConnectionProvider { 26 | constructor (config: any) 27 | } 28 | 29 | export { 30 | DirectConnectionProvider, 31 | RoutingConnectionProvider 32 | } 33 | -------------------------------------------------------------------------------- /packages/neo4j-driver/types/result-rx.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { Observable } from 'rxjs' 18 | import { Record, ResultSummary } from 'neo4j-driver-core' 19 | 20 | declare class RxResult { 21 | keys: () => Observable 22 | 23 | records: () => Observable 24 | 25 | consume: () => Observable 26 | 27 | pause: () => void 28 | 29 | resume: () => Promise 30 | 31 | push: () => Promise 32 | } 33 | 34 | export default RxResult 35 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/bolt/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import handshake from './handshake.js' 18 | import create from './create.js' 19 | import _BoltProtocol from './bolt-protocol-v4x3.js' 20 | import _RawRoutingTable from './routing-table-raw.js' 21 | 22 | export * from './stream-observers.js' 23 | 24 | export const BoltProtocol = _BoltProtocol 25 | export const RawRoutingTable = _RawRoutingTable 26 | 27 | export default { 28 | handshake, 29 | create 30 | } 31 | -------------------------------------------------------------------------------- /packages/neo4j-driver/types/transaction-rx.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import { Observable } from 'rxjs' 18 | import { Parameters } from './query-runner' 19 | import RxResult from './result-rx' 20 | 21 | declare class RxTransaction { 22 | run: (query: string, parameters?: Parameters) => RxResult 23 | 24 | isOpen: () => boolean 25 | 26 | commit: () => Observable 27 | 28 | rollback: () => Observable 29 | 30 | close: () => Observable 31 | } 32 | 33 | export default RxTransaction 34 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/skipped-tests/browser.js: -------------------------------------------------------------------------------- 1 | import skip, { ifEndsWith, ifEquals, ifStartsWith } from './skip.js' 2 | const skippedTests = [ 3 | skip( 4 | "Browser doesn't support socket timeouts", 5 | ifStartsWith('stub.configuration_hints.test_connection_recv_timeout_seconds') 6 | ), 7 | skip( 8 | 'Investigate why websocket is taking too much time to close the connection', 9 | ifEndsWith('test_should_check_multi_db_support'), 10 | ifEquals('stub.disconnects.test_disconnects.TestDisconnects.test_fail_on_reset'), 11 | ifEquals('stub.tx_begin_parameters.test_tx_begin_parameters.TestTxBeginParameters.test_impersonation_fails_on_v4x3'), 12 | ifEquals('stub.session_run_parameters.test_session_run_parameters.TestSessionRunParameters.test_impersonation_fails_on_v4x3'), 13 | ifEquals('stub.driver_parameters.test_liveness_check.TestLivenessCheck.test_timeout_recv_timeout'), 14 | ifEquals('stub.driver_parameters.test_liveness_check.TestLivenessCheckRouting.test_timeout_recv_timeout') 15 | ), 16 | skip( 17 | 'TLS Tests not implemented for browser', 18 | ifStartsWith('tls') 19 | ) 20 | ] 21 | 22 | export default skippedTests 23 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/connection/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import Connection from './connection' 19 | import ChannelConnection, { 20 | createChannelConnection 21 | } from './connection-channel' 22 | import DelegateConnection from './connection-delegate' 23 | import ConnectionErrorHandler from './connection-error-handler' 24 | 25 | export default Connection 26 | export { 27 | Connection, 28 | ChannelConnection, 29 | DelegateConnection, 30 | ConnectionErrorHandler, 31 | createChannelConnection 32 | } 33 | -------------------------------------------------------------------------------- /packages/core/src/internal/resolver/base-host-name-resolver.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | /* eslint-disable @typescript-eslint/promise-function-async */ 18 | 19 | import { ServerAddress } from '../server-address' 20 | 21 | export default class BaseHostNameResolver { 22 | resolve (): Promise { 23 | throw new Error('Abstract function') 24 | } 25 | 26 | /** 27 | * @protected 28 | */ 29 | _resolveToItself (address: ServerAddress): Promise { 30 | return Promise.resolve([address]) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /testkit/build.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in Javascript driver container. 3 | Responsible for building driver and test backend. 4 | """ 5 | from common import is_deno, is_team_city, run, run_in_driver_repo, DRIVER_REPO 6 | import os 7 | 8 | 9 | def copy_files_to_workdir(): 10 | run(["cp", "-fr", "./", DRIVER_REPO]) 11 | run(["chown", "-Rh", "driver:driver", DRIVER_REPO]) 12 | 13 | 14 | def init_monorepo(): 15 | run_in_driver_repo(["rm", "-fr", "node_modules"], env=os.environ) 16 | run_in_driver_repo(["npm", "ci"], env=os.environ) 17 | 18 | 19 | def clean_and_build(): 20 | run_in_driver_repo(["npm", "run", "clean"], env=os.environ) 21 | run_in_driver_repo(["npm", "run", "build"], env=os.environ) 22 | run_in_driver_repo(["npm", "run", "build::deno", "--", "--", 23 | "--output=lib2/"], env=os.environ) 24 | 25 | if is_deno() and is_team_city(): 26 | run_in_driver_repo(["diff", "-r", "-u", 27 | "packages/neo4j-driver-deno/lib/", 28 | "packages/neo4j-driver-deno/lib2/"]) 29 | 30 | 31 | if __name__ == "__main__": 32 | copy_files_to_workdir() 33 | init_monorepo() 34 | clean_and_build() 35 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/connection/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import Connection from './connection.js' 19 | import ChannelConnection, { 20 | createChannelConnection 21 | } from './connection-channel.js' 22 | import DelegateConnection from './connection-delegate.js' 23 | import ConnectionErrorHandler from './connection-error-handler.js' 24 | 25 | export default Connection 26 | export { 27 | Connection, 28 | ChannelConnection, 29 | DelegateConnection, 30 | ConnectionErrorHandler, 31 | createChannelConnection 32 | } 33 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/core/internal/resolver/base-host-name-resolver.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | /* eslint-disable @typescript-eslint/promise-function-async */ 18 | 19 | import { ServerAddress } from '../server-address.ts' 20 | 21 | export default class BaseHostNameResolver { 22 | resolve (): Promise { 23 | throw new Error('Abstract function') 24 | } 25 | 26 | /** 27 | * @protected 28 | */ 29 | _resolveToItself (address: ServerAddress): Promise { 30 | return Promise.resolve([address]) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/versioning.ts: -------------------------------------------------------------------------------- 1 | import { join } from "https://deno.land/std@0.119.0/path/mod.ts"; 2 | import { parse } from "https://deno.land/std@0.119.0/flags/mod.ts"; 3 | import currentVersion from "./current.version.ts"; 4 | 5 | export async function setVersion (rootOutDir: string, version: string = currentVersion, filename: string = "version.ts") { 6 | const copyright = await Deno.readTextFile("./copyright.txt"); 7 | await Deno.writeTextFile( 8 | join(rootOutDir, filename), 9 | [copyright, `export default "${version}" // Specified using --version when running generate.ts\n`].join('\n'), 10 | ); 11 | } 12 | 13 | const thisFilePath = join(Deno.cwd().replace(" ", "%20"), 'versioning.ts'); 14 | if (Deno.mainModule.replace(" ", "%20").endsWith(thisFilePath)) { 15 | const parsedArgs = parse(Deno.args, { 16 | string: ["version", "output", 'filename'], 17 | unknown: (arg) => { 18 | throw new Error(`Unknown argument "${arg}"`); 19 | }, 20 | }); 21 | const rootOutDir = parsedArgs.output ?? "lib/"; 22 | const version = parsedArgs.version; 23 | const filename = parsedArgs.filename 24 | await setVersion(rootOutDir, version, filename); 25 | console.log(`Finished set version to ${version}`); 26 | } 27 | -------------------------------------------------------------------------------- /packages/core/esdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "./lib6", 3 | "destination": "./docs", 4 | "includes": ["\\.js$"], 5 | "excludes": ["external", "internal"], 6 | "package": "./package.json", 7 | "plugins": [ 8 | { 9 | "name": "esdoc-importpath-plugin", 10 | "option": { 11 | "replaces": [ 12 | { 13 | "from": "^lib6/", 14 | "to": "lib/" 15 | } 16 | ] 17 | } 18 | }, 19 | { 20 | "name": "esdoc-standard-plugin", 21 | "option": { 22 | "lint": { 23 | "enable": false 24 | }, 25 | "accessor": { 26 | "access": ["public"], 27 | "autoPrivate": true 28 | }, 29 | "undocumentIdentifier": { 30 | "enable": true 31 | }, 32 | "unexportedIdentifier": { 33 | "enable": false 34 | }, 35 | "typeInference": { 36 | "enable": true 37 | }, 38 | "brand": { 39 | "title": "Neo4j Bolt Driver 6.x for JavaScript", 40 | "repository": "https://github.com/neo4j/neo4j-javascript-driver" 41 | } 42 | } 43 | }, 44 | { 45 | "name": "esdoc-type-inference-plugin", 46 | "option": {"enable": false} 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /packages/core/test/result-eager.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import { EagerResult, Record, ResultSummary } from '../src' 19 | 20 | describe('EagerResult', () => { 21 | it('should construct with keys, records and summary', () => { 22 | const keys = ['a', 'b', 'c'] 23 | const records = [new Record(keys, [1, 2, 3])] 24 | const summary = new ResultSummary('query', {}, {}) 25 | 26 | const eagerResult = new EagerResult(keys, records, summary) 27 | 28 | expect(eagerResult.keys).toBe(keys) 29 | expect(eagerResult.records).toBe(records) 30 | expect(eagerResult.summary).toBe(summary) 31 | }) 32 | }) 33 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/lang/object.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export function equals (a, b) { 19 | if (a === b) { 20 | return true 21 | } 22 | 23 | if (a === null || b === null) { 24 | return false 25 | } 26 | 27 | if (typeof a === 'object' && typeof b === 'object') { 28 | const keysA = Object.keys(a) 29 | const keysB = Object.keys(b) 30 | 31 | if (keysA.length !== keysB.length) { 32 | return false 33 | } 34 | 35 | for (const key of keysA) { 36 | if (a[key] !== b[key]) { 37 | return false 38 | } 39 | } 40 | 41 | return true 42 | } 43 | 44 | return false 45 | } 46 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/lang/object.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | export function equals (a, b) { 19 | if (a === b) { 20 | return true 21 | } 22 | 23 | if (a === null || b === null) { 24 | return false 25 | } 26 | 27 | if (typeof a === 'object' && typeof b === 'object') { 28 | const keysA = Object.keys(a) 29 | const keysB = Object.keys(b) 30 | 31 | if (keysA.length !== keysB.length) { 32 | return false 33 | } 34 | 35 | for (const key of keysA) { 36 | if (a[key] !== b[key]) { 37 | return false 38 | } 39 | } 40 | 41 | return true 42 | } 43 | 44 | return false 45 | } 46 | -------------------------------------------------------------------------------- /packages/testkit-backend/deno/README.md: -------------------------------------------------------------------------------- 1 | # Deno-Specific Testkit Backend Implementations 2 | 3 | This directory contains Deno specific implementations which depend on having 4 | `Deno` global variable available or being able to load `Deno` specific libraries 5 | such as the `Neo4j Deno Module`. Files like `../feature/deno.js` and 6 | `../skipped-tests/deno.js` are outside this directory since they are pure 7 | javascript configuration files, and they don't depend on the environment. 8 | 9 | ## Starting Backend 10 | 11 | ### Pre-Requisites 12 | 13 | First, you need to build the `Neo4j Deno Module` by running 14 | `npm run build::deno` in the repository root folder. 15 | 16 | ### The Start Command 17 | 18 | For starting this backend, you should run the following command in this 19 | directory: 20 | 21 | ``` 22 | deno run --allow-read --allow-write --allow-net --allow-env --allow-run index.ts 23 | ``` 24 | 25 | Alternatively, you could run `'npm run start::deno'` in the root package of the 26 | `testkit-backend` or `npm run start-testkit-backend::deno` in the repository 27 | root folder. 28 | 29 | ## Project Structure 30 | 31 | - `index.ts` is responsible for configuring the backend to run. 32 | - `channel.ts` is responsible for the communication with testkit. 33 | - `controller.ts` is responsible for routing the request to the service. 34 | -------------------------------------------------------------------------------- /packages/bolt-connection/src/connection-provider/connection-provider-single.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import { ConnectionProvider } from 'neo4j-driver-core' 19 | 20 | export default class SingleConnectionProvider extends ConnectionProvider { 21 | constructor (connection) { 22 | super() 23 | this._connection = connection 24 | } 25 | 26 | /** 27 | * See {@link ConnectionProvider} for more information about this method and 28 | * its arguments. 29 | */ 30 | acquireConnection ({ accessMode, database, bookmarks } = {}) { 31 | const connection = this._connection 32 | this._connection = null 33 | return Promise.resolve(connection) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/neo4j-driver/test/routing-driver.test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import neo4j from '../src' 19 | 20 | describe('#unit RoutingDriver', () => { 21 | it('should fail when configured resolver is of illegal type', () => { 22 | expect(() => 23 | neo4j.driver( 24 | 'neo4j://localhost', 25 | {}, 26 | { resolver: 'string instead of a function' } 27 | ) 28 | ).toThrowError(TypeError) 29 | expect(() => 30 | neo4j.driver('neo4j://localhost', {}, { resolver: [] }) 31 | ).toThrowError(TypeError) 32 | expect(() => 33 | neo4j.driver('neo4j://localhost', {}, { resolver: {} }) 34 | ).toThrowError(TypeError) 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-single.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import { ConnectionProvider } from '../../core/index.ts' 19 | 20 | export default class SingleConnectionProvider extends ConnectionProvider { 21 | constructor (connection) { 22 | super() 23 | this._connection = connection 24 | } 25 | 26 | /** 27 | * See {@link ConnectionProvider} for more information about this method and 28 | * its arguments. 29 | */ 30 | acquireConnection ({ accessMode, database, bookmarks } = {}) { 31 | const connection = this._connection 32 | this._connection = null 33 | return Promise.resolve(connection) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/core/README.md: -------------------------------------------------------------------------------- 1 | # Core module of the Neo4j Driver for JavaScript 2 | 3 | > :warning: **This package is not intended to be used by end users, it contains the abstractions used by the `neo4j-driver` to handle `Neo4j` connections.** 4 | 5 | This is a internal package shared by the [neo4j-driver](https://www.npmjs.com/package/neo4j-driver) and the [neo4j-driver-lite](https://www.npmjs.com/package/neo4j-driver-lite) drivers. This package is responsible for high level pieces of the driver such as `Session`, `Result`, `Record`, some data types and the interface for `Connection` and `ConnectionProvider`. 6 | 7 | ## Building 8 | 9 | The build of this package is handled by the root package of this repository. 10 | 11 | First it is needed to install the mono-repo dependencies by running `npm ci` in the root of the repository. Then: 12 | 13 | * Build all could be performed with 14 | 15 | 16 | ``` 17 | npm run build 18 | ``` 19 | * Build only the Core could be performed with 20 | Builind only Core: 21 | ``` 22 | npm run build -- --scope=neo4j-driver-core 23 | 24 | ``` 25 | 26 | This produces a Node.js module version under `lib/`. 27 | 28 | ## Testing 29 | 30 | The tests could be executed by running `npm test` in this package folder. For development, you can have the build tool rerun the tests each time you change the source code: 31 | 32 | ``` 33 | npm run test::watch 34 | ``` 35 | -------------------------------------------------------------------------------- /packages/testkit-backend/src/console.configurable.js: -------------------------------------------------------------------------------- 1 | const originalConsole = console 2 | 3 | const config = { 4 | level: 'info', 5 | canRun: (method) => { 6 | if (config.level === 'debug') { 7 | return true 8 | } else if (config.level === 'info') { 9 | return method !== 'debug' 10 | } else if (config.level === 'warn') { 11 | return method !== 'debug' && 12 | method !== 'log' 13 | } else if (config.level === 'error') { 14 | return method !== 'debug' && 15 | method !== 'log' && 16 | method !== 'warn' 17 | } 18 | return true 19 | } 20 | } 21 | 22 | export default { 23 | install (level = 'info', logWrapper) { 24 | this.setLevel(level) 25 | // eslint-disable-next-line no-global-assign 26 | console = new Proxy({}, { 27 | get: (_, method) => (...args) => { 28 | if (config.canRun(method)) { 29 | if (logWrapper != null) { 30 | logWrapper(...args) 31 | } else { 32 | originalConsole[method].apply(originalConsole, args) 33 | } 34 | } 35 | } 36 | }) 37 | }, 38 | setLevel (level) { 39 | config.level = (level || 'info').toLowerCase() 40 | }, 41 | uninstall () { 42 | config.level = 'info' 43 | // eslint-disable-next-line no-global-assign 44 | console = originalConsole 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /testkit/backend.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in Javascript driver container. 3 | Assumes driver and backend has been built. 4 | Responsible for starting the test backend. 5 | """ 6 | from common import ( 7 | open_proccess_in_driver_repo, 8 | is_browser, 9 | is_deno, 10 | run_in_driver_repo 11 | ) 12 | import os 13 | import time 14 | 15 | 16 | if __name__ == "__main__": 17 | print("starting backend") 18 | backend_script = "start-testkit-backend" 19 | if is_deno(): 20 | backend_script = "start-testkit-backend::deno" 21 | 22 | if is_browser(): 23 | print("Testkit should test browser") 24 | os.environ["TEST_ENVIRONMENT"] = "REMOTE" 25 | 26 | session_type = os.environ.get("TEST_SESSION_TYPE", None) 27 | if session_type is not None: 28 | os.environ["SESSION_TYPE"] = session_type 29 | 30 | print("npm run start-testkit-backend") 31 | with open_proccess_in_driver_repo([ 32 | "npm", "run", backend_script 33 | ], env=os.environ) as backend: 34 | if (is_browser()): 35 | time.sleep(5) 36 | print("openning firefox") 37 | with open_proccess_in_driver_repo([ 38 | "firefox", "--profile", "./testkit/firefox_profile", "--headless", "http://localhost:8000" # type: ignore 39 | ]) as firefox: 40 | firefox.wait() 41 | backend.wait() 42 | --------------------------------------------------------------------------------