neo4j-driver 5.4.0-alpha01 → 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.
- package/README.md +2 -2
- package/lib/browser/neo4j-web.esm.js +1091 -430
- package/lib/browser/neo4j-web.esm.min.js +1 -1
- package/lib/browser/neo4j-web.js +1091 -430
- package/lib/browser/neo4j-web.min.js +1 -1
- package/lib/index.js +10 -3
- package/lib/version.js +1 -1
- package/package.json +5 -5
- package/types/index.d.ts +19 -3
|
@@ -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$
|
|
191
|
+
var error_1$b = error;
|
|
192
192
|
/**
|
|
193
193
|
* A cache of the Integer representations of small integer values.
|
|
194
194
|
* @type {!Object}
|
|
@@ -349,6 +349,20 @@ var Integer = /** @class */ (function () {
|
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
+
/**
|
|
353
|
+
* Converts the Integer to it primitive value.
|
|
354
|
+
*
|
|
355
|
+
* @since 5.4.0
|
|
356
|
+
* @returns {bigint}
|
|
357
|
+
*
|
|
358
|
+
* @see {@link Integer#toBigInt}
|
|
359
|
+
* @see {@link Integer#toInt}
|
|
360
|
+
* @see {@link Integer#toNumber}
|
|
361
|
+
* @see {@link Integer#toString}
|
|
362
|
+
*/
|
|
363
|
+
Integer.prototype.valueOf = function () {
|
|
364
|
+
return this.toBigInt();
|
|
365
|
+
};
|
|
352
366
|
/**
|
|
353
367
|
* Gets the high 32 bits as a signed integer.
|
|
354
368
|
* @returns {number} Signed high bits
|
|
@@ -638,7 +652,7 @@ var Integer = /** @class */ (function () {
|
|
|
638
652
|
Integer.prototype.div = function (divisor) {
|
|
639
653
|
var theDivisor = Integer.fromValue(divisor);
|
|
640
654
|
if (theDivisor.isZero()) {
|
|
641
|
-
throw (0, error_1$
|
|
655
|
+
throw (0, error_1$b.newError)('division by zero');
|
|
642
656
|
}
|
|
643
657
|
if (this.isZero()) {
|
|
644
658
|
return Integer.ZERO;
|
|
@@ -877,7 +891,7 @@ var Integer = /** @class */ (function () {
|
|
|
877
891
|
Integer.fromString = function (str, radix, _a) {
|
|
878
892
|
var _b = _a === void 0 ? {} : _a, strictStringValidation = _b.strictStringValidation;
|
|
879
893
|
if (str.length === 0) {
|
|
880
|
-
throw (0, error_1$
|
|
894
|
+
throw (0, error_1$b.newError)('number format error: empty string');
|
|
881
895
|
}
|
|
882
896
|
if (str === 'NaN' ||
|
|
883
897
|
str === 'Infinity' ||
|
|
@@ -887,11 +901,11 @@ var Integer = /** @class */ (function () {
|
|
|
887
901
|
}
|
|
888
902
|
radix = radix !== null && radix !== void 0 ? radix : 10;
|
|
889
903
|
if (radix < 2 || radix > 36) {
|
|
890
|
-
throw (0, error_1$
|
|
904
|
+
throw (0, error_1$b.newError)('radix out of range: ' + radix.toString());
|
|
891
905
|
}
|
|
892
906
|
var p;
|
|
893
907
|
if ((p = str.indexOf('-')) > 0) {
|
|
894
|
-
throw (0, error_1$
|
|
908
|
+
throw (0, error_1$b.newError)('number format error: interior "-" character: ' + str);
|
|
895
909
|
}
|
|
896
910
|
else if (p === 0) {
|
|
897
911
|
return Integer.fromString(str.substring(1), radix).negate();
|
|
@@ -905,7 +919,7 @@ var Integer = /** @class */ (function () {
|
|
|
905
919
|
var valueString = str.substring(i, i + size);
|
|
906
920
|
var value = parseInt(valueString, radix);
|
|
907
921
|
if (strictStringValidation === true && !_isValidNumberFromString(valueString, value, radix)) {
|
|
908
|
-
throw (0, error_1$
|
|
922
|
+
throw (0, error_1$b.newError)("number format error: \"".concat(valueString, "\" is NaN in radix ").concat(radix, ": ").concat(str));
|
|
909
923
|
}
|
|
910
924
|
if (size < 8) {
|
|
911
925
|
var power = Integer.fromNumber(Math.pow(radix, size));
|
|
@@ -2110,7 +2124,7 @@ Object.defineProperty(temporalTypes, "__esModule", { value: true });
|
|
|
2110
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;
|
|
2111
2125
|
var util$3 = __importStar$a(temporalUtil$1);
|
|
2112
2126
|
var util_1$7 = util$4;
|
|
2113
|
-
var error_1$
|
|
2127
|
+
var error_1$a = error;
|
|
2114
2128
|
var integer_1$2 = __importStar$a(integer);
|
|
2115
2129
|
var IDENTIFIER_PROPERTY_ATTRIBUTES$1 = {
|
|
2116
2130
|
value: true,
|
|
@@ -2636,7 +2650,7 @@ function verifyTimeZoneArguments(timeZoneOffsetSeconds, timeZoneId) {
|
|
|
2636
2650
|
var offsetDefined = timeZoneOffsetSeconds !== null && timeZoneOffsetSeconds !== undefined;
|
|
2637
2651
|
var idDefined = timeZoneId !== null && timeZoneId !== undefined && timeZoneId !== '';
|
|
2638
2652
|
if (!offsetDefined && !idDefined) {
|
|
2639
|
-
throw (0, error_1$
|
|
2653
|
+
throw (0, error_1$a.newError)(
|
|
2640
2654
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
2641
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));
|
|
2642
2656
|
}
|
|
@@ -3046,7 +3060,7 @@ var record = {};
|
|
|
3046
3060
|
* See the License for the specific language governing permissions and
|
|
3047
3061
|
* limitations under the License.
|
|
3048
3062
|
*/
|
|
3049
|
-
var __generator$
|
|
3063
|
+
var __generator$i = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
3050
3064
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
3051
3065
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
3052
3066
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -3101,7 +3115,7 @@ var __read$t = (commonjsGlobal && commonjsGlobal.__read) || function (o, n) {
|
|
|
3101
3115
|
return ar;
|
|
3102
3116
|
};
|
|
3103
3117
|
Object.defineProperty(record, "__esModule", { value: true });
|
|
3104
|
-
var error_1$
|
|
3118
|
+
var error_1$9 = error;
|
|
3105
3119
|
function generateFieldLookup(keys) {
|
|
3106
3120
|
var lookup = {};
|
|
3107
3121
|
keys.forEach(function (name, idx) {
|
|
@@ -3214,7 +3228,7 @@ var Record = /** @class */ (function () {
|
|
|
3214
3228
|
*/
|
|
3215
3229
|
Record.prototype.entries = function () {
|
|
3216
3230
|
var i;
|
|
3217
|
-
return __generator$
|
|
3231
|
+
return __generator$i(this, function (_a) {
|
|
3218
3232
|
switch (_a.label) {
|
|
3219
3233
|
case 0:
|
|
3220
3234
|
i = 0;
|
|
@@ -3240,7 +3254,7 @@ var Record = /** @class */ (function () {
|
|
|
3240
3254
|
*/
|
|
3241
3255
|
Record.prototype.values = function () {
|
|
3242
3256
|
var i;
|
|
3243
|
-
return __generator$
|
|
3257
|
+
return __generator$i(this, function (_a) {
|
|
3244
3258
|
switch (_a.label) {
|
|
3245
3259
|
case 0:
|
|
3246
3260
|
i = 0;
|
|
@@ -3266,7 +3280,7 @@ var Record = /** @class */ (function () {
|
|
|
3266
3280
|
*/
|
|
3267
3281
|
Record.prototype[Symbol.iterator] = function () {
|
|
3268
3282
|
var i;
|
|
3269
|
-
return __generator$
|
|
3283
|
+
return __generator$i(this, function (_a) {
|
|
3270
3284
|
switch (_a.label) {
|
|
3271
3285
|
case 0:
|
|
3272
3286
|
i = 0;
|
|
@@ -3319,7 +3333,7 @@ var Record = /** @class */ (function () {
|
|
|
3319
3333
|
if (!(typeof key === 'number')) {
|
|
3320
3334
|
index = this._fieldLookup[key];
|
|
3321
3335
|
if (index === undefined) {
|
|
3322
|
-
throw (0, error_1$
|
|
3336
|
+
throw (0, error_1$9.newError)("This record has no field with key '".concat(key.toString(), "', available keys are: [") +
|
|
3323
3337
|
this.keys.toString() +
|
|
3324
3338
|
'].');
|
|
3325
3339
|
}
|
|
@@ -3328,7 +3342,7 @@ var Record = /** @class */ (function () {
|
|
|
3328
3342
|
index = key;
|
|
3329
3343
|
}
|
|
3330
3344
|
if (index > this._fields.length - 1 || index < 0) {
|
|
3331
|
-
throw (0, error_1$
|
|
3345
|
+
throw (0, error_1$9.newError)("This record has no field with index '" +
|
|
3332
3346
|
index.toString() +
|
|
3333
3347
|
"'. Remember that indexes start at `0`, " +
|
|
3334
3348
|
'and make sure your query returns records in the shape you meant it to.');
|
|
@@ -4276,7 +4290,7 @@ var __extends$G = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
|
|
|
4276
4290
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4277
4291
|
};
|
|
4278
4292
|
})();
|
|
4279
|
-
var __awaiter$
|
|
4293
|
+
var __awaiter$f = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4280
4294
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4281
4295
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4282
4296
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4285,7 +4299,7 @@ var __awaiter$c = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
|
|
|
4285
4299
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4286
4300
|
});
|
|
4287
4301
|
};
|
|
4288
|
-
var __generator$
|
|
4302
|
+
var __generator$h = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
4289
4303
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4290
4304
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
4291
4305
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -4314,7 +4328,7 @@ var __generator$e = (commonjsGlobal && commonjsGlobal.__generator) || function (
|
|
|
4314
4328
|
};
|
|
4315
4329
|
Object.defineProperty(connectionHolder$1, "__esModule", { value: true });
|
|
4316
4330
|
connectionHolder$1.EMPTY_CONNECTION_HOLDER = connectionHolder$1.ReadOnlyConnectionHolder = connectionHolder$1.ConnectionHolder = void 0;
|
|
4317
|
-
var error_1$
|
|
4331
|
+
var error_1$8 = error;
|
|
4318
4332
|
var util_1$5 = util$4;
|
|
4319
4333
|
var constants_1$2 = constants$1;
|
|
4320
4334
|
var bookmarks_1$3 = bookmarks$1;
|
|
@@ -4376,10 +4390,10 @@ var ConnectionHolder = /** @class */ (function () {
|
|
|
4376
4390
|
return true;
|
|
4377
4391
|
};
|
|
4378
4392
|
ConnectionHolder.prototype._createConnectionPromise = function (connectionProvider) {
|
|
4379
|
-
return __awaiter$
|
|
4393
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4380
4394
|
var _a, _b;
|
|
4381
4395
|
var _c;
|
|
4382
|
-
return __generator$
|
|
4396
|
+
return __generator$h(this, function (_d) {
|
|
4383
4397
|
switch (_d.label) {
|
|
4384
4398
|
case 0:
|
|
4385
4399
|
_b = (_a = connectionProvider).acquireConnection;
|
|
@@ -4398,8 +4412,8 @@ var ConnectionHolder = /** @class */ (function () {
|
|
|
4398
4412
|
});
|
|
4399
4413
|
};
|
|
4400
4414
|
ConnectionHolder.prototype._getBookmarks = function () {
|
|
4401
|
-
return __awaiter$
|
|
4402
|
-
return __generator$
|
|
4415
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4416
|
+
return __generator$h(this, function (_a) {
|
|
4403
4417
|
switch (_a.label) {
|
|
4404
4418
|
case 0: return [4 /*yield*/, this._getConnectionAcquistionBookmarks()];
|
|
4405
4419
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -4530,18 +4544,18 @@ var EmptyConnectionHolder = /** @class */ (function (_super) {
|
|
|
4530
4544
|
return true;
|
|
4531
4545
|
};
|
|
4532
4546
|
EmptyConnectionHolder.prototype.getConnection = function () {
|
|
4533
|
-
return __awaiter$
|
|
4534
|
-
return __generator$
|
|
4547
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4548
|
+
return __generator$h(this, function (_a) {
|
|
4535
4549
|
switch (_a.label) {
|
|
4536
|
-
case 0: return [4 /*yield*/, Promise.reject((0, error_1$
|
|
4550
|
+
case 0: return [4 /*yield*/, Promise.reject((0, error_1$8.newError)('This connection holder does not serve connections'))];
|
|
4537
4551
|
case 1: return [2 /*return*/, _a.sent()];
|
|
4538
4552
|
}
|
|
4539
4553
|
});
|
|
4540
4554
|
});
|
|
4541
4555
|
};
|
|
4542
4556
|
EmptyConnectionHolder.prototype.releaseConnection = function () {
|
|
4543
|
-
return __awaiter$
|
|
4544
|
-
return __generator$
|
|
4557
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4558
|
+
return __generator$h(this, function (_a) {
|
|
4545
4559
|
switch (_a.label) {
|
|
4546
4560
|
case 0: return [4 /*yield*/, Promise.resolve(null)];
|
|
4547
4561
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -4550,8 +4564,8 @@ var EmptyConnectionHolder = /** @class */ (function (_super) {
|
|
|
4550
4564
|
});
|
|
4551
4565
|
};
|
|
4552
4566
|
EmptyConnectionHolder.prototype.close = function () {
|
|
4553
|
-
return __awaiter$
|
|
4554
|
-
return __generator$
|
|
4567
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4568
|
+
return __generator$h(this, function (_a) {
|
|
4555
4569
|
switch (_a.label) {
|
|
4556
4570
|
case 0: return [4 /*yield*/, Promise.resolve(null)];
|
|
4557
4571
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -4619,7 +4633,7 @@ var __importStar$7 = (commonjsGlobal && commonjsGlobal.__importStar) || function
|
|
|
4619
4633
|
Object.defineProperty(txConfig$1, "__esModule", { value: true });
|
|
4620
4634
|
txConfig$1.TxConfig = void 0;
|
|
4621
4635
|
var util$1 = __importStar$7(util$4);
|
|
4622
|
-
var error_1$
|
|
4636
|
+
var error_1$7 = error;
|
|
4623
4637
|
var integer_1 = integer;
|
|
4624
4638
|
/**
|
|
4625
4639
|
* Internal holder of the transaction configuration.
|
|
@@ -4663,7 +4677,7 @@ function extractTimeout(config) {
|
|
|
4663
4677
|
util$1.assertNumberOrInteger(config.timeout, 'Transaction timeout');
|
|
4664
4678
|
var timeout = (0, integer_1.int)(config.timeout);
|
|
4665
4679
|
if (timeout.isNegative()) {
|
|
4666
|
-
throw (0, error_1$
|
|
4680
|
+
throw (0, error_1$7.newError)('Transaction timeout should not be negative');
|
|
4667
4681
|
}
|
|
4668
4682
|
return timeout;
|
|
4669
4683
|
}
|
|
@@ -4710,7 +4724,7 @@ var transactionExecutor$1 = {};
|
|
|
4710
4724
|
* limitations under the License.
|
|
4711
4725
|
*/
|
|
4712
4726
|
/* eslint-disable @typescript-eslint/promise-function-async */
|
|
4713
|
-
var __awaiter$
|
|
4727
|
+
var __awaiter$e = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4714
4728
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4715
4729
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4716
4730
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4719,7 +4733,7 @@ var __awaiter$b = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
|
|
|
4719
4733
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4720
4734
|
});
|
|
4721
4735
|
};
|
|
4722
|
-
var __generator$
|
|
4736
|
+
var __generator$g = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
4723
4737
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4724
4738
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
4725
4739
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -4748,7 +4762,7 @@ var __generator$d = (commonjsGlobal && commonjsGlobal.__generator) || function (
|
|
|
4748
4762
|
};
|
|
4749
4763
|
Object.defineProperty(transactionExecutor$1, "__esModule", { value: true });
|
|
4750
4764
|
transactionExecutor$1.TransactionExecutor = void 0;
|
|
4751
|
-
var error_1$
|
|
4765
|
+
var error_1$6 = error;
|
|
4752
4766
|
var DEFAULT_MAX_RETRY_TIME_MS$1 = 30 * 1000; // 30 seconds
|
|
4753
4767
|
var DEFAULT_INITIAL_RETRY_DELAY_MS$1 = 1000; // 1 seconds
|
|
4754
4768
|
var DEFAULT_RETRY_DELAY_MULTIPLIER$1 = 2.0;
|
|
@@ -4780,7 +4794,7 @@ var TransactionExecutor = /** @class */ (function () {
|
|
|
4780
4794
|
TransactionExecutor.prototype._retryTransactionPromise = function (transactionCreator, transactionWork, error, retryStartTime, retryDelayMs, transactionWrapper) {
|
|
4781
4795
|
var _this = this;
|
|
4782
4796
|
var elapsedTimeMs = Date.now() - retryStartTime;
|
|
4783
|
-
if (elapsedTimeMs > this._maxRetryTimeMs || !(0, error_1$
|
|
4797
|
+
if (elapsedTimeMs > this._maxRetryTimeMs || !(0, error_1$6.isRetriableError)(error)) {
|
|
4784
4798
|
return Promise.reject(error);
|
|
4785
4799
|
}
|
|
4786
4800
|
return new Promise(function (resolve, reject) {
|
|
@@ -4798,10 +4812,10 @@ var TransactionExecutor = /** @class */ (function () {
|
|
|
4798
4812
|
});
|
|
4799
4813
|
};
|
|
4800
4814
|
TransactionExecutor.prototype._executeTransactionInsidePromise = function (transactionCreator, transactionWork, resolve, reject, transactionWrapper) {
|
|
4801
|
-
return __awaiter$
|
|
4815
|
+
return __awaiter$e(this, void 0, void 0, function () {
|
|
4802
4816
|
var tx, error_2, wrap, wrappedTx, resultPromise;
|
|
4803
4817
|
var _this = this;
|
|
4804
|
-
return __generator$
|
|
4818
|
+
return __generator$g(this, function (_a) {
|
|
4805
4819
|
switch (_a.label) {
|
|
4806
4820
|
case 0:
|
|
4807
4821
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -4883,16 +4897,16 @@ var TransactionExecutor = /** @class */ (function () {
|
|
|
4883
4897
|
};
|
|
4884
4898
|
TransactionExecutor.prototype._verifyAfterConstruction = function () {
|
|
4885
4899
|
if (this._maxRetryTimeMs < 0) {
|
|
4886
|
-
throw (0, error_1$
|
|
4900
|
+
throw (0, error_1$6.newError)('Max retry time should be >= 0: ' + this._maxRetryTimeMs.toString());
|
|
4887
4901
|
}
|
|
4888
4902
|
if (this._initialRetryDelayMs < 0) {
|
|
4889
|
-
throw (0, error_1$
|
|
4903
|
+
throw (0, error_1$6.newError)('Initial retry delay should >= 0: ' + this._initialRetryDelayMs.toString());
|
|
4890
4904
|
}
|
|
4891
4905
|
if (this._multiplier < 1.0) {
|
|
4892
|
-
throw (0, error_1$
|
|
4906
|
+
throw (0, error_1$6.newError)('Multiplier should be >= 1.0: ' + this._multiplier.toString());
|
|
4893
4907
|
}
|
|
4894
4908
|
if (this._jitterFactor < 0 || this._jitterFactor > 1) {
|
|
4895
|
-
throw (0, error_1$
|
|
4909
|
+
throw (0, error_1$6.newError)('Jitter factor should be in [0.0, 1.0]: ' + this._jitterFactor.toFixed());
|
|
4896
4910
|
}
|
|
4897
4911
|
};
|
|
4898
4912
|
return TransactionExecutor;
|
|
@@ -4943,7 +4957,7 @@ logger$1.Logger = void 0;
|
|
|
4943
4957
|
* See the License for the specific language governing permissions and
|
|
4944
4958
|
* limitations under the License.
|
|
4945
4959
|
*/
|
|
4946
|
-
var error_1$
|
|
4960
|
+
var error_1$5 = error;
|
|
4947
4961
|
var ERROR = 'error';
|
|
4948
4962
|
var WARN = 'warn';
|
|
4949
4963
|
var INFO = 'info';
|
|
@@ -5099,7 +5113,7 @@ function extractConfiguredLevel(loggingConfig) {
|
|
|
5099
5113
|
var configuredLevel = loggingConfig.level;
|
|
5100
5114
|
var value = levels[configuredLevel];
|
|
5101
5115
|
if (value == null && value !== 0) {
|
|
5102
|
-
throw (0, error_1$
|
|
5116
|
+
throw (0, error_1$5.newError)("Illegal logging level: ".concat(configuredLevel, ". Supported levels are: ").concat(Object.keys(levels).toString()));
|
|
5103
5117
|
}
|
|
5104
5118
|
return configuredLevel;
|
|
5105
5119
|
}
|
|
@@ -5118,7 +5132,7 @@ function extractConfiguredLogger(loggingConfig) {
|
|
|
5118
5132
|
return configuredLogger;
|
|
5119
5133
|
}
|
|
5120
5134
|
}
|
|
5121
|
-
throw (0, error_1$
|
|
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'));
|
|
5122
5136
|
}
|
|
5123
5137
|
|
|
5124
5138
|
var urlUtil$2 = {};
|
|
@@ -5592,7 +5606,7 @@ var ConfiguredCustomResolver = /** @class */ (function () {
|
|
|
5592
5606
|
}());
|
|
5593
5607
|
configuredCustomResolver.default = ConfiguredCustomResolver;
|
|
5594
5608
|
|
|
5595
|
-
var __importDefault$
|
|
5609
|
+
var __importDefault$K = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5596
5610
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5597
5611
|
};
|
|
5598
5612
|
Object.defineProperty(resolver$1, "__esModule", { value: true });
|
|
@@ -5615,9 +5629,9 @@ resolver$1.ConfiguredCustomResolver = resolver$1.BaseHostNameResolver = void 0;
|
|
|
5615
5629
|
* See the License for the specific language governing permissions and
|
|
5616
5630
|
* limitations under the License.
|
|
5617
5631
|
*/
|
|
5618
|
-
var base_host_name_resolver_1 = __importDefault$
|
|
5632
|
+
var base_host_name_resolver_1 = __importDefault$K(baseHostNameResolver);
|
|
5619
5633
|
resolver$1.BaseHostNameResolver = base_host_name_resolver_1.default;
|
|
5620
|
-
var configured_custom_resolver_1$1 = __importDefault$
|
|
5634
|
+
var configured_custom_resolver_1$1 = __importDefault$K(configuredCustomResolver);
|
|
5621
5635
|
resolver$1.ConfiguredCustomResolver = configured_custom_resolver_1$1.default;
|
|
5622
5636
|
|
|
5623
5637
|
/**
|
|
@@ -5708,7 +5722,7 @@ internal.objectUtil = objectUtil$1;
|
|
|
5708
5722
|
* See the License for the specific language governing permissions and
|
|
5709
5723
|
* limitations under the License.
|
|
5710
5724
|
*/
|
|
5711
|
-
var __awaiter$
|
|
5725
|
+
var __awaiter$d = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5712
5726
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5713
5727
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5714
5728
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -5717,7 +5731,7 @@ var __awaiter$a = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
|
|
|
5717
5731
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5718
5732
|
});
|
|
5719
5733
|
};
|
|
5720
|
-
var __generator$
|
|
5734
|
+
var __generator$f = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
5721
5735
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
5722
5736
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5723
5737
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -5744,14 +5758,14 @@ var __generator$c = (commonjsGlobal && commonjsGlobal.__generator) || function (
|
|
|
5744
5758
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
5745
5759
|
}
|
|
5746
5760
|
};
|
|
5747
|
-
var __importDefault$
|
|
5761
|
+
var __importDefault$J = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5748
5762
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5749
5763
|
};
|
|
5750
5764
|
Object.defineProperty(result, "__esModule", { value: true });
|
|
5751
5765
|
/* eslint-disable @typescript-eslint/promise-function-async */
|
|
5752
|
-
var result_summary_1 = __importDefault$
|
|
5766
|
+
var result_summary_1 = __importDefault$J(resultSummary);
|
|
5753
5767
|
var internal_1 = internal;
|
|
5754
|
-
var error_1$
|
|
5768
|
+
var error_1$4 = error;
|
|
5755
5769
|
var EMPTY_CONNECTION_HOLDER = internal_1.connectionHolder.EMPTY_CONNECTION_HOLDER;
|
|
5756
5770
|
/**
|
|
5757
5771
|
* @private
|
|
@@ -5899,7 +5913,7 @@ var Result = /** @class */ (function () {
|
|
|
5899
5913
|
Result.prototype[Symbol.asyncIterator] = function () {
|
|
5900
5914
|
var _this = this;
|
|
5901
5915
|
if (!this.isOpen()) {
|
|
5902
|
-
var error_2 = (0, error_1$
|
|
5916
|
+
var error_2 = (0, error_1$4.newError)('Result is already consumed');
|
|
5903
5917
|
return {
|
|
5904
5918
|
next: function () { return Promise.reject(error_2); },
|
|
5905
5919
|
peek: function () { return Promise.reject(error_2); }
|
|
@@ -5924,9 +5938,9 @@ var Result = /** @class */ (function () {
|
|
|
5924
5938
|
state.streaming.resume();
|
|
5925
5939
|
}
|
|
5926
5940
|
};
|
|
5927
|
-
var initializeObserver = function () { return __awaiter$
|
|
5941
|
+
var initializeObserver = function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
5928
5942
|
var _a;
|
|
5929
|
-
return __generator$
|
|
5943
|
+
return __generator$f(this, function (_b) {
|
|
5930
5944
|
switch (_b.label) {
|
|
5931
5945
|
case 0:
|
|
5932
5946
|
if (!(state.queuedObserver === undefined)) return [3 /*break*/, 2];
|
|
@@ -5943,14 +5957,14 @@ var Result = /** @class */ (function () {
|
|
|
5943
5957
|
}); };
|
|
5944
5958
|
var assertSummary = function (summary) {
|
|
5945
5959
|
if (summary === undefined) {
|
|
5946
|
-
throw (0, error_1$
|
|
5960
|
+
throw (0, error_1$4.newError)('InvalidState: Result stream finished without Summary', error_1$4.PROTOCOL_ERROR);
|
|
5947
5961
|
}
|
|
5948
5962
|
return true;
|
|
5949
5963
|
};
|
|
5950
5964
|
return {
|
|
5951
|
-
next: function () { return __awaiter$
|
|
5965
|
+
next: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
5952
5966
|
var queuedObserver, next;
|
|
5953
|
-
return __generator$
|
|
5967
|
+
return __generator$f(this, function (_a) {
|
|
5954
5968
|
switch (_a.label) {
|
|
5955
5969
|
case 0:
|
|
5956
5970
|
if (state.finished) {
|
|
@@ -5972,10 +5986,10 @@ var Result = /** @class */ (function () {
|
|
|
5972
5986
|
}
|
|
5973
5987
|
});
|
|
5974
5988
|
}); },
|
|
5975
|
-
return: function (value) { return __awaiter$
|
|
5989
|
+
return: function (value) { return __awaiter$d(_this, void 0, void 0, function () {
|
|
5976
5990
|
var queuedObserver, last;
|
|
5977
5991
|
var _a;
|
|
5978
|
-
return __generator$
|
|
5992
|
+
return __generator$f(this, function (_b) {
|
|
5979
5993
|
switch (_b.label) {
|
|
5980
5994
|
case 0:
|
|
5981
5995
|
if (state.finished) {
|
|
@@ -5997,9 +6011,9 @@ var Result = /** @class */ (function () {
|
|
|
5997
6011
|
}
|
|
5998
6012
|
});
|
|
5999
6013
|
}); },
|
|
6000
|
-
peek: function () { return __awaiter$
|
|
6014
|
+
peek: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
6001
6015
|
var queuedObserver;
|
|
6002
|
-
return __generator$
|
|
6016
|
+
return __generator$f(this, function (_a) {
|
|
6003
6017
|
switch (_a.label) {
|
|
6004
6018
|
case 0:
|
|
6005
6019
|
if (state.finished) {
|
|
@@ -6191,13 +6205,13 @@ var Result = /** @class */ (function () {
|
|
|
6191
6205
|
}
|
|
6192
6206
|
function dequeue() {
|
|
6193
6207
|
var _a;
|
|
6194
|
-
return __awaiter$
|
|
6208
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
6195
6209
|
var element;
|
|
6196
|
-
return __generator$
|
|
6210
|
+
return __generator$f(this, function (_b) {
|
|
6197
6211
|
switch (_b.label) {
|
|
6198
6212
|
case 0:
|
|
6199
6213
|
if (buffer.length > 0) {
|
|
6200
|
-
element = (_a = buffer.shift()) !== null && _a !== void 0 ? _a : (0, error_1$
|
|
6214
|
+
element = (_a = buffer.shift()) !== null && _a !== void 0 ? _a : (0, error_1$4.newError)('Unexpected empty buffer', error_1$4.PROTOCOL_ERROR);
|
|
6201
6215
|
onQueueSizeChanged();
|
|
6202
6216
|
if (isError(element)) {
|
|
6203
6217
|
throw element;
|
|
@@ -6240,9 +6254,9 @@ var Result = /** @class */ (function () {
|
|
|
6240
6254
|
}
|
|
6241
6255
|
},
|
|
6242
6256
|
dequeue: dequeue,
|
|
6243
|
-
dequeueUntilDone: function () { return __awaiter$
|
|
6257
|
+
dequeueUntilDone: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
6244
6258
|
var element;
|
|
6245
|
-
return __generator$
|
|
6259
|
+
return __generator$f(this, function (_a) {
|
|
6246
6260
|
switch (_a.label) {
|
|
6247
6261
|
case 0:
|
|
6248
6262
|
return [4 /*yield*/, dequeue()];
|
|
@@ -6256,9 +6270,9 @@ var Result = /** @class */ (function () {
|
|
|
6256
6270
|
}
|
|
6257
6271
|
});
|
|
6258
6272
|
}); },
|
|
6259
|
-
head: function () { return __awaiter$
|
|
6273
|
+
head: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
6260
6274
|
var element, element, error_3;
|
|
6261
|
-
return __generator$
|
|
6275
|
+
return __generator$f(this, function (_a) {
|
|
6262
6276
|
switch (_a.label) {
|
|
6263
6277
|
case 0:
|
|
6264
6278
|
if (buffer.length > 0) {
|
|
@@ -6319,6 +6333,59 @@ function replaceStacktrace(error, newStack) {
|
|
|
6319
6333
|
}
|
|
6320
6334
|
result.default = Result;
|
|
6321
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
|
+
|
|
6322
6389
|
var connectionProvider$1 = {};
|
|
6323
6390
|
|
|
6324
6391
|
/**
|
|
@@ -6364,6 +6431,7 @@ var ConnectionProvider = /** @class */ (function () {
|
|
|
6364
6431
|
* @property {Bookmarks} param.bookmarks - the bookmarks to send to routing discovery
|
|
6365
6432
|
* @property {string} param.impersonatedUser - the impersonated user
|
|
6366
6433
|
* @property {function (databaseName:string?)} param.onDatabaseNameResolved - Callback called when the database name get resolved
|
|
6434
|
+
* @returns {Promise<Connection>}
|
|
6367
6435
|
*/
|
|
6368
6436
|
ConnectionProvider.prototype.acquireConnection = function (param) {
|
|
6369
6437
|
throw Error('Not implemented');
|
|
@@ -6584,7 +6652,7 @@ var transaction = {};
|
|
|
6584
6652
|
* See the License for the specific language governing permissions and
|
|
6585
6653
|
* limitations under the License.
|
|
6586
6654
|
*/
|
|
6587
|
-
var __awaiter$
|
|
6655
|
+
var __awaiter$c = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6588
6656
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6589
6657
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6590
6658
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -6593,7 +6661,7 @@ var __awaiter$9 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
|
|
|
6593
6661
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6594
6662
|
});
|
|
6595
6663
|
};
|
|
6596
|
-
var __generator$
|
|
6664
|
+
var __generator$e = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
6597
6665
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
6598
6666
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
6599
6667
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -6620,7 +6688,7 @@ var __generator$b = (commonjsGlobal && commonjsGlobal.__generator) || function (
|
|
|
6620
6688
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
6621
6689
|
}
|
|
6622
6690
|
};
|
|
6623
|
-
var __importDefault$
|
|
6691
|
+
var __importDefault$I = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
6624
6692
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6625
6693
|
};
|
|
6626
6694
|
Object.defineProperty(transaction, "__esModule", { value: true });
|
|
@@ -6630,8 +6698,8 @@ var connection_holder_1$1 = connectionHolder$1;
|
|
|
6630
6698
|
var bookmarks_1$2 = bookmarks$1;
|
|
6631
6699
|
var tx_config_1$1 = txConfig$1;
|
|
6632
6700
|
var observers_1$1 = observers;
|
|
6633
|
-
var error_1$
|
|
6634
|
-
var result_1$1 = __importDefault$
|
|
6701
|
+
var error_1$3 = error;
|
|
6702
|
+
var result_1$1 = __importDefault$I(result);
|
|
6635
6703
|
/**
|
|
6636
6704
|
* Represents a transaction in the Neo4j database.
|
|
6637
6705
|
*
|
|
@@ -6683,10 +6751,10 @@ var Transaction = /** @class */ (function () {
|
|
|
6683
6751
|
var _this = this;
|
|
6684
6752
|
this._connectionHolder
|
|
6685
6753
|
.getConnection()
|
|
6686
|
-
.then(function (connection) { return __awaiter$
|
|
6754
|
+
.then(function (connection) { return __awaiter$c(_this, void 0, void 0, function () {
|
|
6687
6755
|
var _a;
|
|
6688
6756
|
var _this = this;
|
|
6689
|
-
return __generator$
|
|
6757
|
+
return __generator$e(this, function (_b) {
|
|
6690
6758
|
switch (_b.label) {
|
|
6691
6759
|
case 0:
|
|
6692
6760
|
this._onConnection();
|
|
@@ -6714,7 +6782,7 @@ var Transaction = /** @class */ (function () {
|
|
|
6714
6782
|
return _this._onComplete(metadata);
|
|
6715
6783
|
}
|
|
6716
6784
|
})];
|
|
6717
|
-
case 2: throw (0, error_1$
|
|
6785
|
+
case 2: throw (0, error_1$3.newError)('No connection available');
|
|
6718
6786
|
}
|
|
6719
6787
|
});
|
|
6720
6788
|
}); })
|
|
@@ -6822,8 +6890,8 @@ var Transaction = /** @class */ (function () {
|
|
|
6822
6890
|
* @returns {Promise<void>} An empty promise if closed successfully or error if any error happened during
|
|
6823
6891
|
*/
|
|
6824
6892
|
Transaction.prototype.close = function () {
|
|
6825
|
-
return __awaiter$
|
|
6826
|
-
return __generator$
|
|
6893
|
+
return __awaiter$c(this, void 0, void 0, function () {
|
|
6894
|
+
return __generator$e(this, function (_a) {
|
|
6827
6895
|
switch (_a.label) {
|
|
6828
6896
|
case 0:
|
|
6829
6897
|
if (!this.isOpen()) return [3 /*break*/, 2];
|
|
@@ -6894,7 +6962,7 @@ var _states$1 = {
|
|
|
6894
6962
|
});
|
|
6895
6963
|
}
|
|
6896
6964
|
else {
|
|
6897
|
-
throw (0, error_1$
|
|
6965
|
+
throw (0, error_1$3.newError)('No connection available');
|
|
6898
6966
|
}
|
|
6899
6967
|
})
|
|
6900
6968
|
.catch(function (error) { return new observers_1$1.FailedObserver({ error: error, onError: onError }); });
|
|
@@ -6908,7 +6976,7 @@ var _states$1 = {
|
|
|
6908
6976
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6909
6977
|
return {
|
|
6910
6978
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6911
|
-
error: (0, error_1$
|
|
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.'),
|
|
6912
6980
|
onError: onError
|
|
6913
6981
|
}), 'COMMIT', {}, connectionHolder, 0, // high watermark
|
|
6914
6982
|
0 // low watermark
|
|
@@ -6928,7 +6996,7 @@ var _states$1 = {
|
|
|
6928
6996
|
run: function (query, parameters, _a) {
|
|
6929
6997
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6930
6998
|
return newCompletedResult(new observers_1$1.FailedObserver({
|
|
6931
|
-
error: (0, error_1$
|
|
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.'),
|
|
6932
7000
|
onError: onError
|
|
6933
7001
|
}), query, parameters, connectionHolder, 0, // high watermark
|
|
6934
7002
|
0 // low watermark
|
|
@@ -6941,7 +7009,7 @@ var _states$1 = {
|
|
|
6941
7009
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6942
7010
|
return {
|
|
6943
7011
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6944
|
-
error: (0, error_1$
|
|
7012
|
+
error: (0, error_1$3.newError)('Cannot commit this transaction, because it has already been committed.'),
|
|
6945
7013
|
onError: onError
|
|
6946
7014
|
}), 'COMMIT', {}, connection_holder_1$1.EMPTY_CONNECTION_HOLDER, 0, // high watermark
|
|
6947
7015
|
0 // low watermark
|
|
@@ -6954,7 +7022,7 @@ var _states$1 = {
|
|
|
6954
7022
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6955
7023
|
return {
|
|
6956
7024
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6957
|
-
error: (0, error_1$
|
|
7025
|
+
error: (0, error_1$3.newError)('Cannot rollback this transaction, because it has already been committed.'),
|
|
6958
7026
|
onError: onError
|
|
6959
7027
|
}), 'ROLLBACK', {}, connection_holder_1$1.EMPTY_CONNECTION_HOLDER, 0, // high watermark
|
|
6960
7028
|
0 // low watermark
|
|
@@ -6966,7 +7034,7 @@ var _states$1 = {
|
|
|
6966
7034
|
run: function (query, parameters, _a) {
|
|
6967
7035
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6968
7036
|
return newCompletedResult(new observers_1$1.FailedObserver({
|
|
6969
|
-
error: (0, error_1$
|
|
7037
|
+
error: (0, error_1$3.newError)('Cannot run query in this transaction, because it has already been committed.'),
|
|
6970
7038
|
onError: onError
|
|
6971
7039
|
}), query, parameters, connectionHolder, 0, // high watermark
|
|
6972
7040
|
0 // low watermark
|
|
@@ -6979,7 +7047,7 @@ var _states$1 = {
|
|
|
6979
7047
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6980
7048
|
return {
|
|
6981
7049
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6982
|
-
error: (0, error_1$
|
|
7050
|
+
error: (0, error_1$3.newError)('Cannot commit this transaction, because it has already been rolled back.'),
|
|
6983
7051
|
onError: onError
|
|
6984
7052
|
}), 'COMMIT', {}, connectionHolder, 0, // high watermark
|
|
6985
7053
|
0 // low watermark
|
|
@@ -6991,7 +7059,7 @@ var _states$1 = {
|
|
|
6991
7059
|
var connectionHolder = _a.connectionHolder; _a.onError; _a.onComplete;
|
|
6992
7060
|
return {
|
|
6993
7061
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6994
|
-
error: (0, error_1$
|
|
7062
|
+
error: (0, error_1$3.newError)('Cannot rollback this transaction, because it has already been rolled back.')
|
|
6995
7063
|
}), 'ROLLBACK', {}, connectionHolder, 0, // high watermark
|
|
6996
7064
|
0 // low watermark
|
|
6997
7065
|
),
|
|
@@ -7001,7 +7069,7 @@ var _states$1 = {
|
|
|
7001
7069
|
run: function (query, parameters, _a) {
|
|
7002
7070
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
7003
7071
|
return newCompletedResult(new observers_1$1.FailedObserver({
|
|
7004
|
-
error: (0, error_1$
|
|
7072
|
+
error: (0, error_1$3.newError)('Cannot run query in this transaction, because it has already been rolled back.'),
|
|
7005
7073
|
onError: onError
|
|
7006
7074
|
}), query, parameters, connectionHolder, 0, // high watermark
|
|
7007
7075
|
0 // low watermark
|
|
@@ -7041,7 +7109,7 @@ function finishTransaction(commit, connectionHolder, onError, onComplete, onConn
|
|
|
7041
7109
|
}
|
|
7042
7110
|
}
|
|
7043
7111
|
else {
|
|
7044
|
-
throw (0, error_1$
|
|
7112
|
+
throw (0, error_1$3.newError)('No connection available');
|
|
7045
7113
|
}
|
|
7046
7114
|
});
|
|
7047
7115
|
})
|
|
@@ -7181,13 +7249,13 @@ var __assign$d = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
|
7181
7249
|
};
|
|
7182
7250
|
return __assign$d.apply(this, arguments);
|
|
7183
7251
|
};
|
|
7184
|
-
var __importDefault$
|
|
7252
|
+
var __importDefault$H = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
7185
7253
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7186
7254
|
};
|
|
7187
7255
|
var _a$c;
|
|
7188
7256
|
Object.defineProperty(transactionPromise, "__esModule", { value: true });
|
|
7189
7257
|
/* eslint-disable @typescript-eslint/promise-function-async */
|
|
7190
|
-
var transaction_1 = __importDefault$
|
|
7258
|
+
var transaction_1 = __importDefault$H(transaction);
|
|
7191
7259
|
/**
|
|
7192
7260
|
* Represents a {@link Promise<Transaction>} object and a {@link Transaction} object.
|
|
7193
7261
|
*
|
|
@@ -7331,7 +7399,7 @@ var session = {};
|
|
|
7331
7399
|
* See the License for the specific language governing permissions and
|
|
7332
7400
|
* limitations under the License.
|
|
7333
7401
|
*/
|
|
7334
|
-
var __awaiter$
|
|
7402
|
+
var __awaiter$b = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7335
7403
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7336
7404
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7337
7405
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -7340,7 +7408,7 @@ var __awaiter$8 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (this
|
|
|
7340
7408
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7341
7409
|
});
|
|
7342
7410
|
};
|
|
7343
|
-
var __generator$
|
|
7411
|
+
var __generator$d = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
7344
7412
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
7345
7413
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
7346
7414
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -7392,7 +7460,7 @@ var __spreadArray$k = (commonjsGlobal && commonjsGlobal.__spreadArray) || functi
|
|
|
7392
7460
|
}
|
|
7393
7461
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
7394
7462
|
};
|
|
7395
|
-
var __importDefault$
|
|
7463
|
+
var __importDefault$G = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
7396
7464
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7397
7465
|
};
|
|
7398
7466
|
Object.defineProperty(session, "__esModule", { value: true });
|
|
@@ -7400,14 +7468,14 @@ Object.defineProperty(session, "__esModule", { value: true });
|
|
|
7400
7468
|
var observers_1 = observers;
|
|
7401
7469
|
var util_1$1 = util$4;
|
|
7402
7470
|
var constants_1$1 = constants$1;
|
|
7403
|
-
var error_1 = error;
|
|
7404
|
-
var result_1 = __importDefault$
|
|
7471
|
+
var error_1$2 = error;
|
|
7472
|
+
var result_1 = __importDefault$G(result);
|
|
7405
7473
|
var connection_holder_1 = connectionHolder$1;
|
|
7406
7474
|
var transaction_executor_1 = transactionExecutor$1;
|
|
7407
7475
|
var bookmarks_1$1 = bookmarks$1;
|
|
7408
7476
|
var tx_config_1 = txConfig$1;
|
|
7409
|
-
var transaction_promise_1 = __importDefault$
|
|
7410
|
-
var transaction_managed_1 = __importDefault$
|
|
7477
|
+
var transaction_promise_1 = __importDefault$G(transactionPromise);
|
|
7478
|
+
var transaction_managed_1 = __importDefault$G(transactionManaged);
|
|
7411
7479
|
/**
|
|
7412
7480
|
* A Session instance is used for handling the connection and
|
|
7413
7481
|
* sending queries through the connection.
|
|
@@ -7485,10 +7553,10 @@ var Session = /** @class */ (function () {
|
|
|
7485
7553
|
var autoCommitTxConfig = (transactionConfig != null)
|
|
7486
7554
|
? new tx_config_1.TxConfig(transactionConfig)
|
|
7487
7555
|
: tx_config_1.TxConfig.empty();
|
|
7488
|
-
var result = this._run(validatedQuery, params, function (connection) { return __awaiter$
|
|
7556
|
+
var result = this._run(validatedQuery, params, function (connection) { return __awaiter$b(_this, void 0, void 0, function () {
|
|
7489
7557
|
var bookmarks;
|
|
7490
7558
|
var _this = this;
|
|
7491
|
-
return __generator$
|
|
7559
|
+
return __generator$d(this, function (_a) {
|
|
7492
7560
|
switch (_a.label) {
|
|
7493
7561
|
case 0: return [4 /*yield*/, this._bookmarks()];
|
|
7494
7562
|
case 1:
|
|
@@ -7517,7 +7585,7 @@ var Session = /** @class */ (function () {
|
|
|
7517
7585
|
var observerPromise;
|
|
7518
7586
|
if (!this._open) {
|
|
7519
7587
|
observerPromise = Promise.resolve(new observers_1.FailedObserver({
|
|
7520
|
-
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.')
|
|
7521
7589
|
}));
|
|
7522
7590
|
}
|
|
7523
7591
|
else if (!this._hasTx && connectionHolder.initializeConnection()) {
|
|
@@ -7528,7 +7596,7 @@ var Session = /** @class */ (function () {
|
|
|
7528
7596
|
}
|
|
7529
7597
|
else {
|
|
7530
7598
|
observerPromise = Promise.resolve(new observers_1.FailedObserver({
|
|
7531
|
-
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 ' +
|
|
7532
7600
|
'session with an open transaction; either run from within the ' +
|
|
7533
7601
|
'transaction or use a different session.')
|
|
7534
7602
|
}));
|
|
@@ -7541,14 +7609,14 @@ var Session = /** @class */ (function () {
|
|
|
7541
7609
|
var promise;
|
|
7542
7610
|
var connectionHolder = this._connectionHolderWithMode(this._mode);
|
|
7543
7611
|
if (!this._open) {
|
|
7544
|
-
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.'));
|
|
7545
7613
|
}
|
|
7546
7614
|
else if (!this._hasTx && connectionHolder.initializeConnection()) {
|
|
7547
7615
|
promise = connectionHolder
|
|
7548
7616
|
.getConnection()
|
|
7549
7617
|
.then(function (connection) { return connectionConsumer(connection); })
|
|
7550
|
-
.then(function (result) { return __awaiter$
|
|
7551
|
-
return __generator$
|
|
7618
|
+
.then(function (result) { return __awaiter$b(_this, void 0, void 0, function () {
|
|
7619
|
+
return __generator$d(this, function (_a) {
|
|
7552
7620
|
switch (_a.label) {
|
|
7553
7621
|
case 0: return [4 /*yield*/, connectionHolder.releaseConnection()];
|
|
7554
7622
|
case 1:
|
|
@@ -7559,7 +7627,7 @@ var Session = /** @class */ (function () {
|
|
|
7559
7627
|
}); });
|
|
7560
7628
|
}
|
|
7561
7629
|
else {
|
|
7562
|
-
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 ' +
|
|
7563
7631
|
'session with an open transaction; either run from within the ' +
|
|
7564
7632
|
'transaction or use a different session.'));
|
|
7565
7633
|
}
|
|
@@ -7588,10 +7656,10 @@ var Session = /** @class */ (function () {
|
|
|
7588
7656
|
Session.prototype._beginTransaction = function (accessMode, txConfig) {
|
|
7589
7657
|
var _this = this;
|
|
7590
7658
|
if (!this._open) {
|
|
7591
|
-
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.');
|
|
7592
7660
|
}
|
|
7593
7661
|
if (this._hasTx) {
|
|
7594
|
-
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; ' +
|
|
7595
7663
|
'either run from within the transaction or use a different session.');
|
|
7596
7664
|
}
|
|
7597
7665
|
var mode = Session._validateSessionMode(accessMode);
|
|
@@ -7618,7 +7686,7 @@ var Session = /** @class */ (function () {
|
|
|
7618
7686
|
*/
|
|
7619
7687
|
Session.prototype._assertSessionIsOpen = function () {
|
|
7620
7688
|
if (!this._open) {
|
|
7621
|
-
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.');
|
|
7622
7690
|
}
|
|
7623
7691
|
};
|
|
7624
7692
|
/**
|
|
@@ -7631,9 +7699,10 @@ var Session = /** @class */ (function () {
|
|
|
7631
7699
|
/**
|
|
7632
7700
|
* Return the bookmarks received following the last completed {@link Transaction}.
|
|
7633
7701
|
*
|
|
7634
|
-
* @deprecated This method will be removed in version 6.0. Please, use
|
|
7702
|
+
* @deprecated This method will be removed in version 6.0. Please, use Session#lastBookmarks instead.
|
|
7635
7703
|
*
|
|
7636
7704
|
* @return {string[]} A reference to a previous transaction.
|
|
7705
|
+
* @see {@link Session#lastBookmarks}
|
|
7637
7706
|
*/
|
|
7638
7707
|
Session.prototype.lastBookmark = function () {
|
|
7639
7708
|
return this.lastBookmarks();
|
|
@@ -7648,9 +7717,9 @@ var Session = /** @class */ (function () {
|
|
|
7648
7717
|
};
|
|
7649
7718
|
Session.prototype._bookmarks = function () {
|
|
7650
7719
|
var _a;
|
|
7651
|
-
return __awaiter$
|
|
7720
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
7652
7721
|
var bookmarks;
|
|
7653
|
-
return __generator$
|
|
7722
|
+
return __generator$d(this, function (_b) {
|
|
7654
7723
|
switch (_b.label) {
|
|
7655
7724
|
case 0: return [4 /*yield*/, ((_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.getBookmarks())];
|
|
7656
7725
|
case 1:
|
|
@@ -7671,13 +7740,14 @@ var Session = /** @class */ (function () {
|
|
|
7671
7740
|
* delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
|
|
7672
7741
|
* `maxTransactionRetryTime` property in milliseconds.
|
|
7673
7742
|
*
|
|
7674
|
-
* @deprecated This method will be removed in version 6.0. Please, use
|
|
7743
|
+
* @deprecated This method will be removed in version 6.0. Please, use Session#executeRead instead.
|
|
7675
7744
|
*
|
|
7676
7745
|
* @param {function(tx: Transaction): Promise} transactionWork - Callback that executes operations against
|
|
7677
7746
|
* a given {@link Transaction}.
|
|
7678
7747
|
* @param {TransactionConfig} [transactionConfig] - Configuration for all transactions started to execute the unit of work.
|
|
7679
7748
|
* @return {Promise} Resolved promise as returned by the given function or rejected promise when given
|
|
7680
7749
|
* function or commit fails.
|
|
7750
|
+
* @see {@link Session#executeRead}
|
|
7681
7751
|
*/
|
|
7682
7752
|
Session.prototype.readTransaction = function (transactionWork, transactionConfig) {
|
|
7683
7753
|
var config = new tx_config_1.TxConfig(transactionConfig);
|
|
@@ -7691,13 +7761,14 @@ var Session = /** @class */ (function () {
|
|
|
7691
7761
|
* delay of 1 second and maximum retry time of 30 seconds. Maximum retry time is configurable via driver config's
|
|
7692
7762
|
* `maxTransactionRetryTime` property in milliseconds.
|
|
7693
7763
|
*
|
|
7694
|
-
* @deprecated This method will be removed in version 6.0. Please, use
|
|
7764
|
+
* @deprecated This method will be removed in version 6.0. Please, use Session#executeWrite instead.
|
|
7695
7765
|
*
|
|
7696
7766
|
* @param {function(tx: Transaction): Promise} transactionWork - Callback that executes operations against
|
|
7697
7767
|
* a given {@link Transaction}.
|
|
7698
7768
|
* @param {TransactionConfig} [transactionConfig] - Configuration for all transactions started to execute the unit of work.
|
|
7699
7769
|
* @return {Promise} Resolved promise as returned by the given function or rejected promise when given
|
|
7700
7770
|
* function or commit fails.
|
|
7771
|
+
* @see {@link Session#executeWrite}
|
|
7701
7772
|
*/
|
|
7702
7773
|
Session.prototype.writeTransaction = function (transactionWork, transactionConfig) {
|
|
7703
7774
|
var config = new tx_config_1.TxConfig(transactionConfig);
|
|
@@ -7771,9 +7842,9 @@ var Session = /** @class */ (function () {
|
|
|
7771
7842
|
};
|
|
7772
7843
|
Session.prototype._getConnectionAcquistionBookmarks = function () {
|
|
7773
7844
|
var _a;
|
|
7774
|
-
return __awaiter$
|
|
7845
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
7775
7846
|
var bookmarks;
|
|
7776
|
-
return __generator$
|
|
7847
|
+
return __generator$d(this, function (_b) {
|
|
7777
7848
|
switch (_b.label) {
|
|
7778
7849
|
case 0: return [4 /*yield*/, ((_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.getBookmarks())];
|
|
7779
7850
|
case 1:
|
|
@@ -7805,8 +7876,8 @@ var Session = /** @class */ (function () {
|
|
|
7805
7876
|
* @return {Promise}
|
|
7806
7877
|
*/
|
|
7807
7878
|
Session.prototype.close = function () {
|
|
7808
|
-
return __awaiter$
|
|
7809
|
-
return __generator$
|
|
7879
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
7880
|
+
return __generator$d(this, function (_a) {
|
|
7810
7881
|
switch (_a.label) {
|
|
7811
7882
|
case 0:
|
|
7812
7883
|
if (!this._open) return [3 /*break*/, 3];
|
|
@@ -7833,7 +7904,7 @@ var Session = /** @class */ (function () {
|
|
|
7833
7904
|
return this._writeConnectionHolder;
|
|
7834
7905
|
}
|
|
7835
7906
|
else {
|
|
7836
|
-
throw (0, error_1.newError)('Unknown access mode: ' + mode);
|
|
7907
|
+
throw (0, error_1$2.newError)('Unknown access mode: ' + mode);
|
|
7837
7908
|
}
|
|
7838
7909
|
};
|
|
7839
7910
|
/**
|
|
@@ -7866,7 +7937,7 @@ var Session = /** @class */ (function () {
|
|
|
7866
7937
|
Session._validateSessionMode = function (rawMode) {
|
|
7867
7938
|
var mode = rawMode !== null && rawMode !== void 0 ? rawMode : constants_1$1.ACCESS_MODE_WRITE;
|
|
7868
7939
|
if (mode !== constants_1$1.ACCESS_MODE_READ && mode !== constants_1$1.ACCESS_MODE_WRITE) {
|
|
7869
|
-
throw (0, error_1.newError)('Illegal session mode ' + mode);
|
|
7940
|
+
throw (0, error_1$2.newError)('Illegal session mode ' + mode);
|
|
7870
7941
|
}
|
|
7871
7942
|
return mode;
|
|
7872
7943
|
};
|
|
@@ -7886,67 +7957,696 @@ session.default = Session;
|
|
|
7886
7957
|
|
|
7887
7958
|
var driver = {};
|
|
7888
7959
|
|
|
7889
|
-
var
|
|
7890
|
-
|
|
7891
|
-
};
|
|
7892
|
-
Object.defineProperty(driver, "__esModule", { value: true });
|
|
7893
|
-
driver.SessionConfig = driver.WRITE = driver.READ = driver.Driver = void 0;
|
|
7894
|
-
var bookmarks_1 = bookmarks$1;
|
|
7895
|
-
var configured_custom_resolver_1 = __importDefault$E(configuredCustomResolver);
|
|
7896
|
-
var constants_1 = constants$1;
|
|
7897
|
-
var logger_1 = logger$1;
|
|
7898
|
-
var session_1 = __importDefault$E(session);
|
|
7899
|
-
var util_1 = util$4;
|
|
7900
|
-
var DEFAULT_MAX_CONNECTION_LIFETIME = 60 * 60 * 1000; // 1 hour
|
|
7901
|
-
/**
|
|
7902
|
-
* The default record fetch size. This is used in Bolt V4 protocol to pull query execution result in batches.
|
|
7903
|
-
* @type {number}
|
|
7904
|
-
*/
|
|
7905
|
-
var DEFAULT_FETCH_SIZE = 1000;
|
|
7906
|
-
/**
|
|
7907
|
-
* Constant that represents read session access mode.
|
|
7908
|
-
* Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.READ })`.
|
|
7909
|
-
* @type {string}
|
|
7910
|
-
*/
|
|
7911
|
-
var READ$3 = constants_1.ACCESS_MODE_READ;
|
|
7912
|
-
driver.READ = READ$3;
|
|
7960
|
+
var bookmarkManager$1 = {};
|
|
7961
|
+
|
|
7913
7962
|
/**
|
|
7914
|
-
*
|
|
7915
|
-
*
|
|
7916
|
-
*
|
|
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.
|
|
7917
7979
|
*/
|
|
7918
|
-
var
|
|
7919
|
-
|
|
7920
|
-
|
|
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;
|
|
7921
8054
|
/**
|
|
7922
|
-
*
|
|
7923
|
-
*
|
|
8055
|
+
* Interface for the piece of software responsible for keeping track of current active bookmarks accross the driver.
|
|
7924
8056
|
* @interface
|
|
8057
|
+
* @since 5.0
|
|
8058
|
+
* @experimental
|
|
7925
8059
|
*/
|
|
7926
|
-
var
|
|
8060
|
+
var BookmarkManager = /** @class */ (function () {
|
|
7927
8061
|
/**
|
|
7928
8062
|
* @constructor
|
|
7929
8063
|
* @private
|
|
7930
8064
|
*/
|
|
7931
|
-
function
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
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
|
|
7950
8650
|
* straightforward way and potentially simplifies driver logic as well as
|
|
7951
8651
|
* reduces network communication resulting in better performance.
|
|
7952
8652
|
*
|
|
@@ -8042,6 +8742,77 @@ var SessionConfig = /** @class */ (function () {
|
|
|
8042
8742
|
return SessionConfig;
|
|
8043
8743
|
}());
|
|
8044
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;
|
|
8045
8816
|
/**
|
|
8046
8817
|
* A driver maintains one or more {@link Session}s with a remote
|
|
8047
8818
|
* Neo4j instance. Through the {@link Session}s you can send queries
|
|
@@ -8059,12 +8830,13 @@ var Driver$1 = /** @class */ (function () {
|
|
|
8059
8830
|
* @protected
|
|
8060
8831
|
* @param {Object} meta Metainformation about the driver
|
|
8061
8832
|
* @param {Object} config
|
|
8062
|
-
* @param {function(id: number, config:Object, log:Logger, hostNameResolver: ConfiguredCustomResolver): ConnectionProvider }
|
|
8833
|
+
* @param {function(id: number, config:Object, log:Logger, hostNameResolver: ConfiguredCustomResolver): ConnectionProvider } createConnectionProvider Creates the connection provider
|
|
8063
8834
|
* @param {function(args): Session } createSession Creates the a session
|
|
8064
8835
|
*/
|
|
8065
|
-
function Driver(meta, config,
|
|
8836
|
+
function Driver(meta, config, createConnectionProvider, createSession, createQueryExecutor) {
|
|
8066
8837
|
if (config === void 0) { config = {}; }
|
|
8067
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); }; }
|
|
8068
8840
|
sanitizeConfig(config);
|
|
8069
8841
|
var log = logger_1.Logger.create(config);
|
|
8070
8842
|
validateConfig(config, log);
|
|
@@ -8072,8 +8844,10 @@ var Driver$1 = /** @class */ (function () {
|
|
|
8072
8844
|
this._meta = meta;
|
|
8073
8845
|
this._config = config;
|
|
8074
8846
|
this._log = log;
|
|
8075
|
-
this._createConnectionProvider =
|
|
8847
|
+
this._createConnectionProvider = createConnectionProvider;
|
|
8076
8848
|
this._createSession = createSession;
|
|
8849
|
+
this._queryBookmarkManager = (0, bookmark_manager_1.bookmarkManager)();
|
|
8850
|
+
this._queryExecutor = createQueryExecutor(this.session.bind(this));
|
|
8077
8851
|
/**
|
|
8078
8852
|
* Reference to the connection provider. Initialized lazily by {@link _getOrCreateConnectionProvider}.
|
|
8079
8853
|
* @type {ConnectionProvider}
|
|
@@ -8082,6 +8856,124 @@ var Driver$1 = /** @class */ (function () {
|
|
|
8082
8856
|
this._connectionProvider = null;
|
|
8083
8857
|
this._afterConstruction();
|
|
8084
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
|
+
};
|
|
8085
8977
|
/**
|
|
8086
8978
|
* Verifies connectivity of this driver by trying to open a connection with the provided driver options.
|
|
8087
8979
|
*
|
|
@@ -8234,6 +9126,7 @@ var Driver$1 = /** @class */ (function () {
|
|
|
8234
9126
|
};
|
|
8235
9127
|
/**
|
|
8236
9128
|
* @protected
|
|
9129
|
+
* @returns {void}
|
|
8237
9130
|
*/
|
|
8238
9131
|
Driver.prototype._afterConstruction = function () {
|
|
8239
9132
|
this._log.info("".concat(this._meta.typename, " driver ").concat(this._id, " created for server address ").concat(this._meta.address.toString()));
|
|
@@ -8444,254 +9337,6 @@ function isNotEmpty(value) {
|
|
|
8444
9337
|
}
|
|
8445
9338
|
auth$1.default = auth;
|
|
8446
9339
|
|
|
8447
|
-
var bookmarkManager$1 = {};
|
|
8448
|
-
|
|
8449
|
-
/**
|
|
8450
|
-
* Copyright (c) "Neo4j"
|
|
8451
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
8452
|
-
*
|
|
8453
|
-
* This file is part of Neo4j.
|
|
8454
|
-
*
|
|
8455
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8456
|
-
* you may not use this file except in compliance with the License.
|
|
8457
|
-
* You may obtain a copy of the License at
|
|
8458
|
-
*
|
|
8459
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8460
|
-
*
|
|
8461
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8462
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8463
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8464
|
-
* See the License for the specific language governing permissions and
|
|
8465
|
-
* limitations under the License.
|
|
8466
|
-
*/
|
|
8467
|
-
var __awaiter$7 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8468
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8469
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8470
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8471
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8472
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8473
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8474
|
-
});
|
|
8475
|
-
};
|
|
8476
|
-
var __generator$9 = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
8477
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8478
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
8479
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
8480
|
-
function step(op) {
|
|
8481
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8482
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
8483
|
-
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;
|
|
8484
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
8485
|
-
switch (op[0]) {
|
|
8486
|
-
case 0: case 1: t = op; break;
|
|
8487
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
8488
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
8489
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
8490
|
-
default:
|
|
8491
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
8492
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
8493
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
8494
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
8495
|
-
if (t[2]) _.ops.pop();
|
|
8496
|
-
_.trys.pop(); continue;
|
|
8497
|
-
}
|
|
8498
|
-
op = body.call(thisArg, _);
|
|
8499
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
8500
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8501
|
-
}
|
|
8502
|
-
};
|
|
8503
|
-
var __values$a = (commonjsGlobal && commonjsGlobal.__values) || function(o) {
|
|
8504
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
8505
|
-
if (m) return m.call(o);
|
|
8506
|
-
if (o && typeof o.length === "number") return {
|
|
8507
|
-
next: function () {
|
|
8508
|
-
if (o && i >= o.length) o = void 0;
|
|
8509
|
-
return { value: o && o[i++], done: !o };
|
|
8510
|
-
}
|
|
8511
|
-
};
|
|
8512
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
8513
|
-
};
|
|
8514
|
-
var __read$p = (commonjsGlobal && commonjsGlobal.__read) || function (o, n) {
|
|
8515
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8516
|
-
if (!m) return o;
|
|
8517
|
-
var i = m.call(o), r, ar = [], e;
|
|
8518
|
-
try {
|
|
8519
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8520
|
-
}
|
|
8521
|
-
catch (error) { e = { error: error }; }
|
|
8522
|
-
finally {
|
|
8523
|
-
try {
|
|
8524
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
8525
|
-
}
|
|
8526
|
-
finally { if (e) throw e.error; }
|
|
8527
|
-
}
|
|
8528
|
-
return ar;
|
|
8529
|
-
};
|
|
8530
|
-
var __spreadArray$j = (commonjsGlobal && commonjsGlobal.__spreadArray) || function (to, from, pack) {
|
|
8531
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8532
|
-
if (ar || !(i in from)) {
|
|
8533
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8534
|
-
ar[i] = from[i];
|
|
8535
|
-
}
|
|
8536
|
-
}
|
|
8537
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8538
|
-
};
|
|
8539
|
-
Object.defineProperty(bookmarkManager$1, "__esModule", { value: true });
|
|
8540
|
-
bookmarkManager$1.bookmarkManager = void 0;
|
|
8541
|
-
/**
|
|
8542
|
-
* Interface for the piece of software responsible for keeping track of current active bookmarks accross the driver.
|
|
8543
|
-
* @interface
|
|
8544
|
-
* @since 5.0
|
|
8545
|
-
* @experimental
|
|
8546
|
-
*/
|
|
8547
|
-
var BookmarkManager = /** @class */ (function () {
|
|
8548
|
-
/**
|
|
8549
|
-
* @constructor
|
|
8550
|
-
* @private
|
|
8551
|
-
*/
|
|
8552
|
-
function BookmarkManager() {
|
|
8553
|
-
throw new Error('Not implemented');
|
|
8554
|
-
}
|
|
8555
|
-
/**
|
|
8556
|
-
* Method called when the bookmarks get updated when a transaction finished.
|
|
8557
|
-
*
|
|
8558
|
-
* This method will be called when auto-commit queries finish and when explicit transactions
|
|
8559
|
-
* get committed.
|
|
8560
|
-
*
|
|
8561
|
-
* @param {Iterable<string>} previousBookmarks The bookmarks used when starting the transaction
|
|
8562
|
-
* @param {Iterable<string>} newBookmarks The new bookmarks received at the end of the transaction.
|
|
8563
|
-
* @returns {void}
|
|
8564
|
-
*/
|
|
8565
|
-
BookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
|
|
8566
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8567
|
-
return __generator$9(this, function (_a) {
|
|
8568
|
-
throw new Error('Not implemented');
|
|
8569
|
-
});
|
|
8570
|
-
});
|
|
8571
|
-
};
|
|
8572
|
-
/**
|
|
8573
|
-
* Method called by the driver to get the bookmarks.
|
|
8574
|
-
*
|
|
8575
|
-
* @returns {Iterable<string>} The set of bookmarks
|
|
8576
|
-
*/
|
|
8577
|
-
BookmarkManager.prototype.getBookmarks = function () {
|
|
8578
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8579
|
-
return __generator$9(this, function (_a) {
|
|
8580
|
-
throw new Error('Not implemented');
|
|
8581
|
-
});
|
|
8582
|
-
});
|
|
8583
|
-
};
|
|
8584
|
-
return BookmarkManager;
|
|
8585
|
-
}());
|
|
8586
|
-
bookmarkManager$1.default = BookmarkManager;
|
|
8587
|
-
/**
|
|
8588
|
-
* @typedef {Object} BookmarkManagerConfig
|
|
8589
|
-
*
|
|
8590
|
-
* @since 5.0
|
|
8591
|
-
* @experimental
|
|
8592
|
-
* @property {Iterable<string>} [initialBookmarks] Defines the initial set of bookmarks. The key is the database name and the values are the bookmarks.
|
|
8593
|
-
* @property {function():Promise<Iterable<string>>} [bookmarksSupplier] Called for supplying extra bookmarks to the BookmarkManager
|
|
8594
|
-
* @property {function(bookmarks: Iterable<string>): Promise<void>} [bookmarksConsumer] Called when the set of bookmarks get updated
|
|
8595
|
-
*/
|
|
8596
|
-
/**
|
|
8597
|
-
* Provides an configured {@link BookmarkManager} instance.
|
|
8598
|
-
*
|
|
8599
|
-
* @since 5.0
|
|
8600
|
-
* @experimental
|
|
8601
|
-
* @param {BookmarkManagerConfig} [config={}]
|
|
8602
|
-
* @returns {BookmarkManager}
|
|
8603
|
-
*/
|
|
8604
|
-
function bookmarkManager(config) {
|
|
8605
|
-
if (config === void 0) { config = {}; }
|
|
8606
|
-
var initialBookmarks = new Set(config.initialBookmarks);
|
|
8607
|
-
return new Neo4jBookmarkManager(initialBookmarks, config.bookmarksSupplier, config.bookmarksConsumer);
|
|
8608
|
-
}
|
|
8609
|
-
bookmarkManager$1.bookmarkManager = bookmarkManager;
|
|
8610
|
-
var Neo4jBookmarkManager = /** @class */ (function () {
|
|
8611
|
-
function Neo4jBookmarkManager(_bookmarks, _bookmarksSupplier, _bookmarksConsumer) {
|
|
8612
|
-
this._bookmarks = _bookmarks;
|
|
8613
|
-
this._bookmarksSupplier = _bookmarksSupplier;
|
|
8614
|
-
this._bookmarksConsumer = _bookmarksConsumer;
|
|
8615
|
-
}
|
|
8616
|
-
Neo4jBookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
|
|
8617
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8618
|
-
var bookmarks, previousBookmarks_1, previousBookmarks_1_1, bm, newBookmarks_1, newBookmarks_1_1, bm;
|
|
8619
|
-
var e_1, _a, e_2, _b;
|
|
8620
|
-
return __generator$9(this, function (_c) {
|
|
8621
|
-
switch (_c.label) {
|
|
8622
|
-
case 0:
|
|
8623
|
-
bookmarks = this._bookmarks;
|
|
8624
|
-
try {
|
|
8625
|
-
for (previousBookmarks_1 = __values$a(previousBookmarks), previousBookmarks_1_1 = previousBookmarks_1.next(); !previousBookmarks_1_1.done; previousBookmarks_1_1 = previousBookmarks_1.next()) {
|
|
8626
|
-
bm = previousBookmarks_1_1.value;
|
|
8627
|
-
bookmarks.delete(bm);
|
|
8628
|
-
}
|
|
8629
|
-
}
|
|
8630
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8631
|
-
finally {
|
|
8632
|
-
try {
|
|
8633
|
-
if (previousBookmarks_1_1 && !previousBookmarks_1_1.done && (_a = previousBookmarks_1.return)) _a.call(previousBookmarks_1);
|
|
8634
|
-
}
|
|
8635
|
-
finally { if (e_1) throw e_1.error; }
|
|
8636
|
-
}
|
|
8637
|
-
try {
|
|
8638
|
-
for (newBookmarks_1 = __values$a(newBookmarks), newBookmarks_1_1 = newBookmarks_1.next(); !newBookmarks_1_1.done; newBookmarks_1_1 = newBookmarks_1.next()) {
|
|
8639
|
-
bm = newBookmarks_1_1.value;
|
|
8640
|
-
bookmarks.add(bm);
|
|
8641
|
-
}
|
|
8642
|
-
}
|
|
8643
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
8644
|
-
finally {
|
|
8645
|
-
try {
|
|
8646
|
-
if (newBookmarks_1_1 && !newBookmarks_1_1.done && (_b = newBookmarks_1.return)) _b.call(newBookmarks_1);
|
|
8647
|
-
}
|
|
8648
|
-
finally { if (e_2) throw e_2.error; }
|
|
8649
|
-
}
|
|
8650
|
-
if (!(typeof this._bookmarksConsumer === 'function')) return [3 /*break*/, 2];
|
|
8651
|
-
return [4 /*yield*/, this._bookmarksConsumer(__spreadArray$j([], __read$p(bookmarks), false))];
|
|
8652
|
-
case 1:
|
|
8653
|
-
_c.sent();
|
|
8654
|
-
_c.label = 2;
|
|
8655
|
-
case 2: return [2 /*return*/];
|
|
8656
|
-
}
|
|
8657
|
-
});
|
|
8658
|
-
});
|
|
8659
|
-
};
|
|
8660
|
-
Neo4jBookmarkManager.prototype.getBookmarks = function () {
|
|
8661
|
-
var _a;
|
|
8662
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8663
|
-
var bookmarks, suppliedBookmarks, suppliedBookmarks_1, suppliedBookmarks_1_1, bm;
|
|
8664
|
-
var e_3, _b;
|
|
8665
|
-
return __generator$9(this, function (_c) {
|
|
8666
|
-
switch (_c.label) {
|
|
8667
|
-
case 0:
|
|
8668
|
-
bookmarks = new Set(this._bookmarks);
|
|
8669
|
-
if (!(typeof this._bookmarksSupplier === 'function')) return [3 /*break*/, 2];
|
|
8670
|
-
return [4 /*yield*/, this._bookmarksSupplier()];
|
|
8671
|
-
case 1:
|
|
8672
|
-
suppliedBookmarks = (_a = _c.sent()) !== null && _a !== void 0 ? _a : [];
|
|
8673
|
-
try {
|
|
8674
|
-
for (suppliedBookmarks_1 = __values$a(suppliedBookmarks), suppliedBookmarks_1_1 = suppliedBookmarks_1.next(); !suppliedBookmarks_1_1.done; suppliedBookmarks_1_1 = suppliedBookmarks_1.next()) {
|
|
8675
|
-
bm = suppliedBookmarks_1_1.value;
|
|
8676
|
-
bookmarks.add(bm);
|
|
8677
|
-
}
|
|
8678
|
-
}
|
|
8679
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
8680
|
-
finally {
|
|
8681
|
-
try {
|
|
8682
|
-
if (suppliedBookmarks_1_1 && !suppliedBookmarks_1_1.done && (_b = suppliedBookmarks_1.return)) _b.call(suppliedBookmarks_1);
|
|
8683
|
-
}
|
|
8684
|
-
finally { if (e_3) throw e_3.error; }
|
|
8685
|
-
}
|
|
8686
|
-
_c.label = 2;
|
|
8687
|
-
case 2: return [2 /*return*/, __spreadArray$j([], __read$p(bookmarks), false)];
|
|
8688
|
-
}
|
|
8689
|
-
});
|
|
8690
|
-
});
|
|
8691
|
-
};
|
|
8692
|
-
return Neo4jBookmarkManager;
|
|
8693
|
-
}());
|
|
8694
|
-
|
|
8695
9340
|
var types$1 = {};
|
|
8696
9341
|
|
|
8697
9342
|
/**
|
|
@@ -8760,8 +9405,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
|
|
|
8760
9405
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8761
9406
|
};
|
|
8762
9407
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8763
|
-
exports.
|
|
8764
|
-
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;
|
|
8765
9410
|
var error_1 = error;
|
|
8766
9411
|
Object.defineProperty(exports, "newError", { enumerable: true, get: function () { return error_1.newError; } });
|
|
8767
9412
|
Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return error_1.Neo4jError; } });
|
|
@@ -8813,6 +9458,8 @@ Object.defineProperty(exports, "QueryStatistics", { enumerable: true, get: funct
|
|
|
8813
9458
|
Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return result_summary_1.Stats; } });
|
|
8814
9459
|
var result_1 = __importDefault(result);
|
|
8815
9460
|
exports.Result = result_1.default;
|
|
9461
|
+
var result_eager_1 = __importDefault(resultEager);
|
|
9462
|
+
exports.EagerResult = result_eager_1.default;
|
|
8816
9463
|
var connection_provider_1 = __importDefault(connectionProvider$1);
|
|
8817
9464
|
exports.ConnectionProvider = connection_provider_1.default;
|
|
8818
9465
|
var connection_1 = __importDefault(connection$2);
|
|
@@ -8832,10 +9479,14 @@ var auth_1 = __importDefault(auth$1);
|
|
|
8832
9479
|
exports.auth = auth_1.default;
|
|
8833
9480
|
var bookmark_manager_1 = bookmarkManager$1;
|
|
8834
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; } });
|
|
8835
9484
|
var types = __importStar(types$1);
|
|
8836
9485
|
exports.types = types;
|
|
8837
9486
|
var json$1 = __importStar(json);
|
|
8838
9487
|
exports.json = json$1;
|
|
9488
|
+
var result_transformers_1 = __importDefault(resultTransformers$1);
|
|
9489
|
+
exports.resultTransformers = result_transformers_1.default;
|
|
8839
9490
|
var internal$1 = __importStar(internal); // todo: removed afterwards
|
|
8840
9491
|
exports.internal = internal$1;
|
|
8841
9492
|
/**
|
|
@@ -8896,6 +9547,7 @@ var forExport = {
|
|
|
8896
9547
|
QueryStatistics: result_summary_1.QueryStatistics,
|
|
8897
9548
|
Stats: result_summary_1.Stats,
|
|
8898
9549
|
Result: result_1.default,
|
|
9550
|
+
EagerResult: result_eager_1.default,
|
|
8899
9551
|
Transaction: transaction_1.default,
|
|
8900
9552
|
ManagedTransaction: transaction_managed_1.default,
|
|
8901
9553
|
TransactionPromise: transaction_promise_1.default,
|
|
@@ -8906,7 +9558,9 @@ var forExport = {
|
|
|
8906
9558
|
driver: driver$1,
|
|
8907
9559
|
json: json$1,
|
|
8908
9560
|
auth: auth_1.default,
|
|
8909
|
-
bookmarkManager: bookmark_manager_1.bookmarkManager
|
|
9561
|
+
bookmarkManager: bookmark_manager_1.bookmarkManager,
|
|
9562
|
+
routing: driver_2.routing,
|
|
9563
|
+
resultTransformers: result_transformers_1.default
|
|
8910
9564
|
};
|
|
8911
9565
|
exports.default = forExport;
|
|
8912
9566
|
}(lib$1));
|
|
@@ -17927,7 +18581,7 @@ Object.defineProperty(version$1, "__esModule", { value: true });
|
|
|
17927
18581
|
// This is set up this way to keep the version in the code in
|
|
17928
18582
|
// sync with the npm package version, and to allow the build
|
|
17929
18583
|
// system to control version names at packaging time.
|
|
17930
|
-
version$1.default = '5.
|
|
18584
|
+
version$1.default = '5.5.0';
|
|
17931
18585
|
|
|
17932
18586
|
var lib = {};
|
|
17933
18587
|
|
|
@@ -30791,8 +31445,8 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
|
|
|
30791
31445
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30792
31446
|
};
|
|
30793
31447
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30794
|
-
exports.
|
|
30795
|
-
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;
|
|
30796
31450
|
/**
|
|
30797
31451
|
* Copyright (c) "Neo4j"
|
|
30798
31452
|
* Neo4j Sweden AB [http://neo4j.com]
|
|
@@ -30853,11 +31507,14 @@ Object.defineProperty(exports, "QueryStatistics", { enumerable: true, get: funct
|
|
|
30853
31507
|
Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return neo4j_driver_core_1.Notification; } });
|
|
30854
31508
|
Object.defineProperty(exports, "ServerInfo", { enumerable: true, get: function () { return neo4j_driver_core_1.ServerInfo; } });
|
|
30855
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; } });
|
|
30856
31511
|
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return neo4j_driver_core_1.auth; } });
|
|
30857
31512
|
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return neo4j_driver_core_1.Session; } });
|
|
30858
31513
|
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return neo4j_driver_core_1.Transaction; } });
|
|
30859
31514
|
Object.defineProperty(exports, "ManagedTransaction", { enumerable: true, get: function () { return neo4j_driver_core_1.ManagedTransaction; } });
|
|
30860
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; } });
|
|
30861
31518
|
var neo4j_driver_bolt_connection_1 = lib;
|
|
30862
31519
|
var session_rx_1 = __importDefault(sessionRx);
|
|
30863
31520
|
exports.RxSession = session_rx_1.default;
|
|
@@ -31148,6 +31805,7 @@ var types = {
|
|
|
31148
31805
|
PathSegment: neo4j_driver_core_1.PathSegment,
|
|
31149
31806
|
Path: neo4j_driver_core_1.Path,
|
|
31150
31807
|
Result: neo4j_driver_core_1.Result,
|
|
31808
|
+
EagerResult: neo4j_driver_core_1.EagerResult,
|
|
31151
31809
|
ResultSummary: neo4j_driver_core_1.ResultSummary,
|
|
31152
31810
|
Record: neo4j_driver_core_1.Record,
|
|
31153
31811
|
Point: neo4j_driver_core_1.Point,
|
|
@@ -31234,6 +31892,7 @@ var forExport = {
|
|
|
31234
31892
|
logging: logging,
|
|
31235
31893
|
types: types,
|
|
31236
31894
|
session: session,
|
|
31895
|
+
routing: neo4j_driver_core_1.routing,
|
|
31237
31896
|
error: neo4j_driver_core_1.error,
|
|
31238
31897
|
graph: graph,
|
|
31239
31898
|
spatial: spatial,
|
|
@@ -31243,6 +31902,7 @@ var forExport = {
|
|
|
31243
31902
|
Transaction: neo4j_driver_core_1.Transaction,
|
|
31244
31903
|
ManagedTransaction: neo4j_driver_core_1.ManagedTransaction,
|
|
31245
31904
|
Result: neo4j_driver_core_1.Result,
|
|
31905
|
+
EagerResult: neo4j_driver_core_1.EagerResult,
|
|
31246
31906
|
RxSession: session_rx_1.default,
|
|
31247
31907
|
RxTransaction: transaction_rx_1.default,
|
|
31248
31908
|
RxManagedTransaction: transaction_managed_rx_1.default,
|
|
@@ -31267,7 +31927,8 @@ var forExport = {
|
|
|
31267
31927
|
Date: neo4j_driver_core_1.Date,
|
|
31268
31928
|
LocalDateTime: neo4j_driver_core_1.LocalDateTime,
|
|
31269
31929
|
DateTime: neo4j_driver_core_1.DateTime,
|
|
31270
|
-
bookmarkManager: neo4j_driver_core_1.bookmarkManager
|
|
31930
|
+
bookmarkManager: neo4j_driver_core_1.bookmarkManager,
|
|
31931
|
+
resultTransformers: neo4j_driver_core_1.resultTransformers
|
|
31271
31932
|
};
|
|
31272
31933
|
exports.default = forExport;
|
|
31273
31934
|
}(lib$2));
|