Skip to content

Commit f8a80e8

Browse files
committed
moving connection classes to the bolt-connection package
1 parent 87c73d7 commit f8a80e8

File tree

99 files changed

+422
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+422
-189
lines changed

bolt-connection/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"neo4j",
1818
"driver"
1919
],
20+
"browser": {
21+
"./lib/channel/node/index.js": "./lib/channel/browser/index.js"
22+
},
2023
"author": "Neo4j",
2124
"license": "Apache-2.0",
2225
"bugs": {

src/internal/bolt/bolt-protocol-v1.js renamed to bolt-connection/src/bolt/bolt-protocol-v1.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,23 @@ import {
2020
assertDatabaseIsEmpty,
2121
assertTxConfigIsEmpty
2222
} from './bolt-protocol-util'
23-
import Bookmark from '../bookmark'
2423
import { Chunker } from '../chunking'
25-
import { ACCESS_MODE_WRITE, BOLT_PROTOCOL_V1 } from '../constants'
26-
import Logger from '../logger'
27-
import * as v1 from '../packstream-v1'
28-
import { Packer } from '../packstream-v1'
24+
import { v1 } from '../packstream'
2925
import RequestMessage from './request-message'
3026
import {
3127
LoginObserver,
3228
ResetObserver,
3329
ResultStreamObserver,
3430
StreamObserver
3531
} from './stream-observers'
36-
import TxConfig from '../tx-config'
32+
import { internal } from 'neo4j-driver-core'
33+
34+
const {
35+
bookmark: { Bookmark },
36+
constants: { ACCESS_MODE_WRITE, BOLT_PROTOCOL_V1 },
37+
logger: { Logger },
38+
txConfig: { TxConfig }
39+
} = internal
3740

3841
export default class BoltProtocol {
3942
/**

src/internal/bolt/bolt-protocol-v2.js renamed to bolt-connection/src/bolt/bolt-protocol-v2.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717
* limitations under the License.
1818
*/
1919
import BoltProtocolV1 from './bolt-protocol-v1'
20-
import * as v2 from '../packstream-v2'
21-
import { BOLT_PROTOCOL_V2 } from '../constants'
20+
import v2 from '../packstream'
21+
import { internal } from 'neo4j-driver-core'
22+
23+
const {
24+
constants: { BOLT_PROTOCOL_V2 }
25+
} = internal
2226

2327
export default class BoltProtocol extends BoltProtocolV1 {
2428
_createPacker (chunker) {

src/internal/bolt/bolt-protocol-v3.js renamed to bolt-connection/src/bolt/bolt-protocol-v3.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ import {
2525
ResultStreamObserver,
2626
ProcedureRouteObserver
2727
} from './stream-observers'
28-
import { BOLT_PROTOCOL_V3 } from '../constants'
29-
import Bookmark from '../bookmark'
30-
import TxConfig from '../tx-config'
28+
import { internal } from 'neo4j-driver-core'
29+
30+
const {
31+
bookmark: { Bookmark },
32+
constants: { BOLT_PROTOCOL_V3 },
33+
txConfig: { TxConfig }
34+
} = internal
35+
3136
const CONTEXT = 'context'
3237
const CALL_GET_ROUTING_TABLE = `CALL dbms.cluster.routing.getRoutingTable($${CONTEXT})`
3338

src/internal/bolt/bolt-protocol-v4x0.js renamed to bolt-connection/src/bolt/bolt-protocol-v4x0.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ import {
2222
ResultStreamObserver,
2323
ProcedureRouteObserver
2424
} from './stream-observers'
25-
import { BOLT_PROTOCOL_V4_0 } from '../constants'
26-
import Bookmark from '../bookmark'
27-
import TxConfig from '../tx-config'
25+
26+
import { internal } from 'neo4j-driver-core'
27+
28+
const {
29+
bookmark: { Bookmark },
30+
constants: { BOLT_PROTOCOL_V4_0 },
31+
txConfig: { TxConfig }
32+
} = internal
2833

2934
const CONTEXT = 'context'
3035
const DATABASE = 'database'

src/internal/bolt/bolt-protocol-v4x1.js renamed to bolt-connection/src/bolt/bolt-protocol-v4x1.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
*/
1919
import BoltProtocolV4 from './bolt-protocol-v4x0'
2020
import RequestMessage, { ALL } from './request-message'
21-
import { BOLT_PROTOCOL_V4_1 } from '../constants'
2221
import { LoginObserver } from './stream-observers'
22+
import { internal } from 'neo4j-driver-core'
23+
24+
const {
25+
constants: { BOLT_PROTOCOL_V4_1 }
26+
} = internal
2327

2428
export default class BoltProtocol extends BoltProtocolV4 {
2529
/**

src/internal/bolt/bolt-protocol-v4x2.js renamed to bolt-connection/src/bolt/bolt-protocol-v4x2.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
* limitations under the License.
1818
*/
1919
import BoltProtocolV41 from './bolt-protocol-v4x1'
20-
import { BOLT_PROTOCOL_V4_2 } from '../constants'
20+
21+
import { internal } from 'neo4j-driver-core'
22+
23+
const {
24+
constants: { BOLT_PROTOCOL_V4_2 }
25+
} = internal
2126

2227
export default class BoltProtocol extends BoltProtocolV41 {
2328
get version () {

src/internal/bolt/bolt-protocol-v4x3.js renamed to bolt-connection/src/bolt/bolt-protocol-v4x3.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
* limitations under the License.
1818
*/
1919
import BoltProtocolV42 from './bolt-protocol-v4x2'
20-
import { BOLT_PROTOCOL_V4_3 } from '../constants'
2120
import RequestMessage from './request-message'
2221
import { RouteObserver } from './stream-observers'
2322

23+
import { internal } from 'neo4j-driver-core'
24+
25+
const {
26+
constants: { BOLT_PROTOCOL_V4_3 }
27+
} = internal
28+
2429
export default class BoltProtocol extends BoltProtocolV42 {
2530
get version () {
2631
return BOLT_PROTOCOL_V4_3

src/internal/bolt/create.js renamed to bolt-connection/src/bolt/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import BoltProtocolV4x0 from './bolt-protocol-v4x0'
2525
import BoltProtocolV4x1 from './bolt-protocol-v4x1'
2626
import BoltProtocolV4x2 from './bolt-protocol-v4x2'
2727
import BoltProtocolV4x3 from './bolt-protocol-v4x3'
28-
import { Chunker, Dechunker } from '../chunking'
28+
import { Chunker, Dechunker } from '../channel'
2929
import ResponseHandler from './response-handler'
3030

3131
/**

0 commit comments

Comments
 (0)