neo4j-driver 5.28.0 → 5.28.2

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/README.md CHANGED
@@ -11,8 +11,8 @@ See also: https://neo4j.com/developer/kb/neo4j-supported-versions/
11
11
  Resources to get you started:
12
12
 
13
13
  - [API Documentation](https://neo4j.com/docs/api/javascript-driver/current/)
14
- - [Neo4j Manual](https://neo4j.com/docs/)
15
- - [Neo4j Refcard](https://neo4j.com/docs/cypher-refcard/current/)
14
+ - [Neo4j Driver Manual](https://neo4j.com/docs/javascript-manual/current/)
15
+ - [Neo4j Cypher Cheatsheet](http://neo4j.com/docs/cypher-cheat-sheet/)
16
16
 
17
17
  ## What's New in 5.x
18
18
 
@@ -336,6 +336,13 @@ var GQLError = /** @class */ (function (_super) {
336
336
  * @public
337
337
  */
338
338
  _this.rawClassification = (_a = diagnosticRecord === null || diagnosticRecord === void 0 ? void 0 : diagnosticRecord._classification) !== null && _a !== void 0 ? _a : undefined;
339
+ /**
340
+ * Represents the name for the type of error, inherited from base JavaScript {@link Error}.
341
+ * Will be 'GQLError' for {@link GQLError}s and 'Neo4jError' for {@link Neo4jError}s.
342
+ *
343
+ * @type {string}
344
+ * @public
345
+ */
339
346
  _this.name = 'GQLError';
340
347
  return _this;
341
348
  }
@@ -383,7 +390,20 @@ var Neo4jError = /** @class */ (function (_super) {
383
390
  * @public
384
391
  */
385
392
  _this.code = code;
393
+ /**
394
+ * The name of the type of error.
395
+ *
396
+ * @type {string}
397
+ * @public
398
+ */
386
399
  _this.name = 'Neo4jError';
400
+ /**
401
+ * If the error is considered retriable.
402
+ * This does not apply when running auto-commit transactions using {@link Session#run}
403
+ *
404
+ * @type {boolean}
405
+ * @public
406
+ */
387
407
  _this.retriable = _isRetriableCode(code);
388
408
  return _this;
389
409
  }
@@ -7805,7 +7825,7 @@ var Result = /** @class */ (function () {
7805
7825
  /**
7806
7826
  * Provides a async iterator over the records in the result.
7807
7827
  *
7808
- * *Should not be combined with {@link Result#subscribe} or ${@link Result#then} functions.*
7828
+ * *Should not be combined with {@link Result#subscribe} or {@link Result#then} functions.*
7809
7829
  *
7810
7830
  * @public
7811
7831
  * @returns {PeekableAsyncIterator<Record<R>, ResultSummary>} The async iterator for the Results
@@ -11599,6 +11619,12 @@ var Driver$1 = /** @class */ (function () {
11599
11619
  /**
11600
11620
  * Close all open sessions and other associated resources. You should
11601
11621
  * make sure to use this when you are done with this driver instance.
11622
+ *
11623
+ * This will interrupt any running connections.
11624
+ * Make sure you are done using the driver object and any resources
11625
+ * spawned from it (such as sessions or transactions) while calling
11626
+ * this method. Failing to do so will result in unspecified behavior.
11627
+ *
11602
11628
  * @public
11603
11629
  * @return {Promise<void>} promise resolved when the driver is closed.
11604
11630
  */
@@ -12302,7 +12328,7 @@ var Config = /** @class */ (function () {
12302
12328
  this.connectionAcquisitionTimeout = 60000; // 1 minute
12303
12329
  /**
12304
12330
  * Specify the maximum time in milliseconds transactions are allowed to retry via
12305
- * {@link Session#executeRead} and {@link Session#executeWrite} functions.
12331
+ * {@link Session#executeRead}, {@link Session#executeWrite}, and {@link Driver#executeQuery} functions.
12306
12332
  *
12307
12333
  * These functions will retry the given unit of work on `ServiceUnavailable`, `SessionExpired` and transient
12308
12334
  * errors with exponential backoff using an initial delay of 1 second.
@@ -15159,7 +15185,7 @@ var AnimationFrameAction = (function (_super) {
15159
15185
  return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
15160
15186
  }
15161
15187
  var actions = scheduler.actions;
15162
- if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
15188
+ if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
15163
15189
  animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
15164
15190
  scheduler._scheduled = undefined;
15165
15191
  }
@@ -15196,8 +15222,14 @@ var AnimationFrameScheduler = (function (_super) {
15196
15222
  }
15197
15223
  AnimationFrameScheduler.prototype.flush = function (action) {
15198
15224
  this._active = true;
15199
- var flushId = this._scheduled;
15200
- this._scheduled = undefined;
15225
+ var flushId;
15226
+ if (action) {
15227
+ flushId = action.id;
15228
+ }
15229
+ else {
15230
+ flushId = this._scheduled;
15231
+ this._scheduled = undefined;
15232
+ }
15201
15233
  var actions = this.actions;
15202
15234
  var error;
15203
15235
  action = action || actions.shift();
@@ -16110,11 +16142,13 @@ var EmptyError = {};
16110
16142
  Object.defineProperty(EmptyError, "__esModule", { value: true });
16111
16143
  EmptyError.EmptyError = void 0;
16112
16144
  var createErrorClass_1$3 = createErrorClass$1;
16113
- EmptyError.EmptyError = createErrorClass_1$3.createErrorClass(function (_super) { return function EmptyErrorImpl() {
16114
- _super(this);
16115
- this.name = 'EmptyError';
16116
- this.message = 'no elements in sequence';
16117
- }; });
16145
+ EmptyError.EmptyError = createErrorClass_1$3.createErrorClass(function (_super) {
16146
+ return function EmptyErrorImpl() {
16147
+ _super(this);
16148
+ this.name = 'EmptyError';
16149
+ this.message = 'no elements in sequence';
16150
+ };
16151
+ });
16118
16152
 
16119
16153
  Object.defineProperty(lastValueFrom$1, "__esModule", { value: true });
16120
16154
  lastValueFrom$1.lastValueFrom = void 0;
@@ -17108,7 +17142,7 @@ argsOrArgArray$1.argsOrArgArray = argsOrArgArray;
17108
17142
  Object.defineProperty(onErrorResumeNext$1, "__esModule", { value: true });
17109
17143
  onErrorResumeNext$1.onErrorResumeNext = void 0;
17110
17144
  var Observable_1$6 = Observable$1;
17111
- var argsOrArgArray_1$6 = argsOrArgArray$1;
17145
+ var argsOrArgArray_1$5 = argsOrArgArray$1;
17112
17146
  var OperatorSubscriber_1$O = OperatorSubscriber$1;
17113
17147
  var noop_1$c = noop$1;
17114
17148
  var innerFrom_1$u = innerFrom$1;
@@ -17117,7 +17151,7 @@ function onErrorResumeNext() {
17117
17151
  for (var _i = 0; _i < arguments.length; _i++) {
17118
17152
  sources[_i] = arguments[_i];
17119
17153
  }
17120
- var nextSources = argsOrArgArray_1$6.argsOrArgArray(sources);
17154
+ var nextSources = argsOrArgArray_1$5.argsOrArgArray(sources);
17121
17155
  return new Observable_1$6.Observable(function (subscriber) {
17122
17156
  var sourceIndex = 0;
17123
17157
  var subscribeNext = function () {
@@ -17194,14 +17228,14 @@ Object.defineProperty(race$3, "__esModule", { value: true });
17194
17228
  race$3.raceInit = race$3.race = void 0;
17195
17229
  var Observable_1$5 = Observable$1;
17196
17230
  var innerFrom_1$s = innerFrom$1;
17197
- var argsOrArgArray_1$5 = argsOrArgArray$1;
17231
+ var argsOrArgArray_1$4 = argsOrArgArray$1;
17198
17232
  var OperatorSubscriber_1$M = OperatorSubscriber$1;
17199
17233
  function race$2() {
17200
17234
  var sources = [];
17201
17235
  for (var _i = 0; _i < arguments.length; _i++) {
17202
17236
  sources[_i] = arguments[_i];
17203
17237
  }
17204
- sources = argsOrArgArray_1$5.argsOrArgArray(sources);
17238
+ sources = argsOrArgArray_1$4.argsOrArgArray(sources);
17205
17239
  return sources.length === 1 ? innerFrom_1$s.innerFrom(sources[0]) : new Observable_1$5.Observable(raceInit(sources));
17206
17240
  }
17207
17241
  race$3.race = race$2;
@@ -17315,7 +17349,7 @@ Object.defineProperty(zip$3, "__esModule", { value: true });
17315
17349
  zip$3.zip = void 0;
17316
17350
  var Observable_1$2 = Observable$1;
17317
17351
  var innerFrom_1$q = innerFrom$1;
17318
- var argsOrArgArray_1$4 = argsOrArgArray$1;
17352
+ var argsOrArgArray_1$3 = argsOrArgArray$1;
17319
17353
  var empty_1$3 = empty;
17320
17354
  var OperatorSubscriber_1$L = OperatorSubscriber$1;
17321
17355
  var args_1$7 = args;
@@ -17325,7 +17359,7 @@ function zip$2() {
17325
17359
  args[_i] = arguments[_i];
17326
17360
  }
17327
17361
  var resultSelector = args_1$7.popResultSelector(args);
17328
- var sources = argsOrArgArray_1$4.argsOrArgArray(args);
17362
+ var sources = argsOrArgArray_1$3.argsOrArgArray(args);
17329
17363
  return sources.length
17330
17364
  ? new Observable_1$2.Observable(function (subscriber) {
17331
17365
  var buffers = sources.map(function () { return []; });
@@ -17856,7 +17890,7 @@ Object.defineProperty(combineLatest$1, "__esModule", { value: true });
17856
17890
  combineLatest$1.combineLatest = void 0;
17857
17891
  var combineLatest_1$1 = combineLatest$3;
17858
17892
  var lift_1$Q = lift;
17859
- var argsOrArgArray_1$3 = argsOrArgArray$1;
17893
+ var argsOrArgArray_1$2 = argsOrArgArray$1;
17860
17894
  var mapOneOrManyArgs_1 = mapOneOrManyArgs$1;
17861
17895
  var pipe_1 = pipe$1;
17862
17896
  var args_1$5 = args;
@@ -17869,7 +17903,7 @@ function combineLatest() {
17869
17903
  return resultSelector
17870
17904
  ? pipe_1.pipe(combineLatest.apply(void 0, __spreadArray$f([], __read$k(args))), mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector))
17871
17905
  : lift_1$Q.operate(function (source, subscriber) {
17872
- combineLatest_1$1.combineLatestInit(__spreadArray$f([source], __read$k(argsOrArgArray_1$3.argsOrArgArray(args))))(subscriber);
17906
+ combineLatest_1$1.combineLatestInit(__spreadArray$f([source], __read$k(argsOrArgArray_1$2.argsOrArgArray(args))))(subscriber);
17873
17907
  });
17874
17908
  }
17875
17909
  combineLatest$1.combineLatest = combineLatest;
@@ -18311,7 +18345,7 @@ Object.defineProperty(distinctUntilKeyChanged$1, "__esModule", { value: true });
18311
18345
  distinctUntilKeyChanged$1.distinctUntilKeyChanged = void 0;
18312
18346
  var distinctUntilChanged_1 = distinctUntilChanged$1;
18313
18347
  function distinctUntilKeyChanged(key, compare) {
18314
- return distinctUntilChanged_1.distinctUntilChanged(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });
18348
+ return distinctUntilChanged_1.distinctUntilChanged(function (x, y) { return (compare ? compare(x[key], y[key]) : x[key] === y[key]); });
18315
18349
  }
18316
18350
  distinctUntilKeyChanged$1.distinctUntilKeyChanged = distinctUntilKeyChanged;
18317
18351
 
@@ -18813,7 +18847,6 @@ var __spreadArray$a = (commonjsGlobal && commonjsGlobal.__spreadArray) || functi
18813
18847
  Object.defineProperty(merge$1, "__esModule", { value: true });
18814
18848
  merge$1.merge = void 0;
18815
18849
  var lift_1$t = lift;
18816
- var argsOrArgArray_1$2 = argsOrArgArray$1;
18817
18850
  var mergeAll_1 = mergeAll$1;
18818
18851
  var args_1$3 = args;
18819
18852
  var from_1 = from$1;
@@ -18824,7 +18857,6 @@ function merge() {
18824
18857
  }
18825
18858
  var scheduler = args_1$3.popScheduler(args);
18826
18859
  var concurrent = args_1$3.popNumber(args, Infinity);
18827
- args = argsOrArgArray_1$2.argsOrArgArray(args);
18828
18860
  return lift_1$t.operate(function (source, subscriber) {
18829
18861
  mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray$a([source], __read$f(args)), scheduler)).subscribe(subscriber);
18830
18862
  });
@@ -22093,7 +22125,7 @@ Object.defineProperty(version$1, "__esModule", { value: true });
22093
22125
  // This is set up this way to keep the version in the code in
22094
22126
  // sync with the npm package version, and to allow the build
22095
22127
  // system to control version names at packaging time.
22096
- version$1.default = '5.28.0';
22128
+ version$1.default = '5.28.2';
22097
22129
 
22098
22130
  var lib = {};
22099
22131
 
@@ -25362,7 +25394,7 @@ var WebSocketChannel = /** @class */ (function () {
25362
25394
  }
25363
25395
  else {
25364
25396
  // Some other error occured
25365
- throw error;
25397
+ throw (0, neo4j_driver_core_1$I.newError)('unexpected failure to write.', undefined, error);
25366
25398
  }
25367
25399
  }
25368
25400
  }
@@ -26640,7 +26672,7 @@ Object.defineProperty(handshake$1, "__esModule", { value: true });
26640
26672
  var channel_1$4 = channel;
26641
26673
  var neo4j_driver_core_1$E = lib$1;
26642
26674
  var BOLT_MAGIC_PREAMBLE = 0x6060b017;
26643
- var AVAILABLE_BOLT_PROTOCOLS = [5.8, 5.7, 5.6, 5.4, 5.3, 5.2, 5.1, 5.0, 4.4, 4.3, 4.2, 3.0]; // bolt protocols the client will accept, ordered by preference
26675
+ var AVAILABLE_BOLT_PROTOCOLS = ['5.8', '5.7', '5.6', '5.4', '5.3', '5.2', '5.1', '5.0', '4.4', '4.3', '4.2', '3.0']; // bolt protocols the client will accept, ordered by preference
26644
26676
  var DESIRED_CAPABILITES = 0;
26645
26677
  function version(major, minor) {
26646
26678
  return {
@@ -26709,7 +26741,7 @@ function handshakeNegotiationV2(channel, buffer, log) {
26709
26741
  });
26710
26742
  for (var i = 0; i < versions.length; i++) {
26711
26743
  var version_1 = versions[i];
26712
- if (AVAILABLE_BOLT_PROTOCOLS.includes(Number(version_1.major + '.' + version_1.minor))) {
26744
+ if (AVAILABLE_BOLT_PROTOCOLS.includes(version_1.major + '.' + version_1.minor)) {
26713
26745
  major = version_1.major;
26714
26746
  minor = version_1.minor;
26715
26747
  break;
@@ -37089,7 +37121,8 @@ function _isFailFastError(error) {
37089
37121
  ].includes(error.code);
37090
37122
  }
37091
37123
  function _isFailFastSecurityError(error) {
37092
- return error.code.startsWith('Neo.ClientError.Security.') &&
37124
+ var _a;
37125
+ return ((_a = error.code) === null || _a === void 0 ? void 0 : _a.startsWith('Neo.ClientError.Security.')) &&
37093
37126
  ![
37094
37127
  AUTHORIZATION_EXPIRED_CODE
37095
37128
  ].includes(error.code);
@@ -37221,7 +37254,7 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
37221
37254
  return (mod && mod.__esModule) ? mod : { "default": mod };
37222
37255
  };
37223
37256
  Object.defineProperty(exports, "__esModule", { value: true });
37224
- 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.Neo4jError = exports.integer = 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.hasReachableServer = exports.driver = exports.authTokenManagers = void 0;
37257
+ 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.isRetriableError = exports.Neo4jError = exports.integer = 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.hasReachableServer = exports.driver = exports.authTokenManagers = void 0;
37225
37258
  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;
37226
37259
  /**
37227
37260
  * Copyright (c) "Neo4j"
@@ -37245,7 +37278,7 @@ var version_1 = __importDefault(version$1);
37245
37278
  var neo4j_driver_core_1 = lib$1;
37246
37279
  Object.defineProperty(exports, "authTokenManagers", { enumerable: true, get: function () { return neo4j_driver_core_1.authTokenManagers; } });
37247
37280
  Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return neo4j_driver_core_1.Neo4jError; } });
37248
- Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return neo4j_driver_core_1.isRetryableError; } });
37281
+ Object.defineProperty(exports, "isRetriableError", { enumerable: true, get: function () { return neo4j_driver_core_1.isRetriableError; } });
37249
37282
  Object.defineProperty(exports, "error", { enumerable: true, get: function () { return neo4j_driver_core_1.error; } });
37250
37283
  Object.defineProperty(exports, "Integer", { enumerable: true, get: function () { return neo4j_driver_core_1.Integer; } });
37251
37284
  Object.defineProperty(exports, "int", { enumerable: true, get: function () { return neo4j_driver_core_1.int; } });
@@ -37570,7 +37603,7 @@ var forExport = {
37570
37603
  isUnboundRelationship: neo4j_driver_core_1.isUnboundRelationship,
37571
37604
  integer: integer,
37572
37605
  Neo4jError: neo4j_driver_core_1.Neo4jError,
37573
- isRetryableError: neo4j_driver_core_1.isRetryableError,
37606
+ isRetriableError: neo4j_driver_core_1.isRetriableError,
37574
37607
  auth: neo4j_driver_core_1.auth,
37575
37608
  logging: logging,
37576
37609
  types: types,