@neo4j-cypher/query-tools 2.0.0-next.29 → 2.0.0-next.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/package.json +22 -22
- package/dist/cjs/src/cypher-execution/extract-unique-nodes-and-relationships.d.ts +1 -1
- package/dist/cjs/src/cypher-execution/extract-unique-nodes-and-relationships.test.js +8 -6
- package/dist/cjs/src/cypher-execution/extract-unique-nodes-and-relationships.test.js.map +1 -1
- package/dist/cjs/src/data-transforms/cypher-type-names.d.ts +1 -1
- package/dist/cjs/src/data-transforms/cypher-type-names.js +3 -3
- package/dist/cjs/src/data-transforms/cypher-type-names.js.map +1 -1
- package/dist/cjs/src/data-transforms/record-to-string.d.ts +1 -1
- package/dist/cjs/src/data-transforms/record-to-string.js +10 -11
- package/dist/cjs/src/data-transforms/record-to-string.js.map +1 -1
- package/dist/cjs/src/index.d.ts +17 -17
- package/dist/cjs/src/index.js +15 -15
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/integration-tests/pollingIntegrationTests.test.js +7 -7
- package/dist/cjs/src/integration-tests/pollingIntegrationTests.test.js.map +1 -1
- package/dist/cjs/src/metadataPoller.js +8 -1
- package/dist/cjs/src/metadataPoller.js.map +1 -1
- package/dist/cjs/src/neo4jConnection.d.ts +1 -1
- package/dist/cjs/src/neo4jConnection.js +1 -1
- package/dist/cjs/src/neo4jConnection.js.map +1 -1
- package/dist/cjs/src/queries/dataSummary.d.ts +1 -1
- package/dist/cjs/src/queries/databases.d.ts +1 -1
- package/dist/cjs/src/queries/databases.js +2 -2
- package/dist/cjs/src/queries/databases.js.map +1 -1
- package/dist/cjs/src/queries/functions.js +3 -3
- package/dist/cjs/src/queries/functions.js.map +1 -1
- package/dist/cjs/src/queries/graphSchema.d.ts +1 -1
- package/dist/cjs/src/queries/procedures.d.ts +1 -1
- package/dist/cjs/src/queries/procedures.js +3 -3
- package/dist/cjs/src/queries/procedures.js.map +1 -1
- package/dist/cjs/src/queries/version.d.ts +1 -1
- package/dist/cjs/src/result-transformers/graph-result-transformer.d.ts +1 -1
- package/dist/cjs/src/result-transformers/graph-result-transformer.js +2 -2
- package/dist/cjs/src/result-transformers/graph-result-transformer.js.map +1 -1
- package/dist/cjs/src/schemaPoller.d.ts +3 -3
- package/dist/cjs/src/schemaPoller.js +20 -17
- package/dist/cjs/src/schemaPoller.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/package.json +22 -22
- package/dist/esm/src/cypher-execution/extract-unique-nodes-and-relationships.d.ts +1 -1
- package/dist/esm/src/cypher-execution/extract-unique-nodes-and-relationships.test.js +4 -2
- package/dist/esm/src/cypher-execution/extract-unique-nodes-and-relationships.test.js.map +1 -1
- package/dist/esm/src/data-transforms/cypher-type-names.d.ts +1 -1
- package/dist/esm/src/data-transforms/cypher-type-names.js +1 -1
- package/dist/esm/src/data-transforms/cypher-type-names.js.map +1 -1
- package/dist/esm/src/data-transforms/record-to-string.d.ts +1 -1
- package/dist/esm/src/data-transforms/record-to-string.js +4 -5
- package/dist/esm/src/data-transforms/record-to-string.js.map +1 -1
- package/dist/esm/src/index.d.ts +17 -17
- package/dist/esm/src/index.js +9 -9
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/integration-tests/pollingIntegrationTests.test.js +2 -2
- package/dist/esm/src/integration-tests/pollingIntegrationTests.test.js.map +1 -1
- package/dist/esm/src/metadataPoller.js +8 -1
- package/dist/esm/src/metadataPoller.js.map +1 -1
- package/dist/esm/src/neo4jConnection.d.ts +1 -1
- package/dist/esm/src/neo4jConnection.js +1 -1
- package/dist/esm/src/neo4jConnection.js.map +1 -1
- package/dist/esm/src/queries/dataSummary.d.ts +1 -1
- package/dist/esm/src/queries/databases.d.ts +1 -1
- package/dist/esm/src/queries/databases.js +1 -1
- package/dist/esm/src/queries/databases.js.map +1 -1
- package/dist/esm/src/queries/functions.js +1 -1
- package/dist/esm/src/queries/functions.js.map +1 -1
- package/dist/esm/src/queries/graphSchema.d.ts +1 -1
- package/dist/esm/src/queries/procedures.d.ts +1 -1
- package/dist/esm/src/queries/procedures.js +1 -1
- package/dist/esm/src/queries/procedures.js.map +1 -1
- package/dist/esm/src/queries/version.d.ts +1 -1
- package/dist/esm/src/result-transformers/graph-result-transformer.d.ts +1 -1
- package/dist/esm/src/result-transformers/graph-result-transformer.js +1 -1
- package/dist/esm/src/result-transformers/graph-result-transformer.js.map +1 -1
- package/dist/esm/src/schemaPoller.d.ts +3 -3
- package/dist/esm/src/schemaPoller.js +9 -6
- package/dist/esm/src/schemaPoller.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/cypher-execution/extract-unique-nodes-and-relationships.d.ts +1 -1
- package/dist/types/src/data-transforms/cypher-type-names.d.ts +1 -1
- package/dist/types/src/data-transforms/record-to-string.d.ts +1 -1
- package/dist/types/src/index.d.ts +17 -17
- package/dist/types/src/neo4jConnection.d.ts +1 -1
- package/dist/types/src/queries/dataSummary.d.ts +1 -1
- package/dist/types/src/queries/databases.d.ts +1 -1
- package/dist/types/src/queries/graphSchema.d.ts +1 -1
- package/dist/types/src/queries/procedures.d.ts +1 -1
- package/dist/types/src/queries/version.d.ts +1 -1
- package/dist/types/src/result-transformers/graph-result-transformer.d.ts +1 -1
- package/dist/types/src/schemaPoller.d.ts +3 -3
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/src/cypher-execution/extract-unique-nodes-and-relationships.test.ts +4 -2
- package/src/cypher-execution/extract-unique-nodes-and-relationships.ts +1 -1
- package/src/data-transforms/cypher-type-names.ts +2 -2
- package/src/data-transforms/record-to-string.ts +5 -6
- package/src/index.ts +20 -17
- package/src/integration-tests/pollingIntegrationTests.test.ts +2 -2
- package/src/metadataPoller.ts +9 -1
- package/src/neo4jConnection.ts +2 -2
- package/src/queries/dataSummary.ts +1 -1
- package/src/queries/databases.ts +1 -1
- package/src/queries/functions.ts +4 -1
- package/src/queries/graphSchema.ts +1 -1
- package/src/queries/procedures.ts +2 -2
- package/src/queries/version.ts +1 -1
- package/src/result-transformers/graph-result-transformer.ts +1 -1
- package/src/schemaPoller.ts +10 -9
- package/src/types/cypher-data-types.ts +1 -1
- package/tsconfig.json +2 -0
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-cypher/query-tools",
|
|
3
|
+
"version": "2.0.0-next.31",
|
|
3
4
|
"description": "",
|
|
4
|
-
"
|
|
5
|
+
"bugs": {
|
|
6
|
+
"url": "https://github.com/neo4j/cypher-language-support/issues"
|
|
7
|
+
},
|
|
5
8
|
"license": "Apache-2.0",
|
|
6
|
-
"
|
|
9
|
+
"author": "Neo4j Inc.",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git://github.com/neo4j/cypher-language-support.git"
|
|
13
|
+
},
|
|
7
14
|
"main": "./dist/cjs/src/index.js",
|
|
8
15
|
"module": "./dist/esm/src/index.js",
|
|
9
16
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -15,29 +22,22 @@
|
|
|
15
22
|
"default": "./dist/cjs/src/index.js"
|
|
16
23
|
}
|
|
17
24
|
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git://github.com/neo4j/cypher-language-support.git"
|
|
21
|
-
},
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/neo4j/cypher-language-support/issues"
|
|
24
|
-
},
|
|
25
|
-
"engineStrict": true,
|
|
26
|
-
"engines": {
|
|
27
|
-
"node": ">=24.11.1"
|
|
28
|
-
},
|
|
29
25
|
"dependencies": {
|
|
30
26
|
"ajv": "^8.12.0",
|
|
31
27
|
"neo4j-driver": "6.0.1",
|
|
32
|
-
"@neo4j-cypher/language-support": "2.0.0-next.
|
|
28
|
+
"@neo4j-cypher/language-support": "2.0.0-next.31"
|
|
33
29
|
},
|
|
34
30
|
"devDependencies": {
|
|
35
31
|
"@testcontainers/neo4j": "^11.5.1"
|
|
36
32
|
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=24.11.1"
|
|
35
|
+
},
|
|
36
|
+
"engineStrict": true,
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "concurrently 'npm:build-esm' 'npm:build-commonjs' 'npm:build-types'",
|
|
39
39
|
"build-esm": "tsc --module esnext --outDir dist/esm",
|
|
40
|
-
"build-commonjs": "tsc --module commonjs --outDir dist/cjs",
|
|
40
|
+
"build-commonjs": "tsc --module commonjs --moduleResolution node --outDir dist/cjs",
|
|
41
41
|
"build-types": "tsc --emitDeclarationOnly --outDir dist/types",
|
|
42
42
|
"dev": "concurrently 'npm:build-esm -- --watch' 'npm:build-commonjs -- --watch'",
|
|
43
43
|
"clean": "rm -rf {dist,tsconfig.tsbuildinfo}",
|
|
@@ -2,7 +2,7 @@ import type { Record } from 'neo4j-driver';
|
|
|
2
2
|
import { Node, Path, PathSegment, Relationship } from 'neo4j-driver';
|
|
3
3
|
|
|
4
4
|
import { describe, expect, test } from 'vitest';
|
|
5
|
-
import { extractUniqueNodesAndRels } from './extract-unique-nodes-and-relationships';
|
|
5
|
+
import { extractUniqueNodesAndRels } from './extract-unique-nodes-and-relationships.js';
|
|
6
6
|
|
|
7
7
|
describe('extractNodesAndRels', () => {
|
|
8
8
|
test('should map bolt records with a path to nodes and relationships', () => {
|
|
@@ -156,7 +156,9 @@ describe('extractNodesAndRels', () => {
|
|
|
156
156
|
|
|
157
157
|
const { nodes, relationships, limitHit } = extractUniqueNodesAndRels(
|
|
158
158
|
[boltRecord],
|
|
159
|
-
{
|
|
159
|
+
{
|
|
160
|
+
nodeLimit: 1,
|
|
161
|
+
},
|
|
160
162
|
);
|
|
161
163
|
expect(limitHit).toBe(true);
|
|
162
164
|
expect(nodes.length).toBe(1);
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
Relationship,
|
|
8
8
|
} from 'neo4j-driver';
|
|
9
9
|
import { isNode, isPath, isRelationship } from 'neo4j-driver';
|
|
10
|
-
import { CypherProperty } from '../types/cypher-data-types';
|
|
10
|
+
import { CypherProperty } from '../types/cypher-data-types.js';
|
|
11
11
|
|
|
12
12
|
export type Properties = RecordShape<string, CypherProperty>;
|
|
13
13
|
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
import type {
|
|
17
17
|
CypherDataType,
|
|
18
18
|
CypherProperty,
|
|
19
|
-
} from '../types/cypher-data-types';
|
|
19
|
+
} from '../types/cypher-data-types.js';
|
|
20
20
|
import {
|
|
21
21
|
isCypherBasicPropertyType,
|
|
22
22
|
isInt8Array,
|
|
23
|
-
} from '../types/cypher-data-types';
|
|
23
|
+
} from '../types/cypher-data-types.js';
|
|
24
24
|
|
|
25
25
|
type CypherPropertyName =
|
|
26
26
|
| 'Float'
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
import type {
|
|
14
14
|
CypherDataType,
|
|
15
15
|
CypherProperty,
|
|
16
|
-
} from '../types/cypher-data-types';
|
|
16
|
+
} from '../types/cypher-data-types.js';
|
|
17
17
|
import {
|
|
18
18
|
isCypherPropertyType,
|
|
19
19
|
isCypherTemporalType,
|
|
20
20
|
isInt8Array,
|
|
21
|
-
} from '../types/cypher-data-types';
|
|
22
|
-
import { formatFloat } from './format-float';
|
|
21
|
+
} from '../types/cypher-data-types.js';
|
|
22
|
+
import { formatFloat } from './format-float.js';
|
|
23
23
|
|
|
24
24
|
export const spacialFormat = (p: Point): string => {
|
|
25
25
|
const zString = p.z !== undefined ? `, z:${formatFloat(p.z)}` : '';
|
|
@@ -34,9 +34,7 @@ export function propertyToString(
|
|
|
34
34
|
localeFormattedDates = false,
|
|
35
35
|
): string {
|
|
36
36
|
if (Array.isArray(property)) {
|
|
37
|
-
return `[${property
|
|
38
|
-
.map((p) => propertyToString(p, quoteStrings))
|
|
39
|
-
.join(', ')}]`;
|
|
37
|
+
return `[${property.map((p) => propertyToString(p, quoteStrings)).join(', ')}]`;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
if (property === null) {
|
|
@@ -72,6 +70,7 @@ export function propertyToString(
|
|
|
72
70
|
|
|
73
71
|
if (typeof property === 'string') {
|
|
74
72
|
if (quoteStrings) {
|
|
73
|
+
// oxlint-disable-next-line typescript-eslint/restrict-template-expressions
|
|
75
74
|
return `"${property}"`;
|
|
76
75
|
}
|
|
77
76
|
return property;
|
package/src/index.ts
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
export { FRIENDLY_ERROR_MESSAGES } from './connectionErrorHandler';
|
|
2
|
-
export type { ConnectionError } from './connectionErrorHandler';
|
|
3
|
-
export * from './cypher-execution/extract-unique-nodes-and-relationships';
|
|
4
|
-
export * from './cypher-execution/query-result';
|
|
5
|
-
export type { Neo4jType } from './cypher-execution/query-result';
|
|
1
|
+
export { FRIENDLY_ERROR_MESSAGES } from './connectionErrorHandler.js';
|
|
2
|
+
export type { ConnectionError } from './connectionErrorHandler.js';
|
|
3
|
+
export * from './cypher-execution/extract-unique-nodes-and-relationships.js';
|
|
4
|
+
export * from './cypher-execution/query-result.js';
|
|
5
|
+
export type { Neo4jType } from './cypher-execution/query-result.js';
|
|
6
6
|
export {
|
|
7
7
|
getCypherTypeName,
|
|
8
8
|
getPropertyTypeDisplayName,
|
|
9
|
-
} from './data-transforms/cypher-type-names';
|
|
10
|
-
export type { CypherDataTypeName } from './data-transforms/cypher-type-names';
|
|
11
|
-
export * from './data-transforms/record-to-string';
|
|
12
|
-
export * from './types/cypher-data-types';
|
|
9
|
+
} from './data-transforms/cypher-type-names.js';
|
|
10
|
+
export type { CypherDataTypeName } from './data-transforms/cypher-type-names.js';
|
|
11
|
+
export * from './data-transforms/record-to-string.js';
|
|
12
|
+
export * from './types/cypher-data-types.js';
|
|
13
13
|
export type {
|
|
14
14
|
ConnectedMetadataPoller as CypherMetadataPoller,
|
|
15
15
|
DisconnectedMetadataPoller as EmptyMetadataPoller,
|
|
16
16
|
MetadataPoller,
|
|
17
|
-
} from './metadataPoller';
|
|
18
|
-
export type {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export type {
|
|
23
|
-
export
|
|
24
|
-
export {
|
|
17
|
+
} from './metadataPoller.js';
|
|
18
|
+
export type {
|
|
19
|
+
Neo4jConnection,
|
|
20
|
+
QueryResultWithLimit,
|
|
21
|
+
} from './neo4jConnection.js';
|
|
22
|
+
export type { Database } from './queries/databases.js';
|
|
23
|
+
export { graphResultTransformer } from './result-transformers/graph-result-transformer.js';
|
|
24
|
+
export { Neo4jSchemaPoller } from './schemaPoller.js';
|
|
25
|
+
export type { ConnnectionResult } from './schemaPoller.js';
|
|
26
|
+
export type { CypherDataType } from './types/cypher-data-types.js';
|
|
27
|
+
export { getVersion } from './queries/version.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { auth, Driver, driver, Session } from 'neo4j-driver';
|
|
2
|
-
import { createAndStartTestContainer } from './setupTestContainer';
|
|
2
|
+
import { createAndStartTestContainer } from './setupTestContainer.js';
|
|
3
3
|
import { StartedNeo4jContainer } from '@testcontainers/neo4j';
|
|
4
4
|
import {
|
|
5
5
|
extractRelationshipsWithNamedNodes,
|
|
6
6
|
GraphSchema,
|
|
7
7
|
validateGraphSchema,
|
|
8
|
-
} from '../queries/graphSchema';
|
|
8
|
+
} from '../queries/graphSchema.js';
|
|
9
9
|
|
|
10
10
|
describe('Polling integration', () => {
|
|
11
11
|
let session: Session;
|
package/src/metadataPoller.ts
CHANGED
|
@@ -250,10 +250,18 @@ export class ConnectedMetadataPoller extends MetadataPoller {
|
|
|
250
250
|
await Promise.allSettled([
|
|
251
251
|
this.databases.refetch(),
|
|
252
252
|
this.dataSummary.refetch(),
|
|
253
|
-
this.graphSchema.refetch(),
|
|
254
253
|
...Object.values(this.procedures).map((version) => version?.refetch()),
|
|
255
254
|
...Object.values(this.functions).map((version) => version?.refetch()),
|
|
256
255
|
]);
|
|
256
|
+
if (
|
|
257
|
+
this.dbSchema.labels &&
|
|
258
|
+
this.dbSchema.relationshipTypes &&
|
|
259
|
+
this.dbSchema.labels.length + this.dbSchema.relationshipTypes.length < 200
|
|
260
|
+
) {
|
|
261
|
+
await this.graphSchema.refetch();
|
|
262
|
+
} else {
|
|
263
|
+
this.dbSchema.graphSchema = undefined;
|
|
264
|
+
}
|
|
257
265
|
this.events.emit('schemaFetched');
|
|
258
266
|
}
|
|
259
267
|
|
package/src/neo4jConnection.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from 'neo4j-driver';
|
|
9
9
|
import { version } from '../package.json';
|
|
10
10
|
import { Database } from './queries/databases.js';
|
|
11
|
-
import { ExecuteQueryArgs, QueryType } from './types/sdkTypes';
|
|
11
|
+
import { ExecuteQueryArgs, QueryType } from './types/sdkTypes.js';
|
|
12
12
|
|
|
13
13
|
const METADATA_BASE = {
|
|
14
14
|
app: 'neo4j-sdk',
|
|
@@ -167,7 +167,7 @@ export class Neo4jConnection {
|
|
|
167
167
|
const result = tx.run(query, {});
|
|
168
168
|
return await queryConfig.resultTransformer(result);
|
|
169
169
|
},
|
|
170
|
-
{ metadata: { ...METADATA_BASE, type: queryType } },
|
|
170
|
+
{ timeout: 500, metadata: { ...METADATA_BASE, type: queryType } },
|
|
171
171
|
);
|
|
172
172
|
} finally {
|
|
173
173
|
await session.close();
|
package/src/queries/databases.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CypherVersion } from '@neo4j-cypher/language-support';
|
|
2
2
|
import { resultTransformers } from 'neo4j-driver';
|
|
3
|
-
import { ExecuteQueryArgs, DbType } from '../types/sdkTypes';
|
|
3
|
+
import { ExecuteQueryArgs, DbType } from '../types/sdkTypes.js';
|
|
4
4
|
|
|
5
5
|
export type DatabaseStatus =
|
|
6
6
|
| 'online'
|
package/src/queries/functions.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { CypherVersion, Neo4jFunction } from '@neo4j-cypher/language-support';
|
|
2
2
|
import Ajv, { JSONSchemaType } from 'ajv';
|
|
3
3
|
import { resultTransformers } from 'neo4j-driver';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
cleanType,
|
|
6
|
+
cleanTypeDescription,
|
|
7
|
+
} from '../data-transforms/clean-type.js';
|
|
5
8
|
import type { ExecuteQueryArgs } from '../types/sdkTypes.js';
|
|
6
9
|
|
|
7
10
|
type ListFunctionArgs = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CypherVersion, Neo4jProcedure } from '@neo4j-cypher/language-support';
|
|
2
2
|
import Ajv, { JSONSchemaType } from 'ajv';
|
|
3
3
|
import { resultTransformers } from 'neo4j-driver';
|
|
4
|
-
import { cleanTypeDescription } from '../data-transforms/clean-type';
|
|
5
|
-
import type { ExecuteQueryArgs } from '../types/sdkTypes';
|
|
4
|
+
import { cleanTypeDescription } from '../data-transforms/clean-type.js';
|
|
5
|
+
import type { ExecuteQueryArgs } from '../types/sdkTypes.js';
|
|
6
6
|
|
|
7
7
|
type ListProcedureArgs = {
|
|
8
8
|
executableByMe: boolean;
|
package/src/queries/version.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
DeduplicatedNodesAndRels,
|
|
10
10
|
extractUniqueNodesAndRels,
|
|
11
|
-
} from '../cypher-execution/extract-unique-nodes-and-relationships';
|
|
11
|
+
} from '../cypher-execution/extract-unique-nodes-and-relationships.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Result type for graph queries that includes deduplicated nodes and relationships
|
package/src/schemaPoller.ts
CHANGED
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
FRIENDLY_ERROR_MESSAGES,
|
|
6
6
|
getConnectionError,
|
|
7
7
|
isRetriableNeo4jError,
|
|
8
|
-
} from './connectionErrorHandler';
|
|
8
|
+
} from './connectionErrorHandler.js';
|
|
9
9
|
import {
|
|
10
10
|
ConnectedMetadataPoller,
|
|
11
11
|
DisconnectedMetadataPoller,
|
|
12
12
|
MetadataPoller,
|
|
13
|
-
} from './metadataPoller';
|
|
14
|
-
import { Neo4jConnection } from './neo4jConnection';
|
|
13
|
+
} from './metadataPoller.js';
|
|
14
|
+
import { Neo4jConnection } from './neo4jConnection.js';
|
|
15
15
|
import { listDatabases } from './queries/databases.js';
|
|
16
|
-
import { getVersion } from './queries/version';
|
|
16
|
+
import { getVersion } from './queries/version.js';
|
|
17
17
|
|
|
18
18
|
export type ConnnectionResult = {
|
|
19
19
|
success: boolean;
|
|
@@ -168,7 +168,7 @@ export class Neo4jSchemaPoller {
|
|
|
168
168
|
);
|
|
169
169
|
return ['5', '25'];
|
|
170
170
|
}
|
|
171
|
-
} catch
|
|
171
|
+
} catch {
|
|
172
172
|
return ['5'];
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -247,7 +247,10 @@ export class Neo4jSchemaPoller {
|
|
|
247
247
|
const driver = neo4j.driver(
|
|
248
248
|
url,
|
|
249
249
|
neo4j.auth.basic(credentials.username, credentials.password),
|
|
250
|
-
{
|
|
250
|
+
{
|
|
251
|
+
userAgent: config.appName,
|
|
252
|
+
...config.driverConfig,
|
|
253
|
+
},
|
|
251
254
|
);
|
|
252
255
|
|
|
253
256
|
await driver.verifyConnectivity({ database: database });
|
|
@@ -323,9 +326,7 @@ export class Neo4jSchemaPoller {
|
|
|
323
326
|
retriable: boolean,
|
|
324
327
|
): ConnectionError {
|
|
325
328
|
const friendlyMessage = retriable
|
|
326
|
-
? `${connectionError.friendlyMessage}. Retrying in ${
|
|
327
|
-
RETRY_INTERVAL_MS / 1000
|
|
328
|
-
} seconds`
|
|
329
|
+
? `${connectionError.friendlyMessage}. Retrying in ${RETRY_INTERVAL_MS / 1000} seconds`
|
|
329
330
|
: connectionError.friendlyMessage;
|
|
330
331
|
|
|
331
332
|
return {
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from 'neo4j-driver';
|
|
26
26
|
type NumberOrInteger = number | Integer | bigint;
|
|
27
27
|
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
29
|
The neo4j driver type mapping - https://neo4j.com/docs/javascript-manual/current/cypher-workflow/#js-driver-type-mapping
|
|
30
30
|
|
|
31
31
|
Star denotes custom driver class.
|