neo4j-driver 5.10.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
@@ -938,6 +940,7 @@ var Integer = /** @class */ (function () {
938
940
  * @param {!Integer|number|string|bigint|!{low: number, high: number}} val Value
939
941
  * @param {Object} [opts={}] Configuration options
940
942
  * @param {boolean} [opts.strictStringValidation=false] Enable strict validation generated Integer.
943
+ * @param {boolean} [opts.ceilFloat=false] Enable round up float to the nearest Integer.
941
944
  * @returns {!Integer}
942
945
  * @expose
943
946
  */
@@ -947,6 +950,9 @@ var Integer = /** @class */ (function () {
947
950
  return val;
948
951
  }
949
952
  if (typeof val === 'number') {
953
+ if (opts.ceilFloat === true) {
954
+ val = Math.ceil(val);
955
+ }
950
956
  return Integer.fromNumber(val);
951
957
  }
952
958
  if (typeof val === 'string') {
@@ -1128,6 +1134,7 @@ var TWO_PWR_24 = Integer.fromInt(TWO_PWR_24_DBL);
1128
1134
  * @param {Mixed} value - The value to use.
1129
1135
  * @param {Object} [opts={}] Configuration options
1130
1136
  * @param {boolean} [opts.strictStringValidation=false] Enable strict validation generated Integer.
1137
+ * @param {boolean} [opts.ceilFloat=false] Enable round up float to the nearest Integer.
1131
1138
  * @return {Integer} - An object of type Integer.
1132
1139
  */
1133
1140
  var int = Integer.fromValue;
@@ -4231,10 +4238,11 @@ var CompletedObserver$1 = /** @class */ (function () {
4231
4238
  CompletedObserver.prototype.markCompleted = function () {
4232
4239
  // do nothing
4233
4240
  };
4234
- // eslint-disable-next-line node/handle-callback-err
4235
4241
  CompletedObserver.prototype.onError = function (error) {
4236
4242
  // nothing to do, already finished
4237
- 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 });
4238
4246
  };
4239
4247
  return CompletedObserver;
4240
4248
  }());
@@ -4839,7 +4847,7 @@ var EmptyConnectionHolder = /** @class */ (function (_super) {
4839
4847
  */
4840
4848
  var EMPTY_CONNECTION_HOLDER$1 = new EmptyConnectionHolder();
4841
4849
  connectionHolder$1.EMPTY_CONNECTION_HOLDER = EMPTY_CONNECTION_HOLDER$1;
4842
- // eslint-disable-next-line node/handle-callback-err
4850
+ // eslint-disable-next-line n/handle-callback-err
4843
4851
  function ignoreError(error) {
4844
4852
  return null;
4845
4853
  }
@@ -4903,9 +4911,9 @@ var TxConfig$4 = /** @class */ (function () {
4903
4911
  * @constructor
4904
4912
  * @param {Object} config the raw configuration object.
4905
4913
  */
4906
- function TxConfig(config) {
4914
+ function TxConfig(config, log) {
4907
4915
  assertValidConfig(config);
4908
- this.timeout = extractTimeout(config);
4916
+ this.timeout = extractTimeout(config, log);
4909
4917
  this.metadata = extractMetadata(config);
4910
4918
  }
4911
4919
  /**
@@ -4929,10 +4937,14 @@ var EMPTY_CONFIG = new TxConfig$4({});
4929
4937
  /**
4930
4938
  * @return {Integer|null}
4931
4939
  */
4932
- function extractTimeout(config) {
4940
+ function extractTimeout(config, log) {
4933
4941
  if (util$1.isObject(config) && config.timeout != null) {
4934
4942
  util$1.assertNumberOrInteger(config.timeout, 'Transaction timeout');
4935
- var timeout = (0, integer_1.int)(config.timeout);
4943
+ if (isTimeoutFloat(config) && (log === null || log === void 0 ? void 0 : log.isInfoEnabled()) === true) {
4944
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
4945
+ log === null || log === void 0 ? void 0 : log.info("Transaction timeout expected to be an integer, got: ".concat(config.timeout, ". The value will be rounded up."));
4946
+ }
4947
+ var timeout = (0, integer_1.int)(config.timeout, { ceilFloat: true });
4936
4948
  if (timeout.isNegative()) {
4937
4949
  throw (0, error_1$7.newError)('Transaction timeout should not be negative');
4938
4950
  }
@@ -4940,6 +4952,9 @@ function extractTimeout(config) {
4940
4952
  }
4941
4953
  return null;
4942
4954
  }
4955
+ function isTimeoutFloat(config) {
4956
+ return typeof config.timeout === 'number' && !Number.isInteger(config.timeout);
4957
+ }
4943
4958
  /**
4944
4959
  * @return {object|null}
4945
4960
  */
@@ -5031,6 +5046,7 @@ var TransactionExecutor = /** @class */ (function () {
5031
5046
  this._multiplier = _valueOrDefault(multiplier, DEFAULT_RETRY_DELAY_MULTIPLIER$1);
5032
5047
  this._jitterFactor = _valueOrDefault(jitterFactor, DEFAULT_RETRY_DELAY_JITTER_FACTOR$1);
5033
5048
  this._inFlightTimeoutIds = [];
5049
+ this.pipelineBegin = false;
5034
5050
  this._verifyAfterConstruction();
5035
5051
  }
5036
5052
  TransactionExecutor.prototype.execute = function (transactionCreator, transactionWork, transactionWrapper) {
@@ -5070,22 +5086,29 @@ var TransactionExecutor = /** @class */ (function () {
5070
5086
  };
5071
5087
  TransactionExecutor.prototype._executeTransactionInsidePromise = function (transactionCreator, transactionWork, resolve, reject, transactionWrapper) {
5072
5088
  return __awaiter$g(this, void 0, void 0, function () {
5073
- var tx, error_2, wrap, wrappedTx, resultPromise;
5089
+ var tx, txPromise, _a, error_2, wrap, wrappedTx, resultPromise;
5074
5090
  var _this = this;
5075
- return __generator$i(this, function (_a) {
5076
- switch (_a.label) {
5091
+ return __generator$i(this, function (_b) {
5092
+ switch (_b.label) {
5077
5093
  case 0:
5078
- _a.trys.push([0, 2, , 3]);
5079
- return [4 /*yield*/, transactionCreator()];
5080
- case 1:
5081
- tx = _a.sent();
5094
+ _b.trys.push([0, 4, , 5]);
5095
+ txPromise = transactionCreator();
5096
+ if (!this.pipelineBegin) return [3 /*break*/, 1];
5097
+ _a = txPromise;
5082
5098
  return [3 /*break*/, 3];
5099
+ case 1: return [4 /*yield*/, txPromise];
5083
5100
  case 2:
5084
- 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();
5085
5108
  // failed to create a transaction
5086
5109
  reject(error_2);
5087
5110
  return [2 /*return*/];
5088
- case 3:
5111
+ case 5:
5089
5112
  wrap = transactionWrapper !== null && transactionWrapper !== void 0 ? transactionWrapper : (function (tx) { return tx; });
5090
5113
  wrappedTx = wrap(tx);
5091
5114
  resultPromise = this._safeExecuteTransactionWork(wrappedTx, transactionWork);
@@ -6259,7 +6282,7 @@ var Result = /** @class */ (function () {
6259
6282
  * *Should not be combined with {@link Result#subscribe} or ${@link Result#then} functions.*
6260
6283
  *
6261
6284
  * @public
6262
- * @returns {PeekableAsyncIterator<Record<RecordShape>, ResultSummary>} The async iterator for the Results
6285
+ * @returns {PeekableAsyncIterator<Record<R>, ResultSummary>} The async iterator for the Results
6263
6286
  */
6264
6287
  Result.prototype[Symbol.asyncIterator] = function () {
6265
6288
  var _this = this;
@@ -7904,7 +7927,7 @@ var Session = /** @class */ (function () {
7904
7927
  * @param {NotificationFilter} args.notificationFilter - The notification filter used for this session.
7905
7928
  */
7906
7929
  function Session(_a) {
7907
- var mode = _a.mode, connectionProvider = _a.connectionProvider, bookmarks = _a.bookmarks, database = _a.database, config = _a.config, reactive = _a.reactive, fetchSize = _a.fetchSize, impersonatedUser = _a.impersonatedUser, bookmarkManager = _a.bookmarkManager, notificationFilter = _a.notificationFilter, auth = _a.auth;
7930
+ var mode = _a.mode, connectionProvider = _a.connectionProvider, bookmarks = _a.bookmarks, database = _a.database, config = _a.config, reactive = _a.reactive, fetchSize = _a.fetchSize, impersonatedUser = _a.impersonatedUser, bookmarkManager = _a.bookmarkManager, notificationFilter = _a.notificationFilter, auth = _a.auth, log = _a.log;
7908
7931
  this._mode = mode;
7909
7932
  this._database = database;
7910
7933
  this._reactive = reactive;
@@ -7944,6 +7967,7 @@ var Session = /** @class */ (function () {
7944
7967
  this._results = [];
7945
7968
  this._bookmarkManager = bookmarkManager;
7946
7969
  this._notificationFilter = notificationFilter;
7970
+ this._log = log;
7947
7971
  }
7948
7972
  /**
7949
7973
  * Run Cypher query
@@ -7960,7 +7984,7 @@ var Session = /** @class */ (function () {
7960
7984
  var _this = this;
7961
7985
  var _a = (0, util_1$1.validateQueryAndParameters)(query, parameters), validatedQuery = _a.validatedQuery, params = _a.params;
7962
7986
  var autoCommitTxConfig = (transactionConfig != null)
7963
- ? new tx_config_1.TxConfig(transactionConfig)
7987
+ ? new tx_config_1.TxConfig(transactionConfig, this._log)
7964
7988
  : tx_config_1.TxConfig.empty();
7965
7989
  var result = this._run(validatedQuery, params, function (connection) { return __awaiter$d(_this, void 0, void 0, function () {
7966
7990
  var bookmarks;
@@ -8059,7 +8083,7 @@ var Session = /** @class */ (function () {
8059
8083
  var arg = transactionConfig;
8060
8084
  var txConfig = tx_config_1.TxConfig.empty();
8061
8085
  if (arg != null) {
8062
- txConfig = new tx_config_1.TxConfig(arg);
8086
+ txConfig = new tx_config_1.TxConfig(arg, this._log);
8063
8087
  }
8064
8088
  return this._beginTransaction(this._mode, txConfig);
8065
8089
  };
@@ -8161,7 +8185,7 @@ var Session = /** @class */ (function () {
8161
8185
  * @see {@link Session#executeRead}
8162
8186
  */
8163
8187
  Session.prototype.readTransaction = function (transactionWork, transactionConfig) {
8164
- var config = new tx_config_1.TxConfig(transactionConfig);
8188
+ var config = new tx_config_1.TxConfig(transactionConfig, this._log);
8165
8189
  return this._runTransaction(constants_1$1.ACCESS_MODE_READ, config, transactionWork);
8166
8190
  };
8167
8191
  /**
@@ -8182,7 +8206,7 @@ var Session = /** @class */ (function () {
8182
8206
  * @see {@link Session#executeWrite}
8183
8207
  */
8184
8208
  Session.prototype.writeTransaction = function (transactionWork, transactionConfig) {
8185
- var config = new tx_config_1.TxConfig(transactionConfig);
8209
+ var config = new tx_config_1.TxConfig(transactionConfig, this._log);
8186
8210
  return this._runTransaction(constants_1$1.ACCESS_MODE_WRITE, config, transactionWork);
8187
8211
  };
8188
8212
  Session.prototype._runTransaction = function (accessMode, transactionConfig, transactionWork) {
@@ -8204,7 +8228,7 @@ var Session = /** @class */ (function () {
8204
8228
  * function or commit fails.
8205
8229
  */
8206
8230
  Session.prototype.executeRead = function (transactionWork, transactionConfig) {
8207
- var config = new tx_config_1.TxConfig(transactionConfig);
8231
+ var config = new tx_config_1.TxConfig(transactionConfig, this._log);
8208
8232
  return this._executeInTransaction(constants_1$1.ACCESS_MODE_READ, config, transactionWork);
8209
8233
  };
8210
8234
  /**
@@ -8222,7 +8246,7 @@ var Session = /** @class */ (function () {
8222
8246
  * function or commit fails.
8223
8247
  */
8224
8248
  Session.prototype.executeWrite = function (transactionWork, transactionConfig) {
8225
- var config = new tx_config_1.TxConfig(transactionConfig);
8249
+ var config = new tx_config_1.TxConfig(transactionConfig, this._log);
8226
8250
  return this._executeInTransaction(constants_1$1.ACCESS_MODE_WRITE, config, transactionWork);
8227
8251
  };
8228
8252
  /**
@@ -8277,7 +8301,7 @@ var Session = /** @class */ (function () {
8277
8301
  Session.prototype._updateBookmarks = function (newBookmarks, previousBookmarks, database) {
8278
8302
  var _a, _b, _c;
8279
8303
  if ((newBookmarks != null) && !newBookmarks.isEmpty()) {
8280
- (_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 () { });
8281
8305
  this._lastBookmarks = newBookmarks;
8282
8306
  this._configuredBookmarks = bookmarks_1$1.Bookmarks.empty();
8283
8307
  }
@@ -8342,6 +8366,15 @@ var Session = /** @class */ (function () {
8342
8366
  high: 0.7 * this._fetchSize
8343
8367
  };
8344
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
+ };
8345
8378
  /**
8346
8379
  * @protected
8347
8380
  */
@@ -8913,6 +8946,8 @@ var QueryExecutor = /** @class */ (function () {
8913
8946
  bookmarkManager: config.bookmarkManager,
8914
8947
  impersonatedUser: config.impersonatedUser
8915
8948
  });
8949
+ // @ts-expect-error The method is private for external users
8950
+ session._setTxExecutorToPipelineBegin(true);
8916
8951
  _a.label = 1;
8917
8952
  case 1:
8918
8953
  _a.trys.push([1, , 3, 5]);
@@ -9313,7 +9348,7 @@ var Driver$1 = /** @class */ (function () {
9313
9348
  function Driver(meta, config, createConnectionProvider, createSession, createQueryExecutor) {
9314
9349
  if (config === void 0) { config = {}; }
9315
9350
  if (createSession === void 0) { createSession = function (args) { return new session_1.default(args); }; }
9316
- 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); }; }
9317
9352
  sanitizeConfig(config);
9318
9353
  var log = logger_1.Logger.create(config);
9319
9354
  validateConfig(config, log);
@@ -9668,7 +9703,8 @@ var Driver$1 = /** @class */ (function () {
9668
9703
  fetchSize: fetchSize,
9669
9704
  bookmarkManager: bookmarkManager,
9670
9705
  notificationFilter: notificationFilter,
9671
- auth: auth
9706
+ auth: auth,
9707
+ log: this._log
9672
9708
  });
9673
9709
  };
9674
9710
  /**
@@ -9920,7 +9956,7 @@ var __importDefault$L = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
9920
9956
  return (mod && mod.__esModule) ? mod : { "default": mod };
9921
9957
  };
9922
9958
  Object.defineProperty(authTokenManager, "__esModule", { value: true });
9923
- authTokenManager.isStaticAuthTokenManger = authTokenManager.staticAuthTokenManager = authTokenManager.expirationBasedAuthTokenManager = authTokenManager.AuthTokenAndExpiration = void 0;
9959
+ authTokenManager.staticAuthTokenManager = authTokenManager.authTokenManagers = authTokenManager.AuthTokenAndExpiration = void 0;
9924
9960
  var auth_1 = __importDefault$L(auth$1);
9925
9961
  var internal_1 = internal;
9926
9962
  /**
@@ -9944,12 +9980,13 @@ var AuthTokenManager = /** @class */ (function () {
9944
9980
  throw new Error('Not Implemented');
9945
9981
  };
9946
9982
  /**
9947
- * Called to notify a token expiration.
9983
+ * Handles an error notification emitted by the server if a security error happened.
9948
9984
  *
9949
9985
  * @param {AuthToken} token The expired token.
9950
- * @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..
9951
9988
  */
9952
- AuthTokenManager.prototype.onTokenExpired = function (token) {
9989
+ AuthTokenManager.prototype.handleSecurityException = function (token, securityErrorCode) {
9953
9990
  throw new Error('Not implemented');
9954
9991
  };
9955
9992
  return AuthTokenManager;
@@ -9974,7 +10011,7 @@ var AuthTokenAndExpiration = /** @class */ (function () {
9974
10011
  * The expected expiration date of the auth token.
9975
10012
  *
9976
10013
  * This information will be used for triggering the auth token refresh
9977
- * in managers created with {@link expirationBasedAuthTokenManager}.
10014
+ * in managers created with {@link authTokenManagers#bearer}.
9978
10015
  *
9979
10016
  * If this value is not defined, the {@link AuthToken} will be considered valid
9980
10017
  * until a `Neo.ClientError.Security.TokenExpired` error happens.
@@ -9987,25 +10024,73 @@ var AuthTokenAndExpiration = /** @class */ (function () {
9987
10024
  }());
9988
10025
  authTokenManager.AuthTokenAndExpiration = AuthTokenAndExpiration;
9989
10026
  /**
9990
- * Creates a {@link AuthTokenManager} for handle {@link AuthToken} which is expires.
9991
- *
9992
- * **Warning**: `tokenProvider` must only ever return auth information belonging to the same identity.
9993
- * 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
9994
10088
  *
9995
- * @param {object} param0 - The params
9996
- * @param {function(): Promise<AuthTokenAndExpiration>} param0.tokenProvider - Retrieves a new valid auth token.
9997
- * Must only ever return auth information belonging to the same identity.
9998
- * @returns {AuthTokenManager} The temporal auth data manager.
9999
10089
  * @experimental Exposed as preview feature.
10000
10090
  */
10001
- function expirationBasedAuthTokenManager(_a) {
10002
- var tokenProvider = _a.tokenProvider;
10003
- if (typeof tokenProvider !== 'function') {
10004
- throw new TypeError("tokenProvider should be function, but got: ".concat(typeof tokenProvider));
10005
- }
10006
- return new ExpirationBasedAuthTokenManager(tokenProvider);
10007
- }
10008
- authTokenManager.expirationBasedAuthTokenManager = expirationBasedAuthTokenManager;
10091
+ var authTokenManagers = new AuthTokenManagers();
10092
+ authTokenManager.authTokenManagers = authTokenManagers;
10093
+ Object.freeze(authTokenManagers);
10009
10094
  /**
10010
10095
  * Create a {@link AuthTokenManager} for handle static {@link AuthToken}
10011
10096
  *
@@ -10019,18 +10104,6 @@ function staticAuthTokenManager(_a) {
10019
10104
  return new StaticAuthTokenManager(authToken);
10020
10105
  }
10021
10106
  authTokenManager.staticAuthTokenManager = staticAuthTokenManager;
10022
- /**
10023
- * Checks if the manager is a StaticAuthTokenManager
10024
- *
10025
- * @private
10026
- * @experimental
10027
- * @param {AuthTokenManager} manager The auth token manager to be checked.
10028
- * @returns {boolean} Manager is StaticAuthTokenManager
10029
- */
10030
- function isStaticAuthTokenManger(manager) {
10031
- return manager instanceof StaticAuthTokenManager;
10032
- }
10033
- authTokenManager.isStaticAuthTokenManger = isStaticAuthTokenManger;
10034
10107
  var TokenRefreshObservable = /** @class */ (function () {
10035
10108
  function TokenRefreshObservable(_subscribers) {
10036
10109
  if (_subscribers === void 0) { _subscribers = []; }
@@ -10048,8 +10121,9 @@ var TokenRefreshObservable = /** @class */ (function () {
10048
10121
  return TokenRefreshObservable;
10049
10122
  }());
10050
10123
  var ExpirationBasedAuthTokenManager = /** @class */ (function () {
10051
- function ExpirationBasedAuthTokenManager(_tokenProvider, _currentAuthData, _refreshObservable) {
10124
+ function ExpirationBasedAuthTokenManager(_tokenProvider, _handledSecurityCodes, _currentAuthData, _refreshObservable) {
10052
10125
  this._tokenProvider = _tokenProvider;
10126
+ this._handledSecurityCodes = _handledSecurityCodes;
10053
10127
  this._currentAuthData = _currentAuthData;
10054
10128
  this._refreshObservable = _refreshObservable;
10055
10129
  }
@@ -10071,11 +10145,15 @@ var ExpirationBasedAuthTokenManager = /** @class */ (function () {
10071
10145
  });
10072
10146
  });
10073
10147
  };
10074
- ExpirationBasedAuthTokenManager.prototype.onTokenExpired = function (token) {
10148
+ ExpirationBasedAuthTokenManager.prototype.handleSecurityException = function (token, securityErrorCode) {
10075
10149
  var _a;
10076
- if (internal_1.util.equals(token, (_a = this._currentAuthData) === null || _a === void 0 ? void 0 : _a.token)) {
10077
- 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;
10078
10155
  }
10156
+ return false;
10079
10157
  };
10080
10158
  ExpirationBasedAuthTokenManager.prototype._scheduleRefreshAuthToken = function (observer) {
10081
10159
  var _this = this;
@@ -10125,8 +10203,8 @@ var StaticAuthTokenManager = /** @class */ (function () {
10125
10203
  StaticAuthTokenManager.prototype.getToken = function () {
10126
10204
  return this._authToken;
10127
10205
  };
10128
- StaticAuthTokenManager.prototype.onTokenExpired = function (_) {
10129
- // nothing to do here
10206
+ StaticAuthTokenManager.prototype.handleSecurityException = function (_, __) {
10207
+ return false;
10130
10208
  };
10131
10209
  return StaticAuthTokenManager;
10132
10210
  }());
@@ -10424,8 +10502,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
10424
10502
  return (mod && mod.__esModule) ? mod : { "default": mod };
10425
10503
  };
10426
10504
  Object.defineProperty(exports, "__esModule", { value: true });
10427
- 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;
10428
- 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;
10429
10507
  var error_1 = error;
10430
10508
  Object.defineProperty(exports, "newError", { enumerable: true, get: function () { return error_1.newError; } });
10431
10509
  Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return error_1.Neo4jError; } });
@@ -10504,9 +10582,8 @@ exports.auth = auth_1.default;
10504
10582
  var bookmark_manager_1 = bookmarkManager$1;
10505
10583
  Object.defineProperty(exports, "bookmarkManager", { enumerable: true, get: function () { return bookmark_manager_1.bookmarkManager; } });
10506
10584
  var auth_token_manager_1 = authTokenManager;
10507
- 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; } });
10508
10586
  Object.defineProperty(exports, "staticAuthTokenManager", { enumerable: true, get: function () { return auth_token_manager_1.staticAuthTokenManager; } });
10509
- Object.defineProperty(exports, "isStaticAuthTokenManger", { enumerable: true, get: function () { return auth_token_manager_1.isStaticAuthTokenManger; } });
10510
10587
  var driver_2 = driver;
10511
10588
  Object.defineProperty(exports, "routing", { enumerable: true, get: function () { return driver_2.routing; } });
10512
10589
  var types = __importStar(types$1);
@@ -10530,6 +10607,7 @@ exports.error = error$1;
10530
10607
  * @private
10531
10608
  */
10532
10609
  var forExport = {
10610
+ authTokenManagers: auth_token_manager_1.authTokenManagers,
10533
10611
  newError: error_1.newError,
10534
10612
  Neo4jError: error_1.Neo4jError,
10535
10613
  isRetriableError: error_1.isRetriableError,
@@ -10587,7 +10665,6 @@ var forExport = {
10587
10665
  json: json$1,
10588
10666
  auth: auth_1.default,
10589
10667
  bookmarkManager: bookmark_manager_1.bookmarkManager,
10590
- expirationBasedAuthTokenManager: auth_token_manager_1.expirationBasedAuthTokenManager,
10591
10668
  routing: driver_2.routing,
10592
10669
  resultTransformers: result_transformers_1.default,
10593
10670
  notificationCategory: result_summary_1.notificationCategory,
@@ -18625,7 +18702,7 @@ Object.defineProperty(resultRx, "__esModule", { value: true });
18625
18702
  * limitations under the License.
18626
18703
  */
18627
18704
  /* eslint-disable-next-line no-unused-vars */
18628
- var neo4j_driver_core_1$G = lib$1;
18705
+ var neo4j_driver_core_1$H = lib$1;
18629
18706
  var rxjs_1$3 = cjs;
18630
18707
  var operators_1$2 = operators;
18631
18708
  var States = {
@@ -18759,7 +18836,7 @@ var RxResult = /** @class */ (function () {
18759
18836
  });
18760
18837
  }
18761
18838
  else if (recordsObserver) {
18762
- 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.'));
18763
18840
  }
18764
18841
  return function () {
18765
18842
  subscriptions.forEach(function (s) { return s.unsubscribe(); });
@@ -19159,13 +19236,13 @@ var retryLogicRx = {};
19159
19236
  * limitations under the License.
19160
19237
  */
19161
19238
  Object.defineProperty(retryLogicRx, "__esModule", { value: true });
19162
- var neo4j_driver_core_1$F = lib$1;
19239
+ var neo4j_driver_core_1$G = lib$1;
19163
19240
  // eslint-disable-next-line no-unused-vars
19164
19241
  var rxjs_1$1 = cjs;
19165
19242
  var operators_1$1 = operators;
19166
19243
  // eslint-disable-next-line no-unused-vars
19167
- neo4j_driver_core_1$F.internal.logger.Logger;
19168
- 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;
19169
19246
  var DEFAULT_MAX_RETRY_TIME_MS = 30 * 1000; // 30 seconds
19170
19247
  var DEFAULT_INITIAL_RETRY_DELAY_MS = 1000; // 1 seconds
19171
19248
  var DEFAULT_RETRY_DELAY_MULTIPLIER = 2.0;
@@ -19196,13 +19273,13 @@ var RxRetryLogic = /** @class */ (function () {
19196
19273
  var retryCount = 1;
19197
19274
  var delayDuration = _this._initialDelay;
19198
19275
  return failedWork.pipe((0, operators_1$1.mergeMap)(function (err) {
19199
- if (!(0, neo4j_driver_core_1$F.isRetriableError)(err)) {
19276
+ if (!(0, neo4j_driver_core_1$G.isRetriableError)(err)) {
19200
19277
  return (0, rxjs_1$1.throwError)(function () { return err; });
19201
19278
  }
19202
19279
  handledExceptions.push(err);
19203
19280
  if (retryCount >= 2 &&
19204
19281
  Date.now() - startTime >= _this._maxRetryTimeout) {
19205
- 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);
19206
19283
  error_1.seenErrors = handledExceptions;
19207
19284
  return (0, rxjs_1$1.throwError)(function () { return error_1; });
19208
19285
  }
@@ -19256,11 +19333,11 @@ var rxjs_1 = cjs;
19256
19333
  var operators_1 = operators;
19257
19334
  var result_rx_1 = __importDefault$I(resultRx);
19258
19335
  // eslint-disable-next-line no-unused-vars
19259
- var neo4j_driver_core_1$E = lib$1;
19336
+ var neo4j_driver_core_1$F = lib$1;
19260
19337
  var transaction_rx_1 = __importDefault$I(transactionRx);
19261
19338
  var transaction_managed_rx_1 = __importDefault$I(transactionManagedRx);
19262
19339
  var retry_logic_rx_1 = __importDefault$I(retryLogicRx);
19263
- 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;
19264
19341
  /**
19265
19342
  * A Reactive session, which provides the same functionality as {@link Session} but through a Reactive API.
19266
19343
  */
@@ -19273,9 +19350,10 @@ var RxSession = /** @class */ (function () {
19273
19350
  * @param {Session} param.session - The underlying session instance to relay requests
19274
19351
  */
19275
19352
  function RxSession(_a) {
19276
- var _b = _a === void 0 ? {} : _a, session = _b.session, config = _b.config;
19353
+ var _b = _a === void 0 ? {} : _a, session = _b.session, config = _b.config, log = _b.log;
19277
19354
  this._session = session;
19278
19355
  this._retryLogic = _createRetryLogic(config);
19356
+ this._log = log;
19279
19357
  }
19280
19358
  /**
19281
19359
  * Creates a reactive result that will execute the query with the provided parameters and the provided
@@ -19422,7 +19500,7 @@ var RxSession = /** @class */ (function () {
19422
19500
  var _this = this;
19423
19501
  var txConfig = TxConfig$3.empty();
19424
19502
  if (transactionConfig) {
19425
- txConfig = new TxConfig$3(transactionConfig);
19503
+ txConfig = new TxConfig$3(transactionConfig, this._log);
19426
19504
  }
19427
19505
  return new rxjs_1.Observable(function (observer) {
19428
19506
  try {
@@ -19507,10 +19585,10 @@ var __importDefault$H = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
19507
19585
  };
19508
19586
  Object.defineProperty(driver$1, "__esModule", { value: true });
19509
19587
  driver$1.WRITE = driver$1.READ = driver$1.Driver = void 0;
19510
- var neo4j_driver_core_1$D = lib$1;
19588
+ var neo4j_driver_core_1$E = lib$1;
19511
19589
  var session_rx_1 = __importDefault$H(sessionRx);
19512
- var FETCH_ALL$5 = neo4j_driver_core_1$D.internal.constants.FETCH_ALL;
19513
- 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;
19514
19592
  driver$1.READ = READ$2;
19515
19593
  driver$1.WRITE = WRITE$2;
19516
19594
  /**
@@ -19555,13 +19633,15 @@ var Driver = /** @class */ (function (_super) {
19555
19633
  reactive: false,
19556
19634
  fetchSize: validateFetchSizeValue(fetchSize, this._config.fetchSize),
19557
19635
  bookmarkManager: bookmarkManager,
19558
- notificationFilter: notificationFilter
19636
+ notificationFilter: notificationFilter,
19637
+ log: this._log
19559
19638
  }),
19560
- config: this._config
19639
+ config: this._config,
19640
+ log: this._log
19561
19641
  });
19562
19642
  };
19563
19643
  return Driver;
19564
- }(neo4j_driver_core_1$D.Driver));
19644
+ }(neo4j_driver_core_1$E.Driver));
19565
19645
  driver$1.Driver = Driver;
19566
19646
  /**
19567
19647
  * @private
@@ -19609,7 +19689,7 @@ Object.defineProperty(version$1, "__esModule", { value: true });
19609
19689
  // This is set up this way to keep the version in the code in
19610
19690
  // sync with the npm package version, and to allow the build
19611
19691
  // system to control version names at packaging time.
19612
- version$1.default = '5.10.0';
19692
+ version$1.default = '5.12.0';
19613
19693
 
19614
19694
  var lib = {};
19615
19695
 
@@ -22716,7 +22796,7 @@ function newChannelJSBuffer(arg) {
22716
22796
  }
22717
22797
  else {
22718
22798
  // fallback to the old, potentially deprecated constructor
22719
- // eslint-disable-next-line node/no-deprecated-api
22799
+ // eslint-disable-next-line n/no-deprecated-api
22720
22800
  return new buffer_1$1.default.Buffer(arg);
22721
22801
  }
22722
22802
  }
@@ -22745,8 +22825,8 @@ Object.defineProperty(browserChannel, "__esModule", { value: true });
22745
22825
  */
22746
22826
  /* eslint-env browser */
22747
22827
  var channel_buf_1$3 = __importDefault$C(channelBuf);
22748
- var neo4j_driver_core_1$C = lib$1;
22749
- 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;
22750
22830
  var WS_OPEN = 1;
22751
22831
  var WS_CLOSED = 3;
22752
22832
  /**
@@ -22811,7 +22891,7 @@ var WebSocketChannel = /** @class */ (function () {
22811
22891
  WebSocketChannel.prototype._handleConnectionError = function () {
22812
22892
  if (this._connectionTimeoutFired) {
22813
22893
  // timeout fired - not connected within configured time
22814
- 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);
22815
22895
  if (this.onerror) {
22816
22896
  this.onerror(this._error);
22817
22897
  }
@@ -22820,7 +22900,7 @@ var WebSocketChannel = /** @class */ (function () {
22820
22900
  // onerror triggers on websocket close as well.. don't get me started.
22821
22901
  if (this._open && !this._timedout) {
22822
22902
  // http://stackoverflow.com/questions/25779831/how-to-catch-websocket-connection-to-ws-xxxnn-failed-connection-closed-be
22823
- 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 ' +
22824
22904
  'constraints in your web browser, the reason for the failure is not available ' +
22825
22905
  'to this Neo4j Driver. Please use your browsers development console to determine ' +
22826
22906
  'the root cause of the failure. Common reasons include the database being ' +
@@ -22859,7 +22939,7 @@ var WebSocketChannel = /** @class */ (function () {
22859
22939
  }
22860
22940
  }
22861
22941
  else {
22862
- 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);
22863
22943
  }
22864
22944
  };
22865
22945
  /**
@@ -22925,7 +23005,7 @@ var WebSocketChannel = /** @class */ (function () {
22925
23005
  _this._receiveTimeoutId = null;
22926
23006
  _this._timedout = true;
22927
23007
  _this.stopReceiveTimeout();
22928
- _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);
22929
23009
  _this.close();
22930
23010
  if (_this.onerror) {
22931
23011
  _this.onerror(_this._error);
@@ -23034,7 +23114,7 @@ function determineWebSocketScheme(config, protocolSupplier) {
23034
23114
  return { scheme: 'wss', error: null };
23035
23115
  }
23036
23116
  else {
23037
- 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 ' +
23038
23118
  "strategy, 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES'. " +
23039
23119
  trust +
23040
23120
  ' is not supported. Please ' +
@@ -23127,8 +23207,8 @@ var __extends$m = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
23127
23207
  };
23128
23208
  })();
23129
23209
  Object.defineProperty(browserHostNameResolver, "__esModule", { value: true });
23130
- var neo4j_driver_core_1$B = lib$1;
23131
- 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;
23132
23212
  var BrowserHostNameResolver = /** @class */ (function (_super) {
23133
23213
  __extends$m(BrowserHostNameResolver, _super);
23134
23214
  function BrowserHostNameResolver() {
@@ -23507,9 +23587,9 @@ var channelConfig = {};
23507
23587
  * limitations under the License.
23508
23588
  */
23509
23589
  Object.defineProperty(channelConfig, "__esModule", { value: true });
23510
- var neo4j_driver_core_1$A = lib$1;
23511
- var _a$a = neo4j_driver_core_1$A.internal.util, ENCRYPTION_OFF = _a$a.ENCRYPTION_OFF, ENCRYPTION_ON = _a$a.ENCRYPTION_ON;
23512
- 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;
23513
23593
  var ALLOWED_VALUES_ENCRYPTED = [
23514
23594
  null,
23515
23595
  undefined,
@@ -23547,14 +23627,14 @@ channelConfig.default = ChannelConfig;
23547
23627
  function extractEncrypted(driverConfig) {
23548
23628
  var value = driverConfig.encrypted;
23549
23629
  if (ALLOWED_VALUES_ENCRYPTED.indexOf(value) === -1) {
23550
- 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));
23551
23631
  }
23552
23632
  return value;
23553
23633
  }
23554
23634
  function extractTrust(driverConfig) {
23555
23635
  var value = driverConfig.trust;
23556
23636
  if (ALLOWED_VALUES_TRUST.indexOf(value) === -1) {
23557
- 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));
23558
23638
  }
23559
23639
  return value;
23560
23640
  }
@@ -23936,7 +24016,7 @@ var __importDefault$z = (commonjsGlobal && commonjsGlobal.__importDefault) || fu
23936
24016
  };
23937
24017
  Object.defineProperty(utf8, "__esModule", { value: true });
23938
24018
  var channel_buf_1 = __importDefault$z(channelBuf);
23939
- var neo4j_driver_core_1$z = lib$1;
24019
+ var neo4j_driver_core_1$A = lib$1;
23940
24020
  var buffer_1 = __importDefault$z(buffer);
23941
24021
  var string_decoder_1 = string_decoder;
23942
24022
  var decoder = new string_decoder_1.StringDecoder('utf8');
@@ -23951,7 +24031,7 @@ function decode(buffer, length) {
23951
24031
  return decodeCombinedBuffer(buffer, length);
23952
24032
  }
23953
24033
  else {
23954
- 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, "'"));
23955
24035
  }
23956
24036
  }
23957
24037
  function decodeChannelBuffer(buffer, length) {
@@ -23995,7 +24075,7 @@ function newBuffer(str) {
23995
24075
  return buffer_1.default.Buffer.from(str, 'utf8');
23996
24076
  }
23997
24077
  else {
23998
- // eslint-disable-next-line node/no-deprecated-api
24078
+ // eslint-disable-next-line n/no-deprecated-api
23999
24079
  return new buffer_1.default.Buffer(str, 'utf8');
24000
24080
  }
24001
24081
  }
@@ -24072,7 +24152,7 @@ Object.defineProperty(exports, "utf8", { enumerable: true, get: function () { re
24072
24152
  */
24073
24153
  Object.defineProperty(handshake$1, "__esModule", { value: true });
24074
24154
  var channel_1$3 = channel;
24075
- var neo4j_driver_core_1$y = lib$1;
24155
+ var neo4j_driver_core_1$z = lib$1;
24076
24156
  var BOLT_MAGIC_PREAMBLE = 0x6060b017;
24077
24157
  function version(major, minor) {
24078
24158
  return {
@@ -24082,7 +24162,7 @@ function version(major, minor) {
24082
24162
  }
24083
24163
  function createHandshakeMessage(versions) {
24084
24164
  if (versions.length > 4) {
24085
- 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');
24086
24166
  }
24087
24167
  var handshakeBuffer = (0, channel_1$3.alloc)(5 * 4);
24088
24168
  handshakeBuffer.writeInt32(BOLT_MAGIC_PREAMBLE);
@@ -24101,7 +24181,7 @@ function createHandshakeMessage(versions) {
24101
24181
  handshakeBuffer.reset();
24102
24182
  return handshakeBuffer;
24103
24183
  }
24104
- function parseNegotiatedResponse(buffer) {
24184
+ function parseNegotiatedResponse(buffer, log) {
24105
24185
  var h = [
24106
24186
  buffer.readUInt8(),
24107
24187
  buffer.readUInt8(),
@@ -24109,7 +24189,8 @@ function parseNegotiatedResponse(buffer) {
24109
24189
  buffer.readUInt8()
24110
24190
  ];
24111
24191
  if (h[0] === 0x48 && h[1] === 0x54 && h[2] === 0x54 && h[3] === 0x50) {
24112
- throw (0, neo4j_driver_core_1$y.newError)('Server responded HTTP. Make sure you are not trying to connect to the http endpoint ' +
24192
+ log.error('Handshake failed since server responded with HTTP.');
24193
+ throw (0, neo4j_driver_core_1$z.newError)('Server responded HTTP. Make sure you are not trying to connect to the http endpoint ' +
24113
24194
  '(HTTP defaults to port 7474 whereas BOLT defaults to port 7687)');
24114
24195
  }
24115
24196
  return Number(h[3] + '.' + h[2]);
@@ -24140,9 +24221,10 @@ function newHandshakeBuffer() {
24140
24221
  * Shake hands using the channel and return the protocol version
24141
24222
  *
24142
24223
  * @param {Channel} channel the channel use to shake hands
24224
+ * @param {Logger} log the log object
24143
24225
  * @returns {Promise<HandshakeResult>} Promise of protocol version and consumeRemainingBuffer
24144
24226
  */
24145
- function handshake(channel) {
24227
+ function handshake(channel, log) {
24146
24228
  var _this = this;
24147
24229
  return new Promise(function (resolve, reject) {
24148
24230
  var handshakeErrorHandler = function (error) {
@@ -24155,7 +24237,7 @@ function handshake(channel) {
24155
24237
  channel.onmessage = function (buffer) {
24156
24238
  try {
24157
24239
  // read the response buffer and initialize the protocol
24158
- var protocolVersion = parseNegotiatedResponse(buffer);
24240
+ var protocolVersion = parseNegotiatedResponse(buffer, log);
24159
24241
  resolve({
24160
24242
  protocolVersion: protocolVersion,
24161
24243
  consumeRemainingBuffer: function (consumer) {
@@ -24449,10 +24531,10 @@ streamObservers.ProcedureRouteObserver = streamObservers.RouteObserver = streamO
24449
24531
  * See the License for the specific language governing permissions and
24450
24532
  * limitations under the License.
24451
24533
  */
24452
- var neo4j_driver_core_1$x = lib$1;
24534
+ var neo4j_driver_core_1$y = lib$1;
24453
24535
  var routing_table_raw_1 = __importDefault$x(routingTableRaw);
24454
- var FETCH_ALL$4 = neo4j_driver_core_1$x.internal.constants.FETCH_ALL;
24455
- 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;
24456
24538
  var StreamObserver = /** @class */ (function () {
24457
24539
  function StreamObserver() {
24458
24540
  }
@@ -24545,7 +24627,7 @@ var ResultStreamObserver = /** @class */ (function (_super) {
24545
24627
  * @param {Array} rawRecord - An array with the raw record
24546
24628
  */
24547
24629
  ResultStreamObserver.prototype.onNext = function (rawRecord) {
24548
- 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);
24549
24631
  if (this._observers.some(function (o) { return o.onNext; })) {
24550
24632
  this._observers.forEach(function (o) {
24551
24633
  if (o.onNext) {
@@ -24648,7 +24730,7 @@ var ResultStreamObserver = /** @class */ (function (_super) {
24648
24730
  var _this = this;
24649
24731
  var completionMetadata = Object.assign(this._server ? { server: this._server } : {}, this._meta, meta);
24650
24732
  if (![undefined, null, 'r', 'w', 'rw', 's'].includes(completionMetadata.type)) {
24651
- 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));
24652
24734
  return;
24653
24735
  }
24654
24736
  this._setState(_states.SUCCEEDED);
@@ -24805,7 +24887,7 @@ var LoginObserver = /** @class */ (function (_super) {
24805
24887
  return _this;
24806
24888
  }
24807
24889
  LoginObserver.prototype.onNext = function (record) {
24808
- 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)));
24809
24891
  };
24810
24892
  LoginObserver.prototype.onError = function (error) {
24811
24893
  if (this._onError) {
@@ -24836,7 +24918,7 @@ var LogoffObserver = /** @class */ (function (_super) {
24836
24918
  return _this;
24837
24919
  }
24838
24920
  LogoffObserver.prototype.onNext = function (record) {
24839
- 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)));
24840
24922
  };
24841
24923
  LogoffObserver.prototype.onError = function (error) {
24842
24924
  if (this._onError) {
@@ -24869,8 +24951,8 @@ var ResetObserver = /** @class */ (function (_super) {
24869
24951
  return _this;
24870
24952
  }
24871
24953
  ResetObserver.prototype.onNext = function (record) {
24872
- this.onError((0, neo4j_driver_core_1$x.newError)('Received RECORD when resetting: received record is: ' +
24873
- 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));
24874
24956
  };
24875
24957
  ResetObserver.prototype.onError = function (error) {
24876
24958
  if (error.code === PROTOCOL_ERROR$5 && this._onProtocolError) {
@@ -24935,10 +25017,10 @@ var ProcedureRouteObserver = /** @class */ (function (_super) {
24935
25017
  };
24936
25018
  ProcedureRouteObserver.prototype.onCompleted = function () {
24937
25019
  if (this._records !== null && this._records.length !== 1) {
24938
- 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 ' +
24939
25021
  this._records.length +
24940
25022
  ' records but expected only one.\n' +
24941
- 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));
24942
25024
  return;
24943
25025
  }
24944
25026
  if (this._onCompleted) {
@@ -24966,8 +25048,8 @@ var RouteObserver = /** @class */ (function (_super) {
24966
25048
  return _this;
24967
25049
  }
24968
25050
  RouteObserver.prototype.onNext = function (record) {
24969
- this.onError((0, neo4j_driver_core_1$x.newError)('Received RECORD when resetting: received record is: ' +
24970
- 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));
24971
25053
  };
24972
25054
  RouteObserver.prototype.onError = function (error) {
24973
25055
  if (error.code === PROTOCOL_ERROR$5 && this._onProtocolError) {
@@ -25071,7 +25153,7 @@ boltProtocolUtil.assertNotificationFilterIsEmpty = boltProtocolUtil.assertImpers
25071
25153
  * See the License for the specific language governing permissions and
25072
25154
  * limitations under the License.
25073
25155
  */
25074
- var neo4j_driver_core_1$w = lib$1;
25156
+ var neo4j_driver_core_1$x = lib$1;
25075
25157
  /**
25076
25158
  * @param {TxConfig} txConfig the auto-commit transaction configuration.
25077
25159
  * @param {function(error: string)} onProtocolError called when the txConfig is not empty.
@@ -25080,7 +25162,7 @@ var neo4j_driver_core_1$w = lib$1;
25080
25162
  function assertTxConfigIsEmpty(txConfig, onProtocolError, observer) {
25081
25163
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25082
25164
  if (txConfig && !txConfig.isEmpty()) {
25083
- 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. ' +
25084
25166
  'Please upgrade to neo4j 3.5.0 or later in order to use this functionality');
25085
25167
  // unsupported API was used, consider this a fatal error for the current connection
25086
25168
  onProtocolError(error.message);
@@ -25097,7 +25179,7 @@ boltProtocolUtil.assertTxConfigIsEmpty = assertTxConfigIsEmpty;
25097
25179
  function assertDatabaseIsEmpty(database, onProtocolError, observer) {
25098
25180
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25099
25181
  if (database) {
25100
- 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. ' +
25101
25183
  'Please upgrade to neo4j 4.0.0 or later in order to use this functionality');
25102
25184
  // unsupported API was used, consider this a fatal error for the current connection
25103
25185
  onProtocolError(error.message);
@@ -25115,7 +25197,7 @@ boltProtocolUtil.assertDatabaseIsEmpty = assertDatabaseIsEmpty;
25115
25197
  function assertImpersonatedUserIsEmpty(impersonatedUser, onProtocolError, observer) {
25116
25198
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25117
25199
  if (impersonatedUser) {
25118
- 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. ' +
25119
25201
  'Please upgrade to neo4j 4.4.0 or later in order to use this functionality. ' +
25120
25202
  "Trying to impersonate ".concat(impersonatedUser, "."));
25121
25203
  // unsupported API was used, consider this a fatal error for the current connection
@@ -25134,9 +25216,9 @@ boltProtocolUtil.assertImpersonatedUserIsEmpty = assertImpersonatedUserIsEmpty;
25134
25216
  function assertNotificationFilterIsEmpty(notificationFilter, onProtocolError, observer) {
25135
25217
  if (onProtocolError === void 0) { onProtocolError = function () { }; }
25136
25218
  if (notificationFilter !== undefined) {
25137
- 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. ' +
25138
25220
  'Please upgrade to Neo4j 5.7.0 or later in order to use this functionality. ' +
25139
- "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), "."));
25140
25222
  // unsupported API was used, consider this a fatal error for the current connection
25141
25223
  onProtocolError(error.message);
25142
25224
  observer.onError(error);
@@ -25172,7 +25254,8 @@ var functional = {};
25172
25254
  * limitations under the License.
25173
25255
  */
25174
25256
  Object.defineProperty(functional, "__esModule", { value: true });
25175
- functional.identity = void 0;
25257
+ functional.reuseOngoingRequest = functional.identity = void 0;
25258
+ var neo4j_driver_core_1$w = lib$1;
25176
25259
  /**
25177
25260
  * Identity function.
25178
25261
  *
@@ -25185,6 +25268,33 @@ function identity(x) {
25185
25268
  return x;
25186
25269
  }
25187
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;
25188
25298
 
25189
25299
  var object = {};
25190
25300
 
@@ -25384,7 +25494,7 @@ packstreamV1.Unpacker = packstreamV1.Packer = void 0;
25384
25494
  * limitations under the License.
25385
25495
  */
25386
25496
  var channel_1$2 = channel;
25387
- var lang_1$2 = lang;
25497
+ var lang_1$3 = lang;
25388
25498
  var structure_1 = structure$1;
25389
25499
  var neo4j_driver_core_1$u = lib$1;
25390
25500
  var PROTOCOL_ERROR$3 = neo4j_driver_core_1$u.error.PROTOCOL_ERROR;
@@ -25434,7 +25544,7 @@ var Packer$1 = /** @class */ (function () {
25434
25544
  */
25435
25545
  Packer.prototype.packable = function (x, dehydrateStruct) {
25436
25546
  var _this = this;
25437
- if (dehydrateStruct === void 0) { dehydrateStruct = lang_1$2.functional.identity; }
25547
+ if (dehydrateStruct === void 0) { dehydrateStruct = lang_1$3.functional.identity; }
25438
25548
  try {
25439
25549
  x = dehydrateStruct(x);
25440
25550
  }
@@ -25713,7 +25823,7 @@ var Unpacker$1 = /** @class */ (function () {
25713
25823
  this._useBigInt = useBigInt;
25714
25824
  }
25715
25825
  Unpacker.prototype.unpack = function (buffer, hydrateStructure) {
25716
- if (hydrateStructure === void 0) { hydrateStructure = lang_1$2.functional.identity; }
25826
+ if (hydrateStructure === void 0) { hydrateStructure = lang_1$3.functional.identity; }
25717
25827
  var marker = buffer.readUInt8();
25718
25828
  var markerHigh = marker & 0xf0;
25719
25829
  var markerLow = marker & 0x0f;
@@ -31158,7 +31268,7 @@ function createChannelConnection(address, config, errorHandler, log, serversideR
31158
31268
  if (createChannel === void 0) { createChannel = function (channelConfig) { return new channel_1$1.Channel(channelConfig); }; }
31159
31269
  var channelConfig = new channel_1$1.ChannelConfig(address, config, errorHandler.errorCode());
31160
31270
  var channel = createChannel(channelConfig);
31161
- return bolt_1.default.handshake(channel)
31271
+ return bolt_1.default.handshake(channel, log)
31162
31272
  .then(function (_a) {
31163
31273
  var version = _a.protocolVersion, consumeRemainingBuffer = _a.consumeRemainingBuffer;
31164
31274
  var chunker = new channel_1$1.Chunker(channel);
@@ -31756,15 +31866,15 @@ Object.defineProperty(connectionErrorHandler, "__esModule", { value: true });
31756
31866
  var neo4j_driver_core_1$5 = lib$1;
31757
31867
  var SERVICE_UNAVAILABLE$3 = neo4j_driver_core_1$5.error.SERVICE_UNAVAILABLE, SESSION_EXPIRED$1 = neo4j_driver_core_1$5.error.SESSION_EXPIRED;
31758
31868
  var ConnectionErrorHandler = /** @class */ (function () {
31759
- function ConnectionErrorHandler(errorCode, handleUnavailability, handleWriteFailure, handleAuthorizationExpired) {
31869
+ function ConnectionErrorHandler(errorCode, handleUnavailability, handleWriteFailure, handleSecurityError) {
31760
31870
  this._errorCode = errorCode;
31761
31871
  this._handleUnavailability = handleUnavailability || noOpHandler;
31762
31872
  this._handleWriteFailure = handleWriteFailure || noOpHandler;
31763
- this._handleAuthorizationExpired = handleAuthorizationExpired || noOpHandler;
31873
+ this._handleSecurityError = handleSecurityError || noOpHandler;
31764
31874
  }
31765
31875
  ConnectionErrorHandler.create = function (_a) {
31766
- var errorCode = _a.errorCode, handleUnavailability = _a.handleUnavailability, handleWriteFailure = _a.handleWriteFailure, handleAuthorizationExpired = _a.handleAuthorizationExpired;
31767
- 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);
31768
31878
  };
31769
31879
  /**
31770
31880
  * Error code to use for network errors.
@@ -31780,8 +31890,8 @@ var ConnectionErrorHandler = /** @class */ (function () {
31780
31890
  * @return {Neo4jError} new error that should be propagated to the user.
31781
31891
  */
31782
31892
  ConnectionErrorHandler.prototype.handleAndTransformError = function (error, address, connection) {
31783
- if (isAutorizationExpiredError(error)) {
31784
- return this._handleAuthorizationExpired(error, address, connection);
31893
+ if (isSecurityError(error)) {
31894
+ return this._handleSecurityError(error, address, connection);
31785
31895
  }
31786
31896
  if (isAvailabilityError(error)) {
31787
31897
  return this._handleUnavailability(error, address, connection);
@@ -31794,9 +31904,10 @@ var ConnectionErrorHandler = /** @class */ (function () {
31794
31904
  return ConnectionErrorHandler;
31795
31905
  }());
31796
31906
  connectionErrorHandler.default = ConnectionErrorHandler;
31797
- function isAutorizationExpiredError(error) {
31798
- return error && (error.code === 'Neo.ClientError.Security.AuthorizationExpired' ||
31799
- 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.');
31800
31911
  }
31801
31912
  function isAvailabilityError(error) {
31802
31913
  if (error) {
@@ -31934,16 +32045,14 @@ var __generator$3 = (commonjsGlobal && commonjsGlobal.__generator) || function (
31934
32045
  };
31935
32046
  Object.defineProperty(authenticationProvider, "__esModule", { value: true });
31936
32047
  var neo4j_driver_core_1$4 = lib$1;
31937
- var lang_1$1 = lang;
32048
+ var lang_1$2 = lang;
31938
32049
  /**
31939
32050
  * Class which provides Authorization for {@link Connection}
31940
32051
  */
31941
32052
  var AuthenticationProvider = /** @class */ (function () {
31942
32053
  function AuthenticationProvider(_a) {
31943
32054
  var authTokenManager = _a.authTokenManager, userAgent = _a.userAgent, boltAgent = _a.boltAgent;
31944
- this._authTokenManager = authTokenManager || (0, neo4j_driver_core_1$4.expirationBasedAuthTokenManager)({
31945
- tokenProvider: function () { }
31946
- });
32055
+ this._authTokenManager = authTokenManager || (0, neo4j_driver_core_1$4.staticAuthTokenManager)({});
31947
32056
  this._userAgent = userAgent;
31948
32057
  this._boltAgent = boltAgent;
31949
32058
  }
@@ -31955,7 +32064,7 @@ var AuthenticationProvider = /** @class */ (function () {
31955
32064
  switch (_b.label) {
31956
32065
  case 0:
31957
32066
  if (!(auth != null)) return [3 /*break*/, 3];
31958
- 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) ||
31959
32068
  forceReAuth === true);
31960
32069
  if (!(connection.authToken == null || shouldReAuth)) return [3 /*break*/, 2];
31961
32070
  return [4 /*yield*/, connection.connect(this._userAgent, this._boltAgent, auth, waitReAuth || false)];
@@ -31964,7 +32073,7 @@ var AuthenticationProvider = /** @class */ (function () {
31964
32073
  case 3: return [4 /*yield*/, this._authTokenManager.getToken()];
31965
32074
  case 4:
31966
32075
  authToken = _b.sent();
31967
- 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];
31968
32077
  return [4 /*yield*/, connection.connect(this._userAgent, this._boltAgent, authToken, false)];
31969
32078
  case 5: return [2 /*return*/, _b.sent()];
31970
32079
  case 6: return [2 /*return*/, connection];
@@ -31975,12 +32084,10 @@ var AuthenticationProvider = /** @class */ (function () {
31975
32084
  AuthenticationProvider.prototype.handleError = function (_a) {
31976
32085
  var connection = _a.connection, code = _a.code;
31977
32086
  if (connection &&
31978
- [
31979
- 'Neo.ClientError.Security.Unauthorized',
31980
- 'Neo.ClientError.Security.TokenExpired'
31981
- ].includes(code)) {
31982
- this._authTokenManager.onTokenExpired(connection.authToken);
32087
+ code.startsWith('Neo.ClientError.Security.')) {
32088
+ return this._authTokenManager.handleSecurityException(connection.authToken, code);
31983
32089
  }
32090
+ return false;
31984
32091
  };
31985
32092
  return AuthenticationProvider;
31986
32093
  }());
@@ -32111,7 +32218,7 @@ var connection_1$2 = connection$1;
32111
32218
  var pool_1 = __importStar$1(pool$1);
32112
32219
  var neo4j_driver_core_1$3 = lib$1;
32113
32220
  var authentication_provider_1 = __importDefault$4(authenticationProvider);
32114
- var lang_1 = lang;
32221
+ var lang_1$1 = lang;
32115
32222
  var SERVICE_UNAVAILABLE$2 = neo4j_driver_core_1$3.error.SERVICE_UNAVAILABLE;
32116
32223
  var AUTHENTICATION_ERRORS = [
32117
32224
  'Neo.ClientError.Security.CredentialsExpired',
@@ -32134,7 +32241,6 @@ var PooledConnectionProvider = /** @class */ (function (_super) {
32134
32241
  _this._id = id;
32135
32242
  _this._config = config;
32136
32243
  _this._log = log;
32137
- _this._authTokenManager = authTokenManager;
32138
32244
  _this._authenticationProvider = new authentication_provider_1.default({ authTokenManager: authTokenManager, userAgent: userAgent, boltAgent: boltAgent });
32139
32245
  _this._userAgent = userAgent;
32140
32246
  _this._boltAgent = boltAgent;
@@ -32327,7 +32433,7 @@ var PooledConnectionProvider = /** @class */ (function (_super) {
32327
32433
  return __generator$2(this, function (_b) {
32328
32434
  switch (_b.label) {
32329
32435
  case 0:
32330
- connectionWithSameCredentials = lang_1.object.equals(auth, connection.authToken);
32436
+ connectionWithSameCredentials = lang_1$1.object.equals(auth, connection.authToken);
32331
32437
  shouldCreateStickyConnection = !connectionWithSameCredentials;
32332
32438
  connection._sticky = connectionWithSameCredentials && !connection.supportsReAuth;
32333
32439
  if (!(shouldCreateStickyConnection || connection._sticky)) return [3 /*break*/, 2];
@@ -32371,17 +32477,17 @@ var PooledConnectionProvider = /** @class */ (function (_super) {
32371
32477
  PooledConnectionProvider._removeIdleObserverOnConnection = function (conn) {
32372
32478
  conn._updateCurrentObserver();
32373
32479
  };
32374
- PooledConnectionProvider.prototype._handleAuthorizationExpired = function (error, address, connection) {
32375
- 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
+ }
32376
32485
  if (error.code === 'Neo.ClientError.Security.AuthorizationExpired') {
32377
32486
  this._connectionPool.apply(address, function (conn) { conn.authToken = null; });
32378
32487
  }
32379
32488
  if (connection) {
32380
32489
  connection.close().catch(function () { return undefined; });
32381
32490
  }
32382
- if (error.code === 'Neo.ClientError.Security.TokenExpired' && !(0, neo4j_driver_core_1$3.isStaticAuthTokenManger)(this._authTokenManager)) {
32383
- error.retriable = true;
32384
- }
32385
32491
  return error;
32386
32492
  };
32387
32493
  return PooledConnectionProvider;
@@ -32490,8 +32596,8 @@ var DirectConnectionProvider = /** @class */ (function (_super) {
32490
32596
  case 0:
32491
32597
  databaseSpecificErrorHandler = connection_1$1.ConnectionErrorHandler.create({
32492
32598
  errorCode: SERVICE_UNAVAILABLE$1,
32493
- handleAuthorizationExpired: function (error, address, conn) {
32494
- return _this._handleAuthorizationExpired(error, address, conn, database);
32599
+ handleSecurityError: function (error, address, conn) {
32600
+ return _this._handleSecurityError(error, address, conn, database);
32495
32601
  }
32496
32602
  });
32497
32603
  return [4 /*yield*/, this._connectionPool.acquire({ auth: auth, forceReAuth: forceReAuth }, this._address)];
@@ -32511,9 +32617,9 @@ var DirectConnectionProvider = /** @class */ (function (_super) {
32511
32617
  });
32512
32618
  });
32513
32619
  };
32514
- DirectConnectionProvider.prototype._handleAuthorizationExpired = function (error, address, connection, database) {
32620
+ DirectConnectionProvider.prototype._handleSecurityError = function (error, address, connection, database) {
32515
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, "'"));
32516
- return _super.prototype._handleAuthorizationExpired.call(this, error, address, connection);
32622
+ return _super.prototype._handleSecurityError.call(this, error, address, connection);
32517
32623
  };
32518
32624
  DirectConnectionProvider.prototype._hasProtocolVersion = function (versionPredicate) {
32519
32625
  return __awaiter$1(this, void 0, void 0, function () {
@@ -33098,6 +33204,7 @@ var connection_provider_single_1 = __importDefault(connectionProviderSingle);
33098
33204
  var connection_provider_pooled_1 = __importDefault(connectionProviderPooled);
33099
33205
  var load_balancing_1 = loadBalancing;
33100
33206
  var connection_1 = connection$1;
33207
+ var lang_1 = lang;
33101
33208
  var SERVICE_UNAVAILABLE = neo4j_driver_core_1.error.SERVICE_UNAVAILABLE, SESSION_EXPIRED = neo4j_driver_core_1.error.SESSION_EXPIRED;
33102
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;
33103
33210
  var PROCEDURE_NOT_FOUND_CODE = 'Neo.ClientError.Procedure.ProcedureNotFound';
@@ -33130,6 +33237,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33130
33237
  _this._routingTableRegistry = new RoutingTableRegistry(routingTablePurgeDelay
33131
33238
  ? (0, neo4j_driver_core_1.int)(routingTablePurgeDelay)
33132
33239
  : DEFAULT_ROUTING_TABLE_PURGE_DELAY);
33240
+ _this._refreshRoutingTable = lang_1.functional.reuseOngoingRequest(_this._refreshRoutingTable, _this);
33133
33241
  return _this;
33134
33242
  }
33135
33243
  RoutingConnectionProvider.prototype._createConnectionErrorHandler = function () {
@@ -33142,9 +33250,9 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33142
33250
  this.forget(address, database || DEFAULT_DB_NAME);
33143
33251
  return error;
33144
33252
  };
33145
- RoutingConnectionProvider.prototype._handleAuthorizationExpired = function (error, address, connection, database) {
33253
+ RoutingConnectionProvider.prototype._handleSecurityError = function (error, address, connection, database) {
33146
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, "'"));
33147
- return _super.prototype._handleAuthorizationExpired.call(this, error, address, connection, database);
33255
+ return _super.prototype._handleSecurityError.call(this, error, address, connection, database);
33148
33256
  };
33149
33257
  RoutingConnectionProvider.prototype._handleWriteFailure = function (error, address, database) {
33150
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, "'"));
@@ -33165,7 +33273,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33165
33273
  case 0:
33166
33274
  context = { database: database || DEFAULT_DB_NAME };
33167
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) {
33168
- return _this._handleAuthorizationExpired(error, address, conn, context.database);
33276
+ return _this._handleSecurityError(error, address, conn, context.database);
33169
33277
  });
33170
33278
  return [4 /*yield*/, this._freshRoutingTable({
33171
33279
  accessMode: accessMode,
@@ -33429,16 +33537,20 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33429
33537
  return currentRoutingTable;
33430
33538
  }
33431
33539
  this._log.info("Routing table is stale for database: \"".concat(database, "\" and access mode: \"").concat(accessMode, "\": ").concat(currentRoutingTable));
33432
- 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
+ });
33433
33545
  };
33434
- RoutingConnectionProvider.prototype._refreshRoutingTable = function (currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth) {
33546
+ RoutingConnectionProvider.prototype._refreshRoutingTable = function (currentRoutingTable, bookmarks, impersonatedUser, auth) {
33435
33547
  var knownRouters = currentRoutingTable.routers;
33436
33548
  if (this._useSeedRouter) {
33437
- return this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth);
33549
+ return this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth);
33438
33550
  }
33439
- return this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth);
33551
+ return this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth);
33440
33552
  };
33441
- RoutingConnectionProvider.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth) {
33553
+ RoutingConnectionProvider.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth) {
33442
33554
  return __awaiter(this, void 0, void 0, function () {
33443
33555
  var seenRouters, _a, newRoutingTable, error, _b, newRoutingTable2, error2;
33444
33556
  return __generator(this, function (_c) {
@@ -33457,13 +33569,13 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33457
33569
  newRoutingTable = newRoutingTable2;
33458
33570
  error = error2 || error;
33459
33571
  _c.label = 4;
33460
- case 4: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, onDatabaseNameResolved, error)];
33572
+ case 4: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, error)];
33461
33573
  case 5: return [2 /*return*/, _c.sent()];
33462
33574
  }
33463
33575
  });
33464
33576
  });
33465
33577
  };
33466
- RoutingConnectionProvider.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, onDatabaseNameResolved, auth) {
33578
+ RoutingConnectionProvider.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter = function (knownRouters, currentRoutingTable, bookmarks, impersonatedUser, auth) {
33467
33579
  return __awaiter(this, void 0, void 0, function () {
33468
33580
  var _a, newRoutingTable, error;
33469
33581
  var _b;
@@ -33478,7 +33590,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33478
33590
  // none of the known routers returned a valid routing table - try to use seed router address for rediscovery
33479
33591
  _b = __read.apply(void 0, [_c.sent(), 2]), newRoutingTable = _b[0], error = _b[1];
33480
33592
  _c.label = 3;
33481
- case 3: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, onDatabaseNameResolved, error)];
33593
+ case 3: return [4 /*yield*/, this._applyRoutingTableIfPossible(currentRoutingTable, newRoutingTable, error)];
33482
33594
  case 4: return [2 /*return*/, _c.sent()];
33483
33595
  }
33484
33596
  });
@@ -33606,7 +33718,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33606
33718
  case 3:
33607
33719
  databaseSpecificErrorHandler = connection_1.ConnectionErrorHandler.create({
33608
33720
  errorCode: SESSION_EXPIRED,
33609
- handleAuthorizationExpired: function (error, address, conn) { return _this._handleAuthorizationExpired(error, address, conn); }
33721
+ handleSecurityError: function (error, address, conn) { return _this._handleSecurityError(error, address, conn); }
33610
33722
  });
33611
33723
  delegateConnection = !connection._sticky
33612
33724
  ? new connection_1.DelegateConnection(connection, databaseSpecificErrorHandler)
@@ -33646,7 +33758,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33646
33758
  this._log.warn("unable to fetch routing table because of an error ".concat(error));
33647
33759
  return [null, error];
33648
33760
  };
33649
- RoutingConnectionProvider.prototype._applyRoutingTableIfPossible = function (currentRoutingTable, newRoutingTable, onDatabaseNameResolved, error) {
33761
+ RoutingConnectionProvider.prototype._applyRoutingTableIfPossible = function (currentRoutingTable, newRoutingTable, error) {
33650
33762
  return __awaiter(this, void 0, void 0, function () {
33651
33763
  return __generator(this, function (_a) {
33652
33764
  switch (_a.label) {
@@ -33660,7 +33772,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33660
33772
  // does not always get routing table without writers because it talks exclusively to a minority partition
33661
33773
  this._useSeedRouter = true;
33662
33774
  }
33663
- return [4 /*yield*/, this._updateRoutingTable(newRoutingTable, onDatabaseNameResolved)];
33775
+ return [4 /*yield*/, this._updateRoutingTable(newRoutingTable)];
33664
33776
  case 1:
33665
33777
  _a.sent();
33666
33778
  return [2 /*return*/, newRoutingTable];
@@ -33668,7 +33780,7 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33668
33780
  });
33669
33781
  });
33670
33782
  };
33671
- RoutingConnectionProvider.prototype._updateRoutingTable = function (newRoutingTable, onDatabaseNameResolved) {
33783
+ RoutingConnectionProvider.prototype._updateRoutingTable = function (newRoutingTable) {
33672
33784
  return __awaiter(this, void 0, void 0, function () {
33673
33785
  return __generator(this, function (_a) {
33674
33786
  switch (_a.label) {
@@ -33680,7 +33792,6 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
33680
33792
  _a.sent();
33681
33793
  this._routingTableRegistry.removeExpired();
33682
33794
  this._routingTableRegistry.register(newRoutingTable);
33683
- onDatabaseNameResolved(newRoutingTable.database);
33684
33795
  this._log.info("Updated routing table ".concat(newRoutingTable));
33685
33796
  return [2 /*return*/];
33686
33797
  }
@@ -33958,8 +34069,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
33958
34069
  return (mod && mod.__esModule) ? mod : { "default": mod };
33959
34070
  };
33960
34071
  Object.defineProperty(exports, "__esModule", { value: true });
33961
- 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;
33962
- 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;
33963
34074
  /**
33964
34075
  * Copyright (c) "Neo4j"
33965
34076
  * Neo4j Sweden AB [http://neo4j.com]
@@ -33982,6 +34093,7 @@ var driver_1 = driver$1;
33982
34093
  Object.defineProperty(exports, "Driver", { enumerable: true, get: function () { return driver_1.Driver; } });
33983
34094
  var version_1 = __importDefault(version$1);
33984
34095
  var neo4j_driver_core_1 = lib$1;
34096
+ Object.defineProperty(exports, "authTokenManagers", { enumerable: true, get: function () { return neo4j_driver_core_1.authTokenManagers; } });
33985
34097
  Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return neo4j_driver_core_1.Neo4jError; } });
33986
34098
  Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return neo4j_driver_core_1.isRetryableError; } });
33987
34099
  Object.defineProperty(exports, "error", { enumerable: true, get: function () { return neo4j_driver_core_1.error; } });
@@ -34032,7 +34144,6 @@ Object.defineProperty(exports, "notificationCategory", { enumerable: true, get:
34032
34144
  Object.defineProperty(exports, "notificationSeverityLevel", { enumerable: true, get: function () { return neo4j_driver_core_1.notificationSeverityLevel; } });
34033
34145
  Object.defineProperty(exports, "notificationFilterDisabledCategory", { enumerable: true, get: function () { return neo4j_driver_core_1.notificationFilterDisabledCategory; } });
34034
34146
  Object.defineProperty(exports, "notificationFilterMinimumSeverityLevel", { enumerable: true, get: function () { return neo4j_driver_core_1.notificationFilterMinimumSeverityLevel; } });
34035
- Object.defineProperty(exports, "expirationBasedAuthTokenManager", { enumerable: true, get: function () { return neo4j_driver_core_1.expirationBasedAuthTokenManager; } });
34036
34147
  var neo4j_driver_bolt_connection_1 = lib;
34037
34148
  var session_rx_1 = __importDefault(sessionRx);
34038
34149
  exports.RxSession = session_rx_1.default;
@@ -34048,9 +34159,9 @@ function isAuthTokenManager(value) {
34048
34159
  return typeof value === 'object' &&
34049
34160
  value != null &&
34050
34161
  'getToken' in value &&
34051
- 'onTokenExpired' in value &&
34162
+ 'handleSecurityException' in value &&
34052
34163
  typeof value.getToken === 'function' &&
34053
- typeof value.onTokenExpired === 'function';
34164
+ typeof value.handleSecurityException === 'function';
34054
34165
  }
34055
34166
  function createAuthManager(authTokenOrManager) {
34056
34167
  if (isAuthTokenManager(authTokenOrManager)) {
@@ -34285,6 +34396,7 @@ exports.graph = graph;
34285
34396
  * @private
34286
34397
  */
34287
34398
  var forExport = {
34399
+ authTokenManagers: neo4j_driver_core_1.authTokenManagers,
34288
34400
  driver: driver,
34289
34401
  hasReachableServer: hasReachableServer,
34290
34402
  int: neo4j_driver_core_1.int,
@@ -34348,8 +34460,7 @@ var forExport = {
34348
34460
  notificationCategory: neo4j_driver_core_1.notificationCategory,
34349
34461
  notificationSeverityLevel: neo4j_driver_core_1.notificationSeverityLevel,
34350
34462
  notificationFilterDisabledCategory: neo4j_driver_core_1.notificationFilterDisabledCategory,
34351
- notificationFilterMinimumSeverityLevel: neo4j_driver_core_1.notificationFilterMinimumSeverityLevel,
34352
- expirationBasedAuthTokenManager: neo4j_driver_core_1.expirationBasedAuthTokenManager
34463
+ notificationFilterMinimumSeverityLevel: neo4j_driver_core_1.notificationFilterMinimumSeverityLevel
34353
34464
  };
34354
34465
  exports.default = forExport;
34355
34466
  }(lib$2));