neo4j-driver 6.1.0 → 6.3.0

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/lib/index.js CHANGED
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
14
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
15
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -40,7 +51,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
51
  };
41
52
  Object.defineProperty(exports, "__esModule", { value: true });
42
53
  exports.UnboundRelationship = exports.Relationship = exports.Node = exports.Record = exports.ServerInfo = exports.GqlStatusObject = exports.Notification = exports.QueryStatistics = exports.ProfiledPlan = exports.Plan = exports.ResultSummary = exports.RxResult = exports.RxManagedTransaction = exports.RxTransaction = exports.RxSession = exports.EagerResult = exports.Result = exports.ManagedTransaction = exports.Transaction = exports.Session = exports.Driver = exports.temporal = exports.spatial = exports.graph = exports.error = exports.routing = exports.session = exports.types = exports.logging = exports.auth = exports.isRetryableError = exports.isRetriableError = exports.Neo4jError = exports.integer = exports.isUnsupportedType = exports.isUnboundRelationship = exports.isRelationship = exports.isPathSegment = exports.isPath = exports.isNode = exports.isDateTime = exports.isLocalDateTime = exports.isDate = exports.isTime = exports.isLocalTime = exports.isDuration = exports.isPoint = exports.isInt = exports.int = exports.authTokenManagers = void 0;
43
- exports.ProtocolVersion = exports.StandardCase = exports.RecordObjectMapping = exports.mappingDecorators = exports.rule = exports.Rules = exports.Rule = exports.Vector = exports.vector = exports.isVector = exports.clientCertificateProviders = exports.notificationFilterMinimumSeverityLevel = exports.notificationFilterDisabledClassification = exports.notificationFilterDisabledCategory = exports.notificationSeverityLevel = exports.notificationClassification = exports.notificationCategory = exports.resultTransformers = exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = exports.Integer = exports.Point = exports.PathSegment = exports.Path = void 0;
54
+ exports.EncryptionProfile = exports.SecretKey = exports.KeyEncapsulationService = exports.EncapsulatedKey = exports.EncapsulatedKeyRecord = exports.UnsupportedType = exports.EncryptionService = exports.EnvelopeEncryptionProfile = exports.EncapsulatedKeyRecordRepository = exports.localKeyEncapsulationService = exports.LocalKeyEncapsulationService = exports.isUUID = exports.uuid = exports.UUID = exports.ProtocolVersion = exports.StandardCase = exports.RecordObjectMapping = exports.mappingDecorators = exports.rule = exports.Rules = exports.Rule = exports.Vector = exports.vector = exports.isVector = exports.clientCertificateProviders = exports.notificationFilterMinimumSeverityLevel = exports.notificationFilterDisabledClassification = exports.notificationFilterDisabledCategory = exports.notificationSeverityLevel = exports.notificationClassification = exports.notificationCategory = exports.resultTransformers = exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = exports.Integer = exports.Point = exports.PathSegment = exports.Path = void 0;
44
55
  exports.driver = driver;
45
56
  exports.hasReachableServer = hasReachableServer;
46
57
  /**
@@ -130,6 +141,20 @@ Object.defineProperty(exports, "mappingDecorators", { enumerable: true, get: fun
130
141
  Object.defineProperty(exports, "RecordObjectMapping", { enumerable: true, get: function () { return neo4j_driver_core_1.RecordObjectMapping; } });
131
142
  Object.defineProperty(exports, "StandardCase", { enumerable: true, get: function () { return neo4j_driver_core_1.StandardCase; } });
132
143
  Object.defineProperty(exports, "ProtocolVersion", { enumerable: true, get: function () { return neo4j_driver_core_1.ProtocolVersion; } });
144
+ Object.defineProperty(exports, "UUID", { enumerable: true, get: function () { return neo4j_driver_core_1.UUID; } });
145
+ Object.defineProperty(exports, "uuid", { enumerable: true, get: function () { return neo4j_driver_core_1.uuid; } });
146
+ Object.defineProperty(exports, "isUUID", { enumerable: true, get: function () { return neo4j_driver_core_1.isUUID; } });
147
+ Object.defineProperty(exports, "LocalKeyEncapsulationService", { enumerable: true, get: function () { return neo4j_driver_core_1.LocalKeyEncapsulationService; } });
148
+ Object.defineProperty(exports, "localKeyEncapsulationService", { enumerable: true, get: function () { return neo4j_driver_core_1.localKeyEncapsulationService; } });
149
+ Object.defineProperty(exports, "EncapsulatedKeyRecordRepository", { enumerable: true, get: function () { return neo4j_driver_core_1.EncapsulatedKeyRecordRepository; } });
150
+ Object.defineProperty(exports, "EnvelopeEncryptionProfile", { enumerable: true, get: function () { return neo4j_driver_core_1.EnvelopeEncryptionProfile; } });
151
+ Object.defineProperty(exports, "EncryptionService", { enumerable: true, get: function () { return neo4j_driver_core_1.EncryptionService; } });
152
+ Object.defineProperty(exports, "UnsupportedType", { enumerable: true, get: function () { return neo4j_driver_core_1.UnsupportedType; } });
153
+ Object.defineProperty(exports, "EncapsulatedKeyRecord", { enumerable: true, get: function () { return neo4j_driver_core_1.EncapsulatedKeyRecord; } });
154
+ Object.defineProperty(exports, "EncapsulatedKey", { enumerable: true, get: function () { return neo4j_driver_core_1.EncapsulatedKey; } });
155
+ Object.defineProperty(exports, "KeyEncapsulationService", { enumerable: true, get: function () { return neo4j_driver_core_1.KeyEncapsulationService; } });
156
+ Object.defineProperty(exports, "SecretKey", { enumerable: true, get: function () { return neo4j_driver_core_1.SecretKey; } });
157
+ Object.defineProperty(exports, "EncryptionProfile", { enumerable: true, get: function () { return neo4j_driver_core_1.EncryptionProfile; } });
133
158
  var neo4j_driver_bolt_connection_1 = require("neo4j-driver-bolt-connection");
134
159
  var session_rx_1 = __importDefault(require("./session-rx"));
135
160
  exports.RxSession = session_rx_1.default;
@@ -153,10 +178,15 @@ function createAuthManager(authTokenOrManager) {
153
178
  if (isAuthTokenManager(authTokenOrManager)) {
154
179
  return authTokenOrManager;
155
180
  }
156
- var authToken = authTokenOrManager;
181
+ var authToken = __assign({}, authTokenOrManager);
157
182
  // Sanitize authority token. Nicer error from server when a scheme is set.
158
- authToken = authToken || {};
159
- authToken.scheme = authToken.scheme || 'none';
183
+ if (authToken.scheme == null) {
184
+ if (Object.entries(authToken).length !== 0) {
185
+ throw (0, neo4j_driver_core_1.newError)("Auth token is missing 'scheme'. Use neo4j.auth.basic/bearer/kerberos, " +
186
+ 'or set scheme explicitly.');
187
+ }
188
+ authToken.scheme = 'none';
189
+ }
160
190
  return (0, neo4j_driver_core_1.staticAuthTokenManager)({ authToken: authToken });
161
191
  }
162
192
  /**
@@ -172,6 +202,9 @@ function driver(url, authToken, config) {
172
202
  if (config === void 0) { config = {}; }
173
203
  assertString(url, 'Bolt URL');
174
204
  var parsedUrl = urlUtil.parseDatabaseUrl(url);
205
+ var boltMap = new Map();
206
+ boltMap.set('1', { version: new neo4j_driver_core_1.ProtocolVersion(1, 0), bolt: new neo4j_driver_bolt_connection_1.BoltProtocol(undefined, undefined, { disableLosslessIntegers: config.disableLosslessIntegers, useBigInt: config.useBigInt }) });
207
+ var boltProvider = new neo4j_driver_core_1.BoltProvider(boltMap, '1', neo4j_driver_bolt_connection_1.channel.alloc);
175
208
  // Determine encryption/trust options from the URL.
176
209
  var routing = false;
177
210
  var encrypted = false;
@@ -223,7 +256,7 @@ function driver(url, authToken, config) {
223
256
  typename: routing ? 'Routing' : 'Direct',
224
257
  routing: routing
225
258
  };
226
- return new driver_1.Driver(meta, config, createConnectionProviderFunction());
259
+ return new driver_1.Driver(meta, config, createConnectionProviderFunction(), boltProvider);
227
260
  function createConnectionProviderFunction() {
228
261
  if (routing) {
229
262
  return function (id, config, log, hostNameResolver) {
@@ -294,15 +327,17 @@ function hasReachableServer(url, config) {
294
327
  /**
295
328
  * Object containing predefined logging configurations. These are expected to be used as values of the driver config's `logging` property.
296
329
  * @property {function(level: ?string): object} console the function to create a logging config that prints all messages to `console.log` with
297
- * timestamp, level and message. It takes an optional `level` parameter which represents the maximum log level to be logged. Default value is 'info'.
330
+ * timestamp, level and message. It takes optional `level` parameter which represents the maximum log level to be logged with default value is 'info'
331
+ * and another `unredactDebugLogs` which changes the output to debug logs to unredact query parameters and record fields.
298
332
  */
299
333
  var logging = {
300
- console: function (level) {
334
+ console: function (level, unredactDebugLogs) {
301
335
  return {
302
336
  level: level,
303
337
  logger: function (level, message) {
304
338
  return console.log("".concat(global.Date.now(), " ").concat(level.toUpperCase(), " ").concat(message));
305
- }
339
+ },
340
+ unredactDebugLogs: unredactDebugLogs
306
341
  };
307
342
  }
308
343
  };
@@ -331,7 +366,11 @@ var types = {
331
366
  Vector: neo4j_driver_core_1.Vector,
332
367
  Rule: neo4j_driver_core_1.Rule,
333
368
  Rules: neo4j_driver_core_1.Rules,
334
- ProtocolVersion: neo4j_driver_core_1.ProtocolVersion
369
+ ProtocolVersion: neo4j_driver_core_1.ProtocolVersion,
370
+ EncapsulatedKeyRecordRepository: neo4j_driver_core_1.EncapsulatedKeyRecordRepository,
371
+ EnvelopeEncryptionProfile: neo4j_driver_core_1.EnvelopeEncryptionProfile,
372
+ EncapsulatedKeyRecord: neo4j_driver_core_1.EncapsulatedKeyRecord,
373
+ EncryptionService: neo4j_driver_core_1.EncryptionService
335
374
  };
336
375
  exports.types = types;
337
376
  /**
@@ -461,6 +500,13 @@ var forExport = {
461
500
  mappingDecorators: neo4j_driver_core_1.mappingDecorators,
462
501
  RecordObjectMapping: neo4j_driver_core_1.RecordObjectMapping,
463
502
  StandardCase: neo4j_driver_core_1.StandardCase,
464
- ProtocolVersion: neo4j_driver_core_1.ProtocolVersion
503
+ ProtocolVersion: neo4j_driver_core_1.ProtocolVersion,
504
+ UUID: neo4j_driver_core_1.UUID,
505
+ uuid: neo4j_driver_core_1.uuid,
506
+ isUUID: neo4j_driver_core_1.isUUID,
507
+ LocalKeyEncapsulationService: neo4j_driver_core_1.LocalKeyEncapsulationService,
508
+ localKeyEncapsulationService: neo4j_driver_core_1.localKeyEncapsulationService,
509
+ EncapsulatedKeyRecordRepository: neo4j_driver_core_1.EncapsulatedKeyRecordRepository,
510
+ EnvelopeEncryptionProfile: neo4j_driver_core_1.EnvelopeEncryptionProfile
465
511
  };
466
512
  exports.default = forExport;
package/lib/version.js CHANGED
@@ -24,4 +24,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
24
24
  // This is set up this way to keep the version in the code in
25
25
  // sync with the npm package version, and to allow the build
26
26
  // system to control version names at packaging time.
27
- exports.default = '6.1.0';
27
+ exports.default = '6.3.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo4j-driver",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "description": "The official Neo4j driver for Javascript",
5
5
  "author": "Neo4j",
6
6
  "license": "Apache-2.0",
@@ -86,9 +86,9 @@
86
86
  "ws": "8.20.0"
87
87
  },
88
88
  "dependencies": {
89
- "neo4j-driver-bolt-connection": "6.1.0",
90
- "neo4j-driver-core": "6.1.0",
89
+ "neo4j-driver-bolt-connection": "6.3.0",
90
+ "neo4j-driver-core": "6.3.0",
91
91
  "rxjs": "^7.8.2"
92
92
  },
93
- "gitHead": "1ed870c93993275609c161bc69e774ef90c3611e"
93
+ "gitHead": "169a7d91a52e93161706d09598b73d73d53c89b7"
94
94
  }
package/types/driver.d.ts CHANGED
@@ -19,7 +19,8 @@ import RxSession from './session-rx'
19
19
  import {
20
20
  Driver as CoreDriver,
21
21
  types,
22
- SessionConfig
22
+ SessionConfig,
23
+ EncapsulatedKeyRecordRepository
23
24
  } from 'neo4j-driver-core'
24
25
 
25
26
  declare type AuthToken = types.AuthToken
@@ -44,7 +45,8 @@ export {
44
45
  Config,
45
46
  EncryptionLevel,
46
47
  TrustStrategy,
47
- SessionMode
48
+ SessionMode,
49
+ EncapsulatedKeyRecordRepository
48
50
  }
49
51
 
50
52
  export default Driver
package/types/index.d.ts CHANGED
@@ -109,7 +109,21 @@ import {
109
109
  isVector,
110
110
  vector,
111
111
  Vector,
112
- VectorType
112
+ VectorType,
113
+ uuid,
114
+ UUID,
115
+ isUUID,
116
+ LocalKeyEncapsulationService,
117
+ localKeyEncapsulationService,
118
+ EncapsulatedKeyRecordRepository,
119
+ EnvelopeEncryptionProfile,
120
+ EncryptionService,
121
+ UnsupportedType,
122
+ EncapsulatedKeyRecord,
123
+ EncapsulatedKey,
124
+ KeyEncapsulationService,
125
+ SecretKey,
126
+ EncryptionProfile
113
127
  } from 'neo4j-driver-core'
114
128
  import {
115
129
  AuthToken,
@@ -149,9 +163,10 @@ declare const auth: {
149
163
  * timestamp, level and message. It takes an optional `level` parameter which represents the maximum log level to be logged. Default value is 'info'.
150
164
  */
151
165
  declare const logging: {
152
- console: (level: coreTypes.LogLevel) => {
166
+ console: (level: coreTypes.LogLevel, unredactDebugLogs?: boolean) => {
153
167
  level: coreTypes.LogLevel
154
168
  logger: (level: coreTypes.LogLevel, message: string) => void
169
+ unredactDebugLogs: boolean
155
170
  }
156
171
  }
157
172
 
@@ -189,6 +204,7 @@ declare const types: {
189
204
  RxManagedTransaction: typeof RxManagedTransaction
190
205
  RxResult: typeof RxResult
191
206
  Vector: typeof Vector
207
+ UUID: typeof UUID
192
208
  }
193
209
 
194
210
  declare const session: {
@@ -232,6 +248,9 @@ declare const graph: {
232
248
  ...
233
249
  */
234
250
 
251
+ /**
252
+ * @private
253
+ */
235
254
  declare const forExport: {
236
255
  authTokenManagers: typeof authTokenManagers
237
256
  driver: typeof driver
@@ -317,6 +336,14 @@ declare const forExport: {
317
336
  Vector: typeof Vector
318
337
  RecordObjectMapping: typeof RecordObjectMapping
319
338
  rule: typeof rule
339
+ isUUID: typeof isUUID
340
+ uuid: typeof uuid
341
+ UUID: typeof UUID
342
+ LocalKeyEncapsulationService: typeof LocalKeyEncapsulationService
343
+ localKeyEncapsulationService: typeof localKeyEncapsulationService
344
+ EnvelopeEncryptionProfile: typeof EnvelopeEncryptionProfile
345
+ EncryptionService: typeof EncryptionService
346
+ UnsupportedType: typeof UnsupportedType
320
347
  }
321
348
 
322
349
  export {
@@ -403,7 +430,15 @@ export {
403
430
  vector,
404
431
  Vector,
405
432
  RecordObjectMapping,
406
- rule
433
+ rule,
434
+ uuid,
435
+ UUID,
436
+ isUUID,
437
+ LocalKeyEncapsulationService,
438
+ localKeyEncapsulationService,
439
+ EnvelopeEncryptionProfile,
440
+ EncryptionService,
441
+ UnsupportedType
407
442
  }
408
443
 
409
444
  export type {
@@ -432,7 +467,13 @@ export type {
432
467
  Rules,
433
468
  StandardCase,
434
469
  MappedQueryResult,
435
- VectorType
470
+ VectorType,
471
+ EncryptionProfile,
472
+ EncapsulatedKeyRecordRepository,
473
+ EncapsulatedKeyRecord,
474
+ EncapsulatedKey,
475
+ KeyEncapsulationService,
476
+ SecretKey
436
477
  }
437
478
 
438
479
  export default forExport