neo4j-driver 5.11.0 → 5.12.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.
@@ -331,6 +331,7 @@ var Integer = /** @class */ (function () {
331
331
  // Do several (6) digits each time through the loop, so as to
332
332
  // minimize the calls to the very expensive emulated div.
333
333
  var radixToPower = Integer.fromNumber(Math.pow(radix, 6));
334
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
334
335
  rem = this;
335
336
  var result = '';
336
337
  while (true) {
@@ -700,6 +701,7 @@ var Integer = /** @class */ (function () {
700
701
  // the approximate value is less than or equal to the real value so that the
701
702
  // remainder never becomes negative.
702
703
  res = Integer.ZERO;
704
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
703
705
  rem = this;
704
706
  while (rem.greaterThanOrEqual(theDivisor)) {
705
707
  // Approximate the result of division. This may be a little greater or
@@ -4236,10 +4238,11 @@ var CompletedObserver$1 = /** @class */ (function () {
4236
4238
  CompletedObserver.prototype.markCompleted = function () {
4237
4239
  // do nothing
4238
4240
  };
4239
- // eslint-disable-next-line node/handle-callback-err
4240
4241
  CompletedObserver.prototype.onError = function (error) {
4241
4242
  // nothing to do, already finished
4242
- throw Error('CompletedObserver not supposed to call onError');
4243
+ // eslint-disable-next-line
4244
+ // @ts-ignore: not available in ES oldest supported version
4245
+ throw new Error('CompletedObserver not supposed to call onError', { cause: error });
4243
4246
  };
4244
4247
  return CompletedObserver;
4245
4248
  }());
@@ -4844,7 +4847,7 @@ var EmptyConnectionHolder = /** @class */ (function (_super) {
4844
4847
  */
4845
4848
  var EMPTY_CONNECTION_HOLDER$1 = new EmptyConnectionHolder();
4846
4849
  connectionHolder$1.EMPTY_CONNECTION_HOLDER = EMPTY_CONNECTION_HOLDER$1;
4847
- // eslint-disable-next-line node/handle-callback-err
4850
+ // eslint-disable-next-line n/handle-callback-err
4848
4851
  function ignoreError(error) {
4849
4852
  return null;
4850
4853
  }
@@ -5043,6 +5046,7 @@ var TransactionExecutor = /** @class */ (function () {
5043
5046
  this._multiplier = _valueOrDefault(multiplier, DEFAULT_RETRY_DELAY_MULTIPLIER$1);
5044
5047
  this._jitterFactor = _valueOrDefault(jitterFactor, DEFAULT_RETRY_DELAY_JITTER_FACTOR$1);
5045
5048
  this._inFlightTimeoutIds = [];
5049
+ this.pipelineBegin = false;
5046
5050
  this._verifyAfterConstruction();
5047
5051
  }
5048
5052
  TransactionExecutor.prototype.execute = function (transactionCreator, transactionWork, transactionWrapper) {
@@ -5082,22 +5086,29 @@ var TransactionExecutor = /** @class */ (function () {
5082
5086
  };
5083
5087
  TransactionExecutor.prototype._executeTransactionInsidePromise = function (transactionCreator, transactionWork, resolve, reject, transactionWrapper) {
5084
5088
  return __awaiter$g(this, void 0, void 0, function () {
5085
- var tx, error_2, wrap, wrappedTx, resultPromise;
5089
+ var tx, txPromise, _a, error_2, wrap, wrappedTx, resultPromise;
5086
5090
  var _this = this;
5087
- return __generator$i(this, function (_a) {
5088
- switch (_a.label) {
5091
+ return __generator$i(this, function (_b) {
5092
+ switch (_b.label) {
5089
5093
  case 0:
5090
- _a.trys.push([0, 2, , 3]);
5091
- return [4 /*yield*/, transactionCreator()];
5092
- case 1:
5093
- tx = _a.sent();
5094
+ _b.trys.push([0, 4, , 5]);
5095
+ txPromise = transactionCreator();
5096
+ if (!this.pipelineBegin) return [3 /*break*/, 1];
5097
+ _a = txPromise;
5094
5098
  return [3 /*break*/, 3];
5099
+ case 1: return [4 /*yield*/, txPromise];
5095
5100
  case 2:
5096
- error_2 = _a.sent();
5101
+ _a = _b.sent();
5102
+ _b.label = 3;
5103
+ case 3:
5104
+ tx = _a;
5105
+ return [3 /*break*/, 5];
5106
+ case 4:
5107
+ error_2 = _b.sent();
5097
5108
  // failed to create a transaction
5098
5109
  reject(error_2);
5099
5110
  return [2 /*return*/];
5100
- case 3:
5111
+ case 5:
5101
5112
  wrap = transactionWrapper !== null && transactionWrapper !== void 0 ? transactionWrapper : (function (tx) { return tx; });
5102
5113
  wrappedTx = wrap(tx);
5103
5114
  resultPromise = this._safeExecuteTransactionWork(wrappedTx, transactionWork);
@@ -8290,7 +8301,7 @@ var Session = /** @class */ (function () {
8290
8301
  Session.prototype._updateBookmarks = function (newBookmarks, previousBookmarks, database) {
8291
8302
  var _a, _b, _c;
8292
8303
  if ((newBookmarks != null) && !newBookmarks.isEmpty()) {
8293
- (_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.updateBookmarks((_b = previousBookmarks === null || previousBookmarks === void 0 ? void 0 : previousBookmarks.values()) !== null && _b !== void 0 ? _b : [], (_c = newBookmarks === null || newBookmarks === void 0 ? void 0 : newBookmarks.values()) !== null && _c !== void 0 ? _c : []);
8304
+ (_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.updateBookmarks((_b = previousBookmarks === null || previousBookmarks === void 0 ? void 0 : previousBookmarks.values()) !== null && _b !== void 0 ? _b : [], (_c = newBookmarks === null || newBookmarks === void 0 ? void 0 : newBookmarks.values()) !== null && _c !== void 0 ? _c : []).catch(function () { });
8294
8305
  this._lastBookmarks = newBookmarks;
8295
8306
  this._configuredBookmarks = bookmarks_1$1.Bookmarks.empty();
8296
8307
  }
@@ -8355,6 +8366,15 @@ var Session = /** @class */ (function () {
8355
8366
  high: 0.7 * this._fetchSize
8356
8367
  };
8357
8368
  };
8369
+ /**
8370
+ * Configure the transaction executor to pipeline transaction begin.
8371
+ *
8372
+ * @private
8373
+ * @returns {void}
8374
+ */
8375
+ Session.prototype._setTxExecutorToPipelineBegin = function (pipelined) {
8376
+ this._transactionExecutor.pipelineBegin = pipelined;
8377
+ };
8358
8378
  /**
8359
8379
  * @protected
8360
8380
  */
@@ -8926,6 +8946,8 @@ var QueryExecutor = /** @class */ (function () {
8926
8946
  bookmarkManager: config.bookmarkManager,
8927
8947
  impersonatedUser: config.impersonatedUser
8928
8948
  });
8949
+ // @ts-expect-error The method is private for external users
8950
+ session._setTxExecutorToPipelineBegin(true);
8929
8951
  _a.label = 1;
8930
8952
  case 1:
8931
8953
  _a.trys.push([1, , 3, 5]);
@@ -9326,7 +9348,7 @@ var Driver$1 = /** @class */ (function () {
9326
9348
  function Driver(meta, config, createConnectionProvider, createSession, createQueryExecutor) {
9327
9349
  if (config === void 0) { config = {}; }
9328
9350
  if (createSession === void 0) { createSession = function (args) { return new session_1.default(args); }; }
9329
- if (createQueryExecutor === void 0) { createQueryExecutor = function (createQuery) { return new query_executor_1.default(createQuery); }; }
9351
+ if (createQueryExecutor === void 0) { createQueryExecutor = function (createSession) { return new query_executor_1.default(createSession); }; }
9330
9352
  sanitizeConfig(config);
9331
9353
  var log = logger_1.Logger.create(config);
9332
9354
  validateConfig(config, log);
@@ -9934,7 +9956,7 @@ var __importDefault$L = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
9934
9956
  return (mod && mod.__esModule) ? mod : { "default": mod };
9935
9957
  };
9936
9958
  Object.defineProperty(authTokenManager, "__esModule", { value: true });
9937
- authTokenManager.isStaticAuthTokenManger = authTokenManager.staticAuthTokenManager = authTokenManager.expirationBasedAuthTokenManager = authTokenManager.AuthTokenAndExpiration = void 0;
9959
+ authTokenManager.staticAuthTokenManager = authTokenManager.authTokenManagers = authTokenManager.AuthTokenAndExpiration = void 0;
9938
9960
  var auth_1 = __importDefault$L(auth$1);
9939
9961
  var internal_1 = internal;
9940
9962
  /**
@@ -9958,12 +9980,13 @@ var AuthTokenManager = /** @class */ (function () {
9958
9980
  throw new Error('Not Implemented');
9959
9981
  };
9960
9982
  /**
9961
- * Called to notify a token expiration.
9983
+ * Handles an error notification emitted by the server if a security error happened.
9962
9984
  *
9963
9985
  * @param {AuthToken} token The expired token.
9964
- * @return {void}
9986
+ * @param {`Neo.ClientError.Security.${string}`} securityErrorCode the security error code returned by the server
9987
+ * @return {boolean} whether the exception was handled by the manager, so the driver knows if it can be retried..
9965
9988
  */
9966
- AuthTokenManager.prototype.onTokenExpired = function (token) {
9989
+ AuthTokenManager.prototype.handleSecurityException = function (token, securityErrorCode) {
9967
9990
  throw new Error('Not implemented');
9968
9991
  };
9969
9992
  return AuthTokenManager;
@@ -9988,7 +10011,7 @@ var AuthTokenAndExpiration = /** @class */ (function () {
9988
10011
  * The expected expiration date of the auth token.
9989
10012
  *
9990
10013
  * This information will be used for triggering the auth token refresh
9991
- * in managers created with {@link expirationBasedAuthTokenManager}.
10014
+ * in managers created with {@link authTokenManagers#bearer}.
9992
10015
  *
9993
10016
  * If this value is not defined, the {@link AuthToken} will be considered valid
9994
10017
  * until a `Neo.ClientError.Security.TokenExpired` error happens.
@@ -10001,25 +10024,73 @@ var AuthTokenAndExpiration = /** @class */ (function () {
10001
10024
  }());
10002
10025
  authTokenManager.AuthTokenAndExpiration = AuthTokenAndExpiration;
10003
10026
  /**
10004
- * Creates a {@link AuthTokenManager} for handle {@link AuthToken} which is expires.
10005
- *
10006
- * **Warning**: `tokenProvider` must only ever return auth information belonging to the same identity.
10007
- * Switching identities using the `AuthTokenManager` is undefined behavior.
10027
+ * Defines the object which holds the common {@link AuthTokenManager} used in the Driver
10028
+ */
10029
+ var AuthTokenManagers = /** @class */ (function () {
10030
+ function AuthTokenManagers() {
10031
+ }
10032
+ /**
10033
+ * Creates a {@link AuthTokenManager} for handle {@link AuthToken} which is expires.
10034
+ *
10035
+ * **Warning**: `tokenProvider` must only ever return auth information belonging to the same identity.
10036
+ * Switching identities using the `AuthTokenManager` is undefined behavior.
10037
+ *
10038
+ * @param {object} param0 - The params
10039
+ * @param {function(): Promise<AuthTokenAndExpiration>} param0.tokenProvider - Retrieves a new valid auth token.
10040
+ * Must only ever return auth information belonging to the same identity.
10041
+ * @returns {AuthTokenManager} The temporal auth data manager.
10042
+ * @experimental Exposed as preview feature.
10043
+ */
10044
+ AuthTokenManagers.prototype.bearer = function (_a) {
10045
+ var tokenProvider = _a.tokenProvider;
10046
+ if (typeof tokenProvider !== 'function') {
10047
+ throw new TypeError("tokenProvider should be function, but got: ".concat(typeof tokenProvider));
10048
+ }
10049
+ return new ExpirationBasedAuthTokenManager(tokenProvider, [
10050
+ 'Neo.ClientError.Security.Unauthorized',
10051
+ 'Neo.ClientError.Security.TokenExpired'
10052
+ ]);
10053
+ };
10054
+ /**
10055
+ * Creates a {@link AuthTokenManager} for handle {@link AuthToken} and password rotation.
10056
+ *
10057
+ * **Warning**: `tokenProvider` must only ever return auth information belonging to the same identity.
10058
+ * Switching identities using the `AuthTokenManager` is undefined behavior.
10059
+ *
10060
+ * @param {object} param0 - The params
10061
+ * @param {function(): Promise<AuthToken>} param0.tokenProvider - Retrieves a new valid auth token.
10062
+ * Must only ever return auth information belonging to the same identity.
10063
+ * @returns {AuthTokenManager} The basic auth data manager.
10064
+ * @experimental Exposed as preview feature.
10065
+ */
10066
+ AuthTokenManagers.prototype.basic = function (_a) {
10067
+ var _this = this;
10068
+ var tokenProvider = _a.tokenProvider;
10069
+ if (typeof tokenProvider !== 'function') {
10070
+ throw new TypeError("tokenProvider should be function, but got: ".concat(typeof tokenProvider));
10071
+ }
10072
+ return new ExpirationBasedAuthTokenManager(function () { return __awaiter$8(_this, void 0, void 0, function () {
10073
+ var _a;
10074
+ return __generator$a(this, function (_b) {
10075
+ switch (_b.label) {
10076
+ case 0:
10077
+ _a = {};
10078
+ return [4 /*yield*/, tokenProvider()];
10079
+ case 1: return [2 /*return*/, (_a.token = _b.sent(), _a)];
10080
+ }
10081
+ });
10082
+ }); }, ['Neo.ClientError.Security.Unauthorized']);
10083
+ };
10084
+ return AuthTokenManagers;
10085
+ }());
10086
+ /**
10087
+ * Holds the common {@link AuthTokenManagers} used in the Driver
10008
10088
  *
10009
- * @param {object} param0 - The params
10010
- * @param {function(): Promise<AuthTokenAndExpiration>} param0.tokenProvider - Retrieves a new valid auth token.
10011
- * Must only ever return auth information belonging to the same identity.
10012
- * @returns {AuthTokenManager} The temporal auth data manager.
10013
10089
  * @experimental Exposed as preview feature.
10014
10090
  */
10015
- function expirationBasedAuthTokenManager(_a) {
10016
- var tokenProvider = _a.tokenProvider;
10017
- if (typeof tokenProvider !== 'function') {
10018
- throw new TypeError("tokenProvider should be function, but got: ".concat(typeof tokenProvider));
10019
- }
10020
- return new ExpirationBasedAuthTokenManager(tokenProvider);
10021
- }
10022
- authTokenManager.expirationBasedAuthTokenManager = expirationBasedAuthTokenManager;
10091
+ var authTokenManagers = new AuthTokenManagers();
10092
+ authTokenManager.authTokenManagers = authTokenManagers;
10093
+ Object.freeze(authTokenManagers);
10023
10094
  /**
10024
10095
  * Create a {@link AuthTokenManager} for handle static {@link AuthToken}
10025
10096
  *
@@ -10033,18 +10104,6 @@ function staticAuthTokenManager(_a) {
10033
10104
  return new StaticAuthTokenManager(authToken);
10034
10105
  }
10035
10106
  authTokenManager.staticAuthTokenManager = staticAuthTokenManager;
10036
- /**
10037
- * Checks if the manager is a StaticAuthTokenManager
10038
- *
10039
- * @private
10040
- * @experimental
10041
- * @param {AuthTokenManager} manager The auth token manager to be checked.
10042
- * @returns {boolean} Manager is StaticAuthTokenManager
10043
- */
10044
- function isStaticAuthTokenManger(manager) {
10045
- return manager instanceof StaticAuthTokenManager;
10046
- }
10047
- authTokenManager.isStaticAuthTokenManger = isStaticAuthTokenManger;
10048
10107
  var TokenRefreshObservable = /** @class */ (function () {
10049
10108
  function TokenRefreshObservable(_subscribers) {
10050
10109
  if (_subscribers === void 0) { _subscribers = []; }
@@ -10062,8 +10121,9 @@ var TokenRefreshObservable = /** @class */ (function () {
10062
10121
  return TokenRefreshObservable;
10063
10122
  }());
10064
10123
  var ExpirationBasedAuthTokenManager = /** @class */ (function () {
10065
- function ExpirationBasedAuthTokenManager(_tokenProvider, _currentAuthData, _refreshObservable) {
10124
+ function ExpirationBasedAuthTokenManager(_tokenProvider, _handledSecurityCodes, _currentAuthData, _refreshObservable) {
10066
10125
  this._tokenProvider = _tokenProvider;
10126
+ this._handledSecurityCodes = _handledSecurityCodes;
10067
10127
  this._currentAuthData = _currentAuthData;
10068
10128
  this._refreshObservable = _refreshObservable;
10069
10129
  }
@@ -10085,11 +10145,15 @@ var ExpirationBasedAuthTokenManager = /** @class */ (function () {
10085
10145
  });
10086
10146
  });
10087
10147
  };
10088
- ExpirationBasedAuthTokenManager.prototype.onTokenExpired = function (token) {
10148
+ ExpirationBasedAuthTokenManager.prototype.handleSecurityException = function (token, securityErrorCode) {
10089
10149
  var _a;
10090
- if (internal_1.util.equals(token, (_a = this._currentAuthData) === null || _a === void 0 ? void 0 : _a.token)) {
10091
- this._scheduleRefreshAuthToken();
10150
+ if (this._handledSecurityCodes.includes(securityErrorCode)) {
10151
+ if (internal_1.util.equals(token, (_a = this._currentAuthData) === null || _a === void 0 ? void 0 : _a.token)) {
10152
+ this._scheduleRefreshAuthToken();
10153
+ }
10154
+ return true;
10092
10155
  }
10156
+ return false;
10093
10157
  };
10094
10158
  ExpirationBasedAuthTokenManager.prototype._scheduleRefreshAuthToken = function (observer) {
10095
10159
  var _this = this;
@@ -10139,8 +10203,8 @@ var StaticAuthTokenManager = /** @class */ (function () {
10139
10203
  StaticAuthTokenManager.prototype.getToken = function () {
10140
10204
  return this._authToken;
10141
10205
  };
10142
- StaticAuthTokenManager.prototype.onTokenExpired = function (_) {
10143
- // nothing to do here
10206
+ StaticAuthTokenManager.prototype.handleSecurityException = function (_, __) {
10207
+ return false;
10144
10208
  };
10145
10209
  return StaticAuthTokenManager;
10146
10210
  }());
@@ -10438,8 +10502,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
10438
10502
  return (mod && mod.__esModule) ? mod : { "default": mod };
10439
10503
  };
10440
10504
  Object.defineProperty(exports, "__esModule", { value: true });
10441
- exports.ManagedTransaction = exports.Transaction = exports.Connection = exports.ConnectionProvider = exports.EagerResult = exports.Result = exports.Stats = exports.QueryStatistics = exports.ProfiledPlan = exports.Plan = exports.Notification = exports.ServerInfo = exports.queryType = exports.ResultSummary = exports.Record = exports.isPathSegment = exports.PathSegment = exports.isPath = exports.Path = exports.isUnboundRelationship = exports.UnboundRelationship = exports.isRelationship = exports.Relationship = exports.isNode = exports.Node = exports.Time = exports.LocalTime = exports.LocalDateTime = exports.isTime = exports.isLocalTime = exports.isLocalDateTime = exports.isDuration = exports.isDateTime = exports.isDate = exports.Duration = exports.DateTime = exports.Date = exports.Point = exports.isPoint = exports.internal = exports.toString = exports.toNumber = exports.inSafeRange = exports.isInt = exports.int = exports.Integer = exports.error = exports.isRetriableError = exports.Neo4jError = exports.newError = void 0;
10442
- exports.notificationFilterMinimumSeverityLevel = exports.notificationFilterDisabledCategory = exports.notificationSeverityLevel = exports.notificationCategory = exports.resultTransformers = exports.routing = exports.isStaticAuthTokenManger = exports.staticAuthTokenManager = exports.expirationBasedAuthTokenManager = exports.bookmarkManager = exports.auth = exports.json = exports.driver = exports.types = exports.Driver = exports.Session = exports.TransactionPromise = void 0;
10505
+ exports.Transaction = exports.Connection = exports.ConnectionProvider = exports.EagerResult = exports.Result = exports.Stats = exports.QueryStatistics = exports.ProfiledPlan = exports.Plan = exports.Notification = exports.ServerInfo = exports.queryType = exports.ResultSummary = exports.Record = exports.isPathSegment = exports.PathSegment = exports.isPath = exports.Path = exports.isUnboundRelationship = exports.UnboundRelationship = exports.isRelationship = exports.Relationship = exports.isNode = exports.Node = exports.Time = exports.LocalTime = exports.LocalDateTime = exports.isTime = exports.isLocalTime = exports.isLocalDateTime = exports.isDuration = exports.isDateTime = exports.isDate = exports.Duration = exports.DateTime = exports.Date = exports.Point = exports.isPoint = exports.internal = exports.toString = exports.toNumber = exports.inSafeRange = exports.isInt = exports.int = exports.Integer = exports.error = exports.isRetriableError = exports.Neo4jError = exports.newError = exports.authTokenManagers = void 0;
10506
+ exports.notificationFilterMinimumSeverityLevel = exports.notificationFilterDisabledCategory = exports.notificationSeverityLevel = exports.notificationCategory = exports.resultTransformers = exports.routing = exports.staticAuthTokenManager = exports.bookmarkManager = exports.auth = exports.json = exports.driver = exports.types = exports.Driver = exports.Session = exports.TransactionPromise = exports.ManagedTransaction = void 0;
10443
10507
  var error_1 = error;
10444
10508
  Object.defineProperty(exports, "newError", { enumerable: true, get: function () { return error_1.newError; } });
10445
10509
  Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return error_1.Neo4jError; } });
@@ -10518,9 +10582,8 @@ exports.auth = auth_1.default;
10518
10582
  var bookmark_manager_1 = bookmarkManager$1;
10519
10583
  Object.defineProperty(exports, "bookmarkManager", { enumerable: true, get: function () { return bookmark_manager_1.bookmarkManager; } });
10520
10584
  var auth_token_manager_1 = authTokenManager;
10521
- Object.defineProperty(exports, "expirationBasedAuthTokenManager", { enumerable: true, get: function () { return auth_token_manager_1.expirationBasedAuthTokenManager; } });
10585
+ Object.defineProperty(exports, "authTokenManagers", { enumerable: true, get: function () { return auth_token_manager_1.authTokenManagers; } });
10522
10586
  Object.defineProperty(exports, "staticAuthTokenManager", { enumerable: true, get: function () { return auth_token_manager_1.staticAuthTokenManager; } });
10523
- Object.defineProperty(exports, "isStaticAuthTokenManger", { enumerable: true, get: function () { return auth_token_manager_1.isStaticAuthTokenManger; } });
10524
10587
  var driver_2 = driver;
10525
10588
  Object.defineProperty(exports, "routing", { enumerable: true, get: function () { return driver_2.routing; } });
10526
10589
  var types = __importStar(types$1);
@@ -10544,6 +10607,7 @@ exports.error = error$1;
10544
10607
  * @private
10545
10608
  */
10546
10609
  var forExport = {
10610
+ authTokenManagers: auth_token_manager_1.authTokenManagers,
10547
10611
  newError: error_1.newError,
10548
10612
  Neo4jError: error_1.Neo4jError,
10549
10613
  isRetriableError: error_1.isRetriableError,
@@ -10601,7 +10665,6 @@ var forExport = {
10601
10665
  json: json$1,
10602
10666
  auth: auth_1.default,
10603
10667
  bookmarkManager: bookmark_manager_1.bookmarkManager,
10604
- expirationBasedAuthTokenManager: auth_token_manager_1.expirationBasedAuthTokenManager,
10605
10668
  routing: driver_2.routing,
10606
10669
  resultTransformers: result_transformers_1.default,
10607
10670
  notificationCategory: result_summary_1.notificationCategory,
@@ -18639,7 +18702,7 @@ Object.defineProperty(resultRx, "__esModule", { value: true });
18639
18702
  * limitations under the License.
18640
18703
  */
18641
18704
  /* eslint-disable-next-line no-unused-vars */
18642
- var neo4j_driver_core_1$G = lib$1;
18705
+ var neo4j_driver_core_1$H = lib$1;
18643
18706
  var rxjs_1$3 = cjs;
18644
18707
  var operators_1$2 = operators;
18645
18708
  var States = {
@@ -18773,7 +18836,7 @@ var RxResult = /** @class */ (function () {
18773
18836
  });
18774
18837
  }
18775
18838
  else if (recordsObserver) {
18776
- recordsObserver.error((0, neo4j_driver_core_1$G.newError)('Streaming has already started/consumed with a previous records or summary subscription.'));
18839
+ recordsObserver.error((0, neo4j_driver_core_1$H.newError)('Streaming has already started/consumed with a previous records or summary subscription.'));
18777
18840
  }
18778
18841
  return function () {
18779
18842
  subscriptions.forEach(function (s) { return s.unsubscribe(); });
@@ -19173,13 +19236,13 @@ var retryLogicRx = {};
19173
19236
  * limitations under the License.
19174
19237
  */
19175
19238
  Object.defineProperty(retryLogicRx, "__esModule", { value: true });
19176
- var neo4j_driver_core_1$F = lib$1;
19239
+ var neo4j_driver_core_1$G = lib$1;
19177
19240
  // eslint-disable-next-line no-unused-vars
19178
19241
  var rxjs_1$1 = cjs;
19179
19242
  var operators_1$1 = operators;
19180
19243
  // eslint-disable-next-line no-unused-vars
19181
- neo4j_driver_core_1$F.internal.logger.Logger;
19182
- var SERVICE_UNAVAILABLE$5 = neo4j_driver_core_1$F.error.SERVICE_UNAVAILABLE;
19244
+ neo4j_driver_core_1$G.internal.logger.Logger;
19245
+ var SERVICE_UNAVAILABLE$5 = neo4j_driver_core_1$G.error.SERVICE_UNAVAILABLE;
19183
19246
  var DEFAULT_MAX_RETRY_TIME_MS = 30 * 1000; // 30 seconds
19184
19247
  var DEFAULT_INITIAL_RETRY_DELAY_MS = 1000; // 1 seconds
19185
19248
  var DEFAULT_RETRY_DELAY_MULTIPLIER = 2.0;
@@ -19210,13 +19273,13 @@ var RxRetryLogic = /** @class */ (function () {
19210
19273
  var retryCount = 1;
19211
19274
  var delayDuration = _this._initialDelay;
19212
19275
  return failedWork.pipe((0, operators_1$1.mergeMap)(function (err) {
19213
- if (!(0, neo4j_driver_core_1$F.isRetriableError)(err)) {
19276
+ if (!(0, neo4j_driver_core_1$G.isRetriableError)(err)) {
19214
19277
  return (0, rxjs_1$1.throwError)(function () { return err; });
19215
19278
  }
19216
19279
  handledExceptions.push(err);
19217
19280
  if (retryCount >= 2 &&
19218
19281
  Date.now() - startTime >= _this._maxRetryTimeout) {
19219
- var error_1 = (0, neo4j_driver_core_1$F.newError)("Failed after retried for ".concat(retryCount, " times in ").concat(_this._maxRetryTimeout, " ms. Make sure that your database is online and retry again."), SERVICE_UNAVAILABLE$5);
19282
+ var error_1 = (0, neo4j_driver_core_1$G.newError)("Failed after retried for ".concat(retryCount, " times in ").concat(_this._maxRetryTimeout, " ms. Make sure that your database is online and retry again."), SERVICE_UNAVAILABLE$5);
19220
19283
  error_1.seenErrors = handledExceptions;
19221
19284
  return (0, rxjs_1$1.throwError)(function () { return error_1; });
19222
19285
  }
@@ -19270,11 +19333,11 @@ var rxjs_1 = cjs;
19270
19333
  var operators_1 = operators;
19271
19334
  var result_rx_1 = __importDefault$I(resultRx);
19272
19335
  // eslint-disable-next-line no-unused-vars
19273
- var neo4j_driver_core_1$E = lib$1;
19336
+ var neo4j_driver_core_1$F = lib$1;
19274
19337
  var transaction_rx_1 = __importDefault$I(transactionRx);
19275
19338
  var transaction_managed_rx_1 = __importDefault$I(transactionManagedRx);
19276
19339
  var retry_logic_rx_1 = __importDefault$I(retryLogicRx);
19277
- var _a$c = neo4j_driver_core_1$E.internal.constants, ACCESS_MODE_READ$1 = _a$c.ACCESS_MODE_READ, ACCESS_MODE_WRITE$1 = _a$c.ACCESS_MODE_WRITE, TxConfig$3 = neo4j_driver_core_1$E.internal.txConfig.TxConfig;
19340
+ var _a$c = neo4j_driver_core_1$F.internal.constants, ACCESS_MODE_READ$1 = _a$c.ACCESS_MODE_READ, ACCESS_MODE_WRITE$1 = _a$c.ACCESS_MODE_WRITE, TxConfig$3 = neo4j_driver_core_1$F.internal.txConfig.TxConfig;
19278
19341
  /**
19279
19342
  * A Reactive session, which provides the same functionality as {@link Session} but through a Reactive API.
19280
19343
  */
@@ -19522,10 +19585,10 @@ var __importDefault$H = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
19522
19585
  };
19523
19586
  Object.defineProperty(driver$1, "__esModule", { value: true });
19524
19587
  driver$1.WRITE = driver$1.READ = driver$1.Driver = void 0;
19525
- var neo4j_driver_core_1$D = lib$1;
19588
+ var neo4j_driver_core_1$E = lib$1;
19526
19589
  var session_rx_1 = __importDefault$H(sessionRx);
19527
- var FETCH_ALL$5 = neo4j_driver_core_1$D.internal.constants.FETCH_ALL;
19528
- var READ$2 = neo4j_driver_core_1$D.driver.READ, WRITE$2 = neo4j_driver_core_1$D.driver.WRITE;
19590
+ var FETCH_ALL$5 = neo4j_driver_core_1$E.internal.constants.FETCH_ALL;
19591
+ var READ$2 = neo4j_driver_core_1$E.driver.READ, WRITE$2 = neo4j_driver_core_1$E.driver.WRITE;
19529
19592
  driver$1.READ = READ$2;
19530
19593
  driver$1.WRITE = WRITE$2;
19531
19594
  /**
@@ -19578,7 +19641,7 @@ var Driver = /** @class */ (function (_super) {
19578
19641
  });
19579
19642
  };
19580
19643
  return Driver;
19581
- }(neo4j_driver_core_1$D.Driver));
19644
+ }(neo4j_driver_core_1$E.Driver));
19582
19645
  driver$1.Driver = Driver;
19583
19646
  /**
19584
19647
  * @private
@@ -19626,7 +19689,7 @@ Object.defineProperty(version$1, "__esModule", { value: true });
19626
19689
  // This is set up this way to keep the version in the code in
19627
19690
  // sync with the npm package version, and to allow the build
19628
19691
  // system to control version names at packaging time.
19629
- version$1.default = '5.11.0';
19692
+ version$1.default = '5.12.0';
19630
19693
 
19631
19694
  var lib = {};
19632
19695
 
@@ -22733,7 +22796,7 @@ function newChannelJSBuffer(arg) {
22733
22796
  }
22734
22797
  else {
22735
22798
  // fallback to the old, potentially deprecated constructor
22736
- // eslint-disable-next-line node/no-deprecated-api
22799
+ // eslint-disable-next-line n/no-deprecated-api
22737
22800
  return new buffer_1$1.default.Buffer(arg);
22738
22801
  }
22739
22802
  }
@@ -22762,8 +22825,8 @@ Object.defineProperty(browserChannel, "__esModule", { value: true });
22762
22825
  */
22763
22826
  /* eslint-env browser */
22764
22827
  var channel_buf_1$3 = __importDefault$C(channelBuf);
22765
- var neo4j_driver_core_1$C = lib$1;
22766
- var _a$b = neo4j_driver_core_1$C.internal.util, ENCRYPTION_OFF$1 = _a$b.ENCRYPTION_OFF, ENCRYPTION_ON$1 = _a$b.ENCRYPTION_ON;
22828
+ var neo4j_driver_core_1$D = lib$1;
22829
+ var _a$b = neo4j_driver_core_1$D.internal.util, ENCRYPTION_OFF$1 = _a$b.ENCRYPTION_OFF, ENCRYPTION_ON$1 = _a$b.ENCRYPTION_ON;
22767
22830
  var WS_OPEN = 1;
22768
22831
  var WS_CLOSED = 3;
22769
22832
  /**
@@ -22828,7 +22891,7 @@ var WebSocketChannel = /** @class */ (function () {
22828
22891
  WebSocketChannel.prototype._handleConnectionError = function () {
22829
22892
  if (this._connectionTimeoutFired) {
22830
22893
  // timeout fired - not connected within configured time
22831
- this._error = (0, neo4j_driver_core_1$C.newError)("Failed to establish connection in ".concat(this._config.connectionTimeout, "ms"), this._config.connectionErrorCode);
22894
+ this._error = (0, neo4j_driver_core_1$D.newError)("Failed to establish connection in ".concat(this._config.connectionTimeout, "ms"), this._config.connectionErrorCode);
22832
22895
  if (this.onerror) {
22833
22896
  this.onerror(this._error);
22834
22897
  }
@@ -22837,7 +22900,7 @@ var WebSocketChannel = /** @class */ (function () {
22837
22900
  // onerror triggers on websocket close as well.. don't get me started.
22838
22901
  if (this._open && !this._timedout) {
22839
22902
  // http://stackoverflow.com/questions/25779831/how-to-catch-websocket-connection-to-ws-xxxnn-failed-connection-closed-be
22840
- this._error = (0, neo4j_driver_core_1$C.newError)('WebSocket connection failure. Due to security ' +
22903
+ this._error = (0, neo4j_driver_core_1$D.newError)('WebSocket connection failure. Due to security ' +
22841
22904
  'constraints in your web browser, the reason for the failure is not available ' +
22842
22905
  'to this Neo4j Driver. Please use your browsers development console to determine ' +
22843
22906
  'the root cause of the failure. Common reasons include the database being ' +
@@ -22876,7 +22939,7 @@ var WebSocketChannel = /** @class */ (function () {
22876
22939
  }
22877
22940
  }
22878
22941
  else {
22879
- throw (0, neo4j_driver_core_1$C.newError)("Don't know how to send buffer: " + buffer);
22942
+ throw (0, neo4j_driver_core_1$D.newError)("Don't know how to send buffer: " + buffer);
22880
22943
  }
22881
22944
  };
22882
22945
  /**
@@ -22942,7 +23005,7 @@ var WebSocketChannel = /** @class */ (function () {
22942
23005
  _this._receiveTimeoutId = null;
22943
23006
  _this._timedout = true;
22944
23007
  _this.stopReceiveTimeout();
22945
- _this._error = (0, neo4j_driver_core_1$C.newError)("Connection lost. Server didn't respond in ".concat(_this._receiveTimeout, "ms"), _this._config.connectionErrorCode);
23008
+ _this._error = (0, neo4j_driver_core_1$D.newError)("Connection lost. Server didn't respond in ".concat(_this._receiveTimeout, "ms"), _this._config.connectionErrorCode);
22946
23009
  _this.close();
22947
23010
  if (_this.onerror) {
22948
23011
  _this.onerror(_this._error);
@@ -23051,7 +23114,7 @@ function determineWebSocketScheme(config, protocolSupplier) {
23051
23114
  return { scheme: 'wss', error: null };
23052
23115
  }
23053
23116
  else {
23054
- var error = (0, neo4j_driver_core_1$C.newError)('The browser version of this driver only supports one trust ' +
23117
+ var error = (0, neo4j_driver_core_1$D.newError)('The browser version of this driver only supports one trust ' +
23055
23118
  "strategy, 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES'. " +
23056
23119
  trust +
23057
23120
  ' is not supported. Please ' +
@@ -23144,8 +23207,8 @@ var __extends$m = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
23144
23207
  };
23145
23208
  })();
23146
23209
  Object.defineProperty(browserHostNameResolver, "__esModule", { value: true });
23147
- var neo4j_driver_core_1$B = lib$1;
23148
- var BaseHostNameResolver = neo4j_driver_core_1$B.internal.resolver.BaseHostNameResolver;
23210
+ var neo4j_driver_core_1$C = lib$1;
23211
+ var BaseHostNameResolver = neo4j_driver_core_1$C.internal.resolver.BaseHostNameResolver;
23149
23212
  var BrowserHostNameResolver = /** @class */ (function (_super) {
23150
23213
  __extends$m(BrowserHostNameResolver, _super);
23151
23214
  function BrowserHostNameResolver() {
@@ -23524,9 +23587,9 @@ var channelConfig = {};
23524
23587
  * limitations under the License.
23525
23588
  */
23526
23589
  Object.defineProperty(channelConfig, "__esModule", { value: true });
23527
- var neo4j_driver_core_1$A = lib$1;
23528
- var _a$a = neo4j_driver_core_1$A.internal.util, ENCRYPTION_OFF = _a$a.ENCRYPTION_OFF, ENCRYPTION_ON = _a$a.ENCRYPTION_ON;
23529
- var SERVICE_UNAVAILABLE$4 = neo4j_driver_core_1$A.error.SERVICE_UNAVAILABLE;
23590
+ var neo4j_driver_core_1$B = lib$1;
23591
+ var _a$a = neo4j_driver_core_1$B.internal.util, ENCRYPTION_OFF = _a$a.ENCRYPTION_OFF, ENCRYPTION_ON = _a$a.ENCRYPTION_ON;
23592
+ var SERVICE_UNAVAILABLE$4 = neo4j_driver_core_1$B.error.SERVICE_UNAVAILABLE;
23530
23593
  var ALLOWED_VALUES_ENCRYPTED = [
23531
23594
  null,
23532
23595
  undefined,
@@ -23564,14 +23627,14 @@ channelConfig.default = ChannelConfig;
23564
23627
  function extractEncrypted(driverConfig) {
23565
23628
  var value = driverConfig.encrypted;
23566
23629
  if (ALLOWED_VALUES_ENCRYPTED.indexOf(value) === -1) {
23567
- throw (0, neo4j_driver_core_1$A.newError)("Illegal value of the encrypted setting ".concat(value, ". Expected one of ").concat(ALLOWED_VALUES_ENCRYPTED));
23630
+ throw (0, neo4j_driver_core_1$B.newError)("Illegal value of the encrypted setting ".concat(value, ". Expected one of ").concat(ALLOWED_VALUES_ENCRYPTED));
23568
23631
  }
23569
23632
  return value;
23570
23633
  }
23571
23634
  function extractTrust(driverConfig) {
23572
23635
  var value = driverConfig.trust;
23573
23636
  if (ALLOWED_VALUES_TRUST.indexOf(value) === -1) {
23574
- throw (0, neo4j_driver_core_1$A.newError)("Illegal value of the trust setting ".concat(value, ". Expected one of ").concat(ALLOWED_VALUES_TRUST));
23637
+ throw (0, neo4j_driver_core_1$B.newError)("Illegal value of the trust setting ".concat(value, ". Expected one of ").concat(ALLOWED_VALUES_TRUST));
23575
23638
  }
23576
23639
  return value;
23577
23640
  }
@@ -23953,7 +24016,7 @@ var __importDefault$z = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
23953
24016
  };
23954
24017
  Object.defineProperty(utf8, "__esModule", { value: true });
23955
24018
  var channel_buf_1 = __importDefault$z(channelBuf);
23956
- var neo4j_driver_core_1$z = lib$1;
24019
+ var neo4j_driver_core_1$A = lib$1;
23957
24020
  var buffer_1 = __importDefault$z(buffer);
23958
24021
  var string_decoder_1 = string_decoder;
23959
24022
  var decoder = new string_decoder_1.StringDecoder('utf8');
@@ -23968,7 +24031,7 @@ function decode(buffer, length) {
23968
24031
  return decodeCombinedBuffer(buffer, length);
23969
24032
  }
23970
24033
  else {
23971
- throw (0, neo4j_driver_core_1$z.newError)("Don't know how to decode strings from '".concat(buffer, "'"));
24034
+ throw (0, neo4j_driver_core_1$A.newError)("Don't know how to decode strings from '".concat(buffer, "'"));
23972
24035
  }
23973
24036
  }
23974
24037
  function decodeChannelBuffer(buffer, length) {
@@ -24012,7 +24075,7 @@ function newBuffer(str) {
24012
24075
  return buffer_1.default.Buffer.from(str, 'utf8');
24013
24076
  }
24014
24077
  else {
24015
- // eslint-disable-next-line node/no-deprecated-api
24078
+ // eslint-disable-next-line n/no-deprecated-api
24016
24079
  return new buffer_1.default.Buffer(str, 'utf8');
24017
24080
  }
24018
24081
  }
@@ -24089,7 +24152,7 @@ Object.defineProperty(exports, "utf8", { enumerable: true, get: function () { re
24089
24152
  */
24090
24153
  Object.defineProperty(handshake$1, "__esModule", { value: true });
24091
24154
  var channel_1$3 = channel;
24092
- var neo4j_driver_core_1$y = lib$1;
24155
+ var neo4j_driver_core_1$z = lib$1;
24093
24156
  var BOLT_MAGIC_PREAMBLE = 0x6060b017;
24094
24157
  function version(major, minor) {
24095
24158
  return {
@@ -24099,7 +24162,7 @@ function version(major, minor) {
24099
24162
  }
24100
24163
  function createHandshakeMessage(versions) {
24101
24164
  if (versions.length > 4) {
24102
- throw (0, neo4j_driver_core_1$y.newError)('It should not have more than 4 versions of the protocol');
24165
+ throw (0, neo4j_driver_core_1$z.newError)('It should not have more than 4 versions of the protocol');
24103
24166
  }
24104
24167
  var handshakeBuffer = (0, channel_1$3.alloc)(5 * 4);
24105
24168
  handshakeBuffer.writeInt32(BOLT_MAGIC_PREAMBLE);
@@ -24127,7 +24190,7 @@ function parseNegotiatedResponse(buffer, log) {
24127
24190
  ];
24128
24191
  if (h[0] === 0x48 && h[1] === 0x54 && h[2] === 0x54 && h[3] === 0x50) {
24129
24192
  log.error('Handshake failed since server responded with HTTP.');
24130
- throw (0, neo4j_driver_core_1$y.newError)('Server responded HTTP. Make sure you are not trying to connect to the http endpoint ' +
24193
+ throw (0, neo4j_driver_core_1$z.newError)('Server responded HTTP. Make sure you are not trying to connect to the http endpoint ' +
24131
24194
  '(HTTP defaults to port 7474 whereas BOLT defaults to port 7687)');
24132
24195
  }
24133
24196
  return Number(h[3] + '.' + h[2]);
@@ -24468,10 +24531,10 @@ streamObservers.ProcedureRouteObserver = streamObservers.RouteObserver = streamO
24468
24531
  * See the License for the specific language governing permissions and
24469
24532
  * limitations under the License.
24470
24533
  */
24471
- var neo4j_driver_core_1$x = lib$1;
24534
+ var neo4j_driver_core_1$y = lib$1;
24472
24535
  var routing_table_raw_1 = __importDefault$x(routingTableRaw);
24473
- var FETCH_ALL$4 = neo4j_driver_core_1$x.internal.constants.FETCH_ALL;
24474
- var PROTOCOL_ERROR$5 = neo4j_driver_core_1$x.error.PROTOCOL_ERROR;
24536
+ var FETCH_ALL$4 = neo4j_driver_core_1$y.internal.constants.FETCH_ALL;
24537
+ var PROTOCOL_ERROR$5 = neo4j_driver_core_1$y.error.PROTOCOL_ERROR;
24475
24538
  var StreamObserver = /** @class */ (function () {
24476
24539
  function StreamObserver() {
24477
24540
  }
@@ -24564,7 +24627,7 @@ var ResultStreamObserver = /** @class */ (function (_super) {
24564
24627
  * @param {Array} rawRecord - An array with the raw record
24565
24628
  */
24566
24629
  ResultStreamObserver.prototype.onNext = function (rawRecord) {
24567
- var record = new neo4j_driver_core_1$x.Record(this._fieldKeys, rawRecord, this._fieldLookup);
24630
+ var record = new neo4j_driver_core_1$y.Record(this._fieldKeys, rawRecord, this._fieldLookup);
24568
24631
  if (this._observers.some(function (o) { return o.onNext; })) {
24569
24632
  this._observers.forEach(function (o) {
24570
24633
  if (o.onNext) {
@@ -24667,7 +24730,7 @@ var ResultStreamObserver = /** @class */ (function (_super) {
24667
24730
  var _this = this;
24668
24731
  var completionMetadata = Object.assign(this._server ? { server: this._server } : {}, this._meta, meta);
24669
24732
  if (![undefined, null, 'r', 'w', 'rw', 's'].includes(completionMetadata.type)) {
24670
- this.onError((0, neo4j_driver_core_1$x.newError)("Server returned invalid query type. Expected one of [undefined, null, \"r\", \"w\", \"rw\", \"s\"] but got '".concat(completionMetadata.type, "'"), PROTOCOL_ERROR$5));
24733
+ this.onError((0, neo4j_driver_core_1$y.newError)("Server returned invalid query type. Expected one of [undefined, null, \"r\", \"w\", \"rw\", \"s\"] but got '".concat(completionMetadata.type, "'"), PROTOCOL_ERROR$5));
24671
24734
  return;
24672
24735
  }
24673
24736
  this._setState(_states.SUCCEEDED);
@@ -24824,7 +24887,7 @@ var LoginObserver = /** @class */ (function (_super) {
24824
24887
  return _this;
24825
24888
  }
24826
24889
  LoginObserver.prototype.onNext = function (record) {
24827
- this.onError((0, neo4j_driver_core_1$x.newError)('Received RECORD when initializing ' + neo4j_driver_core_1$x.json.stringify(record)));
24890
+ this.onError((0, neo4j_driver_core_1$y.newError)('Received RECORD when initializing ' + neo4j_driver_core_1$y.json.stringify(record)));
24828
24891
  };
24829
24892
  LoginObserver.prototype.onError = function (error) {
24830
24893
  if (this._onError) {
@@ -24855,7 +24918,7 @@ var LogoffObserver = /** @class */ (function (_super) {
24855
24918
  return _this;
24856
24919
  }
24857
24920
  LogoffObserver.prototype.onNext = function (record) {
24858
- this.onError((0, neo4j_driver_core_1$x.newError)('Received RECORD when logging off ' + neo4j_driver_core_1$x.json.stringify(record)));
24921
+ this.onError((0, neo4j_driver_core_1$y.newError)('Received RECORD when logging off ' + neo4j_driver_core_1$y.json.stringify(record)));
24859
24922
  };
24860
24923
  LogoffObserver.prototype.onError = function (error) {
24861
24924
  if (this._onError) {
@@ -24888,8 +24951,8 @@ var ResetObserver = /** @class */ (function (_super) {
24888
24951
  return _this;
24889
24952
  }
24890
24953
  ResetObserver.prototype.onNext = function (record) {
24891
- this.onError((0, neo4j_driver_core_1$x.newError)('Received RECORD when resetting: received record is: ' +
24892
- neo4j_driver_core_1$x.json.stringify(record), PROTOCOL_ERROR$5));
24954
+ this.onError((0, neo4j_driver_core_1$y.newError)('Received RECORD when resetting: received record is: ' +
24955
+ neo4j_driver_core_1$y.json.stringify(record), PROTOCOL_ERROR$5));
24893
24956
  };
24894
24957
  ResetObserver.prototype.onError = function (error) {
24895
24958
  if (error.code === PROTOCOL_ERROR$5 && this._onProtocolError) {
@@ -24954,10 +25017,10 @@ var ProcedureRouteObserver = /** @class */ (function (_super) {
24954
25017
  };
24955
25018
  ProcedureRouteObserver.prototype.onCompleted = function () {
24956
25019
  if (this._records !== null && this._records.length !== 1) {
24957
- this.onError((0, neo4j_driver_core_1$x.newError)('Illegal response from router. Received ' +
25020
+ this.onError((0, neo4j_driver_core_1$y.newError)('Illegal response from router. Received ' +
24958
25021
  this._records.length +
24959
25022
  ' records but expected only one.\n' +
24960
- neo4j_driver_core_1$x.json.stringify(this._records), PROTOCOL_ERROR$5));
25023
+ neo4j_driver_core_1$y.json.stringify(this._records), PROTOCOL_ERROR$5));
24961
25024
  return;
24962
25025
  }
24963
25026
  if (this._onCompleted) {
@@ -24985,8 +25048,8 @@ var RouteObserver = /** @class */ (function (_super) {
24985
25048
  return _this;
24986
25049
  }
24987
25050
  RouteObserver.prototype.onNext = function (record) {
24988
- this.onError((0, neo4j_driver_core_1$x.newError)('Received RECORD when resetting: received record is: ' +
24989
- neo4j_driver_core_1$x.json.stringify(record), PROTOCOL_ERROR$5));
25051
+ this.onError((0, neo4j_driver_core_1$y.newError)('Received RECORD when resetting: received record is: ' +
25052
+ neo4j_driver_core_1$y.json.stringify(record), PROTOCOL_ERROR$5));
24990
25053
  };
24991
25054
  RouteObserver.prototype.onError = function (error) {
24992
25055
  if (error.code === PROTOCOL_ERROR$5 && this._onProtocolError) {
@@ -25090,7 +25153,7 @@ boltProtocolUtil.assertNotificationFilterIsEmpty = boltProtocolUtil.assertImpers
25090
25153
  * See the License for the specific language governing permissions and
25091
25154
  * limitations under the License.
25092
25155
  */
25093
- var neo4j_driver_core_1$w = lib$1;
25156
+ var neo4j_driver_core_1$x = lib$1;
25094
25157
  /**
25095
25158
  * @param {TxConfig} txConfig the auto-commit transaction configuration.
25096
25159
  * @param {function(error: string)} onProtocolError called when the txConfig is not empty.
@@ -25099,7 +25162,7 @@ var neo4j_driver_core_1$w = lib$1;
25099
25162
  function assertTxConfigIsEmpty(txConfig, onProtocolError, observer) {
25100
25163
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25101
25164
  if (txConfig && !txConfig.isEmpty()) {
25102
- var error = (0, neo4j_driver_core_1$w.newError)('Driver is connected to the database that does not support transaction configuration. ' +
25165
+ var error = (0, neo4j_driver_core_1$x.newError)('Driver is connected to the database that does not support transaction configuration. ' +
25103
25166
  'Please upgrade to neo4j 3.5.0 or later in order to use this functionality');
25104
25167
  // unsupported API was used, consider this a fatal error for the current connection
25105
25168
  onProtocolError(error.message);
@@ -25116,7 +25179,7 @@ boltProtocolUtil.assertTxConfigIsEmpty = assertTxConfigIsEmpty;
25116
25179
  function assertDatabaseIsEmpty(database, onProtocolError, observer) {
25117
25180
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25118
25181
  if (database) {
25119
- var error = (0, neo4j_driver_core_1$w.newError)('Driver is connected to the database that does not support multiple databases. ' +
25182
+ var error = (0, neo4j_driver_core_1$x.newError)('Driver is connected to the database that does not support multiple databases. ' +
25120
25183
  'Please upgrade to neo4j 4.0.0 or later in order to use this functionality');
25121
25184
  // unsupported API was used, consider this a fatal error for the current connection
25122
25185
  onProtocolError(error.message);
@@ -25134,7 +25197,7 @@ boltProtocolUtil.assertDatabaseIsEmpty = assertDatabaseIsEmpty;
25134
25197
  function assertImpersonatedUserIsEmpty(impersonatedUser, onProtocolError, observer) {
25135
25198
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25136
25199
  if (impersonatedUser) {
25137
- var error = (0, neo4j_driver_core_1$w.newError)('Driver is connected to the database that does not support user impersonation. ' +
25200
+ var error = (0, neo4j_driver_core_1$x.newError)('Driver is connected to the database that does not support user impersonation. ' +
25138
25201
  'Please upgrade to neo4j 4.4.0 or later in order to use this functionality. ' +
25139
25202
  "Trying to impersonate ".concat(impersonatedUser, "."));
25140
25203
  // unsupported API was used, consider this a fatal error for the current connection
@@ -25153,9 +25216,9 @@ boltProtocolUtil.assertImpersonatedUserIsEmpty = assertImpersonatedUserIsEmpty;
25153
25216
  function assertNotificationFilterIsEmpty(notificationFilter, onProtocolError, observer) {
25154
25217
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25155
25218
  if (notificationFilter !== undefined) {
25156
- var error = (0, neo4j_driver_core_1$w.newError)('Driver is connected to a database that does not support user notification filters. ' +
25219
+ var error = (0, neo4j_driver_core_1$x.newError)('Driver is connected to a database that does not support user notification filters. ' +
25157
25220
  'Please upgrade to Neo4j 5.7.0 or later in order to use this functionality. ' +
25158
- "Trying to set notifications to ".concat(neo4j_driver_core_1$w.json.stringify(notificationFilter), "."));
25221
+ "Trying to set notifications to ".concat(neo4j_driver_core_1$x.json.stringify(notificationFilter), "."));
25159
25222
  // unsupported API was used, consider this a fatal error for the current connection
25160
25223
  onProtocolError(error.message);
25161
25224
  observer.onError(error);
@@ -25191,7 +25254,8 @@ var functional = {};
25191
25254
  * limitations under the License.
25192
25255
  */
25193
25256
  Object.defineProperty(functional, "__esModule", { value: true });
25194
- functional.identity = void 0;
25257
+ functional.reuseOngoingRequest = functional.identity = void 0;
25258
+ var neo4j_driver_core_1$w = lib$1;
25195
25259
  /**
25196
25260
  * Identity function.
25197
25261
  *
@@ -25204,6 +25268,33 @@ function identity(x) {
25204
25268
  return x;
25205
25269
  }
25206
25270
  functional.identity = identity;
25271
+ /**
25272
+ * Makes the function able to share ongoing requests
25273
+ *
25274
+ * @param {function(...args): Promise} func The function to be decorated
25275
+ * @param {any} thisArg The `this` which should be used in the function call
25276
+ * @return {function(...args): Promise} The decorated function
25277
+ */
25278
+ function reuseOngoingRequest(func, thisArg) {
25279
+ if (thisArg === void 0) { thisArg = null; }
25280
+ var ongoingRequests = new Map();
25281
+ return function () {
25282
+ var args = [];
25283
+ for (var _i = 0; _i < arguments.length; _i++) {
25284
+ args[_i] = arguments[_i];
25285
+ }
25286
+ var key = neo4j_driver_core_1$w.json.stringify(args);
25287
+ if (ongoingRequests.has(key)) {
25288
+ return ongoingRequests.get(key);
25289
+ }
25290
+ var promise = func.apply(thisArg, args);
25291
+ ongoingRequests.set(key, promise);
25292
+ return promise.finally(function () {
25293
+ ongoingRequests.delete(key);
25294
+ });
25295
+ };
25296
+ }
25297
+ functional.reuseOngoingRequest = reuseOngoingRequest;
25207
25298
 
25208
25299
  var object = {};
25209
25300
 
@@ -25403,7 +25494,7 @@ packstreamV1.Unpacker = packstreamV1.Packer = void 0;
25403
25494
  * limitations under the License.
25404
25495
  */
25405
25496
  var channel_1$2 = channel;
25406
- var lang_1$2 = lang;
25497
+ var lang_1$3 = lang;
25407
25498
  var structure_1 = structure$1;
25408
25499
  var neo4j_driver_core_1$u = lib$1;
25409
25500
  var PROTOCOL_ERROR$3 = neo4j_driver_core_1$u.error.PROTOCOL_ERROR;
@@ -25453,7 +25544,7 @@ var Packer$1 = /** @class */ (function () {
25453
25544
  */
25454
25545
  Packer.prototype.packable = function (x, dehydrateStruct) {
25455
25546
  var _this = this;
25456
- if (dehydrateStruct === void 0) { dehydrateStruct = lang_1$2.functional.identity; }
25547
+ if (dehydrateStruct === void 0) { dehydrateStruct = lang_1$3.functional.identity; }
25457
25548
  try {
25458
25549
  x = dehydrateStruct(x);
25459
25550
  }
@@ -25732,7 +25823,7 @@ var Unpacker$1 = /** @class */ (function () {
25732
25823
  this._useBigInt = useBigInt;
25733
25824
  }
25734
25825
  Unpacker.prototype.unpack = function (buffer, hydrateStructure) {
25735
- if (hydrateStructure === void 0) { hydrateStructure = lang_1$2.functional.identity; }
25826
+ if (hydrateStructure === void 0) { hydrateStructure = lang_1$3.functional.identity; }
25736
25827
  var marker = buffer.readUInt8();
25737
25828
  var markerHigh = marker & 0xf0;
25738
25829
  var markerLow = marker & 0x0f;
@@ -31775,15 +31866,15 @@ Object.defineProperty(connectionErrorHandler, "__esModule", { value: true });
31775
31866
  var neo4j_driver_core_1$5 = lib$1;
31776
31867
  var SERVICE_UNAVAILABLE$3 = neo4j_driver_core_1$5.error.SERVICE_UNAVAILABLE, SESSION_EXPIRED$1 = neo4j_driver_core_1$5.error.SESSION_EXPIRED;
31777
31868
  var ConnectionErrorHandler = /** @class */ (function () {
31778
- function ConnectionErrorHandler(errorCode, handleUnavailability, handleWriteFailure, handleAuthorizationExpired) {
31869
+ function ConnectionErrorHandler(errorCode, handleUnavailability, handleWriteFailure, handleSecurityError) {
31779
31870
  this._errorCode = errorCode;
31780
31871
  this._handleUnavailability = handleUnavailability || noOpHandler;
31781
31872
  this._handleWriteFailure = handleWriteFailure || noOpHandler;
31782
- this._handleAuthorizationExpired = handleAuthorizationExpired || noOpHandler;
31873
+ this._handleSecurityError = handleSecurityError || noOpHandler;
31783
31874
  }
31784
31875
  ConnectionErrorHandler.create = function (_a) {
31785
- var errorCode = _a.errorCode, handleUnavailability = _a.handleUnavailability, handleWriteFailure = _a.handleWriteFailure, handleAuthorizationExpired = _a.handleAuthorizationExpired;
31786
- return new ConnectionErrorHandler(errorCode, handleUnavailability, handleWriteFailure, handleAuthorizationExpired);
31876
+ var errorCode = _a.errorCode, handleUnavailability = _a.handleUnavailability, handleWriteFailure = _a.handleWriteFailure, handleSecurityError = _a.handleSecurityError;
31877
+ return new ConnectionErrorHandler(errorCode, handleUnavailability, handleWriteFailure, handleSecurityError);
31787
31878
  };
31788
31879
  /**
31789
31880
  * Error code to use for network errors.
@@ -31799,8 +31890,8 @@ var ConnectionErrorHandler = /** @class */ (function () {
31799
31890
  * @return {Neo4jError} new error that should be propagated to the user.
31800
31891
  */
31801
31892
  ConnectionErrorHandler.prototype.handleAndTransformError = function (error, address, connection) {
31802
- if (isAutorizationExpiredError(error)) {
31803
- return this._handleAuthorizationExpired(error, address, connection);
31893
+ if (isSecurityError(error)) {
31894
+ return this._handleSecurityError(error, address, connection);
31804
31895
  }
31805
31896
  if (isAvailabilityError(error)) {
31806
31897
  return this._handleUnavailability(error, address, connection);
@@ -31813,9 +31904,10 @@ var ConnectionErrorHandler = /** @class */ (function () {
31813
31904
  return ConnectionErrorHandler;
31814
31905
  }());
31815
31906
  connectionErrorHandler.default = ConnectionErrorHandler;
31816
- function isAutorizationExpiredError(error) {
31817
- return error && (error.code === 'Neo.ClientError.Security.AuthorizationExpired' ||
31818
- error.code === 'Neo.ClientError.Security.TokenExpired');
31907
+ function isSecurityError(error) {
31908
+ return error != null &&
31909
+ error.code != null &&
31910
+ error.code.startsWith('Neo.ClientError.Security.');
31819
31911
  }
31820
31912
  function isAvailabilityError(error) {
31821
31913
  if (error) {
@@ -31953,16 +32045,14 @@ var __generator$3 = (commonjsGlobal && commonjsGlobal.__generator) || function (
31953
32045
  };
31954
32046
  Object.defineProperty(authenticationProvider, "__esModule", { value: true });
31955
32047
  var neo4j_driver_core_1$4 = lib$1;
31956
- var lang_1$1 = lang;
32048
+ var lang_1$2 = lang;
31957
32049
  /**
31958
32050
  * Class which provides Authorization for {@link Connection}
31959
32051
  */
31960
32052
  var AuthenticationProvider = /** @class */ (function () {
31961
32053
  function AuthenticationProvider(_a) {
31962
32054
  var authTokenManager = _a.authTokenManager, userAgent = _a.userAgent, boltAgent = _a.boltAgent;
31963
- this._authTokenManager = authTokenManager || (0, neo4j_driver_core_1$4.expirationBasedAuthTokenManager)({
31964
- tokenProvider: function () { }
31965
- });
32055
+ this._authTokenManager = authTokenManager || (0, neo4j_driver_core_1$4.staticAuthTokenManager)({});
31966
32056
  this._userAgent = userAgent;
31967
32057
  this._boltAgent = boltAgent;
31968
32058
  }
@@ -31974,7 +32064,7 @@ var AuthenticationProvider = /** @class */ (function () {
31974
32064
  switch (_b.label) {
31975
32065
  case 0:
31976
32066
  if (!(auth != null)) return [3 /*break*/, 3];
31977
- shouldReAuth = connection.supportsReAuth === true && ((!lang_1$1.object.equals(connection.authToken, auth) && skipReAuth !== true) ||
32067
+ shouldReAuth = connection.supportsReAuth === true && ((!lang_1$2.object.equals(connection.authToken, auth) && skipReAuth !== true) ||
31978
32068
  forceReAuth === true);
31979
32069
  if (!(connection.authToken == null || shouldReAuth)) return [3 /*break*/, 2];
31980
32070
  return [4 /*yield*/, connection.connect(this._userAgent, this._boltAgent, auth, waitReAuth || false)];
@@ -31983,7 +32073,7 @@ var AuthenticationProvider = /** @class */ (function () {
31983
32073
  case 3: return [4 /*yield*/, this._authTokenManager.getToken()];
31984
32074
  case 4:
31985
32075
  authToken = _b.sent();
31986
- if (!!lang_1$1.object.equals(authToken, connection.authToken)) return [3 /*break*/, 6];
32076
+ if (!!lang_1$2.object.equals(authToken, connection.authToken)) return [3 /*break*/, 6];
31987
32077
  return [4 /*yield*/, connection.connect(this._userAgent, this._boltAgent, authToken, false)];
31988
32078
  case 5: return [2 /*return*/, _b.sent()];
31989
32079
  case 6: return [2 /*return*/, connection];
@@ -31994,12 +32084,10 @@ var AuthenticationProvider = /** @class */ (function () {
31994
32084
  AuthenticationProvider.prototype.handleError = function (_a) {
31995
32085
  var connection = _a.connection, code = _a.code;
31996
32086
  if (connection &&
31997
- [
31998
- 'Neo.ClientError.Security.Unauthorized',
31999
- 'Neo.ClientError.Security.TokenExpired'
32000
- ].includes(code)) {
32001
- this._authTokenManager.onTokenExpired(connection.authToken);
32087
+ code.startsWith('Neo.ClientError.Security.')) {
32088
+ return this._authTokenManager.handleSecurityException(connection.authToken, code);
32002
32089
  }
32090
+ return false;
32003
32091
  };
32004
32092
  return AuthenticationProvider;
32005
32093
  }());
@@ -32130,7 +32218,7 @@ var connection_1$2 = connection$1;
32130
32218
  var pool_1 = __importStar$1(pool$1);
32131
32219
  var neo4j_driver_core_1$3 = lib$1;
32132
32220
  var authentication_provider_1 = __importDefault$4(authenticationProvider);
32133
- var lang_1 = lang;
32221
+ var lang_1$1 = lang;
32134
32222
  var SERVICE_UNAVAILABLE$2 = neo4j_driver_core_1$3.error.SERVICE_UNAVAILABLE;
32135
32223
  var AUTHENTICATION_ERRORS = [
32136
32224
  'Neo.ClientError.Security.CredentialsExpired',
@@ -32153,7 +32241,6 @@ var PooledConnectionProvider = /** @class */ (function (_super) {
32153
32241
  _this._id = id;
32154
32242
  _this._config = config;
32155
32243
  _this._log = log;
32156
- _this._authTokenManager = authTokenManager;
32157
32244
  _this._authenticationProvider = new authentication_provider_1.default({ authTokenManager: authTokenManager, userAgent: userAgent, boltAgent: boltAgent });
32158
32245
  _this._userAgent = userAgent;
32159
32246
  _this._boltAgent = boltAgent;
@@ -32346,7 +32433,7 @@ var PooledConnectionProvider = /** @class */ (function (_super) {
32346
32433
  return __generator$2(this, function (_b) {
32347
32434
  switch (_b.label) {
32348
32435
  case 0:
32349
- connectionWithSameCredentials = lang_1.object.equals(auth, connection.authToken);
32436
+ connectionWithSameCredentials = lang_1$1.object.equals(auth, connection.authToken);
32350
32437
  shouldCreateStickyConnection = !connectionWithSameCredentials;
32351
32438
  connection._sticky = connectionWithSameCredentials && !connection.supportsReAuth;
32352
32439
  if (!(shouldCreateStickyConnection || connection._sticky)) return [3 /*break*/, 2];
@@ -32390,17 +32477,17 @@ var PooledConnectionProvider = /** @class */ (function (_super) {
32390
32477
  PooledConnectionProvider._removeIdleObserverOnConnection = function (conn) {
32391
32478
  conn._updateCurrentObserver();
32392
32479
  };
32393
- PooledConnectionProvider.prototype._handleAuthorizationExpired = function (error, address, connection) {
32394
- this._authenticationProvider.handleError({ connection: connection, code: error.code });
32480
+ PooledConnectionProvider.prototype._handleSecurityError = function (error, address, connection) {
32481
+ var handled = this._authenticationProvider.handleError({ connection: connection, code: error.code });
32482
+ if (handled) {
32483
+ error.retriable = true;
32484
+ }
32395
32485
  if (error.code === 'Neo.ClientError.Security.AuthorizationExpired') {
32396
32486
  this._connectionPool.apply(address, function (conn) { conn.authToken = null; });
32397
32487
  }
32398
32488
  if (connection) {
32399
32489
  connection.close().catch(function () { return undefined; });
32400
32490
  }
32401
- if (error.code === 'Neo.ClientError.Security.TokenExpired' && !(0, neo4j_driver_core_1$3.isStaticAuthTokenManger)(this._authTokenManager)) {
32402
- error.retriable = true;
32403
- }
32404
32491
  return error;
32405
32492
  };
32406
32493
  return PooledConnectionProvider;
@@ -32509,8 +32596,8 @@ var DirectConnectionProvider = /** @class */ (function (_super) {
32509
32596
  case 0:
32510
32597
  databaseSpecificErrorHandler = connection_1$1.ConnectionErrorHandler.create({
32511
32598
  errorCode: SERVICE_UNAVAILABLE$1,
32512
- handleAuthorizationExpired: function (error, address, conn) {
32513
- return _this._handleAuthorizationExpired(error, address, conn, database);
32599
+ handleSecurityError: function (error, address, conn) {
32600
+ return _this._handleSecurityError(error, address, conn, database);
32514
32601
  }
32515
32602
  });
32516
32603
  return [4 /*yield*/, this._connectionPool.acquire({ auth: auth, forceReAuth: forceReAuth }, this._address)];
@@ -32530,9 +32617,9 @@ var DirectConnectionProvider = /** @class */ (function (_super) {
32530
32617
  });
32531
32618
  });
32532
32619
  };
32533
- DirectConnectionProvider.prototype._handleAuthorizationExpired = function (error, address, connection, database) {
32620
+ DirectConnectionProvider.prototype._handleSecurityError = function (error, address, connection, database) {
32534
32621
  this._log.warn("Direct driver ".concat(this._id, " will close connection to ").concat(address, " for database '").concat(database, "' because of an error ").concat(error.code, " '").concat(error.message, "'"));
32535
- return _super.prototype._handleAuthorizationExpired.call(this, error, address, connection);
32622
+ return _super.prototype._handleSecurityError.call(this, error, address, connection);
32536
32623
  };
32537
32624
  DirectConnectionProvider.prototype._hasProtocolVersion = function (versionPredicate) {
32538
32625
  return __awaiter$1(this, void 0, void 0, function () {
@@ -33117,6 +33204,7 @@ var connection_provider_single_1 = __importDefault(connectionProviderSingle);
33117
33204
  var connection_provider_pooled_1 = __importDefault(connectionProviderPooled);
33118
33205
  var load_balancing_1 = loadBalancing;
33119
33206
  var connection_1 = connection$1;
33207
+ var lang_1 = lang;
33120
33208
  var SERVICE_UNAVAILABLE = neo4j_driver_core_1.error.SERVICE_UNAVAILABLE, SESSION_EXPIRED = neo4j_driver_core_1.error.SESSION_EXPIRED;
33121
33209
  var Bookmarks = neo4j_driver_core_1.internal.bookmarks.Bookmarks, _a = neo4j_driver_core_1.internal.constants, READ = _a.ACCESS_MODE_READ, WRITE = _a.ACCESS_MODE_WRITE, BOLT_PROTOCOL_V3 = _a.BOLT_PROTOCOL_V3, BOLT_PROTOCOL_V4_0 = _a.BOLT_PROTOCOL_V4_0, BOLT_PROTOCOL_V4_4 = _a.BOLT_PROTOCOL_V4_4, BOLT_PROTOCOL_V5_1 = _a.BOLT_PROTOCOL_V5_1;
33122
33210
  var PROCEDURE_NOT_FOUND_CODE = 'Neo.ClientError.Procedure.ProcedureNotFound';
@@ -33149,6 +33237,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33149
33237
  _this._routingTableRegistry = new RoutingTableRegistry(routingTablePurgeDelay
33150
33238
  ? (0, neo4j_driver_core_1.int)(routingTablePurgeDelay)
33151
33239
  : DEFAULT_ROUTING_TABLE_PURGE_DELAY);
33240
+ _this._refreshRoutingTable = lang_1.functional.reuseOngoingRequest(_this._refreshRoutingTable, _this);
33152
33241
  return _this;
33153
33242
  }
33154
33243
  RoutingConnectionProvider.prototype._createConnectionErrorHandler = function () {
@@ -33161,9 +33250,9 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33161
33250
  this.forget(address, database || DEFAULT_DB_NAME);
33162
33251
  return error;
33163
33252
  };
33164
- RoutingConnectionProvider.prototype._handleAuthorizationExpired = function (error, address, connection, database) {
33253
+ RoutingConnectionProvider.prototype._handleSecurityError = function (error, address, connection, database) {
33165
33254
  this._log.warn("Routing driver ".concat(this._id, " will close connections to ").concat(address, " for database '").concat(database, "' because of an error ").concat(error.code, " '").concat(error.message, "'"));
33166
- return _super.prototype._handleAuthorizationExpired.call(this, error, address, connection, database);
33255
+ return _super.prototype._handleSecurityError.call(this, error, address, connection, database);
33167
33256
  };
33168
33257
  RoutingConnectionProvider.prototype._handleWriteFailure = function (error, address, database) {
33169
33258
  this._log.warn("Routing driver ".concat(this._id, " will forget writer ").concat(address, " for database '").concat(database, "' because of an error ").concat(error.code, " '").concat(error.message, "'"));
@@ -33184,7 +33273,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33184
33273
  case 0:
33185
33274
  context = { database: database || DEFAULT_DB_NAME };
33186
33275
  databaseSpecificErrorHandler = new connection_1.ConnectionErrorHandler(SESSION_EXPIRED, function (error, address) { return _this._handleUnavailability(error, address, context.database); }, function (error, address) { return _this._handleWriteFailure(error, address, context.database); }, function (error, address, conn) {
33187
- return _this._handleAuthorizationExpired(error, address, conn, context.database);
33276
+ return _this._handleSecurityError(error, address, conn, context.database);
33188
33277
  });
33189
33278
  return [4 /*yield*/, this._freshRoutingTable({
33190
33279
  accessMode: accessMode,
@@ -33448,16 +33537,20 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33448
33537
  return currentRoutingTable;
33449
33538
  }
33450
33539
  this._log.info("Routing table is stale for database: \"".concat(database, "\" and access mode: \"").concat(accessMode, "\": ").concat(currentRoutingTable));
33451
- return this._refreshRoutingTable(currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth);
33540
+ return this._refreshRoutingTable(currentRoutingTable, bookmarks, impersonatedUser, auth)
33541
+ .then(function (newRoutingTable) {
33542
+ onDatabaseNameResolved(newRoutingTable.database);
33543
+ return newRoutingTable;
33544
+ });
33452
33545
  };
33453
- RoutingConnectionProvider.prototype._refreshRoutingTable = function (currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth) {
33546
+ RoutingConnectionProvider.prototype._refreshRoutingTable = function (currentRoutingTable, bookmarks, impersonatedUser, auth) {
33454
33547
  var knownRouters = currentRoutingTable.routers;
33455
33548
  if (this._useSeedRouter) {
33456
- return this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth);
33549
+ return this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth);
33457
33550
  }
33458
- return this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth);
33551
+ return this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth);
33459
33552
  };
33460
- RoutingConnectionProvider.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth) {
33553
+ RoutingConnectionProvider.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth) {
33461
33554
  return __awaiter(this, void 0, void 0, function () {
33462
33555
  var seenRouters, _a, newRoutingTable, error, _b, newRoutingTable2, error2;
33463
33556
  return __generator(this, function (_c) {
@@ -33476,13 +33569,13 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33476
33569
  newRoutingTable = newRoutingTable2;
33477
33570
  error = error2 || error;
33478
33571
  _c.label = 4;
33479
- case 4: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, onDatabaseNameResolved, error)];
33572
+ case 4: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, error)];
33480
33573
  case 5: return [2 /*return*/, _c.sent()];
33481
33574
  }
33482
33575
  });
33483
33576
  });
33484
33577
  };
33485
- RoutingConnectionProvider.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth) {
33578
+ RoutingConnectionProvider.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth) {
33486
33579
  return __awaiter(this, void 0, void 0, function () {
33487
33580
  var _a, newRoutingTable, error;
33488
33581
  var _b;
@@ -33497,7 +33590,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33497
33590
  // none of the known routers returned a valid routing table - try to use seed router address for rediscovery
33498
33591
  _b = __read.apply(void 0, [_c.sent(), 2]), newRoutingTable = _b[0], error = _b[1];
33499
33592
  _c.label = 3;
33500
- case 3: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, onDatabaseNameResolved, error)];
33593
+ case 3: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, error)];
33501
33594
  case 4: return [2 /*return*/, _c.sent()];
33502
33595
  }
33503
33596
  });
@@ -33625,7 +33718,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33625
33718
  case 3:
33626
33719
  databaseSpecificErrorHandler = connection_1.ConnectionErrorHandler.create({
33627
33720
  errorCode: SESSION_EXPIRED,
33628
- handleAuthorizationExpired: function (error, address, conn) { return _this._handleAuthorizationExpired(error, address, conn); }
33721
+ handleSecurityError: function (error, address, conn) { return _this._handleSecurityError(error, address, conn); }
33629
33722
  });
33630
33723
  delegateConnection = !connection._sticky
33631
33724
  ? new connection_1.DelegateConnection(connection, databaseSpecificErrorHandler)
@@ -33665,7 +33758,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33665
33758
  this._log.warn("unable to fetch routing table because of an error ".concat(error));
33666
33759
  return [null, error];
33667
33760
  };
33668
- RoutingConnectionProvider.prototype._applyRoutingTableIfPossible = function (currentRoutingTable, newRoutingTable, onDatabaseNameResolved, error) {
33761
+ RoutingConnectionProvider.prototype._applyRoutingTableIfPossible = function (currentRoutingTable, newRoutingTable, error) {
33669
33762
  return __awaiter(this, void 0, void 0, function () {
33670
33763
  return __generator(this, function (_a) {
33671
33764
  switch (_a.label) {
@@ -33679,7 +33772,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33679
33772
  // does not always get routing table without writers because it talks exclusively to a minority partition
33680
33773
  this._useSeedRouter = true;
33681
33774
  }
33682
- return [4 /*yield*/, this._updateRoutingTable(newRoutingTable, onDatabaseNameResolved)];
33775
+ return [4 /*yield*/, this._updateRoutingTable(newRoutingTable)];
33683
33776
  case 1:
33684
33777
  _a.sent();
33685
33778
  return [2 /*return*/, newRoutingTable];
@@ -33687,7 +33780,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33687
33780
  });
33688
33781
  });
33689
33782
  };
33690
- RoutingConnectionProvider.prototype._updateRoutingTable = function (newRoutingTable, onDatabaseNameResolved) {
33783
+ RoutingConnectionProvider.prototype._updateRoutingTable = function (newRoutingTable) {
33691
33784
  return __awaiter(this, void 0, void 0, function () {
33692
33785
  return __generator(this, function (_a) {
33693
33786
  switch (_a.label) {
@@ -33699,7 +33792,6 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33699
33792
  _a.sent();
33700
33793
  this._routingTableRegistry.removeExpired();
33701
33794
  this._routingTableRegistry.register(newRoutingTable);
33702
- onDatabaseNameResolved(newRoutingTable.database);
33703
33795
  this._log.info("Updated routing table ".concat(newRoutingTable));
33704
33796
  return [2 /*return*/];
33705
33797
  }
@@ -33977,8 +34069,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
33977
34069
  return (mod && mod.__esModule) ? mod : { "default": mod };
33978
34070
  };
33979
34071
  Object.defineProperty(exports, "__esModule", { value: true });
33980
- exports.PathSegment = exports.Path = exports.UnboundRelationship = exports.Relationship = exports.Node = exports.Record = exports.ServerInfo = 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 = void 0;
33981
- exports.expirationBasedAuthTokenManager = exports.notificationFilterMinimumSeverityLevel = exports.notificationFilterDisabledCategory = exports.notificationSeverityLevel = exports.notificationCategory = exports.resultTransformers = exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = exports.Integer = exports.Point = void 0;
34072
+ exports.Path = exports.UnboundRelationship = exports.Relationship = exports.Node = exports.Record = exports.ServerInfo = 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;
34073
+ exports.notificationFilterMinimumSeverityLevel = exports.notificationFilterDisabledCategory = exports.notificationSeverityLevel = exports.notificationCategory = exports.resultTransformers = exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = exports.Integer = exports.Point = exports.PathSegment = void 0;
33982
34074
  /**
33983
34075
  * Copyright (c) "Neo4j"
33984
34076
  * Neo4j Sweden AB [http://neo4j.com]
@@ -34001,6 +34093,7 @@ var driver_1 = driver$1;
34001
34093
  Object.defineProperty(exports, "Driver", { enumerable: true, get: function () { return driver_1.Driver; } });
34002
34094
  var version_1 = __importDefault(version$1);
34003
34095
  var neo4j_driver_core_1 = lib$1;
34096
+ Object.defineProperty(exports, "authTokenManagers", { enumerable: true, get: function () { return neo4j_driver_core_1.authTokenManagers; } });
34004
34097
  Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return neo4j_driver_core_1.Neo4jError; } });
34005
34098
  Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return neo4j_driver_core_1.isRetryableError; } });
34006
34099
  Object.defineProperty(exports, "error", { enumerable: true, get: function () { return neo4j_driver_core_1.error; } });
@@ -34051,7 +34144,6 @@ Object.defineProperty(exports, "notificationCategory", { enumerable: true, get:
34051
34144
  Object.defineProperty(exports, "notificationSeverityLevel", { enumerable: true, get: function () { return neo4j_driver_core_1.notificationSeverityLevel; } });
34052
34145
  Object.defineProperty(exports, "notificationFilterDisabledCategory", { enumerable: true, get: function () { return neo4j_driver_core_1.notificationFilterDisabledCategory; } });
34053
34146
  Object.defineProperty(exports, "notificationFilterMinimumSeverityLevel", { enumerable: true, get: function () { return neo4j_driver_core_1.notificationFilterMinimumSeverityLevel; } });
34054
- Object.defineProperty(exports, "expirationBasedAuthTokenManager", { enumerable: true, get: function () { return neo4j_driver_core_1.expirationBasedAuthTokenManager; } });
34055
34147
  var neo4j_driver_bolt_connection_1 = lib;
34056
34148
  var session_rx_1 = __importDefault(sessionRx);
34057
34149
  exports.RxSession = session_rx_1.default;
@@ -34067,9 +34159,9 @@ function isAuthTokenManager(value) {
34067
34159
  return typeof value === 'object' &&
34068
34160
  value != null &&
34069
34161
  'getToken' in value &&
34070
- 'onTokenExpired' in value &&
34162
+ 'handleSecurityException' in value &&
34071
34163
  typeof value.getToken === 'function' &&
34072
- typeof value.onTokenExpired === 'function';
34164
+ typeof value.handleSecurityException === 'function';
34073
34165
  }
34074
34166
  function createAuthManager(authTokenOrManager) {
34075
34167
  if (isAuthTokenManager(authTokenOrManager)) {
@@ -34304,6 +34396,7 @@ exports.graph = graph;
34304
34396
  * @private
34305
34397
  */
34306
34398
  var forExport = {
34399
+ authTokenManagers: neo4j_driver_core_1.authTokenManagers,
34307
34400
  driver: driver,
34308
34401
  hasReachableServer: hasReachableServer,
34309
34402
  int: neo4j_driver_core_1.int,
@@ -34367,8 +34460,7 @@ var forExport = {
34367
34460
  notificationCategory: neo4j_driver_core_1.notificationCategory,
34368
34461
  notificationSeverityLevel: neo4j_driver_core_1.notificationSeverityLevel,
34369
34462
  notificationFilterDisabledCategory: neo4j_driver_core_1.notificationFilterDisabledCategory,
34370
- notificationFilterMinimumSeverityLevel: neo4j_driver_core_1.notificationFilterMinimumSeverityLevel,
34371
- expirationBasedAuthTokenManager: neo4j_driver_core_1.expirationBasedAuthTokenManager
34463
+ notificationFilterMinimumSeverityLevel: neo4j_driver_core_1.notificationFilterMinimumSeverityLevel
34372
34464
  };
34373
34465
  exports.default = forExport;
34374
34466
  }(lib$2));