neo4j-driver 5.4.0 → 5.5.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.
@@ -188,7 +188,7 @@ integer.toString = integer.toNumber = integer.inSafeRange = integer.isInt = inte
188
188
  // 64-bit Integer library, originally from Long.js by dcodeIO
189
189
  // https://github.com/dcodeIO/Long.js
190
190
  // License Apache 2
191
- var error_1$9 = error;
191
+ var error_1$b = error;
192
192
  /**
193
193
  * A cache of the Integer representations of small integer values.
194
194
  * @type {!Object}
@@ -652,7 +652,7 @@ var Integer = /** @class */ (function () {
652
652
  Integer.prototype.div = function (divisor) {
653
653
  var theDivisor = Integer.fromValue(divisor);
654
654
  if (theDivisor.isZero()) {
655
- throw (0, error_1$9.newError)('division by zero');
655
+ throw (0, error_1$b.newError)('division by zero');
656
656
  }
657
657
  if (this.isZero()) {
658
658
  return Integer.ZERO;
@@ -891,7 +891,7 @@ var Integer = /** @class */ (function () {
891
891
  Integer.fromString = function (str, radix, _a) {
892
892
  var _b = _a === void 0 ? {} : _a, strictStringValidation = _b.strictStringValidation;
893
893
  if (str.length === 0) {
894
- throw (0, error_1$9.newError)('number format error: empty string');
894
+ throw (0, error_1$b.newError)('number format error: empty string');
895
895
  }
896
896
  if (str === 'NaN' ||
897
897
  str === 'Infinity' ||
@@ -901,11 +901,11 @@ var Integer = /** @class */ (function () {
901
901
  }
902
902
  radix = radix !== null && radix !== void 0 ? radix : 10;
903
903
  if (radix < 2 || radix > 36) {
904
- throw (0, error_1$9.newError)('radix out of range: ' + radix.toString());
904
+ throw (0, error_1$b.newError)('radix out of range: ' + radix.toString());
905
905
  }
906
906
  var p;
907
907
  if ((p = str.indexOf('-')) > 0) {
908
- throw (0, error_1$9.newError)('number format error: interior "-" character: ' + str);
908
+ throw (0, error_1$b.newError)('number format error: interior "-" character: ' + str);
909
909
  }
910
910
  else if (p === 0) {
911
911
  return Integer.fromString(str.substring(1), radix).negate();
@@ -919,7 +919,7 @@ var Integer = /** @class */ (function () {
919
919
  var valueString = str.substring(i, i + size);
920
920
  var value = parseInt(valueString, radix);
921
921
  if (strictStringValidation === true && !_isValidNumberFromString(valueString, value, radix)) {
922
- throw (0, error_1$9.newError)("number format error: \"".concat(valueString, "\" is NaN in radix ").concat(radix, ": ").concat(str));
922
+ throw (0, error_1$b.newError)("number format error: \"".concat(valueString, "\" is NaN in radix ").concat(radix, ": ").concat(str));
923
923
  }
924
924
  if (size < 8) {
925
925
  var power = Integer.fromNumber(Math.pow(radix, size));
@@ -2124,7 +2124,7 @@ Object.defineProperty(temporalTypes, "__esModule", { value: true });
2124
2124
  temporalTypes.isDateTime = temporalTypes.DateTime = temporalTypes.isLocalDateTime = temporalTypes.LocalDateTime = temporalTypes.isDate = temporalTypes.Date = temporalTypes.isTime = temporalTypes.Time = temporalTypes.isLocalTime = temporalTypes.LocalTime = temporalTypes.isDuration = temporalTypes.Duration = void 0;
2125
2125
  var util$3 = __importStar$a(temporalUtil$1);
2126
2126
  var util_1$7 = util$4;
2127
- var error_1$8 = error;
2127
+ var error_1$a = error;
2128
2128
  var integer_1$2 = __importStar$a(integer);
2129
2129
  var IDENTIFIER_PROPERTY_ATTRIBUTES$1 = {
2130
2130
  value: true,
@@ -2650,7 +2650,7 @@ function verifyTimeZoneArguments(timeZoneOffsetSeconds, timeZoneId) {
2650
2650
  var offsetDefined = timeZoneOffsetSeconds !== null && timeZoneOffsetSeconds !== undefined;
2651
2651
  var idDefined = timeZoneId !== null && timeZoneId !== undefined && timeZoneId !== '';
2652
2652
  if (!offsetDefined && !idDefined) {
2653
- throw (0, error_1$8.newError)(
2653
+ throw (0, error_1$a.newError)(
2654
2654
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
2655
2655
  "Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: ".concat(timeZoneOffsetSeconds, " and id: ").concat(timeZoneId));
2656
2656
  }
@@ -3060,7 +3060,7 @@ var record = {};
3060
3060
  * See the License for the specific language governing permissions and
3061
3061
  * limitations under the License.
3062
3062
  */
3063
- var __generator$f = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
3063
+ var __generator$i = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
3064
3064
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
3065
3065
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
3066
3066
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -3115,7 +3115,7 @@ var __read$t = (commonjsGlobal && commonjsGlobal.__read) || function (o, n) {
3115
3115
  return ar;
3116
3116
  };
3117
3117
  Object.defineProperty(record, "__esModule", { value: true });
3118
- var error_1$7 = error;
3118
+ var error_1$9 = error;
3119
3119
  function generateFieldLookup(keys) {
3120
3120
  var lookup = {};
3121
3121
  keys.forEach(function (name, idx) {
@@ -3228,7 +3228,7 @@ var Record = /** @class */ (function () {
3228
3228
  */
3229
3229
  Record.prototype.entries = function () {
3230
3230
  var i;
3231
- return __generator$f(this, function (_a) {
3231
+ return __generator$i(this, function (_a) {
3232
3232
  switch (_a.label) {
3233
3233
  case 0:
3234
3234
  i = 0;
@@ -3254,7 +3254,7 @@ var Record = /** @class */ (function () {
3254
3254
  */
3255
3255
  Record.prototype.values = function () {
3256
3256
  var i;
3257
- return __generator$f(this, function (_a) {
3257
+ return __generator$i(this, function (_a) {
3258
3258
  switch (_a.label) {
3259
3259
  case 0:
3260
3260
  i = 0;
@@ -3280,7 +3280,7 @@ var Record = /** @class */ (function () {
3280
3280
  */
3281
3281
  Record.prototype[Symbol.iterator] = function () {
3282
3282
  var i;
3283
- return __generator$f(this, function (_a) {
3283
+ return __generator$i(this, function (_a) {
3284
3284
  switch (_a.label) {
3285
3285
  case 0:
3286
3286
  i = 0;
@@ -3333,7 +3333,7 @@ var Record = /** @class */ (function () {
3333
3333
  if (!(typeof key === 'number')) {
3334
3334
  index = this._fieldLookup[key];
3335
3335
  if (index === undefined) {
3336
- throw (0, error_1$7.newError)("This record has no field with key '".concat(key.toString(), "', available keys are: [") +
3336
+ throw (0, error_1$9.newError)("This record has no field with key '".concat(key.toString(), "', available keys are: [") +
3337
3337
  this.keys.toString() +
3338
3338
  '].');
3339
3339
  }
@@ -3342,7 +3342,7 @@ var Record = /** @class */ (function () {
3342
3342
  index = key;
3343
3343
  }
3344
3344
  if (index > this._fields.length - 1 || index < 0) {
3345
- throw (0, error_1$7.newError)("This record has no field with index '" +
3345
+ throw (0, error_1$9.newError)("This record has no field with index '" +
3346
3346
  index.toString() +
3347
3347
  "'. Remember that indexes start at `0`, " +
3348
3348
  'and make sure your query returns records in the shape you meant it to.');
@@ -4290,7 +4290,7 @@ var __extends$G = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
4290
4290
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4291
4291
  };
4292
4292
  })();
4293
- var __awaiter$c = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
4293
+ var __awaiter$f = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
4294
4294
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4295
4295
  return new (P || (P = Promise))(function (resolve, reject) {
4296
4296
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4299,7 +4299,7 @@ var __awaiter$c = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
4299
4299
  step((generator = generator.apply(thisArg, _arguments || [])).next());
4300
4300
  });
4301
4301
  };
4302
- var __generator$e = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
4302
+ var __generator$h = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
4303
4303
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
4304
4304
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
4305
4305
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -4328,7 +4328,7 @@ var __generator$e = (commonjsGlobal && commonjsGlobal.__generator) || function (
4328
4328
  };
4329
4329
  Object.defineProperty(connectionHolder$1, "__esModule", { value: true });
4330
4330
  connectionHolder$1.EMPTY_CONNECTION_HOLDER = connectionHolder$1.ReadOnlyConnectionHolder = connectionHolder$1.ConnectionHolder = void 0;
4331
- var error_1$6 = error;
4331
+ var error_1$8 = error;
4332
4332
  var util_1$5 = util$4;
4333
4333
  var constants_1$2 = constants$1;
4334
4334
  var bookmarks_1$3 = bookmarks$1;
@@ -4390,10 +4390,10 @@ var ConnectionHolder = /** @class */ (function () {
4390
4390
  return true;
4391
4391
  };
4392
4392
  ConnectionHolder.prototype._createConnectionPromise = function (connectionProvider) {
4393
- return __awaiter$c(this, void 0, void 0, function () {
4393
+ return __awaiter$f(this, void 0, void 0, function () {
4394
4394
  var _a, _b;
4395
4395
  var _c;
4396
- return __generator$e(this, function (_d) {
4396
+ return __generator$h(this, function (_d) {
4397
4397
  switch (_d.label) {
4398
4398
  case 0:
4399
4399
  _b = (_a = connectionProvider).acquireConnection;
@@ -4412,8 +4412,8 @@ var ConnectionHolder = /** @class */ (function () {
4412
4412
  });
4413
4413
  };
4414
4414
  ConnectionHolder.prototype._getBookmarks = function () {
4415
- return __awaiter$c(this, void 0, void 0, function () {
4416
- return __generator$e(this, function (_a) {
4415
+ return __awaiter$f(this, void 0, void 0, function () {
4416
+ return __generator$h(this, function (_a) {
4417
4417
  switch (_a.label) {
4418
4418
  case 0: return [4 /*yield*/, this._getConnectionAcquistionBookmarks()];
4419
4419
  case 1: return [2 /*return*/, _a.sent()];
@@ -4544,18 +4544,18 @@ var EmptyConnectionHolder = /** @class */ (function (_super) {
4544
4544
  return true;
4545
4545
  };
4546
4546
  EmptyConnectionHolder.prototype.getConnection = function () {
4547
- return __awaiter$c(this, void 0, void 0, function () {
4548
- return __generator$e(this, function (_a) {
4547
+ return __awaiter$f(this, void 0, void 0, function () {
4548
+ return __generator$h(this, function (_a) {
4549
4549
  switch (_a.label) {
4550
- case 0: return [4 /*yield*/, Promise.reject((0, error_1$6.newError)('This connection holder does not serve connections'))];
4550
+ case 0: return [4 /*yield*/, Promise.reject((0, error_1$8.newError)('This connection holder does not serve connections'))];
4551
4551
  case 1: return [2 /*return*/, _a.sent()];
4552
4552
  }
4553
4553
  });
4554
4554
  });
4555
4555
  };
4556
4556
  EmptyConnectionHolder.prototype.releaseConnection = function () {
4557
- return __awaiter$c(this, void 0, void 0, function () {
4558
- return __generator$e(this, function (_a) {
4557
+ return __awaiter$f(this, void 0, void 0, function () {
4558
+ return __generator$h(this, function (_a) {
4559
4559
  switch (_a.label) {
4560
4560
  case 0: return [4 /*yield*/, Promise.resolve(null)];
4561
4561
  case 1: return [2 /*return*/, _a.sent()];
@@ -4564,8 +4564,8 @@ var EmptyConnectionHolder = /** @class */ (function (_super) {
4564
4564
  });
4565
4565
  };
4566
4566
  EmptyConnectionHolder.prototype.close = function () {
4567
- return __awaiter$c(this, void 0, void 0, function () {
4568
- return __generator$e(this, function (_a) {
4567
+ return __awaiter$f(this, void 0, void 0, function () {
4568
+ return __generator$h(this, function (_a) {
4569
4569
  switch (_a.label) {
4570
4570
  case 0: return [4 /*yield*/, Promise.resolve(null)];
4571
4571
  case 1: return [2 /*return*/, _a.sent()];
@@ -4633,7 +4633,7 @@ var __importStar$7 = (commonjsGlobal && commonjsGlobal.__importStar) || function
4633
4633
  Object.defineProperty(txConfig$1, "__esModule", { value: true });
4634
4634
  txConfig$1.TxConfig = void 0;
4635
4635
  var util$1 = __importStar$7(util$4);
4636
- var error_1$5 = error;
4636
+ var error_1$7 = error;
4637
4637
  var integer_1 = integer;
4638
4638
  /**
4639
4639
  * Internal holder of the transaction configuration.
@@ -4677,7 +4677,7 @@ function extractTimeout(config) {
4677
4677
  util$1.assertNumberOrInteger(config.timeout, 'Transaction timeout');
4678
4678
  var timeout = (0, integer_1.int)(config.timeout);
4679
4679
  if (timeout.isNegative()) {
4680
- throw (0, error_1$5.newError)('Transaction timeout should not be negative');
4680
+ throw (0, error_1$7.newError)('Transaction timeout should not be negative');
4681
4681
  }
4682
4682
  return timeout;
4683
4683
  }
@@ -4724,7 +4724,7 @@ var transactionExecutor$1 = {};
4724
4724
  * limitations under the License.
4725
4725
  */
4726
4726
  /* eslint-disable @typescript-eslint/promise-function-async */
4727
- var __awaiter$b = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
4727
+ var __awaiter$e = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
4728
4728
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4729
4729
  return new (P || (P = Promise))(function (resolve, reject) {
4730
4730
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4733,7 +4733,7 @@ var __awaiter$b = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
4733
4733
  step((generator = generator.apply(thisArg, _arguments || [])).next());
4734
4734
  });
4735
4735
  };
4736
- var __generator$d = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
4736
+ var __generator$g = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
4737
4737
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
4738
4738
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
4739
4739
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -4762,7 +4762,7 @@ var __generator$d = (commonjsGlobal && commonjsGlobal.__generator) || function (
4762
4762
  };
4763
4763
  Object.defineProperty(transactionExecutor$1, "__esModule", { value: true });
4764
4764
  transactionExecutor$1.TransactionExecutor = void 0;
4765
- var error_1$4 = error;
4765
+ var error_1$6 = error;
4766
4766
  var DEFAULT_MAX_RETRY_TIME_MS$1 = 30 * 1000; // 30 seconds
4767
4767
  var DEFAULT_INITIAL_RETRY_DELAY_MS$1 = 1000; // 1 seconds
4768
4768
  var DEFAULT_RETRY_DELAY_MULTIPLIER$1 = 2.0;
@@ -4794,7 +4794,7 @@ var TransactionExecutor = /** @class */ (function () {
4794
4794
  TransactionExecutor.prototype._retryTransactionPromise = function (transactionCreator, transactionWork, error, retryStartTime, retryDelayMs, transactionWrapper) {
4795
4795
  var _this = this;
4796
4796
  var elapsedTimeMs = Date.now() - retryStartTime;
4797
- if (elapsedTimeMs > this._maxRetryTimeMs || !(0, error_1$4.isRetriableError)(error)) {
4797
+ if (elapsedTimeMs > this._maxRetryTimeMs || !(0, error_1$6.isRetriableError)(error)) {
4798
4798
  return Promise.reject(error);
4799
4799
  }
4800
4800
  return new Promise(function (resolve, reject) {
@@ -4812,10 +4812,10 @@ var TransactionExecutor = /** @class */ (function () {
4812
4812
  });
4813
4813
  };
4814
4814
  TransactionExecutor.prototype._executeTransactionInsidePromise = function (transactionCreator, transactionWork, resolve, reject, transactionWrapper) {
4815
- return __awaiter$b(this, void 0, void 0, function () {
4815
+ return __awaiter$e(this, void 0, void 0, function () {
4816
4816
  var tx, error_2, wrap, wrappedTx, resultPromise;
4817
4817
  var _this = this;
4818
- return __generator$d(this, function (_a) {
4818
+ return __generator$g(this, function (_a) {
4819
4819
  switch (_a.label) {
4820
4820
  case 0:
4821
4821
  _a.trys.push([0, 2, , 3]);
@@ -4897,16 +4897,16 @@ var TransactionExecutor = /** @class */ (function () {
4897
4897
  };
4898
4898
  TransactionExecutor.prototype._verifyAfterConstruction = function () {
4899
4899
  if (this._maxRetryTimeMs < 0) {
4900
- throw (0, error_1$4.newError)('Max retry time should be >= 0: ' + this._maxRetryTimeMs.toString());
4900
+ throw (0, error_1$6.newError)('Max retry time should be >= 0: ' + this._maxRetryTimeMs.toString());
4901
4901
  }
4902
4902
  if (this._initialRetryDelayMs < 0) {
4903
- throw (0, error_1$4.newError)('Initial retry delay should >= 0: ' + this._initialRetryDelayMs.toString());
4903
+ throw (0, error_1$6.newError)('Initial retry delay should >= 0: ' + this._initialRetryDelayMs.toString());
4904
4904
  }
4905
4905
  if (this._multiplier < 1.0) {
4906
- throw (0, error_1$4.newError)('Multiplier should be >= 1.0: ' + this._multiplier.toString());
4906
+ throw (0, error_1$6.newError)('Multiplier should be >= 1.0: ' + this._multiplier.toString());
4907
4907
  }
4908
4908
  if (this._jitterFactor < 0 || this._jitterFactor > 1) {
4909
- throw (0, error_1$4.newError)('Jitter factor should be in [0.0, 1.0]: ' + this._jitterFactor.toFixed());
4909
+ throw (0, error_1$6.newError)('Jitter factor should be in [0.0, 1.0]: ' + this._jitterFactor.toFixed());
4910
4910
  }
4911
4911
  };
4912
4912
  return TransactionExecutor;
@@ -4957,7 +4957,7 @@ logger$1.Logger = void 0;
4957
4957
  * See the License for the specific language governing permissions and
4958
4958
  * limitations under the License.
4959
4959
  */
4960
- var error_1$3 = error;
4960
+ var error_1$5 = error;
4961
4961
  var ERROR = 'error';
4962
4962
  var WARN = 'warn';
4963
4963
  var INFO = 'info';
@@ -5113,7 +5113,7 @@ function extractConfiguredLevel(loggingConfig) {
5113
5113
  var configuredLevel = loggingConfig.level;
5114
5114
  var value = levels[configuredLevel];
5115
5115
  if (value == null && value !== 0) {
5116
- throw (0, error_1$3.newError)("Illegal logging level: ".concat(configuredLevel, ". Supported levels are: ").concat(Object.keys(levels).toString()));
5116
+ throw (0, error_1$5.newError)("Illegal logging level: ".concat(configuredLevel, ". Supported levels are: ").concat(Object.keys(levels).toString()));
5117
5117
  }
5118
5118
  return configuredLevel;
5119
5119
  }
@@ -5132,7 +5132,7 @@ function extractConfiguredLogger(loggingConfig) {
5132
5132
  return configuredLogger;
5133
5133
  }
5134
5134
  }
5135
- throw (0, error_1$3.newError)("Illegal logger function: ".concat((_b = (_a = loggingConfig === null || loggingConfig === void 0 ? void 0 : loggingConfig.logger) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : 'undefined'));
5135
+ throw (0, error_1$5.newError)("Illegal logger function: ".concat((_b = (_a = loggingConfig === null || loggingConfig === void 0 ? void 0 : loggingConfig.logger) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : 'undefined'));
5136
5136
  }
5137
5137
 
5138
5138
  var urlUtil$2 = {};
@@ -5606,7 +5606,7 @@ var ConfiguredCustomResolver = /** @class */ (function () {
5606
5606
  }());
5607
5607
  configuredCustomResolver.default = ConfiguredCustomResolver;
5608
5608
 
5609
- var __importDefault$J = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
5609
+ var __importDefault$K = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
5610
5610
  return (mod && mod.__esModule) ? mod : { "default": mod };
5611
5611
  };
5612
5612
  Object.defineProperty(resolver$1, "__esModule", { value: true });
@@ -5629,9 +5629,9 @@ resolver$1.ConfiguredCustomResolver = resolver$1.BaseHostNameResolver = void 0;
5629
5629
  * See the License for the specific language governing permissions and
5630
5630
  * limitations under the License.
5631
5631
  */
5632
- var base_host_name_resolver_1 = __importDefault$J(baseHostNameResolver);
5632
+ var base_host_name_resolver_1 = __importDefault$K(baseHostNameResolver);
5633
5633
  resolver$1.BaseHostNameResolver = base_host_name_resolver_1.default;
5634
- var configured_custom_resolver_1$1 = __importDefault$J(configuredCustomResolver);
5634
+ var configured_custom_resolver_1$1 = __importDefault$K(configuredCustomResolver);
5635
5635
  resolver$1.ConfiguredCustomResolver = configured_custom_resolver_1$1.default;
5636
5636
 
5637
5637
  /**
@@ -5722,7 +5722,7 @@ internal.objectUtil = objectUtil$1;
5722
5722
  * See the License for the specific language governing permissions and
5723
5723
  * limitations under the License.
5724
5724
  */
5725
- var __awaiter$a = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
5725
+ var __awaiter$d = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
5726
5726
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5727
5727
  return new (P || (P = Promise))(function (resolve, reject) {
5728
5728
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -5731,7 +5731,7 @@ var __awaiter$a = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
5731
5731
  step((generator = generator.apply(thisArg, _arguments || [])).next());
5732
5732
  });
5733
5733
  };
5734
- var __generator$c = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
5734
+ var __generator$f = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
5735
5735
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
5736
5736
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
5737
5737
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -5758,14 +5758,14 @@ var __generator$c = (commonjsGlobal && commonjsGlobal.__generator) || function (
5758
5758
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
5759
5759
  }
5760
5760
  };
5761
- var __importDefault$I = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
5761
+ var __importDefault$J = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
5762
5762
  return (mod && mod.__esModule) ? mod : { "default": mod };
5763
5763
  };
5764
5764
  Object.defineProperty(result, "__esModule", { value: true });
5765
5765
  /* eslint-disable @typescript-eslint/promise-function-async */
5766
- var result_summary_1 = __importDefault$I(resultSummary);
5766
+ var result_summary_1 = __importDefault$J(resultSummary);
5767
5767
  var internal_1 = internal;
5768
- var error_1$2 = error;
5768
+ var error_1$4 = error;
5769
5769
  var EMPTY_CONNECTION_HOLDER = internal_1.connectionHolder.EMPTY_CONNECTION_HOLDER;
5770
5770
  /**
5771
5771
  * @private
@@ -5913,7 +5913,7 @@ var Result = /** @class */ (function () {
5913
5913
  Result.prototype[Symbol.asyncIterator] = function () {
5914
5914
  var _this = this;
5915
5915
  if (!this.isOpen()) {
5916
- var error_2 = (0, error_1$2.newError)('Result is already consumed');
5916
+ var error_2 = (0, error_1$4.newError)('Result is already consumed');
5917
5917
  return {
5918
5918
  next: function () { return Promise.reject(error_2); },
5919
5919
  peek: function () { return Promise.reject(error_2); }
@@ -5938,9 +5938,9 @@ var Result = /** @class */ (function () {
5938
5938
  state.streaming.resume();
5939
5939
  }
5940
5940
  };
5941
- var initializeObserver = function () { return __awaiter$a(_this, void 0, void 0, function () {
5941
+ var initializeObserver = function () { return __awaiter$d(_this, void 0, void 0, function () {
5942
5942
  var _a;
5943
- return __generator$c(this, function (_b) {
5943
+ return __generator$f(this, function (_b) {
5944
5944
  switch (_b.label) {
5945
5945
  case 0:
5946
5946
  if (!(state.queuedObserver === undefined)) return [3 /*break*/, 2];
@@ -5957,14 +5957,14 @@ var Result = /** @class */ (function () {
5957
5957
  }); };
5958
5958
  var assertSummary = function (summary) {
5959
5959
  if (summary === undefined) {
5960
- throw (0, error_1$2.newError)('InvalidState: Result stream finished without Summary', error_1$2.PROTOCOL_ERROR);
5960
+ throw (0, error_1$4.newError)('InvalidState: Result stream finished without Summary', error_1$4.PROTOCOL_ERROR);
5961
5961
  }
5962
5962
  return true;
5963
5963
  };
5964
5964
  return {
5965
- next: function () { return __awaiter$a(_this, void 0, void 0, function () {
5965
+ next: function () { return __awaiter$d(_this, void 0, void 0, function () {
5966
5966
  var queuedObserver, next;
5967
- return __generator$c(this, function (_a) {
5967
+ return __generator$f(this, function (_a) {
5968
5968
  switch (_a.label) {
5969
5969
  case 0:
5970
5970
  if (state.finished) {
@@ -5986,10 +5986,10 @@ var Result = /** @class */ (function () {
5986
5986
  }
5987
5987
  });
5988
5988
  }); },
5989
- return: function (value) { return __awaiter$a(_this, void 0, void 0, function () {
5989
+ return: function (value) { return __awaiter$d(_this, void 0, void 0, function () {
5990
5990
  var queuedObserver, last;
5991
5991
  var _a;
5992
- return __generator$c(this, function (_b) {
5992
+ return __generator$f(this, function (_b) {
5993
5993
  switch (_b.label) {
5994
5994
  case 0:
5995
5995
  if (state.finished) {
@@ -6011,9 +6011,9 @@ var Result = /** @class */ (function () {
6011
6011
  }
6012
6012
  });
6013
6013
  }); },
6014
- peek: function () { return __awaiter$a(_this, void 0, void 0, function () {
6014
+ peek: function () { return __awaiter$d(_this, void 0, void 0, function () {
6015
6015
  var queuedObserver;
6016
- return __generator$c(this, function (_a) {
6016
+ return __generator$f(this, function (_a) {
6017
6017
  switch (_a.label) {
6018
6018
  case 0:
6019
6019
  if (state.finished) {
@@ -6205,13 +6205,13 @@ var Result = /** @class */ (function () {
6205
6205
  }
6206
6206
  function dequeue() {
6207
6207
  var _a;
6208
- return __awaiter$a(this, void 0, void 0, function () {
6208
+ return __awaiter$d(this, void 0, void 0, function () {
6209
6209
  var element;
6210
- return __generator$c(this, function (_b) {
6210
+ return __generator$f(this, function (_b) {
6211
6211
  switch (_b.label) {
6212
6212
  case 0:
6213
6213
  if (buffer.length > 0) {
6214
- element = (_a = buffer.shift()) !== null && _a !== void 0 ? _a : (0, error_1$2.newError)('Unexpected empty buffer', error_1$2.PROTOCOL_ERROR);
6214
+ element = (_a = buffer.shift()) !== null && _a !== void 0 ? _a : (0, error_1$4.newError)('Unexpected empty buffer', error_1$4.PROTOCOL_ERROR);
6215
6215
  onQueueSizeChanged();
6216
6216
  if (isError(element)) {
6217
6217
  throw element;
@@ -6254,9 +6254,9 @@ var Result = /** @class */ (function () {
6254
6254
  }
6255
6255
  },
6256
6256
  dequeue: dequeue,
6257
- dequeueUntilDone: function () { return __awaiter$a(_this, void 0, void 0, function () {
6257
+ dequeueUntilDone: function () { return __awaiter$d(_this, void 0, void 0, function () {
6258
6258
  var element;
6259
- return __generator$c(this, function (_a) {
6259
+ return __generator$f(this, function (_a) {
6260
6260
  switch (_a.label) {
6261
6261
  case 0:
6262
6262
  return [4 /*yield*/, dequeue()];
@@ -6270,9 +6270,9 @@ var Result = /** @class */ (function () {
6270
6270
  }
6271
6271
  });
6272
6272
  }); },
6273
- head: function () { return __awaiter$a(_this, void 0, void 0, function () {
6273
+ head: function () { return __awaiter$d(_this, void 0, void 0, function () {
6274
6274
  var element, element, error_3;
6275
- return __generator$c(this, function (_a) {
6275
+ return __generator$f(this, function (_a) {
6276
6276
  switch (_a.label) {
6277
6277
  case 0:
6278
6278
  if (buffer.length > 0) {
@@ -6333,6 +6333,59 @@ function replaceStacktrace(error, newStack) {
6333
6333
  }
6334
6334
  result.default = Result;
6335
6335
 
6336
+ var resultEager = {};
6337
+
6338
+ /**
6339
+ * Copyright (c) "Neo4j"
6340
+ * Neo4j Sweden AB [http://neo4j.com]
6341
+ *
6342
+ * This file is part of Neo4j.
6343
+ *
6344
+ * Licensed under the Apache License, Version 2.0 (the "License");
6345
+ * you may not use this file except in compliance with the License.
6346
+ * You may obtain a copy of the License at
6347
+ *
6348
+ * http://www.apache.org/licenses/LICENSE-2.0
6349
+ *
6350
+ * Unless required by applicable law or agreed to in writing, software
6351
+ * distributed under the License is distributed on an "AS IS" BASIS,
6352
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6353
+ * See the License for the specific language governing permissions and
6354
+ * limitations under the License.
6355
+ */
6356
+ Object.defineProperty(resultEager, "__esModule", { value: true });
6357
+ /**
6358
+ * Represents the fully streamed result
6359
+ */
6360
+ var EagerResult = /** @class */ (function () {
6361
+ /**
6362
+ * @constructor
6363
+ * @private
6364
+ * @param {string[]} keys The records keys
6365
+ * @param {Record[]} records The resulted records
6366
+ * @param {ResultSummary[]} summary The result Summary
6367
+ */
6368
+ function EagerResult(keys, records, summary) {
6369
+ /**
6370
+ * Field keys, in the order the fields appear in the records.
6371
+ * @type {string[]}
6372
+ */
6373
+ this.keys = keys;
6374
+ /**
6375
+ * Field records, in the order the records arrived from the server.
6376
+ * @type {Record[]}
6377
+ */
6378
+ this.records = records;
6379
+ /**
6380
+ * Field summary
6381
+ * @type {ResultSummary}
6382
+ */
6383
+ this.summary = summary;
6384
+ }
6385
+ return EagerResult;
6386
+ }());
6387
+ resultEager.default = EagerResult;
6388
+
6336
6389
  var connectionProvider$1 = {};
6337
6390
 
6338
6391
  /**
@@ -6378,6 +6431,7 @@ var ConnectionProvider = /** @class */ (function () {
6378
6431
  * @property {Bookmarks} param.bookmarks - the bookmarks to send to routing discovery
6379
6432
  * @property {string} param.impersonatedUser - the impersonated user
6380
6433
  * @property {function (databaseName:string?)} param.onDatabaseNameResolved - Callback called when the database name get resolved
6434
+ * @returns {Promise<Connection>}
6381
6435
  */
6382
6436
  ConnectionProvider.prototype.acquireConnection = function (param) {
6383
6437
  throw Error('Not implemented');
@@ -6598,7 +6652,7 @@ var transaction = {};
6598
6652
  * See the License for the specific language governing permissions and
6599
6653
  * limitations under the License.
6600
6654
  */
6601
- var __awaiter$9 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
6655
+ var __awaiter$c = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
6602
6656
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6603
6657
  return new (P || (P = Promise))(function (resolve, reject) {
6604
6658
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6607,7 +6661,7 @@ var __awaiter$9 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
6607
6661
  step((generator = generator.apply(thisArg, _arguments || [])).next());
6608
6662
  });
6609
6663
  };
6610
- var __generator$b = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
6664
+ var __generator$e = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
6611
6665
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
6612
6666
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
6613
6667
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -6634,7 +6688,7 @@ var __generator$b = (commonjsGlobal && commonjsGlobal.__generator) || function (
6634
6688
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
6635
6689
  }
6636
6690
  };
6637
- var __importDefault$H = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
6691
+ var __importDefault$I = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
6638
6692
  return (mod && mod.__esModule) ? mod : { "default": mod };
6639
6693
  };
6640
6694
  Object.defineProperty(transaction, "__esModule", { value: true });
@@ -6644,8 +6698,8 @@ var connection_holder_1$1 = connectionHolder$1;
6644
6698
  var bookmarks_1$2 = bookmarks$1;
6645
6699
  var tx_config_1$1 = txConfig$1;
6646
6700
  var observers_1$1 = observers;
6647
- var error_1$1 = error;
6648
- var result_1$1 = __importDefault$H(result);
6701
+ var error_1$3 = error;
6702
+ var result_1$1 = __importDefault$I(result);
6649
6703
  /**
6650
6704
  * Represents a transaction in the Neo4j database.
6651
6705
  *
@@ -6697,10 +6751,10 @@ var Transaction = /** @class */ (function () {
6697
6751
  var _this = this;
6698
6752
  this._connectionHolder
6699
6753
  .getConnection()
6700
- .then(function (connection) { return __awaiter$9(_this, void 0, void 0, function () {
6754
+ .then(function (connection) { return __awaiter$c(_this, void 0, void 0, function () {
6701
6755
  var _a;
6702
6756
  var _this = this;
6703
- return __generator$b(this, function (_b) {
6757
+ return __generator$e(this, function (_b) {
6704
6758
  switch (_b.label) {
6705
6759
  case 0:
6706
6760
  this._onConnection();
@@ -6728,7 +6782,7 @@ var Transaction = /** @class */ (function () {
6728
6782
  return _this._onComplete(metadata);
6729
6783
  }
6730
6784
  })];
6731
- case 2: throw (0, error_1$1.newError)('No connection available');
6785
+ case 2: throw (0, error_1$3.newError)('No connection available');
6732
6786
  }
6733
6787
  });
6734
6788
  }); })
@@ -6836,8 +6890,8 @@ var Transaction = /** @class */ (function () {
6836
6890
  * @returns {Promise<void>} An empty promise if closed successfully or error if any error happened during
6837
6891
  */
6838
6892
  Transaction.prototype.close = function () {
6839
- return __awaiter$9(this, void 0, void 0, function () {
6840
- return __generator$b(this, function (_a) {
6893
+ return __awaiter$c(this, void 0, void 0, function () {
6894
+ return __generator$e(this, function (_a) {
6841
6895
  switch (_a.label) {
6842
6896
  case 0:
6843
6897
  if (!this.isOpen()) return [3 /*break*/, 2];
@@ -6908,7 +6962,7 @@ var _states$1 = {
6908
6962
  });
6909
6963
  }
6910
6964
  else {
6911
- throw (0, error_1$1.newError)('No connection available');
6965
+ throw (0, error_1$3.newError)('No connection available');
6912
6966
  }
6913
6967
  })
6914
6968
  .catch(function (error) { return new observers_1$1.FailedObserver({ error: error, onError: onError }); });
@@ -6922,7 +6976,7 @@ var _states$1 = {
6922
6976
  var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
6923
6977
  return {
6924
6978
  result: newCompletedResult(new observers_1$1.FailedObserver({
6925
- error: (0, error_1$1.newError)('Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination.'),
6979
+ error: (0, error_1$3.newError)('Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination.'),
6926
6980
  onError: onError
6927
6981
  }), 'COMMIT', {}, connectionHolder, 0, // high watermark
6928
6982
  0 // low watermark
@@ -6942,7 +6996,7 @@ var _states$1 = {
6942
6996
  run: function (query, parameters, _a) {
6943
6997
  var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
6944
6998
  return newCompletedResult(new observers_1$1.FailedObserver({
6945
- error: (0, error_1$1.newError)('Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination.'),
6999
+ error: (0, error_1$3.newError)('Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination.'),
6946
7000
  onError: onError
6947
7001
  }), query, parameters, connectionHolder, 0, // high watermark
6948
7002
  0 // low watermark
@@ -6955,7 +7009,7 @@ var _states$1 = {
6955
7009
  var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
6956
7010
  return {
6957
7011
  result: newCompletedResult(new observers_1$1.FailedObserver({
6958
- error: (0, error_1$1.newError)('Cannot commit this transaction, because it has already been committed.'),
7012
+ error: (0, error_1$3.newError)('Cannot commit this transaction, because it has already been committed.'),
6959
7013
  onError: onError
6960
7014
  }), 'COMMIT', {}, connection_holder_1$1.EMPTY_CONNECTION_HOLDER, 0, // high watermark
6961
7015
  0 // low watermark
@@ -6968,7 +7022,7 @@ var _states$1 = {
6968
7022
  var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
6969
7023
  return {
6970
7024
  result: newCompletedResult(new observers_1$1.FailedObserver({
6971
- error: (0, error_1$1.newError)('Cannot rollback this transaction, because it has already been committed.'),
7025
+ error: (0, error_1$3.newError)('Cannot rollback this transaction, because it has already been committed.'),
6972
7026
  onError: onError
6973
7027
  }), 'ROLLBACK', {}, connection_holder_1$1.EMPTY_CONNECTION_HOLDER, 0, // high watermark
6974
7028
  0 // low watermark
@@ -6980,7 +7034,7 @@ var _states$1 = {
6980
7034
  run: function (query, parameters, _a) {
6981
7035
  var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
6982
7036
  return newCompletedResult(new observers_1$1.FailedObserver({
6983
- error: (0, error_1$1.newError)('Cannot run query in this transaction, because it has already been committed.'),
7037
+ error: (0, error_1$3.newError)('Cannot run query in this transaction, because it has already been committed.'),
6984
7038
  onError: onError
6985
7039
  }), query, parameters, connectionHolder, 0, // high watermark
6986
7040
  0 // low watermark
@@ -6993,7 +7047,7 @@ var _states$1 = {
6993
7047
  var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
6994
7048
  return {
6995
7049
  result: newCompletedResult(new observers_1$1.FailedObserver({
6996
- error: (0, error_1$1.newError)('Cannot commit this transaction, because it has already been rolled back.'),
7050
+ error: (0, error_1$3.newError)('Cannot commit this transaction, because it has already been rolled back.'),
6997
7051
  onError: onError
6998
7052
  }), 'COMMIT', {}, connectionHolder, 0, // high watermark
6999
7053
  0 // low watermark
@@ -7005,7 +7059,7 @@ var _states$1 = {
7005
7059
  var connectionHolder = _a.connectionHolder; _a.onError; _a.onComplete;
7006
7060
  return {
7007
7061
  result: newCompletedResult(new observers_1$1.FailedObserver({
7008
- error: (0, error_1$1.newError)('Cannot rollback this transaction, because it has already been rolled back.')
7062
+ error: (0, error_1$3.newError)('Cannot rollback this transaction, because it has already been rolled back.')
7009
7063
  }), 'ROLLBACK', {}, connectionHolder, 0, // high watermark
7010
7064
  0 // low watermark
7011
7065
  ),
@@ -7015,7 +7069,7 @@ var _states$1 = {
7015
7069
  run: function (query, parameters, _a) {
7016
7070
  var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
7017
7071
  return newCompletedResult(new observers_1$1.FailedObserver({
7018
- error: (0, error_1$1.newError)('Cannot run query in this transaction, because it has already been rolled back.'),
7072
+ error: (0, error_1$3.newError)('Cannot run query in this transaction, because it has already been rolled back.'),
7019
7073
  onError: onError
7020
7074
  }), query, parameters, connectionHolder, 0, // high watermark
7021
7075
  0 // low watermark
@@ -7055,7 +7109,7 @@ function finishTransaction(commit, connectionHolder, onError, onComplete, onConn
7055
7109
  }
7056
7110
  }
7057
7111
  else {
7058
- throw (0, error_1$1.newError)('No connection available');
7112
+ throw (0, error_1$3.newError)('No connection available');
7059
7113
  }
7060
7114
  });
7061
7115
  })
@@ -7195,13 +7249,13 @@ var __assign$d = (commonjsGlobal && commonjsGlobal.__assign) || function () {
7195
7249
  };
7196
7250
  return __assign$d.apply(this, arguments);
7197
7251
  };
7198
- var __importDefault$G = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
7252
+ var __importDefault$H = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
7199
7253
  return (mod && mod.__esModule) ? mod : { "default": mod };
7200
7254
  };
7201
7255
  var _a$c;
7202
7256
  Object.defineProperty(transactionPromise, "__esModule", { value: true });
7203
7257
  /* eslint-disable @typescript-eslint/promise-function-async */
7204
- var transaction_1 = __importDefault$G(transaction);
7258
+ var transaction_1 = __importDefault$H(transaction);
7205
7259
  /**
7206
7260
  * Represents a {@link Promise<Transaction>} object and a {@link Transaction} object.
7207
7261
  *
@@ -7345,7 +7399,7 @@ var session = {};
7345
7399
  * See the License for the specific language governing permissions and
7346
7400
  * limitations under the License.
7347
7401
  */
7348
- var __awaiter$8 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
7402
+ var __awaiter$b = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
7349
7403
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7350
7404
  return new (P || (P = Promise))(function (resolve, reject) {
7351
7405
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7354,7 +7408,7 @@ var __awaiter$8 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
7354
7408
  step((generator = generator.apply(thisArg, _arguments || [])).next());
7355
7409
  });
7356
7410
  };
7357
- var __generator$a = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
7411
+ var __generator$d = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
7358
7412
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
7359
7413
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
7360
7414
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -7406,7 +7460,7 @@ var __spreadArray$k = (commonjsGlobal && commonjsGlobal.__spreadArray) || functi
7406
7460
  }
7407
7461
  return to.concat(ar || Array.prototype.slice.call(from));
7408
7462
  };
7409
- var __importDefault$F = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
7463
+ var __importDefault$G = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
7410
7464
  return (mod && mod.__esModule) ? mod : { "default": mod };
7411
7465
  };
7412
7466
  Object.defineProperty(session, "__esModule", { value: true });
@@ -7414,14 +7468,14 @@ Object.defineProperty(session, "__esModule", { value: true });
7414
7468
  var observers_1 = observers;
7415
7469
  var util_1$1 = util$4;
7416
7470
  var constants_1$1 = constants$1;
7417
- var error_1 = error;
7418
- var result_1 = __importDefault$F(result);
7471
+ var error_1$2 = error;
7472
+ var result_1 = __importDefault$G(result);
7419
7473
  var connection_holder_1 = connectionHolder$1;
7420
7474
  var transaction_executor_1 = transactionExecutor$1;
7421
7475
  var bookmarks_1$1 = bookmarks$1;
7422
7476
  var tx_config_1 = txConfig$1;
7423
- var transaction_promise_1 = __importDefault$F(transactionPromise);
7424
- var transaction_managed_1 = __importDefault$F(transactionManaged);
7477
+ var transaction_promise_1 = __importDefault$G(transactionPromise);
7478
+ var transaction_managed_1 = __importDefault$G(transactionManaged);
7425
7479
  /**
7426
7480
  * A Session instance is used for handling the connection and
7427
7481
  * sending queries through the connection.
@@ -7499,10 +7553,10 @@ var Session = /** @class */ (function () {
7499
7553
  var autoCommitTxConfig = (transactionConfig != null)
7500
7554
  ? new tx_config_1.TxConfig(transactionConfig)
7501
7555
  : tx_config_1.TxConfig.empty();
7502
- var result = this._run(validatedQuery, params, function (connection) { return __awaiter$8(_this, void 0, void 0, function () {
7556
+ var result = this._run(validatedQuery, params, function (connection) { return __awaiter$b(_this, void 0, void 0, function () {
7503
7557
  var bookmarks;
7504
7558
  var _this = this;
7505
- return __generator$a(this, function (_a) {
7559
+ return __generator$d(this, function (_a) {
7506
7560
  switch (_a.label) {
7507
7561
  case 0: return [4 /*yield*/, this._bookmarks()];
7508
7562
  case 1:
@@ -7531,7 +7585,7 @@ var Session = /** @class */ (function () {
7531
7585
  var observerPromise;
7532
7586
  if (!this._open) {
7533
7587
  observerPromise = Promise.resolve(new observers_1.FailedObserver({
7534
- error: (0, error_1.newError)('Cannot run query in a closed session.')
7588
+ error: (0, error_1$2.newError)('Cannot run query in a closed session.')
7535
7589
  }));
7536
7590
  }
7537
7591
  else if (!this._hasTx && connectionHolder.initializeConnection()) {
@@ -7542,7 +7596,7 @@ var Session = /** @class */ (function () {
7542
7596
  }
7543
7597
  else {
7544
7598
  observerPromise = Promise.resolve(new observers_1.FailedObserver({
7545
- error: (0, error_1.newError)('Queries cannot be run directly on a ' +
7599
+ error: (0, error_1$2.newError)('Queries cannot be run directly on a ' +
7546
7600
  'session with an open transaction; either run from within the ' +
7547
7601
  'transaction or use a different session.')
7548
7602
  }));
@@ -7555,14 +7609,14 @@ var Session = /** @class */ (function () {
7555
7609
  var promise;
7556
7610
  var connectionHolder = this._connectionHolderWithMode(this._mode);
7557
7611
  if (!this._open) {
7558
- promise = Promise.reject((0, error_1.newError)('Cannot run query in a closed session.'));
7612
+ promise = Promise.reject((0, error_1$2.newError)('Cannot run query in a closed session.'));
7559
7613
  }
7560
7614
  else if (!this._hasTx && connectionHolder.initializeConnection()) {
7561
7615
  promise = connectionHolder
7562
7616
  .getConnection()
7563
7617
  .then(function (connection) { return connectionConsumer(connection); })
7564
- .then(function (result) { return __awaiter$8(_this, void 0, void 0, function () {
7565
- return __generator$a(this, function (_a) {
7618
+ .then(function (result) { return __awaiter$b(_this, void 0, void 0, function () {
7619
+ return __generator$d(this, function (_a) {
7566
7620
  switch (_a.label) {
7567
7621
  case 0: return [4 /*yield*/, connectionHolder.releaseConnection()];
7568
7622
  case 1:
@@ -7573,7 +7627,7 @@ var Session = /** @class */ (function () {
7573
7627
  }); });
7574
7628
  }
7575
7629
  else {
7576
- promise = Promise.reject((0, error_1.newError)('Queries cannot be run directly on a ' +
7630
+ promise = Promise.reject((0, error_1$2.newError)('Queries cannot be run directly on a ' +
7577
7631
  'session with an open transaction; either run from within the ' +
7578
7632
  'transaction or use a different session.'));
7579
7633
  }
@@ -7602,10 +7656,10 @@ var Session = /** @class */ (function () {
7602
7656
  Session.prototype._beginTransaction = function (accessMode, txConfig) {
7603
7657
  var _this = this;
7604
7658
  if (!this._open) {
7605
- throw (0, error_1.newError)('Cannot begin a transaction on a closed session.');
7659
+ throw (0, error_1$2.newError)('Cannot begin a transaction on a closed session.');
7606
7660
  }
7607
7661
  if (this._hasTx) {
7608
- throw (0, error_1.newError)('You cannot begin a transaction on a session with an open transaction; ' +
7662
+ throw (0, error_1$2.newError)('You cannot begin a transaction on a session with an open transaction; ' +
7609
7663
  'either run from within the transaction or use a different session.');
7610
7664
  }
7611
7665
  var mode = Session._validateSessionMode(accessMode);
@@ -7632,7 +7686,7 @@ var Session = /** @class */ (function () {
7632
7686
  */
7633
7687
  Session.prototype._assertSessionIsOpen = function () {
7634
7688
  if (!this._open) {
7635
- throw (0, error_1.newError)('You cannot run more transactions on a closed session.');
7689
+ throw (0, error_1$2.newError)('You cannot run more transactions on a closed session.');
7636
7690
  }
7637
7691
  };
7638
7692
  /**
@@ -7663,9 +7717,9 @@ var Session = /** @class */ (function () {
7663
7717
  };
7664
7718
  Session.prototype._bookmarks = function () {
7665
7719
  var _a;
7666
- return __awaiter$8(this, void 0, void 0, function () {
7720
+ return __awaiter$b(this, void 0, void 0, function () {
7667
7721
  var bookmarks;
7668
- return __generator$a(this, function (_b) {
7722
+ return __generator$d(this, function (_b) {
7669
7723
  switch (_b.label) {
7670
7724
  case 0: return [4 /*yield*/, ((_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.getBookmarks())];
7671
7725
  case 1:
@@ -7788,9 +7842,9 @@ var Session = /** @class */ (function () {
7788
7842
  };
7789
7843
  Session.prototype._getConnectionAcquistionBookmarks = function () {
7790
7844
  var _a;
7791
- return __awaiter$8(this, void 0, void 0, function () {
7845
+ return __awaiter$b(this, void 0, void 0, function () {
7792
7846
  var bookmarks;
7793
- return __generator$a(this, function (_b) {
7847
+ return __generator$d(this, function (_b) {
7794
7848
  switch (_b.label) {
7795
7849
  case 0: return [4 /*yield*/, ((_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.getBookmarks())];
7796
7850
  case 1:
@@ -7822,8 +7876,8 @@ var Session = /** @class */ (function () {
7822
7876
  * @return {Promise}
7823
7877
  */
7824
7878
  Session.prototype.close = function () {
7825
- return __awaiter$8(this, void 0, void 0, function () {
7826
- return __generator$a(this, function (_a) {
7879
+ return __awaiter$b(this, void 0, void 0, function () {
7880
+ return __generator$d(this, function (_a) {
7827
7881
  switch (_a.label) {
7828
7882
  case 0:
7829
7883
  if (!this._open) return [3 /*break*/, 3];
@@ -7850,7 +7904,7 @@ var Session = /** @class */ (function () {
7850
7904
  return this._writeConnectionHolder;
7851
7905
  }
7852
7906
  else {
7853
- throw (0, error_1.newError)('Unknown access mode: ' + mode);
7907
+ throw (0, error_1$2.newError)('Unknown access mode: ' + mode);
7854
7908
  }
7855
7909
  };
7856
7910
  /**
@@ -7883,7 +7937,7 @@ var Session = /** @class */ (function () {
7883
7937
  Session._validateSessionMode = function (rawMode) {
7884
7938
  var mode = rawMode !== null && rawMode !== void 0 ? rawMode : constants_1$1.ACCESS_MODE_WRITE;
7885
7939
  if (mode !== constants_1$1.ACCESS_MODE_READ && mode !== constants_1$1.ACCESS_MODE_WRITE) {
7886
- throw (0, error_1.newError)('Illegal session mode ' + mode);
7940
+ throw (0, error_1$2.newError)('Illegal session mode ' + mode);
7887
7941
  }
7888
7942
  return mode;
7889
7943
  };
@@ -7903,73 +7957,702 @@ session.default = Session;
7903
7957
 
7904
7958
  var driver = {};
7905
7959
 
7906
- var __importDefault$E = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
7907
- return (mod && mod.__esModule) ? mod : { "default": mod };
7908
- };
7909
- Object.defineProperty(driver, "__esModule", { value: true });
7910
- driver.SessionConfig = driver.WRITE = driver.READ = driver.Driver = void 0;
7911
- var bookmarks_1 = bookmarks$1;
7912
- var configured_custom_resolver_1 = __importDefault$E(configuredCustomResolver);
7913
- var constants_1 = constants$1;
7914
- var logger_1 = logger$1;
7915
- var session_1 = __importDefault$E(session);
7916
- var util_1 = util$4;
7917
- var DEFAULT_MAX_CONNECTION_LIFETIME = 60 * 60 * 1000; // 1 hour
7918
- /**
7919
- * The default record fetch size. This is used in Bolt V4 protocol to pull query execution result in batches.
7920
- * @type {number}
7921
- */
7922
- var DEFAULT_FETCH_SIZE = 1000;
7923
- /**
7924
- * Constant that represents read session access mode.
7925
- * Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.READ })`.
7926
- * @type {string}
7927
- */
7928
- var READ$3 = constants_1.ACCESS_MODE_READ;
7929
- driver.READ = READ$3;
7960
+ var bookmarkManager$1 = {};
7961
+
7930
7962
  /**
7931
- * Constant that represents write session access mode.
7932
- * Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.WRITE })`.
7933
- * @type {string}
7963
+ * Copyright (c) "Neo4j"
7964
+ * Neo4j Sweden AB [http://neo4j.com]
7965
+ *
7966
+ * This file is part of Neo4j.
7967
+ *
7968
+ * Licensed under the Apache License, Version 2.0 (the "License");
7969
+ * you may not use this file except in compliance with the License.
7970
+ * You may obtain a copy of the License at
7971
+ *
7972
+ * http://www.apache.org/licenses/LICENSE-2.0
7973
+ *
7974
+ * Unless required by applicable law or agreed to in writing, software
7975
+ * distributed under the License is distributed on an "AS IS" BASIS,
7976
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7977
+ * See the License for the specific language governing permissions and
7978
+ * limitations under the License.
7934
7979
  */
7935
- var WRITE$3 = constants_1.ACCESS_MODE_WRITE;
7936
- driver.WRITE = WRITE$3;
7937
- var idGenerator$1 = 0;
7980
+ var __awaiter$a = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
7981
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7982
+ return new (P || (P = Promise))(function (resolve, reject) {
7983
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7984
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7985
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7986
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
7987
+ });
7988
+ };
7989
+ var __generator$c = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
7990
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
7991
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
7992
+ function verb(n) { return function (v) { return step([n, v]); }; }
7993
+ function step(op) {
7994
+ if (f) throw new TypeError("Generator is already executing.");
7995
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
7996
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
7997
+ if (y = 0, t) op = [op[0] & 2, t.value];
7998
+ switch (op[0]) {
7999
+ case 0: case 1: t = op; break;
8000
+ case 4: _.label++; return { value: op[1], done: false };
8001
+ case 5: _.label++; y = op[1]; op = [0]; continue;
8002
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
8003
+ default:
8004
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8005
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8006
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8007
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8008
+ if (t[2]) _.ops.pop();
8009
+ _.trys.pop(); continue;
8010
+ }
8011
+ op = body.call(thisArg, _);
8012
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8013
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8014
+ }
8015
+ };
8016
+ var __values$a = (commonjsGlobal && commonjsGlobal.__values) || function(o) {
8017
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
8018
+ if (m) return m.call(o);
8019
+ if (o && typeof o.length === "number") return {
8020
+ next: function () {
8021
+ if (o && i >= o.length) o = void 0;
8022
+ return { value: o && o[i++], done: !o };
8023
+ }
8024
+ };
8025
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
8026
+ };
8027
+ var __read$p = (commonjsGlobal && commonjsGlobal.__read) || function (o, n) {
8028
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
8029
+ if (!m) return o;
8030
+ var i = m.call(o), r, ar = [], e;
8031
+ try {
8032
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8033
+ }
8034
+ catch (error) { e = { error: error }; }
8035
+ finally {
8036
+ try {
8037
+ if (r && !r.done && (m = i["return"])) m.call(i);
8038
+ }
8039
+ finally { if (e) throw e.error; }
8040
+ }
8041
+ return ar;
8042
+ };
8043
+ var __spreadArray$j = (commonjsGlobal && commonjsGlobal.__spreadArray) || function (to, from, pack) {
8044
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
8045
+ if (ar || !(i in from)) {
8046
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
8047
+ ar[i] = from[i];
8048
+ }
8049
+ }
8050
+ return to.concat(ar || Array.prototype.slice.call(from));
8051
+ };
8052
+ Object.defineProperty(bookmarkManager$1, "__esModule", { value: true });
8053
+ bookmarkManager$1.bookmarkManager = void 0;
7938
8054
  /**
7939
- * The session configuration
7940
- *
8055
+ * Interface for the piece of software responsible for keeping track of current active bookmarks accross the driver.
7941
8056
  * @interface
8057
+ * @since 5.0
8058
+ * @experimental
7942
8059
  */
7943
- var SessionConfig = /** @class */ (function () {
8060
+ var BookmarkManager = /** @class */ (function () {
7944
8061
  /**
7945
8062
  * @constructor
7946
8063
  * @private
7947
8064
  */
7948
- function SessionConfig() {
7949
- /**
7950
- * The access mode of this session, allowed values are {@link READ} and {@link WRITE}.
7951
- * **Default**: {@link WRITE}
7952
- * @type {string}
7953
- */
7954
- this.defaultAccessMode = WRITE$3;
7955
- /**
7956
- * The initial reference or references to some previous
7957
- * transactions. Value is optional and absence indicates that that the bookmarks do not exist or are unknown.
7958
- * @type {string|string[]|undefined}
7959
- */
7960
- this.bookmarks = [];
7961
- /**
7962
- * The database this session will operate on.
7963
- *
7964
- * This option has no explicit value by default, but it is recommended to set
7965
- * one if the target database is known in advance. This has the benefit of
7966
- * ensuring a consistent target database name throughout the session in a
7967
- * straightforward way and potentially simplifies driver logic as well as
7968
- * reduces network communication resulting in better performance.
7969
- *
7970
- * Usage of Cypher clauses like USE is not a replacement for this option.
7971
- * The driver does not parse any Cypher.
7972
- *
8065
+ function BookmarkManager() {
8066
+ throw new Error('Not implemented');
8067
+ }
8068
+ /**
8069
+ * Method called when the bookmarks get updated when a transaction finished.
8070
+ *
8071
+ * This method will be called when auto-commit queries finish and when explicit transactions
8072
+ * get committed.
8073
+ *
8074
+ * @param {Iterable<string>} previousBookmarks The bookmarks used when starting the transaction
8075
+ * @param {Iterable<string>} newBookmarks The new bookmarks received at the end of the transaction.
8076
+ * @returns {void}
8077
+ */
8078
+ BookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
8079
+ return __awaiter$a(this, void 0, void 0, function () {
8080
+ return __generator$c(this, function (_a) {
8081
+ throw new Error('Not implemented');
8082
+ });
8083
+ });
8084
+ };
8085
+ /**
8086
+ * Method called by the driver to get the bookmarks.
8087
+ *
8088
+ * @returns {Iterable<string>} The set of bookmarks
8089
+ */
8090
+ BookmarkManager.prototype.getBookmarks = function () {
8091
+ return __awaiter$a(this, void 0, void 0, function () {
8092
+ return __generator$c(this, function (_a) {
8093
+ throw new Error('Not implemented');
8094
+ });
8095
+ });
8096
+ };
8097
+ return BookmarkManager;
8098
+ }());
8099
+ bookmarkManager$1.default = BookmarkManager;
8100
+ /**
8101
+ * @typedef {Object} BookmarkManagerConfig
8102
+ *
8103
+ * @since 5.0
8104
+ * @experimental
8105
+ * @property {Iterable<string>} [initialBookmarks] Defines the initial set of bookmarks. The key is the database name and the values are the bookmarks.
8106
+ * @property {function():Promise<Iterable<string>>} [bookmarksSupplier] Called for supplying extra bookmarks to the BookmarkManager
8107
+ * @property {function(bookmarks: Iterable<string>): Promise<void>} [bookmarksConsumer] Called when the set of bookmarks get updated
8108
+ */
8109
+ /**
8110
+ * Provides an configured {@link BookmarkManager} instance.
8111
+ *
8112
+ * @since 5.0
8113
+ * @experimental
8114
+ * @param {BookmarkManagerConfig} [config={}]
8115
+ * @returns {BookmarkManager}
8116
+ */
8117
+ function bookmarkManager(config) {
8118
+ if (config === void 0) { config = {}; }
8119
+ var initialBookmarks = new Set(config.initialBookmarks);
8120
+ return new Neo4jBookmarkManager(initialBookmarks, config.bookmarksSupplier, config.bookmarksConsumer);
8121
+ }
8122
+ bookmarkManager$1.bookmarkManager = bookmarkManager;
8123
+ var Neo4jBookmarkManager = /** @class */ (function () {
8124
+ function Neo4jBookmarkManager(_bookmarks, _bookmarksSupplier, _bookmarksConsumer) {
8125
+ this._bookmarks = _bookmarks;
8126
+ this._bookmarksSupplier = _bookmarksSupplier;
8127
+ this._bookmarksConsumer = _bookmarksConsumer;
8128
+ }
8129
+ Neo4jBookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
8130
+ return __awaiter$a(this, void 0, void 0, function () {
8131
+ var bookmarks, previousBookmarks_1, previousBookmarks_1_1, bm, newBookmarks_1, newBookmarks_1_1, bm;
8132
+ var e_1, _a, e_2, _b;
8133
+ return __generator$c(this, function (_c) {
8134
+ switch (_c.label) {
8135
+ case 0:
8136
+ bookmarks = this._bookmarks;
8137
+ try {
8138
+ for (previousBookmarks_1 = __values$a(previousBookmarks), previousBookmarks_1_1 = previousBookmarks_1.next(); !previousBookmarks_1_1.done; previousBookmarks_1_1 = previousBookmarks_1.next()) {
8139
+ bm = previousBookmarks_1_1.value;
8140
+ bookmarks.delete(bm);
8141
+ }
8142
+ }
8143
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
8144
+ finally {
8145
+ try {
8146
+ if (previousBookmarks_1_1 && !previousBookmarks_1_1.done && (_a = previousBookmarks_1.return)) _a.call(previousBookmarks_1);
8147
+ }
8148
+ finally { if (e_1) throw e_1.error; }
8149
+ }
8150
+ try {
8151
+ for (newBookmarks_1 = __values$a(newBookmarks), newBookmarks_1_1 = newBookmarks_1.next(); !newBookmarks_1_1.done; newBookmarks_1_1 = newBookmarks_1.next()) {
8152
+ bm = newBookmarks_1_1.value;
8153
+ bookmarks.add(bm);
8154
+ }
8155
+ }
8156
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
8157
+ finally {
8158
+ try {
8159
+ if (newBookmarks_1_1 && !newBookmarks_1_1.done && (_b = newBookmarks_1.return)) _b.call(newBookmarks_1);
8160
+ }
8161
+ finally { if (e_2) throw e_2.error; }
8162
+ }
8163
+ if (!(typeof this._bookmarksConsumer === 'function')) return [3 /*break*/, 2];
8164
+ return [4 /*yield*/, this._bookmarksConsumer(__spreadArray$j([], __read$p(bookmarks), false))];
8165
+ case 1:
8166
+ _c.sent();
8167
+ _c.label = 2;
8168
+ case 2: return [2 /*return*/];
8169
+ }
8170
+ });
8171
+ });
8172
+ };
8173
+ Neo4jBookmarkManager.prototype.getBookmarks = function () {
8174
+ var _a;
8175
+ return __awaiter$a(this, void 0, void 0, function () {
8176
+ var bookmarks, suppliedBookmarks, suppliedBookmarks_1, suppliedBookmarks_1_1, bm;
8177
+ var e_3, _b;
8178
+ return __generator$c(this, function (_c) {
8179
+ switch (_c.label) {
8180
+ case 0:
8181
+ bookmarks = new Set(this._bookmarks);
8182
+ if (!(typeof this._bookmarksSupplier === 'function')) return [3 /*break*/, 2];
8183
+ return [4 /*yield*/, this._bookmarksSupplier()];
8184
+ case 1:
8185
+ suppliedBookmarks = (_a = _c.sent()) !== null && _a !== void 0 ? _a : [];
8186
+ try {
8187
+ for (suppliedBookmarks_1 = __values$a(suppliedBookmarks), suppliedBookmarks_1_1 = suppliedBookmarks_1.next(); !suppliedBookmarks_1_1.done; suppliedBookmarks_1_1 = suppliedBookmarks_1.next()) {
8188
+ bm = suppliedBookmarks_1_1.value;
8189
+ bookmarks.add(bm);
8190
+ }
8191
+ }
8192
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
8193
+ finally {
8194
+ try {
8195
+ if (suppliedBookmarks_1_1 && !suppliedBookmarks_1_1.done && (_b = suppliedBookmarks_1.return)) _b.call(suppliedBookmarks_1);
8196
+ }
8197
+ finally { if (e_3) throw e_3.error; }
8198
+ }
8199
+ _c.label = 2;
8200
+ case 2: return [2 /*return*/, __spreadArray$j([], __read$p(bookmarks), false)];
8201
+ }
8202
+ });
8203
+ });
8204
+ };
8205
+ return Neo4jBookmarkManager;
8206
+ }());
8207
+
8208
+ var resultTransformers$1 = {};
8209
+
8210
+ /**
8211
+ * Copyright (c) "Neo4j"
8212
+ * Neo4j Sweden AB [http://neo4j.com]
8213
+ *
8214
+ * This file is part of Neo4j.
8215
+ *
8216
+ * Licensed under the Apache License, Version 2.0 (the "License");
8217
+ * you may not use this file except in compliance with the License.
8218
+ * You may obtain a copy of the License at
8219
+ *
8220
+ * http://www.apache.org/licenses/LICENSE-2.0
8221
+ *
8222
+ * Unless required by applicable law or agreed to in writing, software
8223
+ * distributed under the License is distributed on an "AS IS" BASIS,
8224
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8225
+ * See the License for the specific language governing permissions and
8226
+ * limitations under the License.
8227
+ */
8228
+ var __awaiter$9 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
8229
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8230
+ return new (P || (P = Promise))(function (resolve, reject) {
8231
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8232
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8233
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8234
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8235
+ });
8236
+ };
8237
+ var __generator$b = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
8238
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8239
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8240
+ function verb(n) { return function (v) { return step([n, v]); }; }
8241
+ function step(op) {
8242
+ if (f) throw new TypeError("Generator is already executing.");
8243
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
8244
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8245
+ if (y = 0, t) op = [op[0] & 2, t.value];
8246
+ switch (op[0]) {
8247
+ case 0: case 1: t = op; break;
8248
+ case 4: _.label++; return { value: op[1], done: false };
8249
+ case 5: _.label++; y = op[1]; op = [0]; continue;
8250
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
8251
+ default:
8252
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8253
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8254
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8255
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8256
+ if (t[2]) _.ops.pop();
8257
+ _.trys.pop(); continue;
8258
+ }
8259
+ op = body.call(thisArg, _);
8260
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8261
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8262
+ }
8263
+ };
8264
+ var __importDefault$F = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
8265
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8266
+ };
8267
+ Object.defineProperty(resultTransformers$1, "__esModule", { value: true });
8268
+ var result_eager_1 = __importDefault$F(resultEager);
8269
+ var error_1$1 = error;
8270
+ function createEagerResultFromResult(result) {
8271
+ return __awaiter$9(this, void 0, void 0, function () {
8272
+ var _a, summary, records, keys;
8273
+ return __generator$b(this, function (_b) {
8274
+ switch (_b.label) {
8275
+ case 0: return [4 /*yield*/, result];
8276
+ case 1:
8277
+ _a = _b.sent(), summary = _a.summary, records = _a.records;
8278
+ return [4 /*yield*/, result.keys()];
8279
+ case 2:
8280
+ keys = _b.sent();
8281
+ return [2 /*return*/, new result_eager_1.default(keys, records, summary)];
8282
+ }
8283
+ });
8284
+ });
8285
+ }
8286
+ /**
8287
+ * Protocol for transforming {@link Result}.
8288
+ *
8289
+ * @typedef {function<T>(result:Result):Promise<T>} ResultTransformer
8290
+ * @interface
8291
+ * @experimental This can be changed or removed anytime.
8292
+ *
8293
+ * @see {@link resultTransformers} for provided implementations.
8294
+ * @see {@link Driver#executeQuery} for usage.
8295
+ * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
8296
+ */
8297
+ /**
8298
+ * Defines the object which holds the common {@link ResultTransformer} used with {@link Driver#executeQuery}.
8299
+ *
8300
+ * @experimental This can be changed or removed anytime.
8301
+ * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
8302
+ */
8303
+ var ResultTransformers = /** @class */ (function () {
8304
+ function ResultTransformers() {
8305
+ }
8306
+ /**
8307
+ * Creates a {@link ResultTransformer} which transforms {@link Result} to {@link EagerResult}
8308
+ * by consuming the whole stream.
8309
+ *
8310
+ * This is the default implementation used in {@link Driver#executeQuery}
8311
+ *
8312
+ * @example
8313
+ * // This:
8314
+ * const { keys, records, summary } = await driver.executeQuery('CREATE (p:Person{ name: $name }) RETURN p', { name: 'Person1'}, {
8315
+ * resultTransformer: neo4j.resultTransformers.eagerResultTransformer()
8316
+ * })
8317
+ * // is equivalent to:
8318
+ * const { keys, records, summary } = await driver.executeQuery('CREATE (p:Person{ name: $name }) RETURN p', { name: 'Person1'})
8319
+ *
8320
+ *
8321
+ * @experimental This can be changed or removed anytime.
8322
+ * @returns {ResultTransformer<EagerResult<Entries>>} The result transformer
8323
+ * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
8324
+ */
8325
+ ResultTransformers.prototype.eagerResultTransformer = function () {
8326
+ return createEagerResultFromResult;
8327
+ };
8328
+ /**
8329
+ * Creates a {@link ResultTransformer} which maps the {@link Record} in the result and collects it
8330
+ * along with the {@link ResultSummary} and {@link Result#keys}.
8331
+ *
8332
+ * NOTE: The config object requires map or/and collect to be valid.
8333
+ *
8334
+ * @example
8335
+ * // Mapping the records
8336
+ * const { keys, records, summary } = await driver.executeQuery('MATCH (p:Person{ age: $age }) RETURN p.name as name', { age: 25 }, {
8337
+ * resultTransformer: neo4j.resultTransformers.mappedResultTransformer({
8338
+ * map(record) {
8339
+ * return record.get('name')
8340
+ * }
8341
+ * })
8342
+ * })
8343
+ *
8344
+ * records.forEach(name => console.log(`${name} has 25`))
8345
+ *
8346
+ * @example
8347
+ * // Mapping records and collect result
8348
+ * const names = await driver.executeQuery('MATCH (p:Person{ age: $age }) RETURN p.name as name', { age: 25 }, {
8349
+ * resultTransformer: neo4j.resultTransformers.mappedResultTransformer({
8350
+ * map(record) {
8351
+ * return record.get('name')
8352
+ * },
8353
+ * collect(records, summary, keys) {
8354
+ * return records
8355
+ * }
8356
+ * })
8357
+ * })
8358
+ *
8359
+ * names.forEach(name => console.log(`${name} has 25`))
8360
+ *
8361
+ * @example
8362
+ * // The transformer can be defined one and used everywhere
8363
+ * const getRecordsAsObjects = neo4j.resultTransformers.mappedResultTransformer({
8364
+ * map(record) {
8365
+ * return record.toObject()
8366
+ * },
8367
+ * collect(objects) {
8368
+ * return objects
8369
+ * }
8370
+ * })
8371
+ *
8372
+ * // The usage in a driver.executeQuery
8373
+ * const objects = await driver.executeQuery('MATCH (p:Person{ age: $age }) RETURN p.name as name', { age: 25 }, {
8374
+ * resultTransformer: getRecordsAsObjects
8375
+ * })
8376
+ * objects.forEach(object => console.log(`${object.name} has 25`))
8377
+ *
8378
+ *
8379
+ * // The usage in session.executeRead
8380
+ * const objects = await session.executeRead(tx => getRecordsAsObjects(tx.run('MATCH (p:Person{ age: $age }) RETURN p.name as name')))
8381
+ * objects.forEach(object => console.log(`${object.name} has 25`))
8382
+ *
8383
+ * @experimental This can be changed or removed anytime.
8384
+ * @param {object} config The result transformer configuration
8385
+ * @param {function(record:Record):R} [config.map=function(record) { return record }] Method called for mapping each record
8386
+ * @param {function(records:R[], summary:ResultSummary, keys:string[]):T} [config.collect=function(records, summary, keys) { return { records, summary, keys }}] Method called for mapping
8387
+ * the result data to the transformer output.
8388
+ * @returns {ResultTransformer<T>} The result transformer
8389
+ * @see {@link Driver#executeQuery}
8390
+ * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
8391
+ */
8392
+ ResultTransformers.prototype.mappedResultTransformer = function (config) {
8393
+ var _this = this;
8394
+ if (config == null || (config.collect == null && config.map == null)) {
8395
+ throw (0, error_1$1.newError)('Requires a map or/and a collect functions.');
8396
+ }
8397
+ return function (result) { return __awaiter$9(_this, void 0, void 0, function () {
8398
+ return __generator$b(this, function (_a) {
8399
+ switch (_a.label) {
8400
+ case 0: return [4 /*yield*/, new Promise(function (resolve, reject) {
8401
+ var state = { records: [], keys: [] };
8402
+ result.subscribe({
8403
+ onKeys: function (keys) {
8404
+ state.keys = keys;
8405
+ },
8406
+ onNext: function (record) {
8407
+ if (config.map != null) {
8408
+ state.records.push(config.map(record));
8409
+ }
8410
+ else {
8411
+ state.records.push(record);
8412
+ }
8413
+ },
8414
+ onCompleted: function (summary) {
8415
+ if (config.collect != null) {
8416
+ resolve(config.collect(state.records, summary, state.keys));
8417
+ }
8418
+ else {
8419
+ var obj = { records: state.records, summary: summary, keys: state.keys };
8420
+ resolve(obj);
8421
+ }
8422
+ },
8423
+ onError: function (error) {
8424
+ reject(error);
8425
+ }
8426
+ });
8427
+ })];
8428
+ case 1: return [2 /*return*/, _a.sent()];
8429
+ }
8430
+ });
8431
+ }); };
8432
+ };
8433
+ return ResultTransformers;
8434
+ }());
8435
+ /**
8436
+ * Holds the common {@link ResultTransformer} used with {@link Driver#executeQuery}.
8437
+ *
8438
+ * @experimental This can be changed or removed anytime.
8439
+ * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
8440
+ */
8441
+ var resultTransformers = new ResultTransformers();
8442
+ Object.freeze(resultTransformers);
8443
+ resultTransformers$1.default = resultTransformers;
8444
+
8445
+ var queryExecutor = {};
8446
+
8447
+ /**
8448
+ * Copyright (c) "Neo4j"
8449
+ * Neo4j Sweden AB [http://neo4j.com]
8450
+ *
8451
+ * This file is part of Neo4j.
8452
+ *
8453
+ * Licensed under the Apache License, Version 2.0 (the "License");
8454
+ * you may not use this file except in compliance with the License.
8455
+ * You may obtain a copy of the License at
8456
+ *
8457
+ * http://www.apache.org/licenses/LICENSE-2.0
8458
+ *
8459
+ * Unless required by applicable law or agreed to in writing, software
8460
+ * distributed under the License is distributed on an "AS IS" BASIS,
8461
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8462
+ * See the License for the specific language governing permissions and
8463
+ * limitations under the License.
8464
+ */
8465
+ var __awaiter$8 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
8466
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8467
+ return new (P || (P = Promise))(function (resolve, reject) {
8468
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8469
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8470
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8471
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8472
+ });
8473
+ };
8474
+ var __generator$a = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
8475
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8476
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8477
+ function verb(n) { return function (v) { return step([n, v]); }; }
8478
+ function step(op) {
8479
+ if (f) throw new TypeError("Generator is already executing.");
8480
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
8481
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8482
+ if (y = 0, t) op = [op[0] & 2, t.value];
8483
+ switch (op[0]) {
8484
+ case 0: case 1: t = op; break;
8485
+ case 4: _.label++; return { value: op[1], done: false };
8486
+ case 5: _.label++; y = op[1]; op = [0]; continue;
8487
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
8488
+ default:
8489
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8490
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8491
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8492
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8493
+ if (t[2]) _.ops.pop();
8494
+ _.trys.pop(); continue;
8495
+ }
8496
+ op = body.call(thisArg, _);
8497
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8498
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8499
+ }
8500
+ };
8501
+ Object.defineProperty(queryExecutor, "__esModule", { value: true });
8502
+ var QueryExecutor = /** @class */ (function () {
8503
+ function QueryExecutor(_createSession) {
8504
+ this._createSession = _createSession;
8505
+ }
8506
+ QueryExecutor.prototype.execute = function (config, query, parameters) {
8507
+ return __awaiter$8(this, void 0, void 0, function () {
8508
+ var session, executeInTransaction;
8509
+ var _this = this;
8510
+ return __generator$a(this, function (_a) {
8511
+ switch (_a.label) {
8512
+ case 0:
8513
+ session = this._createSession({
8514
+ database: config.database,
8515
+ bookmarkManager: config.bookmarkManager,
8516
+ impersonatedUser: config.impersonatedUser
8517
+ });
8518
+ _a.label = 1;
8519
+ case 1:
8520
+ _a.trys.push([1, , 3, 5]);
8521
+ executeInTransaction = config.routing === 'READERS'
8522
+ ? session.executeRead.bind(session)
8523
+ : session.executeWrite.bind(session);
8524
+ return [4 /*yield*/, executeInTransaction(function (tx) { return __awaiter$8(_this, void 0, void 0, function () {
8525
+ var result;
8526
+ return __generator$a(this, function (_a) {
8527
+ switch (_a.label) {
8528
+ case 0:
8529
+ result = tx.run(query, parameters);
8530
+ return [4 /*yield*/, config.resultTransformer(result)];
8531
+ case 1: return [2 /*return*/, _a.sent()];
8532
+ }
8533
+ });
8534
+ }); })];
8535
+ case 2: return [2 /*return*/, _a.sent()];
8536
+ case 3: return [4 /*yield*/, session.close()];
8537
+ case 4:
8538
+ _a.sent();
8539
+ return [7 /*endfinally*/];
8540
+ case 5: return [2 /*return*/];
8541
+ }
8542
+ });
8543
+ });
8544
+ };
8545
+ return QueryExecutor;
8546
+ }());
8547
+ queryExecutor.default = QueryExecutor;
8548
+
8549
+ var __awaiter$7 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
8550
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8551
+ return new (P || (P = Promise))(function (resolve, reject) {
8552
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8553
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8554
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8555
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8556
+ });
8557
+ };
8558
+ var __generator$9 = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
8559
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8560
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8561
+ function verb(n) { return function (v) { return step([n, v]); }; }
8562
+ function step(op) {
8563
+ if (f) throw new TypeError("Generator is already executing.");
8564
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
8565
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8566
+ if (y = 0, t) op = [op[0] & 2, t.value];
8567
+ switch (op[0]) {
8568
+ case 0: case 1: t = op; break;
8569
+ case 4: _.label++; return { value: op[1], done: false };
8570
+ case 5: _.label++; y = op[1]; op = [0]; continue;
8571
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
8572
+ default:
8573
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8574
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8575
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8576
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8577
+ if (t[2]) _.ops.pop();
8578
+ _.trys.pop(); continue;
8579
+ }
8580
+ op = body.call(thisArg, _);
8581
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8582
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8583
+ }
8584
+ };
8585
+ var __importDefault$E = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
8586
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8587
+ };
8588
+ Object.defineProperty(driver, "__esModule", { value: true });
8589
+ driver.QueryConfig = driver.SessionConfig = driver.routing = driver.WRITE = driver.READ = driver.Driver = void 0;
8590
+ var bookmarks_1 = bookmarks$1;
8591
+ var configured_custom_resolver_1 = __importDefault$E(configuredCustomResolver);
8592
+ var constants_1 = constants$1;
8593
+ var logger_1 = logger$1;
8594
+ var session_1 = __importDefault$E(session);
8595
+ var util_1 = util$4;
8596
+ var bookmark_manager_1 = bookmarkManager$1;
8597
+ var result_transformers_1 = __importDefault$E(resultTransformers$1);
8598
+ var query_executor_1 = __importDefault$E(queryExecutor);
8599
+ var error_1 = error;
8600
+ var DEFAULT_MAX_CONNECTION_LIFETIME = 60 * 60 * 1000; // 1 hour
8601
+ /**
8602
+ * The default record fetch size. This is used in Bolt V4 protocol to pull query execution result in batches.
8603
+ * @type {number}
8604
+ */
8605
+ var DEFAULT_FETCH_SIZE = 1000;
8606
+ /**
8607
+ * Constant that represents read session access mode.
8608
+ * Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.READ })`.
8609
+ * @type {string}
8610
+ */
8611
+ var READ$3 = constants_1.ACCESS_MODE_READ;
8612
+ driver.READ = READ$3;
8613
+ /**
8614
+ * Constant that represents write session access mode.
8615
+ * Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.WRITE })`.
8616
+ * @type {string}
8617
+ */
8618
+ var WRITE$3 = constants_1.ACCESS_MODE_WRITE;
8619
+ driver.WRITE = WRITE$3;
8620
+ var idGenerator$1 = 0;
8621
+ /**
8622
+ * The session configuration
8623
+ *
8624
+ * @interface
8625
+ */
8626
+ var SessionConfig = /** @class */ (function () {
8627
+ /**
8628
+ * @constructor
8629
+ * @private
8630
+ */
8631
+ function SessionConfig() {
8632
+ /**
8633
+ * The access mode of this session, allowed values are {@link READ} and {@link WRITE}.
8634
+ * **Default**: {@link WRITE}
8635
+ * @type {string}
8636
+ */
8637
+ this.defaultAccessMode = WRITE$3;
8638
+ /**
8639
+ * The initial reference or references to some previous
8640
+ * transactions. Value is optional and absence indicates that that the bookmarks do not exist or are unknown.
8641
+ * @type {string|string[]|undefined}
8642
+ */
8643
+ this.bookmarks = [];
8644
+ /**
8645
+ * The database this session will operate on.
8646
+ *
8647
+ * This option has no explicit value by default, but it is recommended to set
8648
+ * one if the target database is known in advance. This has the benefit of
8649
+ * ensuring a consistent target database name throughout the session in a
8650
+ * straightforward way and potentially simplifies driver logic as well as
8651
+ * reduces network communication resulting in better performance.
8652
+ *
8653
+ * Usage of Cypher clauses like USE is not a replacement for this option.
8654
+ * The driver does not parse any Cypher.
8655
+ *
7973
8656
  * When no explicit name is set, the driver behavior depends on the connection
7974
8657
  * URI scheme supplied to the driver on instantiation and Bolt protocol
7975
8658
  * version.
@@ -8059,6 +8742,77 @@ var SessionConfig = /** @class */ (function () {
8059
8742
  return SessionConfig;
8060
8743
  }());
8061
8744
  driver.SessionConfig = SessionConfig;
8745
+ var WRITERS = 'WRITERS';
8746
+ var READERS = 'READERS';
8747
+ /**
8748
+ * @typedef {'WRITERS'|'READERS'} RoutingControl
8749
+ */
8750
+ /**
8751
+ * Constants that represents routing modes.
8752
+ *
8753
+ * @example
8754
+ * driver.executeQuery("<QUERY>", <PARAMETERS>, { routing: neo4j.routing.WRITERS })
8755
+ */
8756
+ var routing = {
8757
+ WRITERS: WRITERS,
8758
+ READERS: READERS
8759
+ };
8760
+ driver.routing = routing;
8761
+ Object.freeze(routing);
8762
+ /**
8763
+ * The query configuration
8764
+ * @interface
8765
+ * @experimental This can be changed or removed anytime.
8766
+ * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
8767
+ */
8768
+ var QueryConfig = /** @class */ (function () {
8769
+ /**
8770
+ * @constructor
8771
+ * @private
8772
+ */
8773
+ function QueryConfig() {
8774
+ /**
8775
+ * Define the type of cluster member the query will be routed to.
8776
+ *
8777
+ * @type {RoutingControl}
8778
+ */
8779
+ this.routing = routing.WRITERS;
8780
+ /**
8781
+ * Define the transformation will be applied to the Result before return from the
8782
+ * query method.
8783
+ *
8784
+ * @type {ResultTransformer}
8785
+ * @see {@link resultTransformers} for provided implementations.
8786
+ */
8787
+ this.resultTransformer = undefined;
8788
+ /**
8789
+ * The database this session will operate on.
8790
+ *
8791
+ * @type {string|undefined}
8792
+ */
8793
+ this.database = '';
8794
+ /**
8795
+ * The username which the user wants to impersonate for the duration of the query.
8796
+ *
8797
+ * @type {string|undefined}
8798
+ */
8799
+ this.impersonatedUser = undefined;
8800
+ /**
8801
+ * Configure a BookmarkManager for the session to use
8802
+ *
8803
+ * A BookmarkManager is a piece of software responsible for keeping casual consistency between different pieces of work by sharing bookmarks
8804
+ * between the them.
8805
+ *
8806
+ * By default, it uses the driver's non mutable driver level bookmark manager. See, {@link Driver.queryBookmarkManager}
8807
+ *
8808
+ * Can be set to null to disable causal chaining.
8809
+ * @type {BookmarkManager|null}
8810
+ */
8811
+ this.bookmarkManager = undefined;
8812
+ }
8813
+ return QueryConfig;
8814
+ }());
8815
+ driver.QueryConfig = QueryConfig;
8062
8816
  /**
8063
8817
  * A driver maintains one or more {@link Session}s with a remote
8064
8818
  * Neo4j instance. Through the {@link Session}s you can send queries
@@ -8076,12 +8830,13 @@ var Driver$1 = /** @class */ (function () {
8076
8830
  * @protected
8077
8831
  * @param {Object} meta Metainformation about the driver
8078
8832
  * @param {Object} config
8079
- * @param {function(id: number, config:Object, log:Logger, hostNameResolver: ConfiguredCustomResolver): ConnectionProvider } createConnectonProvider Creates the connection provider
8833
+ * @param {function(id: number, config:Object, log:Logger, hostNameResolver: ConfiguredCustomResolver): ConnectionProvider } createConnectionProvider Creates the connection provider
8080
8834
  * @param {function(args): Session } createSession Creates the a session
8081
8835
  */
8082
- function Driver(meta, config, createConnectonProvider, createSession) {
8836
+ function Driver(meta, config, createConnectionProvider, createSession, createQueryExecutor) {
8083
8837
  if (config === void 0) { config = {}; }
8084
8838
  if (createSession === void 0) { createSession = function (args) { return new session_1.default(args); }; }
8839
+ if (createQueryExecutor === void 0) { createQueryExecutor = function (createQuery) { return new query_executor_1.default(createQuery); }; }
8085
8840
  sanitizeConfig(config);
8086
8841
  var log = logger_1.Logger.create(config);
8087
8842
  validateConfig(config, log);
@@ -8089,8 +8844,10 @@ var Driver$1 = /** @class */ (function () {
8089
8844
  this._meta = meta;
8090
8845
  this._config = config;
8091
8846
  this._log = log;
8092
- this._createConnectionProvider = createConnectonProvider;
8847
+ this._createConnectionProvider = createConnectionProvider;
8093
8848
  this._createSession = createSession;
8849
+ this._queryBookmarkManager = (0, bookmark_manager_1.bookmarkManager)();
8850
+ this._queryExecutor = createQueryExecutor(this.session.bind(this));
8094
8851
  /**
8095
8852
  * Reference to the connection provider. Initialized lazily by {@link _getOrCreateConnectionProvider}.
8096
8853
  * @type {ConnectionProvider}
@@ -8099,6 +8856,124 @@ var Driver$1 = /** @class */ (function () {
8099
8856
  this._connectionProvider = null;
8100
8857
  this._afterConstruction();
8101
8858
  }
8859
+ Object.defineProperty(Driver.prototype, "queryBookmarkManager", {
8860
+ /**
8861
+ * The bookmark managed used by {@link Driver.executeQuery}
8862
+ *
8863
+ * @experimental This can be changed or removed anytime.
8864
+ * @type {BookmarkManager}
8865
+ * @returns {BookmarkManager}
8866
+ */
8867
+ get: function () {
8868
+ return this._queryBookmarkManager;
8869
+ },
8870
+ enumerable: false,
8871
+ configurable: true
8872
+ });
8873
+ /**
8874
+ * Executes a query in a retriable context and returns a {@link EagerResult}.
8875
+ *
8876
+ * This method is a shortcut for a {@link Session#executeRead} and {@link Session#executeWrite}.
8877
+ *
8878
+ * NOTE: Because it is an explicit transaction from the server point of view, Cypher queries using
8879
+ * "CALL {} IN TRANSACTIONS" or the older "USING PERIODIC COMMIT" construct will not work (call
8880
+ * {@link Session#run} for these).
8881
+ *
8882
+ * @example
8883
+ * // Run a simple write query
8884
+ * const { keys, records, summary } = await driver.executeQuery('CREATE (p:Person{ name: $name }) RETURN p', { name: 'Person1'})
8885
+ *
8886
+ * @example
8887
+ * // Run a read query
8888
+ * const { keys, records, summary } = await driver.executeQuery(
8889
+ * 'MATCH (p:Person{ name: $name }) RETURN p',
8890
+ * { name: 'Person1'},
8891
+ * { routing: neo4j.routing.READERS})
8892
+ *
8893
+ * @example
8894
+ * // Run a read query returning a Person Nodes per elementId
8895
+ * const peopleMappedById = await driver.executeQuery(
8896
+ * 'MATCH (p:Person{ name: $name }) RETURN p',
8897
+ * { name: 'Person1'},
8898
+ * {
8899
+ * resultTransformer: neo4j.resultTransformers.mappedResultTransformer({
8900
+ * map(record) {
8901
+ * const p = record.get('p')
8902
+ * return [p.elementId, p]
8903
+ * },
8904
+ * collect(elementIdPersonPairArray) {
8905
+ * return new Map(elementIdPersonPairArray)
8906
+ * }
8907
+ * })
8908
+ * }
8909
+ * )
8910
+ *
8911
+ * const person = peopleMappedById.get("<ELEMENT_ID>")
8912
+ *
8913
+ * @example
8914
+ * // these lines
8915
+ * const transformedResult = await driver.executeQuery(
8916
+ * "<QUERY>",
8917
+ * <PARAMETERS>,
8918
+ * {
8919
+ * routing: neo4j.routing.WRITERS,
8920
+ * resultTransformer: transformer,
8921
+ * database: "<DATABASE>",
8922
+ * impersonatedUser: "<USER>",
8923
+ * bookmarkManager: bookmarkManager
8924
+ * })
8925
+ * // are equivalent to those
8926
+ * const session = driver.session({
8927
+ * database: "<DATABASE>",
8928
+ * impersonatedUser: "<USER>",
8929
+ * bookmarkManager: bookmarkManager
8930
+ * })
8931
+ *
8932
+ * try {
8933
+ * const transformedResult = await session.executeWrite(tx => {
8934
+ * const result = tx.run("<QUERY>", <PARAMETERS>)
8935
+ * return transformer(result)
8936
+ * })
8937
+ * } finally {
8938
+ * await session.close()
8939
+ * }
8940
+ *
8941
+ * @public
8942
+ * @experimental This can be changed or removed anytime.
8943
+ * @param {string | {text: string, parameters?: object}} query - Cypher query to execute
8944
+ * @param {Object} parameters - Map with parameters to use in the query
8945
+ * @param {QueryConfig<T>} config - The query configuration
8946
+ * @returns {Promise<T>}
8947
+ *
8948
+ * @see {@link resultTransformers} for provided result transformers.
8949
+ * @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
8950
+ */
8951
+ Driver.prototype.executeQuery = function (query, parameters, config) {
8952
+ var _a, _b, _c;
8953
+ if (config === void 0) { config = {}; }
8954
+ return __awaiter$7(this, void 0, void 0, function () {
8955
+ var bookmarkManager, resultTransformer, routingConfig;
8956
+ return __generator$9(this, function (_d) {
8957
+ switch (_d.label) {
8958
+ case 0:
8959
+ bookmarkManager = config.bookmarkManager === null ? undefined : ((_a = config.bookmarkManager) !== null && _a !== void 0 ? _a : this.queryBookmarkManager);
8960
+ resultTransformer = ((_b = config.resultTransformer) !== null && _b !== void 0 ? _b : result_transformers_1.default.eagerResultTransformer());
8961
+ routingConfig = (_c = config.routing) !== null && _c !== void 0 ? _c : routing.WRITERS;
8962
+ if (routingConfig !== routing.READERS && routingConfig !== routing.WRITERS) {
8963
+ throw (0, error_1.newError)("Illegal query routing config: \"".concat(routingConfig, "\""));
8964
+ }
8965
+ return [4 /*yield*/, this._queryExecutor.execute({
8966
+ resultTransformer: resultTransformer,
8967
+ bookmarkManager: bookmarkManager,
8968
+ routing: routingConfig,
8969
+ database: config.database,
8970
+ impersonatedUser: config.impersonatedUser
8971
+ }, query, parameters)];
8972
+ case 1: return [2 /*return*/, _d.sent()];
8973
+ }
8974
+ });
8975
+ });
8976
+ };
8102
8977
  /**
8103
8978
  * Verifies connectivity of this driver by trying to open a connection with the provided driver options.
8104
8979
  *
@@ -8251,6 +9126,7 @@ var Driver$1 = /** @class */ (function () {
8251
9126
  };
8252
9127
  /**
8253
9128
  * @protected
9129
+ * @returns {void}
8254
9130
  */
8255
9131
  Driver.prototype._afterConstruction = function () {
8256
9132
  this._log.info("".concat(this._meta.typename, " driver ").concat(this._id, " created for server address ").concat(this._meta.address.toString()));
@@ -8461,254 +9337,6 @@ function isNotEmpty(value) {
8461
9337
  }
8462
9338
  auth$1.default = auth;
8463
9339
 
8464
- var bookmarkManager$1 = {};
8465
-
8466
- /**
8467
- * Copyright (c) "Neo4j"
8468
- * Neo4j Sweden AB [http://neo4j.com]
8469
- *
8470
- * This file is part of Neo4j.
8471
- *
8472
- * Licensed under the Apache License, Version 2.0 (the "License");
8473
- * you may not use this file except in compliance with the License.
8474
- * You may obtain a copy of the License at
8475
- *
8476
- * http://www.apache.org/licenses/LICENSE-2.0
8477
- *
8478
- * Unless required by applicable law or agreed to in writing, software
8479
- * distributed under the License is distributed on an "AS IS" BASIS,
8480
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8481
- * See the License for the specific language governing permissions and
8482
- * limitations under the License.
8483
- */
8484
- var __awaiter$7 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
8485
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8486
- return new (P || (P = Promise))(function (resolve, reject) {
8487
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8488
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8489
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8490
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8491
- });
8492
- };
8493
- var __generator$9 = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
8494
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8495
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8496
- function verb(n) { return function (v) { return step([n, v]); }; }
8497
- function step(op) {
8498
- if (f) throw new TypeError("Generator is already executing.");
8499
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
8500
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8501
- if (y = 0, t) op = [op[0] & 2, t.value];
8502
- switch (op[0]) {
8503
- case 0: case 1: t = op; break;
8504
- case 4: _.label++; return { value: op[1], done: false };
8505
- case 5: _.label++; y = op[1]; op = [0]; continue;
8506
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
8507
- default:
8508
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8509
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8510
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8511
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8512
- if (t[2]) _.ops.pop();
8513
- _.trys.pop(); continue;
8514
- }
8515
- op = body.call(thisArg, _);
8516
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8517
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8518
- }
8519
- };
8520
- var __values$a = (commonjsGlobal && commonjsGlobal.__values) || function(o) {
8521
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
8522
- if (m) return m.call(o);
8523
- if (o && typeof o.length === "number") return {
8524
- next: function () {
8525
- if (o && i >= o.length) o = void 0;
8526
- return { value: o && o[i++], done: !o };
8527
- }
8528
- };
8529
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
8530
- };
8531
- var __read$p = (commonjsGlobal && commonjsGlobal.__read) || function (o, n) {
8532
- var m = typeof Symbol === "function" && o[Symbol.iterator];
8533
- if (!m) return o;
8534
- var i = m.call(o), r, ar = [], e;
8535
- try {
8536
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8537
- }
8538
- catch (error) { e = { error: error }; }
8539
- finally {
8540
- try {
8541
- if (r && !r.done && (m = i["return"])) m.call(i);
8542
- }
8543
- finally { if (e) throw e.error; }
8544
- }
8545
- return ar;
8546
- };
8547
- var __spreadArray$j = (commonjsGlobal && commonjsGlobal.__spreadArray) || function (to, from, pack) {
8548
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
8549
- if (ar || !(i in from)) {
8550
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
8551
- ar[i] = from[i];
8552
- }
8553
- }
8554
- return to.concat(ar || Array.prototype.slice.call(from));
8555
- };
8556
- Object.defineProperty(bookmarkManager$1, "__esModule", { value: true });
8557
- bookmarkManager$1.bookmarkManager = void 0;
8558
- /**
8559
- * Interface for the piece of software responsible for keeping track of current active bookmarks accross the driver.
8560
- * @interface
8561
- * @since 5.0
8562
- * @experimental
8563
- */
8564
- var BookmarkManager = /** @class */ (function () {
8565
- /**
8566
- * @constructor
8567
- * @private
8568
- */
8569
- function BookmarkManager() {
8570
- throw new Error('Not implemented');
8571
- }
8572
- /**
8573
- * Method called when the bookmarks get updated when a transaction finished.
8574
- *
8575
- * This method will be called when auto-commit queries finish and when explicit transactions
8576
- * get committed.
8577
- *
8578
- * @param {Iterable<string>} previousBookmarks The bookmarks used when starting the transaction
8579
- * @param {Iterable<string>} newBookmarks The new bookmarks received at the end of the transaction.
8580
- * @returns {void}
8581
- */
8582
- BookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
8583
- return __awaiter$7(this, void 0, void 0, function () {
8584
- return __generator$9(this, function (_a) {
8585
- throw new Error('Not implemented');
8586
- });
8587
- });
8588
- };
8589
- /**
8590
- * Method called by the driver to get the bookmarks.
8591
- *
8592
- * @returns {Iterable<string>} The set of bookmarks
8593
- */
8594
- BookmarkManager.prototype.getBookmarks = function () {
8595
- return __awaiter$7(this, void 0, void 0, function () {
8596
- return __generator$9(this, function (_a) {
8597
- throw new Error('Not implemented');
8598
- });
8599
- });
8600
- };
8601
- return BookmarkManager;
8602
- }());
8603
- bookmarkManager$1.default = BookmarkManager;
8604
- /**
8605
- * @typedef {Object} BookmarkManagerConfig
8606
- *
8607
- * @since 5.0
8608
- * @experimental
8609
- * @property {Iterable<string>} [initialBookmarks] Defines the initial set of bookmarks. The key is the database name and the values are the bookmarks.
8610
- * @property {function():Promise<Iterable<string>>} [bookmarksSupplier] Called for supplying extra bookmarks to the BookmarkManager
8611
- * @property {function(bookmarks: Iterable<string>): Promise<void>} [bookmarksConsumer] Called when the set of bookmarks get updated
8612
- */
8613
- /**
8614
- * Provides an configured {@link BookmarkManager} instance.
8615
- *
8616
- * @since 5.0
8617
- * @experimental
8618
- * @param {BookmarkManagerConfig} [config={}]
8619
- * @returns {BookmarkManager}
8620
- */
8621
- function bookmarkManager(config) {
8622
- if (config === void 0) { config = {}; }
8623
- var initialBookmarks = new Set(config.initialBookmarks);
8624
- return new Neo4jBookmarkManager(initialBookmarks, config.bookmarksSupplier, config.bookmarksConsumer);
8625
- }
8626
- bookmarkManager$1.bookmarkManager = bookmarkManager;
8627
- var Neo4jBookmarkManager = /** @class */ (function () {
8628
- function Neo4jBookmarkManager(_bookmarks, _bookmarksSupplier, _bookmarksConsumer) {
8629
- this._bookmarks = _bookmarks;
8630
- this._bookmarksSupplier = _bookmarksSupplier;
8631
- this._bookmarksConsumer = _bookmarksConsumer;
8632
- }
8633
- Neo4jBookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
8634
- return __awaiter$7(this, void 0, void 0, function () {
8635
- var bookmarks, previousBookmarks_1, previousBookmarks_1_1, bm, newBookmarks_1, newBookmarks_1_1, bm;
8636
- var e_1, _a, e_2, _b;
8637
- return __generator$9(this, function (_c) {
8638
- switch (_c.label) {
8639
- case 0:
8640
- bookmarks = this._bookmarks;
8641
- try {
8642
- for (previousBookmarks_1 = __values$a(previousBookmarks), previousBookmarks_1_1 = previousBookmarks_1.next(); !previousBookmarks_1_1.done; previousBookmarks_1_1 = previousBookmarks_1.next()) {
8643
- bm = previousBookmarks_1_1.value;
8644
- bookmarks.delete(bm);
8645
- }
8646
- }
8647
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
8648
- finally {
8649
- try {
8650
- if (previousBookmarks_1_1 && !previousBookmarks_1_1.done && (_a = previousBookmarks_1.return)) _a.call(previousBookmarks_1);
8651
- }
8652
- finally { if (e_1) throw e_1.error; }
8653
- }
8654
- try {
8655
- for (newBookmarks_1 = __values$a(newBookmarks), newBookmarks_1_1 = newBookmarks_1.next(); !newBookmarks_1_1.done; newBookmarks_1_1 = newBookmarks_1.next()) {
8656
- bm = newBookmarks_1_1.value;
8657
- bookmarks.add(bm);
8658
- }
8659
- }
8660
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
8661
- finally {
8662
- try {
8663
- if (newBookmarks_1_1 && !newBookmarks_1_1.done && (_b = newBookmarks_1.return)) _b.call(newBookmarks_1);
8664
- }
8665
- finally { if (e_2) throw e_2.error; }
8666
- }
8667
- if (!(typeof this._bookmarksConsumer === 'function')) return [3 /*break*/, 2];
8668
- return [4 /*yield*/, this._bookmarksConsumer(__spreadArray$j([], __read$p(bookmarks), false))];
8669
- case 1:
8670
- _c.sent();
8671
- _c.label = 2;
8672
- case 2: return [2 /*return*/];
8673
- }
8674
- });
8675
- });
8676
- };
8677
- Neo4jBookmarkManager.prototype.getBookmarks = function () {
8678
- var _a;
8679
- return __awaiter$7(this, void 0, void 0, function () {
8680
- var bookmarks, suppliedBookmarks, suppliedBookmarks_1, suppliedBookmarks_1_1, bm;
8681
- var e_3, _b;
8682
- return __generator$9(this, function (_c) {
8683
- switch (_c.label) {
8684
- case 0:
8685
- bookmarks = new Set(this._bookmarks);
8686
- if (!(typeof this._bookmarksSupplier === 'function')) return [3 /*break*/, 2];
8687
- return [4 /*yield*/, this._bookmarksSupplier()];
8688
- case 1:
8689
- suppliedBookmarks = (_a = _c.sent()) !== null && _a !== void 0 ? _a : [];
8690
- try {
8691
- for (suppliedBookmarks_1 = __values$a(suppliedBookmarks), suppliedBookmarks_1_1 = suppliedBookmarks_1.next(); !suppliedBookmarks_1_1.done; suppliedBookmarks_1_1 = suppliedBookmarks_1.next()) {
8692
- bm = suppliedBookmarks_1_1.value;
8693
- bookmarks.add(bm);
8694
- }
8695
- }
8696
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
8697
- finally {
8698
- try {
8699
- if (suppliedBookmarks_1_1 && !suppliedBookmarks_1_1.done && (_b = suppliedBookmarks_1.return)) _b.call(suppliedBookmarks_1);
8700
- }
8701
- finally { if (e_3) throw e_3.error; }
8702
- }
8703
- _c.label = 2;
8704
- case 2: return [2 /*return*/, __spreadArray$j([], __read$p(bookmarks), false)];
8705
- }
8706
- });
8707
- });
8708
- };
8709
- return Neo4jBookmarkManager;
8710
- }());
8711
-
8712
9340
  var types$1 = {};
8713
9341
 
8714
9342
  /**
@@ -8777,8 +9405,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
8777
9405
  return (mod && mod.__esModule) ? mod : { "default": mod };
8778
9406
  };
8779
9407
  Object.defineProperty(exports, "__esModule", { value: true });
8780
- exports.TransactionPromise = exports.ManagedTransaction = exports.Transaction = exports.Connection = exports.ConnectionProvider = 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;
8781
- exports.bookmarkManager = exports.auth = exports.json = exports.driver = exports.types = exports.Driver = exports.Session = void 0;
9408
+ 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;
9409
+ exports.resultTransformers = exports.routing = exports.bookmarkManager = exports.auth = exports.json = exports.driver = exports.types = exports.Driver = exports.Session = exports.TransactionPromise = void 0;
8782
9410
  var error_1 = error;
8783
9411
  Object.defineProperty(exports, "newError", { enumerable: true, get: function () { return error_1.newError; } });
8784
9412
  Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return error_1.Neo4jError; } });
@@ -8830,6 +9458,8 @@ Object.defineProperty(exports, "QueryStatistics", { enumerable: true, get: funct
8830
9458
  Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return result_summary_1.Stats; } });
8831
9459
  var result_1 = __importDefault(result);
8832
9460
  exports.Result = result_1.default;
9461
+ var result_eager_1 = __importDefault(resultEager);
9462
+ exports.EagerResult = result_eager_1.default;
8833
9463
  var connection_provider_1 = __importDefault(connectionProvider$1);
8834
9464
  exports.ConnectionProvider = connection_provider_1.default;
8835
9465
  var connection_1 = __importDefault(connection$2);
@@ -8849,10 +9479,14 @@ var auth_1 = __importDefault(auth$1);
8849
9479
  exports.auth = auth_1.default;
8850
9480
  var bookmark_manager_1 = bookmarkManager$1;
8851
9481
  Object.defineProperty(exports, "bookmarkManager", { enumerable: true, get: function () { return bookmark_manager_1.bookmarkManager; } });
9482
+ var driver_2 = driver;
9483
+ Object.defineProperty(exports, "routing", { enumerable: true, get: function () { return driver_2.routing; } });
8852
9484
  var types = __importStar(types$1);
8853
9485
  exports.types = types;
8854
9486
  var json$1 = __importStar(json);
8855
9487
  exports.json = json$1;
9488
+ var result_transformers_1 = __importDefault(resultTransformers$1);
9489
+ exports.resultTransformers = result_transformers_1.default;
8856
9490
  var internal$1 = __importStar(internal); // todo: removed afterwards
8857
9491
  exports.internal = internal$1;
8858
9492
  /**
@@ -8913,6 +9547,7 @@ var forExport = {
8913
9547
  QueryStatistics: result_summary_1.QueryStatistics,
8914
9548
  Stats: result_summary_1.Stats,
8915
9549
  Result: result_1.default,
9550
+ EagerResult: result_eager_1.default,
8916
9551
  Transaction: transaction_1.default,
8917
9552
  ManagedTransaction: transaction_managed_1.default,
8918
9553
  TransactionPromise: transaction_promise_1.default,
@@ -8923,7 +9558,9 @@ var forExport = {
8923
9558
  driver: driver$1,
8924
9559
  json: json$1,
8925
9560
  auth: auth_1.default,
8926
- bookmarkManager: bookmark_manager_1.bookmarkManager
9561
+ bookmarkManager: bookmark_manager_1.bookmarkManager,
9562
+ routing: driver_2.routing,
9563
+ resultTransformers: result_transformers_1.default
8927
9564
  };
8928
9565
  exports.default = forExport;
8929
9566
  }(lib$1));
@@ -17944,7 +18581,7 @@ Object.defineProperty(version$1, "__esModule", { value: true });
17944
18581
  // This is set up this way to keep the version in the code in
17945
18582
  // sync with the npm package version, and to allow the build
17946
18583
  // system to control version names at packaging time.
17947
- version$1.default = '5.4.0';
18584
+ version$1.default = '5.5.0';
17948
18585
 
17949
18586
  var lib = {};
17950
18587
 
@@ -30808,8 +31445,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
30808
31445
  return (mod && mod.__esModule) ? mod : { "default": mod };
30809
31446
  };
30810
31447
  Object.defineProperty(exports, "__esModule", { value: true });
30811
- exports.Integer = exports.Point = 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.Result = exports.ManagedTransaction = exports.Transaction = exports.Session = exports.Driver = exports.temporal = exports.spatial = exports.graph = exports.error = 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;
30812
- exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = void 0;
31448
+ 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;
31449
+ exports.resultTransformers = exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = exports.Integer = exports.Point = void 0;
30813
31450
  /**
30814
31451
  * Copyright (c) "Neo4j"
30815
31452
  * Neo4j Sweden AB [http://neo4j.com]
@@ -30870,11 +31507,14 @@ Object.defineProperty(exports, "QueryStatistics", { enumerable: true, get: funct
30870
31507
  Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return neo4j_driver_core_1.Notification; } });
30871
31508
  Object.defineProperty(exports, "ServerInfo", { enumerable: true, get: function () { return neo4j_driver_core_1.ServerInfo; } });
30872
31509
  Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return neo4j_driver_core_1.Result; } });
31510
+ Object.defineProperty(exports, "EagerResult", { enumerable: true, get: function () { return neo4j_driver_core_1.EagerResult; } });
30873
31511
  Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return neo4j_driver_core_1.auth; } });
30874
31512
  Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return neo4j_driver_core_1.Session; } });
30875
31513
  Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return neo4j_driver_core_1.Transaction; } });
30876
31514
  Object.defineProperty(exports, "ManagedTransaction", { enumerable: true, get: function () { return neo4j_driver_core_1.ManagedTransaction; } });
30877
31515
  Object.defineProperty(exports, "bookmarkManager", { enumerable: true, get: function () { return neo4j_driver_core_1.bookmarkManager; } });
31516
+ Object.defineProperty(exports, "routing", { enumerable: true, get: function () { return neo4j_driver_core_1.routing; } });
31517
+ Object.defineProperty(exports, "resultTransformers", { enumerable: true, get: function () { return neo4j_driver_core_1.resultTransformers; } });
30878
31518
  var neo4j_driver_bolt_connection_1 = lib;
30879
31519
  var session_rx_1 = __importDefault(sessionRx);
30880
31520
  exports.RxSession = session_rx_1.default;
@@ -31165,6 +31805,7 @@ var types = {
31165
31805
  PathSegment: neo4j_driver_core_1.PathSegment,
31166
31806
  Path: neo4j_driver_core_1.Path,
31167
31807
  Result: neo4j_driver_core_1.Result,
31808
+ EagerResult: neo4j_driver_core_1.EagerResult,
31168
31809
  ResultSummary: neo4j_driver_core_1.ResultSummary,
31169
31810
  Record: neo4j_driver_core_1.Record,
31170
31811
  Point: neo4j_driver_core_1.Point,
@@ -31251,6 +31892,7 @@ var forExport = {
31251
31892
  logging: logging,
31252
31893
  types: types,
31253
31894
  session: session,
31895
+ routing: neo4j_driver_core_1.routing,
31254
31896
  error: neo4j_driver_core_1.error,
31255
31897
  graph: graph,
31256
31898
  spatial: spatial,
@@ -31260,6 +31902,7 @@ var forExport = {
31260
31902
  Transaction: neo4j_driver_core_1.Transaction,
31261
31903
  ManagedTransaction: neo4j_driver_core_1.ManagedTransaction,
31262
31904
  Result: neo4j_driver_core_1.Result,
31905
+ EagerResult: neo4j_driver_core_1.EagerResult,
31263
31906
  RxSession: session_rx_1.default,
31264
31907
  RxTransaction: transaction_rx_1.default,
31265
31908
  RxManagedTransaction: transaction_managed_rx_1.default,
@@ -31284,7 +31927,8 @@ var forExport = {
31284
31927
  Date: neo4j_driver_core_1.Date,
31285
31928
  LocalDateTime: neo4j_driver_core_1.LocalDateTime,
31286
31929
  DateTime: neo4j_driver_core_1.DateTime,
31287
- bookmarkManager: neo4j_driver_core_1.bookmarkManager
31930
+ bookmarkManager: neo4j_driver_core_1.bookmarkManager,
31931
+ resultTransformers: neo4j_driver_core_1.resultTransformers
31288
31932
  };
31289
31933
  exports.default = forExport;
31290
31934
  }(lib$2));