@neo4j-cypher/query-tools 2.0.0-next.38 → 2.0.0-next.39

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/api-extractor/api-report.api.md +340 -0
  3. package/api-extractor.json +10 -0
  4. package/checkApiReport.ts +4 -0
  5. package/dist/cjs/index.cjs +4 -3
  6. package/dist/cjs/index.cjs.map +2 -2
  7. package/dist/esm/package.json +4 -3
  8. package/dist/esm/src/cypher-execution/extract-unique-nodes-and-relationships.d.ts +2 -3
  9. package/dist/esm/src/cypher-execution/extract-unique-nodes-and-relationships.js +2 -3
  10. package/dist/esm/src/cypher-execution/extract-unique-nodes-and-relationships.js.map +1 -1
  11. package/dist/esm/src/cypher-execution/extract-unique-nodes-and-relationships.test.js.map +1 -1
  12. package/dist/esm/src/cypher-execution/query-result.js.map +1 -1
  13. package/dist/esm/src/data-transforms/cypher-type-names.d.ts +1 -2
  14. package/dist/esm/src/index.d.ts +5 -4
  15. package/dist/esm/src/index.js +1 -1
  16. package/dist/esm/src/index.js.map +1 -1
  17. package/dist/esm/src/neo4jConnection.d.ts +2 -3
  18. package/dist/esm/src/neo4jConnection.js +1 -0
  19. package/dist/esm/src/neo4jConnection.js.map +1 -1
  20. package/dist/esm/src/queries/databases.d.ts +1 -2
  21. package/dist/esm/src/result-transformers/graph-result-transformer.d.ts +3 -4
  22. package/dist/esm/src/result-transformers/graph-result-transformer.js.map +1 -1
  23. package/dist/esm/src/{integration-tests → tests/integration}/pollingIntegrationTests.test.js +1 -1
  24. package/dist/esm/src/tests/integration/pollingIntegrationTests.test.js.map +1 -0
  25. package/dist/esm/src/tests/integration/setupTestContainer.js.map +1 -0
  26. package/dist/esm/src/types/cypher-data-types.d.ts +1 -2
  27. package/dist/esm/src/types/sdkTypes.d.ts +2 -3
  28. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  29. package/dist/esm/vitest.config.d.mts +1 -1
  30. package/dist/esm/vitest.config.mjs +20 -4
  31. package/dist/esm/vitest.config.mjs.map +1 -1
  32. package/dist/types/src/cypher-execution/extract-unique-nodes-and-relationships.d.ts +2 -3
  33. package/dist/types/src/data-transforms/cypher-type-names.d.ts +1 -2
  34. package/dist/types/src/index.d.ts +5 -4
  35. package/dist/types/src/neo4jConnection.d.ts +2 -3
  36. package/dist/types/src/queries/databases.d.ts +1 -2
  37. package/dist/types/src/result-transformers/graph-result-transformer.d.ts +3 -4
  38. package/dist/types/src/types/cypher-data-types.d.ts +1 -2
  39. package/dist/types/src/types/sdkTypes.d.ts +2 -3
  40. package/dist/types/tsconfig.tsbuildinfo +1 -1
  41. package/dist/types/vitest.config.d.mts +1 -1
  42. package/package.json +5 -4
  43. package/src/cypher-execution/extract-unique-nodes-and-relationships.test.ts +5 -5
  44. package/src/cypher-execution/extract-unique-nodes-and-relationships.ts +2 -3
  45. package/src/cypher-execution/query-result.ts +1 -0
  46. package/src/data-transforms/cypher-type-names.ts +1 -1
  47. package/src/index.ts +17 -3
  48. package/src/neo4jConnection.ts +3 -2
  49. package/src/queries/databases.ts +1 -1
  50. package/src/result-transformers/graph-result-transformer.ts +7 -3
  51. package/src/{integration-tests → tests/integration}/pollingIntegrationTests.test.ts +2 -2
  52. package/src/types/cypher-data-types.ts +1 -1
  53. package/src/types/sdkTypes.ts +2 -2
  54. package/vitest.config.mts +20 -4
  55. package/dist/esm/src/integration-tests/pollingIntegrationTests.test.js.map +0 -1
  56. package/dist/esm/src/integration-tests/setupTestContainer.js.map +0 -1
  57. /package/dist/esm/src/{integration-tests → tests/integration}/pollingIntegrationTests.test.d.ts +0 -0
  58. /package/dist/esm/src/{integration-tests → tests/integration}/setupTestContainer.d.ts +0 -0
  59. /package/dist/esm/src/{integration-tests → tests/integration}/setupTestContainer.js +0 -0
  60. /package/dist/types/src/{integration-tests → tests/integration}/pollingIntegrationTests.test.d.ts +0 -0
  61. /package/dist/types/src/{integration-tests → tests/integration}/setupTestContainer.d.ts +0 -0
  62. /package/src/{integration-tests → tests/integration}/setupTestContainer.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @neo4j-cypher/query-tools
2
2
 
3
+ ## 2.0.0-next.39
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b510128]
8
+ - Updated dependencies [8b991d6]
9
+ - Updated dependencies [b510128]
10
+ - @neo4j-cypher/language-support@2.0.0-next.39
11
+
3
12
  ## 2.0.0-next.38
4
13
 
5
14
  ### Patch Changes
@@ -0,0 +1,340 @@
1
+ ## API Report File for "@neo4j-cypher/query-tools"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { Config } from 'neo4j-driver';
8
+ import type { CypherVersion } from '@neo4j-cypher/language-support';
9
+ import type { Date as Date_2 } from 'neo4j-driver';
10
+ import type { DateTime } from 'neo4j-driver';
11
+ import type { DbSchema } from '@neo4j-cypher/language-support';
12
+ import type { Driver } from 'neo4j-driver';
13
+ import type { Duration } from 'neo4j-driver';
14
+ import { EventEmitter } from 'events';
15
+ import { Integer } from 'neo4j-driver';
16
+ import type { LocalDateTime } from 'neo4j-driver';
17
+ import type { LocalTime } from 'neo4j-driver';
18
+ import type { ManagedTransaction } from 'neo4j-driver';
19
+ import type { Node as Node_2 } from 'neo4j-driver';
20
+ import type { Path } from 'neo4j-driver';
21
+ import type { Point } from 'neo4j-driver';
22
+ import type { QueryConfig } from 'neo4j-driver';
23
+ import type { QueryResult } from 'neo4j-driver';
24
+ import type { Record as Record_2 } from 'neo4j-driver';
25
+ import type { RecordShape } from 'neo4j-driver';
26
+ import type { Relationship } from 'neo4j-driver';
27
+ import { ResultSummary } from 'neo4j-driver';
28
+ import { ResultTransformer } from 'neo4j-driver';
29
+ import type { Session } from 'neo4j-driver';
30
+ import type { Time } from 'neo4j-driver';
31
+ import { types } from 'neo4j-driver';
32
+ import type { Vector } from 'neo4j-driver';
33
+
34
+ // @public (undocumented)
35
+ export function addAnnotationProp(obj: Record<string, unknown>, type: string | unknown, prop?: string): Record<string, unknown>;
36
+
37
+ // @public (undocumented)
38
+ export type ConnectionError = {
39
+ message: string;
40
+ friendlyMessage: string;
41
+ code: string;
42
+ };
43
+
44
+ // @public (undocumented)
45
+ export type ConnnectionResult = {
46
+ success: boolean;
47
+ retriable?: boolean;
48
+ error?: ConnectionError;
49
+ };
50
+
51
+ // @public
52
+ export type CypherBasicPropertyType = null | boolean | number | string | Integer | bigint | Int8Array | CypherTemporalType | Point | Vector<BigInt64Array | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array>;
53
+
54
+ // @public (undocumented)
55
+ export const cypherDataToCypherCSVString: (map: CypherDataType | undefined, stringStyle: StringStyle) => string;
56
+
57
+ // @public (undocumented)
58
+ export const cypherDataToString: (map: CypherDataType | undefined, stringStyle?: StringStyle, quoteStrings?: boolean) => string;
59
+
60
+ // @public (undocumented)
61
+ export type CypherDataType = CypherBasicPropertyType | CypherStructuralType | CypherMap | CypherList;
62
+
63
+ // @public (undocumented)
64
+ export type CypherDataTypeName = CypherPropertyName | 'Node' | 'Relationship' | 'Path' | 'Map' | 'Vector';
65
+
66
+ // @public (undocumented)
67
+ export type CypherList = (CypherBasicPropertyType | CypherStructuralType | CypherMap | CypherList)[];
68
+
69
+ // @public (undocumented)
70
+ export interface CypherMap {
71
+ // (undocumented)
72
+ [key: string]: CypherBasicPropertyType | CypherStructuralType | CypherMap | CypherList;
73
+ }
74
+
75
+ // @public (undocumented)
76
+ export class CypherMetadataPoller extends MetadataPoller {
77
+ constructor(databases: Database[], parameters: Record<string, unknown>, serverCypherVersions: string[] | undefined, connection: Neo4jConnection, events: EventEmitter);
78
+ // (undocumented)
79
+ dbSchema: DbSchema;
80
+ // (undocumented)
81
+ fetchDbSchema(): Promise<void>;
82
+ // (undocumented)
83
+ startBackgroundPolling(intervalSeconds?: number): void;
84
+ // (undocumented)
85
+ stopBackgroundPolling(): void;
86
+ }
87
+
88
+ // @public (undocumented)
89
+ export type CypherProperty = CypherBasicPropertyType | CypherBasicPropertyType[];
90
+
91
+ // @public (undocumented)
92
+ export type CypherPropertyName = 'Float' | 'null' | 'String' | 'Bigint' | 'Boolean' | `List${string}` | 'LocalTime' | 'Time' | 'Date' | 'LocalDateTime' | 'DateTime' | 'Integer' | 'Duration' | 'Point' | 'ByteArray' | 'Vector' | 'Unknown';
93
+
94
+ // @public (undocumented)
95
+ export type CypherStringStyle = 'cypher' | 'cypher-with-ids';
96
+
97
+ // @public (undocumented)
98
+ export type CypherStructuralType = Node_2 | Relationship | Path;
99
+
100
+ // @public (undocumented)
101
+ export type CypherTemporalType = Date_2<NumberOrInteger> | Time<NumberOrInteger> | DateTime | LocalTime<NumberOrInteger> | LocalDateTime | Duration<NumberOrInteger>;
102
+
103
+ // @public (undocumented)
104
+ export type Database = {
105
+ name: string;
106
+ address: string;
107
+ role: string;
108
+ requestedStatus: DatabaseStatus;
109
+ currentStatus: DatabaseStatus;
110
+ statusMessage?: string;
111
+ error: string;
112
+ default: boolean;
113
+ home: boolean;
114
+ aliases?: string[];
115
+ type?: 'system' | 'composite' | 'standard' | 'graph shard' | 'property shard';
116
+ writer?: boolean;
117
+ access?: string;
118
+ constituents?: string[];
119
+ defaultLanguage?: CypherVersion;
120
+ };
121
+
122
+ // @public (undocumented)
123
+ export type DatabaseStatus = 'online' | 'offline' | 'starting' | 'stopping' | 'store copying' | 'initial' | 'dirty' | 'quarantined' | 'unknown' | 'dropped' | 'deallocating';
124
+
125
+ // @public
126
+ export type DeduplicatedNodesAndRels = {
127
+ nodes: Node_2<Integer, Properties, string>[];
128
+ relationships: Relationship<Integer, Properties, string>[];
129
+ limitHit: boolean;
130
+ };
131
+
132
+ // @public (undocumented)
133
+ export function deleteAnnotationProp(obj: Record<string, unknown>): void;
134
+
135
+ // @public (undocumented)
136
+ export function deserializeTypeAnnotations(rawItem: Record<string, unknown>): QueryResult | Record_2;
137
+
138
+ // @public (undocumented)
139
+ export function deserializeTypeAnnotations(rawItem: any): any;
140
+
141
+ // @public (undocumented)
142
+ export class EmptyMetadataPoller extends MetadataPoller {
143
+ constructor(parameters: Record<string, unknown>);
144
+ // (undocumented)
145
+ dbSchema: DbSchema;
146
+ // (undocumented)
147
+ fetchDbSchema(): void;
148
+ // (undocumented)
149
+ startBackgroundPolling(): void;
150
+ // (undocumented)
151
+ stopBackgroundPolling(): void;
152
+ }
153
+
154
+ // @public (undocumented)
155
+ export const ESCAPE_CHAR = "_";
156
+
157
+ // @public (undocumented)
158
+ export type ExecuteQueryArgs<T> = {
159
+ query: string;
160
+ queryConfig: ExtendedQueryConfig<Result<T>>;
161
+ };
162
+
163
+ // @public (undocumented)
164
+ export type ExtendedQueryConfig<T> = QueryConfig<T> & Required<Pick<QueryConfig<T>, 'routing' | 'resultTransformer'>>;
165
+
166
+ // @public
167
+ export const extractUniqueNodesAndRels: (records: Record_2[], input?: {
168
+ nodeLimit?: number;
169
+ keepDanglingRels?: boolean;
170
+ }) => DeduplicatedNodesAndRels;
171
+
172
+ // @public (undocumented)
173
+ export const FRIENDLY_ERROR_MESSAGES: {
174
+ Default: string;
175
+ [key: string]: string;
176
+ };
177
+
178
+ // @public (undocumented)
179
+ export function getCypherTypeName(val?: CypherDataType): CypherDataTypeName;
180
+
181
+ // @public (undocumented)
182
+ export const getPropertyTypeDisplayName: (val?: CypherProperty) => CypherPropertyName;
183
+
184
+ // @public
185
+ export function getVersion(): ExecuteQueryArgs<{
186
+ serverVersion: string | undefined;
187
+ }>;
188
+
189
+ // @public
190
+ export type GraphResult = DeduplicatedNodesAndRels & {
191
+ records: Record_2[];
192
+ summary: ResultSummary<Integer>;
193
+ };
194
+
195
+ // @public
196
+ export const graphResultTransformer: ResultTransformer<GraphResult>;
197
+
198
+ // @public (undocumented)
199
+ export const isCypherBasicPropertyType: (value: unknown) => value is CypherBasicPropertyType;
200
+
201
+ // @public (undocumented)
202
+ export const isCypherPropertyType: (value: unknown) => value is CypherProperty;
203
+
204
+ // @public (undocumented)
205
+ export const isCypherTemporalType: (anything: unknown) => anything is CypherTemporalType;
206
+
207
+ // @public (undocumented)
208
+ export function isInt8Array(val: unknown): val is Int8Array;
209
+
210
+ // @public (undocumented)
211
+ export abstract class MetadataPoller {
212
+ // (undocumented)
213
+ dbSchema: DbSchema;
214
+ // (undocumented)
215
+ abstract fetchDbSchema(): void;
216
+ // (undocumented)
217
+ abstract startBackgroundPolling(intervalSeconds?: number): void;
218
+ // (undocumented)
219
+ abstract stopBackgroundPolling(): void;
220
+ }
221
+
222
+ // @public (undocumented)
223
+ export class Neo4jConnection {
224
+ constructor(connectedUser: string, protocolVersion: string, databases: Database[], driver: Driver, database?: string);
225
+ // (undocumented)
226
+ connectedUser: string;
227
+ // (undocumented)
228
+ currentDb: string | undefined;
229
+ // (undocumented)
230
+ databases: Database[];
231
+ // (undocumented)
232
+ dispose(): void;
233
+ // (undocumented)
234
+ driver: Driver;
235
+ // (undocumented)
236
+ evalQuery(session: Session, query: string, parameters: Record<string, unknown>, metadata: object, tx?: ManagedTransaction): Promise<{
237
+ records: any[];
238
+ summary: ResultSummary<Integer>;
239
+ recordLimitHit: boolean;
240
+ }>;
241
+ // (undocumented)
242
+ healthcheck(): Promise<boolean>;
243
+ // (undocumented)
244
+ protocolVersion: string;
245
+ // (undocumented)
246
+ runCypherQuery(input: RunCypherQueryArgs): Promise<QueryResultWithLimit>;
247
+ // (undocumented)
248
+ runSdkQuery<T>(input: ExecuteQueryArgs<T>, input2: SdkQueryArgs): Promise<T>;
249
+ // (undocumented)
250
+ serverVersion: string | undefined;
251
+ }
252
+
253
+ // @public (undocumented)
254
+ export class Neo4jSchemaPoller {
255
+ // (undocumented)
256
+ connect(url: string, credentials: {
257
+ username: string;
258
+ password: string;
259
+ }, config: {
260
+ driverConfig?: Config;
261
+ appName: string;
262
+ }, database?: string): Promise<ConnnectionResult>;
263
+ // (undocumented)
264
+ connection?: Neo4jConnection;
265
+ // (undocumented)
266
+ disconnect(): void;
267
+ // (undocumented)
268
+ events: EventEmitter;
269
+ // (undocumented)
270
+ metadata?: MetadataPoller;
271
+ // (undocumented)
272
+ persistentConnect(url: string, credentials: {
273
+ username: string;
274
+ password: string;
275
+ }, config: {
276
+ driverConfig?: Config;
277
+ appName: string;
278
+ }, database?: string): Promise<ConnnectionResult>;
279
+ // (undocumented)
280
+ setParameters(parameters: Record<string, unknown>): void;
281
+ }
282
+
283
+ // @public (undocumented)
284
+ export type Neo4jType = typeof types.Record | typeof types.Result | typeof types.ResultSummary | typeof types.Node | typeof types.PathSegment | typeof types.Path | typeof types.Relationship | typeof types.Point | typeof types.Date | typeof types.DateTime | typeof types.Duration | typeof types.LocalDateTime | typeof types.LocalTime | typeof types.Time | typeof types.Integer | typeof types.Vector | Record<string, unknown> | Neo4jType[] | undefined | null;
285
+
286
+ // @public (undocumented)
287
+ export type NumberOrInteger = number | Integer | bigint;
288
+
289
+ // @public (undocumented)
290
+ export type Properties = RecordShape<string, CypherProperty>;
291
+
292
+ // @public (undocumented)
293
+ export function propertyToString(property: CypherProperty, quoteStrings?: boolean, localeFormattedDates?: boolean): string;
294
+
295
+ // @public (undocumented)
296
+ export type QueryResultWithLimit = QueryResult & {
297
+ recordLimitHit: boolean;
298
+ };
299
+
300
+ // @public (undocumented)
301
+ export type QueryType = 'system' | 'user-direct' | 'user-action' | 'user-transpiled';
302
+
303
+ // @public (undocumented)
304
+ export const RESERVED_TYPE_PROPERTY_NAME = "transport-class";
305
+
306
+ // @public (undocumented)
307
+ export type Result<T> = T & {
308
+ summary: ResultSummary;
309
+ };
310
+
311
+ // @public (undocumented)
312
+ export type RunCypherQueryArgs = {
313
+ query: string;
314
+ parameters: Record<string, unknown>;
315
+ database?: string;
316
+ abortSignal?: AbortSignal;
317
+ implicitTransaction?: boolean;
318
+ };
319
+
320
+ // @public (undocumented)
321
+ export type SdkQueryArgs = {
322
+ queryType: QueryType;
323
+ abortSignal?: AbortSignal;
324
+ };
325
+
326
+ // @public (undocumented)
327
+ export function serializeTypeAnnotations(item: QueryResult | Record_2): Record<string, unknown>;
328
+
329
+ // @public (undocumented)
330
+ export function serializeTypeAnnotations(item: Neo4jType): Record<string, unknown> | null | undefined | unknown[];
331
+
332
+ // @public (undocumented)
333
+ export const spacialFormat: (p: Point) => string;
334
+
335
+ // @public (undocumented)
336
+ export type StringStyle = 'json' | CypherStringStyle;
337
+
338
+ // (No @packageDocumentation comment for this package)
339
+
340
+ ```
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Config file for API Extractor. For more info, please visit: https://api-extractor.com
3
+ */
4
+ {
5
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
6
+
7
+ "extends": "../../api-extractor-base.json",
8
+
9
+ "mainEntryPointFilePath": "./dist/types/src/index.d.ts"
10
+ }
@@ -0,0 +1,4 @@
1
+ import { runApiExtractor } from '../../scripts/runApiExtractor.js';
2
+
3
+ // Deliberately outside src/ so it is not part of the package's tsc build.
4
+ runApiExtractor(import.meta.dirname);
@@ -1415,7 +1415,7 @@ var ConnectedMetadataPoller = class extends MetadataPoller {
1415
1415
  // package.json
1416
1416
  var package_default = {
1417
1417
  name: "@neo4j-cypher/query-tools",
1418
- version: "2.0.0-next.38",
1418
+ version: "2.0.0-next.39",
1419
1419
  description: "",
1420
1420
  bugs: {
1421
1421
  url: "https://github.com/neo4j/cypher-language-support/issues"
@@ -1443,10 +1443,11 @@ var package_default = {
1443
1443
  "build-esm": "tsc --outDir dist/esm",
1444
1444
  "build-commonjs": "esbuild ./src/index.ts --bundle --format=cjs --sourcemap --packages=external --outfile=dist/cjs/index.cjs",
1445
1445
  "build-types": "tsc --emitDeclarationOnly --outDir dist/types",
1446
+ "check-api-report": "tsx checkApiReport.ts",
1447
+ "gen-api-report": "pnpm build-types && pnpm check-api-report",
1446
1448
  dev: "concurrently 'npm:build-esm -- --watch' 'npm:build-commonjs -- --watch'",
1447
1449
  clean: "rm -rf dist tsconfig*.tsbuildinfo",
1448
- test: "vitest run extract-unique-nodes-and-relationships",
1449
- "test:polling": "vitest run pollingIntegrationTests"
1450
+ test: "vitest run"
1450
1451
  },
1451
1452
  dependencies: {
1452
1453
  "@neo4j-cypher/language-support": "workspace:*",