neo4j-driver 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/neo4j-web.esm.js +1077 -433
- package/lib/browser/neo4j-web.esm.min.js +1 -1
- package/lib/browser/neo4j-web.js +1077 -433
- 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
package/lib/browser/neo4j-web.js
CHANGED
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
// 64-bit Integer library, originally from Long.js by dcodeIO
|
|
195
195
|
// https://github.com/dcodeIO/Long.js
|
|
196
196
|
// License Apache 2
|
|
197
|
-
var error_1$
|
|
197
|
+
var error_1$b = error;
|
|
198
198
|
/**
|
|
199
199
|
* A cache of the Integer representations of small integer values.
|
|
200
200
|
* @type {!Object}
|
|
@@ -658,7 +658,7 @@
|
|
|
658
658
|
Integer.prototype.div = function (divisor) {
|
|
659
659
|
var theDivisor = Integer.fromValue(divisor);
|
|
660
660
|
if (theDivisor.isZero()) {
|
|
661
|
-
throw (0, error_1$
|
|
661
|
+
throw (0, error_1$b.newError)('division by zero');
|
|
662
662
|
}
|
|
663
663
|
if (this.isZero()) {
|
|
664
664
|
return Integer.ZERO;
|
|
@@ -897,7 +897,7 @@
|
|
|
897
897
|
Integer.fromString = function (str, radix, _a) {
|
|
898
898
|
var _b = _a === void 0 ? {} : _a, strictStringValidation = _b.strictStringValidation;
|
|
899
899
|
if (str.length === 0) {
|
|
900
|
-
throw (0, error_1$
|
|
900
|
+
throw (0, error_1$b.newError)('number format error: empty string');
|
|
901
901
|
}
|
|
902
902
|
if (str === 'NaN' ||
|
|
903
903
|
str === 'Infinity' ||
|
|
@@ -907,11 +907,11 @@
|
|
|
907
907
|
}
|
|
908
908
|
radix = radix !== null && radix !== void 0 ? radix : 10;
|
|
909
909
|
if (radix < 2 || radix > 36) {
|
|
910
|
-
throw (0, error_1$
|
|
910
|
+
throw (0, error_1$b.newError)('radix out of range: ' + radix.toString());
|
|
911
911
|
}
|
|
912
912
|
var p;
|
|
913
913
|
if ((p = str.indexOf('-')) > 0) {
|
|
914
|
-
throw (0, error_1$
|
|
914
|
+
throw (0, error_1$b.newError)('number format error: interior "-" character: ' + str);
|
|
915
915
|
}
|
|
916
916
|
else if (p === 0) {
|
|
917
917
|
return Integer.fromString(str.substring(1), radix).negate();
|
|
@@ -925,7 +925,7 @@
|
|
|
925
925
|
var valueString = str.substring(i, i + size);
|
|
926
926
|
var value = parseInt(valueString, radix);
|
|
927
927
|
if (strictStringValidation === true && !_isValidNumberFromString(valueString, value, radix)) {
|
|
928
|
-
throw (0, error_1$
|
|
928
|
+
throw (0, error_1$b.newError)("number format error: \"".concat(valueString, "\" is NaN in radix ").concat(radix, ": ").concat(str));
|
|
929
929
|
}
|
|
930
930
|
if (size < 8) {
|
|
931
931
|
var power = Integer.fromNumber(Math.pow(radix, size));
|
|
@@ -2130,7 +2130,7 @@
|
|
|
2130
2130
|
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;
|
|
2131
2131
|
var util$3 = __importStar$a(temporalUtil$1);
|
|
2132
2132
|
var util_1$7 = util$4;
|
|
2133
|
-
var error_1$
|
|
2133
|
+
var error_1$a = error;
|
|
2134
2134
|
var integer_1$2 = __importStar$a(integer);
|
|
2135
2135
|
var IDENTIFIER_PROPERTY_ATTRIBUTES$1 = {
|
|
2136
2136
|
value: true,
|
|
@@ -2656,7 +2656,7 @@
|
|
|
2656
2656
|
var offsetDefined = timeZoneOffsetSeconds !== null && timeZoneOffsetSeconds !== undefined;
|
|
2657
2657
|
var idDefined = timeZoneId !== null && timeZoneId !== undefined && timeZoneId !== '';
|
|
2658
2658
|
if (!offsetDefined && !idDefined) {
|
|
2659
|
-
throw (0, error_1$
|
|
2659
|
+
throw (0, error_1$a.newError)(
|
|
2660
2660
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
2661
2661
|
"Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: ".concat(timeZoneOffsetSeconds, " and id: ").concat(timeZoneId));
|
|
2662
2662
|
}
|
|
@@ -3066,7 +3066,7 @@
|
|
|
3066
3066
|
* See the License for the specific language governing permissions and
|
|
3067
3067
|
* limitations under the License.
|
|
3068
3068
|
*/
|
|
3069
|
-
var __generator$
|
|
3069
|
+
var __generator$i = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
3070
3070
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
3071
3071
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
3072
3072
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -3121,7 +3121,7 @@
|
|
|
3121
3121
|
return ar;
|
|
3122
3122
|
};
|
|
3123
3123
|
Object.defineProperty(record, "__esModule", { value: true });
|
|
3124
|
-
var error_1$
|
|
3124
|
+
var error_1$9 = error;
|
|
3125
3125
|
function generateFieldLookup(keys) {
|
|
3126
3126
|
var lookup = {};
|
|
3127
3127
|
keys.forEach(function (name, idx) {
|
|
@@ -3234,7 +3234,7 @@
|
|
|
3234
3234
|
*/
|
|
3235
3235
|
Record.prototype.entries = function () {
|
|
3236
3236
|
var i;
|
|
3237
|
-
return __generator$
|
|
3237
|
+
return __generator$i(this, function (_a) {
|
|
3238
3238
|
switch (_a.label) {
|
|
3239
3239
|
case 0:
|
|
3240
3240
|
i = 0;
|
|
@@ -3260,7 +3260,7 @@
|
|
|
3260
3260
|
*/
|
|
3261
3261
|
Record.prototype.values = function () {
|
|
3262
3262
|
var i;
|
|
3263
|
-
return __generator$
|
|
3263
|
+
return __generator$i(this, function (_a) {
|
|
3264
3264
|
switch (_a.label) {
|
|
3265
3265
|
case 0:
|
|
3266
3266
|
i = 0;
|
|
@@ -3286,7 +3286,7 @@
|
|
|
3286
3286
|
*/
|
|
3287
3287
|
Record.prototype[Symbol.iterator] = function () {
|
|
3288
3288
|
var i;
|
|
3289
|
-
return __generator$
|
|
3289
|
+
return __generator$i(this, function (_a) {
|
|
3290
3290
|
switch (_a.label) {
|
|
3291
3291
|
case 0:
|
|
3292
3292
|
i = 0;
|
|
@@ -3339,7 +3339,7 @@
|
|
|
3339
3339
|
if (!(typeof key === 'number')) {
|
|
3340
3340
|
index = this._fieldLookup[key];
|
|
3341
3341
|
if (index === undefined) {
|
|
3342
|
-
throw (0, error_1$
|
|
3342
|
+
throw (0, error_1$9.newError)("This record has no field with key '".concat(key.toString(), "', available keys are: [") +
|
|
3343
3343
|
this.keys.toString() +
|
|
3344
3344
|
'].');
|
|
3345
3345
|
}
|
|
@@ -3348,7 +3348,7 @@
|
|
|
3348
3348
|
index = key;
|
|
3349
3349
|
}
|
|
3350
3350
|
if (index > this._fields.length - 1 || index < 0) {
|
|
3351
|
-
throw (0, error_1$
|
|
3351
|
+
throw (0, error_1$9.newError)("This record has no field with index '" +
|
|
3352
3352
|
index.toString() +
|
|
3353
3353
|
"'. Remember that indexes start at `0`, " +
|
|
3354
3354
|
'and make sure your query returns records in the shape you meant it to.');
|
|
@@ -4296,7 +4296,7 @@
|
|
|
4296
4296
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4297
4297
|
};
|
|
4298
4298
|
})();
|
|
4299
|
-
var __awaiter$
|
|
4299
|
+
var __awaiter$f = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4300
4300
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4301
4301
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4302
4302
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4305,7 +4305,7 @@
|
|
|
4305
4305
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4306
4306
|
});
|
|
4307
4307
|
};
|
|
4308
|
-
var __generator$
|
|
4308
|
+
var __generator$h = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
4309
4309
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4310
4310
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
4311
4311
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -4334,7 +4334,7 @@
|
|
|
4334
4334
|
};
|
|
4335
4335
|
Object.defineProperty(connectionHolder$1, "__esModule", { value: true });
|
|
4336
4336
|
connectionHolder$1.EMPTY_CONNECTION_HOLDER = connectionHolder$1.ReadOnlyConnectionHolder = connectionHolder$1.ConnectionHolder = void 0;
|
|
4337
|
-
var error_1$
|
|
4337
|
+
var error_1$8 = error;
|
|
4338
4338
|
var util_1$5 = util$4;
|
|
4339
4339
|
var constants_1$2 = constants$1;
|
|
4340
4340
|
var bookmarks_1$3 = bookmarks$1;
|
|
@@ -4396,10 +4396,10 @@
|
|
|
4396
4396
|
return true;
|
|
4397
4397
|
};
|
|
4398
4398
|
ConnectionHolder.prototype._createConnectionPromise = function (connectionProvider) {
|
|
4399
|
-
return __awaiter$
|
|
4399
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4400
4400
|
var _a, _b;
|
|
4401
4401
|
var _c;
|
|
4402
|
-
return __generator$
|
|
4402
|
+
return __generator$h(this, function (_d) {
|
|
4403
4403
|
switch (_d.label) {
|
|
4404
4404
|
case 0:
|
|
4405
4405
|
_b = (_a = connectionProvider).acquireConnection;
|
|
@@ -4418,8 +4418,8 @@
|
|
|
4418
4418
|
});
|
|
4419
4419
|
};
|
|
4420
4420
|
ConnectionHolder.prototype._getBookmarks = function () {
|
|
4421
|
-
return __awaiter$
|
|
4422
|
-
return __generator$
|
|
4421
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4422
|
+
return __generator$h(this, function (_a) {
|
|
4423
4423
|
switch (_a.label) {
|
|
4424
4424
|
case 0: return [4 /*yield*/, this._getConnectionAcquistionBookmarks()];
|
|
4425
4425
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -4550,18 +4550,18 @@
|
|
|
4550
4550
|
return true;
|
|
4551
4551
|
};
|
|
4552
4552
|
EmptyConnectionHolder.prototype.getConnection = function () {
|
|
4553
|
-
return __awaiter$
|
|
4554
|
-
return __generator$
|
|
4553
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4554
|
+
return __generator$h(this, function (_a) {
|
|
4555
4555
|
switch (_a.label) {
|
|
4556
|
-
case 0: return [4 /*yield*/, Promise.reject((0, error_1$
|
|
4556
|
+
case 0: return [4 /*yield*/, Promise.reject((0, error_1$8.newError)('This connection holder does not serve connections'))];
|
|
4557
4557
|
case 1: return [2 /*return*/, _a.sent()];
|
|
4558
4558
|
}
|
|
4559
4559
|
});
|
|
4560
4560
|
});
|
|
4561
4561
|
};
|
|
4562
4562
|
EmptyConnectionHolder.prototype.releaseConnection = function () {
|
|
4563
|
-
return __awaiter$
|
|
4564
|
-
return __generator$
|
|
4563
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4564
|
+
return __generator$h(this, function (_a) {
|
|
4565
4565
|
switch (_a.label) {
|
|
4566
4566
|
case 0: return [4 /*yield*/, Promise.resolve(null)];
|
|
4567
4567
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -4570,8 +4570,8 @@
|
|
|
4570
4570
|
});
|
|
4571
4571
|
};
|
|
4572
4572
|
EmptyConnectionHolder.prototype.close = function () {
|
|
4573
|
-
return __awaiter$
|
|
4574
|
-
return __generator$
|
|
4573
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
4574
|
+
return __generator$h(this, function (_a) {
|
|
4575
4575
|
switch (_a.label) {
|
|
4576
4576
|
case 0: return [4 /*yield*/, Promise.resolve(null)];
|
|
4577
4577
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -4639,7 +4639,7 @@
|
|
|
4639
4639
|
Object.defineProperty(txConfig$1, "__esModule", { value: true });
|
|
4640
4640
|
txConfig$1.TxConfig = void 0;
|
|
4641
4641
|
var util$1 = __importStar$7(util$4);
|
|
4642
|
-
var error_1$
|
|
4642
|
+
var error_1$7 = error;
|
|
4643
4643
|
var integer_1 = integer;
|
|
4644
4644
|
/**
|
|
4645
4645
|
* Internal holder of the transaction configuration.
|
|
@@ -4683,7 +4683,7 @@
|
|
|
4683
4683
|
util$1.assertNumberOrInteger(config.timeout, 'Transaction timeout');
|
|
4684
4684
|
var timeout = (0, integer_1.int)(config.timeout);
|
|
4685
4685
|
if (timeout.isNegative()) {
|
|
4686
|
-
throw (0, error_1$
|
|
4686
|
+
throw (0, error_1$7.newError)('Transaction timeout should not be negative');
|
|
4687
4687
|
}
|
|
4688
4688
|
return timeout;
|
|
4689
4689
|
}
|
|
@@ -4730,7 +4730,7 @@
|
|
|
4730
4730
|
* limitations under the License.
|
|
4731
4731
|
*/
|
|
4732
4732
|
/* eslint-disable @typescript-eslint/promise-function-async */
|
|
4733
|
-
var __awaiter$
|
|
4733
|
+
var __awaiter$e = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4734
4734
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4735
4735
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4736
4736
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -4739,7 +4739,7 @@
|
|
|
4739
4739
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4740
4740
|
});
|
|
4741
4741
|
};
|
|
4742
|
-
var __generator$
|
|
4742
|
+
var __generator$g = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
4743
4743
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4744
4744
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
4745
4745
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -4768,7 +4768,7 @@
|
|
|
4768
4768
|
};
|
|
4769
4769
|
Object.defineProperty(transactionExecutor$1, "__esModule", { value: true });
|
|
4770
4770
|
transactionExecutor$1.TransactionExecutor = void 0;
|
|
4771
|
-
var error_1$
|
|
4771
|
+
var error_1$6 = error;
|
|
4772
4772
|
var DEFAULT_MAX_RETRY_TIME_MS$1 = 30 * 1000; // 30 seconds
|
|
4773
4773
|
var DEFAULT_INITIAL_RETRY_DELAY_MS$1 = 1000; // 1 seconds
|
|
4774
4774
|
var DEFAULT_RETRY_DELAY_MULTIPLIER$1 = 2.0;
|
|
@@ -4800,7 +4800,7 @@
|
|
|
4800
4800
|
TransactionExecutor.prototype._retryTransactionPromise = function (transactionCreator, transactionWork, error, retryStartTime, retryDelayMs, transactionWrapper) {
|
|
4801
4801
|
var _this = this;
|
|
4802
4802
|
var elapsedTimeMs = Date.now() - retryStartTime;
|
|
4803
|
-
if (elapsedTimeMs > this._maxRetryTimeMs || !(0, error_1$
|
|
4803
|
+
if (elapsedTimeMs > this._maxRetryTimeMs || !(0, error_1$6.isRetriableError)(error)) {
|
|
4804
4804
|
return Promise.reject(error);
|
|
4805
4805
|
}
|
|
4806
4806
|
return new Promise(function (resolve, reject) {
|
|
@@ -4818,10 +4818,10 @@
|
|
|
4818
4818
|
});
|
|
4819
4819
|
};
|
|
4820
4820
|
TransactionExecutor.prototype._executeTransactionInsidePromise = function (transactionCreator, transactionWork, resolve, reject, transactionWrapper) {
|
|
4821
|
-
return __awaiter$
|
|
4821
|
+
return __awaiter$e(this, void 0, void 0, function () {
|
|
4822
4822
|
var tx, error_2, wrap, wrappedTx, resultPromise;
|
|
4823
4823
|
var _this = this;
|
|
4824
|
-
return __generator$
|
|
4824
|
+
return __generator$g(this, function (_a) {
|
|
4825
4825
|
switch (_a.label) {
|
|
4826
4826
|
case 0:
|
|
4827
4827
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -4903,16 +4903,16 @@
|
|
|
4903
4903
|
};
|
|
4904
4904
|
TransactionExecutor.prototype._verifyAfterConstruction = function () {
|
|
4905
4905
|
if (this._maxRetryTimeMs < 0) {
|
|
4906
|
-
throw (0, error_1$
|
|
4906
|
+
throw (0, error_1$6.newError)('Max retry time should be >= 0: ' + this._maxRetryTimeMs.toString());
|
|
4907
4907
|
}
|
|
4908
4908
|
if (this._initialRetryDelayMs < 0) {
|
|
4909
|
-
throw (0, error_1$
|
|
4909
|
+
throw (0, error_1$6.newError)('Initial retry delay should >= 0: ' + this._initialRetryDelayMs.toString());
|
|
4910
4910
|
}
|
|
4911
4911
|
if (this._multiplier < 1.0) {
|
|
4912
|
-
throw (0, error_1$
|
|
4912
|
+
throw (0, error_1$6.newError)('Multiplier should be >= 1.0: ' + this._multiplier.toString());
|
|
4913
4913
|
}
|
|
4914
4914
|
if (this._jitterFactor < 0 || this._jitterFactor > 1) {
|
|
4915
|
-
throw (0, error_1$
|
|
4915
|
+
throw (0, error_1$6.newError)('Jitter factor should be in [0.0, 1.0]: ' + this._jitterFactor.toFixed());
|
|
4916
4916
|
}
|
|
4917
4917
|
};
|
|
4918
4918
|
return TransactionExecutor;
|
|
@@ -4963,7 +4963,7 @@
|
|
|
4963
4963
|
* See the License for the specific language governing permissions and
|
|
4964
4964
|
* limitations under the License.
|
|
4965
4965
|
*/
|
|
4966
|
-
var error_1$
|
|
4966
|
+
var error_1$5 = error;
|
|
4967
4967
|
var ERROR = 'error';
|
|
4968
4968
|
var WARN = 'warn';
|
|
4969
4969
|
var INFO = 'info';
|
|
@@ -5119,7 +5119,7 @@
|
|
|
5119
5119
|
var configuredLevel = loggingConfig.level;
|
|
5120
5120
|
var value = levels[configuredLevel];
|
|
5121
5121
|
if (value == null && value !== 0) {
|
|
5122
|
-
throw (0, error_1$
|
|
5122
|
+
throw (0, error_1$5.newError)("Illegal logging level: ".concat(configuredLevel, ". Supported levels are: ").concat(Object.keys(levels).toString()));
|
|
5123
5123
|
}
|
|
5124
5124
|
return configuredLevel;
|
|
5125
5125
|
}
|
|
@@ -5138,7 +5138,7 @@
|
|
|
5138
5138
|
return configuredLogger;
|
|
5139
5139
|
}
|
|
5140
5140
|
}
|
|
5141
|
-
throw (0, error_1$
|
|
5141
|
+
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'));
|
|
5142
5142
|
}
|
|
5143
5143
|
|
|
5144
5144
|
var urlUtil$2 = {};
|
|
@@ -5612,7 +5612,7 @@
|
|
|
5612
5612
|
}());
|
|
5613
5613
|
configuredCustomResolver.default = ConfiguredCustomResolver;
|
|
5614
5614
|
|
|
5615
|
-
var __importDefault$
|
|
5615
|
+
var __importDefault$K = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5616
5616
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5617
5617
|
};
|
|
5618
5618
|
Object.defineProperty(resolver$1, "__esModule", { value: true });
|
|
@@ -5635,9 +5635,9 @@
|
|
|
5635
5635
|
* See the License for the specific language governing permissions and
|
|
5636
5636
|
* limitations under the License.
|
|
5637
5637
|
*/
|
|
5638
|
-
var base_host_name_resolver_1 = __importDefault$
|
|
5638
|
+
var base_host_name_resolver_1 = __importDefault$K(baseHostNameResolver);
|
|
5639
5639
|
resolver$1.BaseHostNameResolver = base_host_name_resolver_1.default;
|
|
5640
|
-
var configured_custom_resolver_1$1 = __importDefault$
|
|
5640
|
+
var configured_custom_resolver_1$1 = __importDefault$K(configuredCustomResolver);
|
|
5641
5641
|
resolver$1.ConfiguredCustomResolver = configured_custom_resolver_1$1.default;
|
|
5642
5642
|
|
|
5643
5643
|
/**
|
|
@@ -5728,7 +5728,7 @@
|
|
|
5728
5728
|
* See the License for the specific language governing permissions and
|
|
5729
5729
|
* limitations under the License.
|
|
5730
5730
|
*/
|
|
5731
|
-
var __awaiter$
|
|
5731
|
+
var __awaiter$d = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5732
5732
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5733
5733
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5734
5734
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -5737,7 +5737,7 @@
|
|
|
5737
5737
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5738
5738
|
});
|
|
5739
5739
|
};
|
|
5740
|
-
var __generator$
|
|
5740
|
+
var __generator$f = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
5741
5741
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
5742
5742
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5743
5743
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -5764,14 +5764,14 @@
|
|
|
5764
5764
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
5765
5765
|
}
|
|
5766
5766
|
};
|
|
5767
|
-
var __importDefault$
|
|
5767
|
+
var __importDefault$J = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5768
5768
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5769
5769
|
};
|
|
5770
5770
|
Object.defineProperty(result, "__esModule", { value: true });
|
|
5771
5771
|
/* eslint-disable @typescript-eslint/promise-function-async */
|
|
5772
|
-
var result_summary_1 = __importDefault$
|
|
5772
|
+
var result_summary_1 = __importDefault$J(resultSummary);
|
|
5773
5773
|
var internal_1 = internal;
|
|
5774
|
-
var error_1$
|
|
5774
|
+
var error_1$4 = error;
|
|
5775
5775
|
var EMPTY_CONNECTION_HOLDER = internal_1.connectionHolder.EMPTY_CONNECTION_HOLDER;
|
|
5776
5776
|
/**
|
|
5777
5777
|
* @private
|
|
@@ -5919,7 +5919,7 @@
|
|
|
5919
5919
|
Result.prototype[Symbol.asyncIterator] = function () {
|
|
5920
5920
|
var _this = this;
|
|
5921
5921
|
if (!this.isOpen()) {
|
|
5922
|
-
var error_2 = (0, error_1$
|
|
5922
|
+
var error_2 = (0, error_1$4.newError)('Result is already consumed');
|
|
5923
5923
|
return {
|
|
5924
5924
|
next: function () { return Promise.reject(error_2); },
|
|
5925
5925
|
peek: function () { return Promise.reject(error_2); }
|
|
@@ -5944,9 +5944,9 @@
|
|
|
5944
5944
|
state.streaming.resume();
|
|
5945
5945
|
}
|
|
5946
5946
|
};
|
|
5947
|
-
var initializeObserver = function () { return __awaiter$
|
|
5947
|
+
var initializeObserver = function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
5948
5948
|
var _a;
|
|
5949
|
-
return __generator$
|
|
5949
|
+
return __generator$f(this, function (_b) {
|
|
5950
5950
|
switch (_b.label) {
|
|
5951
5951
|
case 0:
|
|
5952
5952
|
if (!(state.queuedObserver === undefined)) return [3 /*break*/, 2];
|
|
@@ -5963,14 +5963,14 @@
|
|
|
5963
5963
|
}); };
|
|
5964
5964
|
var assertSummary = function (summary) {
|
|
5965
5965
|
if (summary === undefined) {
|
|
5966
|
-
throw (0, error_1$
|
|
5966
|
+
throw (0, error_1$4.newError)('InvalidState: Result stream finished without Summary', error_1$4.PROTOCOL_ERROR);
|
|
5967
5967
|
}
|
|
5968
5968
|
return true;
|
|
5969
5969
|
};
|
|
5970
5970
|
return {
|
|
5971
|
-
next: function () { return __awaiter$
|
|
5971
|
+
next: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
5972
5972
|
var queuedObserver, next;
|
|
5973
|
-
return __generator$
|
|
5973
|
+
return __generator$f(this, function (_a) {
|
|
5974
5974
|
switch (_a.label) {
|
|
5975
5975
|
case 0:
|
|
5976
5976
|
if (state.finished) {
|
|
@@ -5992,10 +5992,10 @@
|
|
|
5992
5992
|
}
|
|
5993
5993
|
});
|
|
5994
5994
|
}); },
|
|
5995
|
-
return: function (value) { return __awaiter$
|
|
5995
|
+
return: function (value) { return __awaiter$d(_this, void 0, void 0, function () {
|
|
5996
5996
|
var queuedObserver, last;
|
|
5997
5997
|
var _a;
|
|
5998
|
-
return __generator$
|
|
5998
|
+
return __generator$f(this, function (_b) {
|
|
5999
5999
|
switch (_b.label) {
|
|
6000
6000
|
case 0:
|
|
6001
6001
|
if (state.finished) {
|
|
@@ -6017,9 +6017,9 @@
|
|
|
6017
6017
|
}
|
|
6018
6018
|
});
|
|
6019
6019
|
}); },
|
|
6020
|
-
peek: function () { return __awaiter$
|
|
6020
|
+
peek: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
6021
6021
|
var queuedObserver;
|
|
6022
|
-
return __generator$
|
|
6022
|
+
return __generator$f(this, function (_a) {
|
|
6023
6023
|
switch (_a.label) {
|
|
6024
6024
|
case 0:
|
|
6025
6025
|
if (state.finished) {
|
|
@@ -6211,13 +6211,13 @@
|
|
|
6211
6211
|
}
|
|
6212
6212
|
function dequeue() {
|
|
6213
6213
|
var _a;
|
|
6214
|
-
return __awaiter$
|
|
6214
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
6215
6215
|
var element;
|
|
6216
|
-
return __generator$
|
|
6216
|
+
return __generator$f(this, function (_b) {
|
|
6217
6217
|
switch (_b.label) {
|
|
6218
6218
|
case 0:
|
|
6219
6219
|
if (buffer.length > 0) {
|
|
6220
|
-
element = (_a = buffer.shift()) !== null && _a !== void 0 ? _a : (0, error_1$
|
|
6220
|
+
element = (_a = buffer.shift()) !== null && _a !== void 0 ? _a : (0, error_1$4.newError)('Unexpected empty buffer', error_1$4.PROTOCOL_ERROR);
|
|
6221
6221
|
onQueueSizeChanged();
|
|
6222
6222
|
if (isError(element)) {
|
|
6223
6223
|
throw element;
|
|
@@ -6260,9 +6260,9 @@
|
|
|
6260
6260
|
}
|
|
6261
6261
|
},
|
|
6262
6262
|
dequeue: dequeue,
|
|
6263
|
-
dequeueUntilDone: function () { return __awaiter$
|
|
6263
|
+
dequeueUntilDone: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
6264
6264
|
var element;
|
|
6265
|
-
return __generator$
|
|
6265
|
+
return __generator$f(this, function (_a) {
|
|
6266
6266
|
switch (_a.label) {
|
|
6267
6267
|
case 0:
|
|
6268
6268
|
return [4 /*yield*/, dequeue()];
|
|
@@ -6276,9 +6276,9 @@
|
|
|
6276
6276
|
}
|
|
6277
6277
|
});
|
|
6278
6278
|
}); },
|
|
6279
|
-
head: function () { return __awaiter$
|
|
6279
|
+
head: function () { return __awaiter$d(_this, void 0, void 0, function () {
|
|
6280
6280
|
var element, element, error_3;
|
|
6281
|
-
return __generator$
|
|
6281
|
+
return __generator$f(this, function (_a) {
|
|
6282
6282
|
switch (_a.label) {
|
|
6283
6283
|
case 0:
|
|
6284
6284
|
if (buffer.length > 0) {
|
|
@@ -6339,6 +6339,59 @@
|
|
|
6339
6339
|
}
|
|
6340
6340
|
result.default = Result;
|
|
6341
6341
|
|
|
6342
|
+
var resultEager = {};
|
|
6343
|
+
|
|
6344
|
+
/**
|
|
6345
|
+
* Copyright (c) "Neo4j"
|
|
6346
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6347
|
+
*
|
|
6348
|
+
* This file is part of Neo4j.
|
|
6349
|
+
*
|
|
6350
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6351
|
+
* you may not use this file except in compliance with the License.
|
|
6352
|
+
* You may obtain a copy of the License at
|
|
6353
|
+
*
|
|
6354
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6355
|
+
*
|
|
6356
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6357
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6358
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6359
|
+
* See the License for the specific language governing permissions and
|
|
6360
|
+
* limitations under the License.
|
|
6361
|
+
*/
|
|
6362
|
+
Object.defineProperty(resultEager, "__esModule", { value: true });
|
|
6363
|
+
/**
|
|
6364
|
+
* Represents the fully streamed result
|
|
6365
|
+
*/
|
|
6366
|
+
var EagerResult = /** @class */ (function () {
|
|
6367
|
+
/**
|
|
6368
|
+
* @constructor
|
|
6369
|
+
* @private
|
|
6370
|
+
* @param {string[]} keys The records keys
|
|
6371
|
+
* @param {Record[]} records The resulted records
|
|
6372
|
+
* @param {ResultSummary[]} summary The result Summary
|
|
6373
|
+
*/
|
|
6374
|
+
function EagerResult(keys, records, summary) {
|
|
6375
|
+
/**
|
|
6376
|
+
* Field keys, in the order the fields appear in the records.
|
|
6377
|
+
* @type {string[]}
|
|
6378
|
+
*/
|
|
6379
|
+
this.keys = keys;
|
|
6380
|
+
/**
|
|
6381
|
+
* Field records, in the order the records arrived from the server.
|
|
6382
|
+
* @type {Record[]}
|
|
6383
|
+
*/
|
|
6384
|
+
this.records = records;
|
|
6385
|
+
/**
|
|
6386
|
+
* Field summary
|
|
6387
|
+
* @type {ResultSummary}
|
|
6388
|
+
*/
|
|
6389
|
+
this.summary = summary;
|
|
6390
|
+
}
|
|
6391
|
+
return EagerResult;
|
|
6392
|
+
}());
|
|
6393
|
+
resultEager.default = EagerResult;
|
|
6394
|
+
|
|
6342
6395
|
var connectionProvider$1 = {};
|
|
6343
6396
|
|
|
6344
6397
|
/**
|
|
@@ -6384,6 +6437,7 @@
|
|
|
6384
6437
|
* @property {Bookmarks} param.bookmarks - the bookmarks to send to routing discovery
|
|
6385
6438
|
* @property {string} param.impersonatedUser - the impersonated user
|
|
6386
6439
|
* @property {function (databaseName:string?)} param.onDatabaseNameResolved - Callback called when the database name get resolved
|
|
6440
|
+
* @returns {Promise<Connection>}
|
|
6387
6441
|
*/
|
|
6388
6442
|
ConnectionProvider.prototype.acquireConnection = function (param) {
|
|
6389
6443
|
throw Error('Not implemented');
|
|
@@ -6604,7 +6658,7 @@
|
|
|
6604
6658
|
* See the License for the specific language governing permissions and
|
|
6605
6659
|
* limitations under the License.
|
|
6606
6660
|
*/
|
|
6607
|
-
var __awaiter$
|
|
6661
|
+
var __awaiter$c = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6608
6662
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6609
6663
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6610
6664
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -6613,7 +6667,7 @@
|
|
|
6613
6667
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6614
6668
|
});
|
|
6615
6669
|
};
|
|
6616
|
-
var __generator$
|
|
6670
|
+
var __generator$e = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
6617
6671
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
6618
6672
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
6619
6673
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -6640,7 +6694,7 @@
|
|
|
6640
6694
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
6641
6695
|
}
|
|
6642
6696
|
};
|
|
6643
|
-
var __importDefault$
|
|
6697
|
+
var __importDefault$I = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
6644
6698
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6645
6699
|
};
|
|
6646
6700
|
Object.defineProperty(transaction, "__esModule", { value: true });
|
|
@@ -6650,8 +6704,8 @@
|
|
|
6650
6704
|
var bookmarks_1$2 = bookmarks$1;
|
|
6651
6705
|
var tx_config_1$1 = txConfig$1;
|
|
6652
6706
|
var observers_1$1 = observers;
|
|
6653
|
-
var error_1$
|
|
6654
|
-
var result_1$1 = __importDefault$
|
|
6707
|
+
var error_1$3 = error;
|
|
6708
|
+
var result_1$1 = __importDefault$I(result);
|
|
6655
6709
|
/**
|
|
6656
6710
|
* Represents a transaction in the Neo4j database.
|
|
6657
6711
|
*
|
|
@@ -6703,10 +6757,10 @@
|
|
|
6703
6757
|
var _this = this;
|
|
6704
6758
|
this._connectionHolder
|
|
6705
6759
|
.getConnection()
|
|
6706
|
-
.then(function (connection) { return __awaiter$
|
|
6760
|
+
.then(function (connection) { return __awaiter$c(_this, void 0, void 0, function () {
|
|
6707
6761
|
var _a;
|
|
6708
6762
|
var _this = this;
|
|
6709
|
-
return __generator$
|
|
6763
|
+
return __generator$e(this, function (_b) {
|
|
6710
6764
|
switch (_b.label) {
|
|
6711
6765
|
case 0:
|
|
6712
6766
|
this._onConnection();
|
|
@@ -6734,7 +6788,7 @@
|
|
|
6734
6788
|
return _this._onComplete(metadata);
|
|
6735
6789
|
}
|
|
6736
6790
|
})];
|
|
6737
|
-
case 2: throw (0, error_1$
|
|
6791
|
+
case 2: throw (0, error_1$3.newError)('No connection available');
|
|
6738
6792
|
}
|
|
6739
6793
|
});
|
|
6740
6794
|
}); })
|
|
@@ -6842,8 +6896,8 @@
|
|
|
6842
6896
|
* @returns {Promise<void>} An empty promise if closed successfully or error if any error happened during
|
|
6843
6897
|
*/
|
|
6844
6898
|
Transaction.prototype.close = function () {
|
|
6845
|
-
return __awaiter$
|
|
6846
|
-
return __generator$
|
|
6899
|
+
return __awaiter$c(this, void 0, void 0, function () {
|
|
6900
|
+
return __generator$e(this, function (_a) {
|
|
6847
6901
|
switch (_a.label) {
|
|
6848
6902
|
case 0:
|
|
6849
6903
|
if (!this.isOpen()) return [3 /*break*/, 2];
|
|
@@ -6914,7 +6968,7 @@
|
|
|
6914
6968
|
});
|
|
6915
6969
|
}
|
|
6916
6970
|
else {
|
|
6917
|
-
throw (0, error_1$
|
|
6971
|
+
throw (0, error_1$3.newError)('No connection available');
|
|
6918
6972
|
}
|
|
6919
6973
|
})
|
|
6920
6974
|
.catch(function (error) { return new observers_1$1.FailedObserver({ error: error, onError: onError }); });
|
|
@@ -6928,7 +6982,7 @@
|
|
|
6928
6982
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6929
6983
|
return {
|
|
6930
6984
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6931
|
-
error: (0, error_1$
|
|
6985
|
+
error: (0, error_1$3.newError)('Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination.'),
|
|
6932
6986
|
onError: onError
|
|
6933
6987
|
}), 'COMMIT', {}, connectionHolder, 0, // high watermark
|
|
6934
6988
|
0 // low watermark
|
|
@@ -6948,7 +7002,7 @@
|
|
|
6948
7002
|
run: function (query, parameters, _a) {
|
|
6949
7003
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6950
7004
|
return newCompletedResult(new observers_1$1.FailedObserver({
|
|
6951
|
-
error: (0, error_1$
|
|
7005
|
+
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.'),
|
|
6952
7006
|
onError: onError
|
|
6953
7007
|
}), query, parameters, connectionHolder, 0, // high watermark
|
|
6954
7008
|
0 // low watermark
|
|
@@ -6961,7 +7015,7 @@
|
|
|
6961
7015
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6962
7016
|
return {
|
|
6963
7017
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6964
|
-
error: (0, error_1$
|
|
7018
|
+
error: (0, error_1$3.newError)('Cannot commit this transaction, because it has already been committed.'),
|
|
6965
7019
|
onError: onError
|
|
6966
7020
|
}), 'COMMIT', {}, connection_holder_1$1.EMPTY_CONNECTION_HOLDER, 0, // high watermark
|
|
6967
7021
|
0 // low watermark
|
|
@@ -6974,7 +7028,7 @@
|
|
|
6974
7028
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6975
7029
|
return {
|
|
6976
7030
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
6977
|
-
error: (0, error_1$
|
|
7031
|
+
error: (0, error_1$3.newError)('Cannot rollback this transaction, because it has already been committed.'),
|
|
6978
7032
|
onError: onError
|
|
6979
7033
|
}), 'ROLLBACK', {}, connection_holder_1$1.EMPTY_CONNECTION_HOLDER, 0, // high watermark
|
|
6980
7034
|
0 // low watermark
|
|
@@ -6986,7 +7040,7 @@
|
|
|
6986
7040
|
run: function (query, parameters, _a) {
|
|
6987
7041
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
6988
7042
|
return newCompletedResult(new observers_1$1.FailedObserver({
|
|
6989
|
-
error: (0, error_1$
|
|
7043
|
+
error: (0, error_1$3.newError)('Cannot run query in this transaction, because it has already been committed.'),
|
|
6990
7044
|
onError: onError
|
|
6991
7045
|
}), query, parameters, connectionHolder, 0, // high watermark
|
|
6992
7046
|
0 // low watermark
|
|
@@ -6999,7 +7053,7 @@
|
|
|
6999
7053
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
7000
7054
|
return {
|
|
7001
7055
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
7002
|
-
error: (0, error_1$
|
|
7056
|
+
error: (0, error_1$3.newError)('Cannot commit this transaction, because it has already been rolled back.'),
|
|
7003
7057
|
onError: onError
|
|
7004
7058
|
}), 'COMMIT', {}, connectionHolder, 0, // high watermark
|
|
7005
7059
|
0 // low watermark
|
|
@@ -7011,7 +7065,7 @@
|
|
|
7011
7065
|
var connectionHolder = _a.connectionHolder; _a.onError; _a.onComplete;
|
|
7012
7066
|
return {
|
|
7013
7067
|
result: newCompletedResult(new observers_1$1.FailedObserver({
|
|
7014
|
-
error: (0, error_1$
|
|
7068
|
+
error: (0, error_1$3.newError)('Cannot rollback this transaction, because it has already been rolled back.')
|
|
7015
7069
|
}), 'ROLLBACK', {}, connectionHolder, 0, // high watermark
|
|
7016
7070
|
0 // low watermark
|
|
7017
7071
|
),
|
|
@@ -7021,7 +7075,7 @@
|
|
|
7021
7075
|
run: function (query, parameters, _a) {
|
|
7022
7076
|
var connectionHolder = _a.connectionHolder, onError = _a.onError; _a.onComplete;
|
|
7023
7077
|
return newCompletedResult(new observers_1$1.FailedObserver({
|
|
7024
|
-
error: (0, error_1$
|
|
7078
|
+
error: (0, error_1$3.newError)('Cannot run query in this transaction, because it has already been rolled back.'),
|
|
7025
7079
|
onError: onError
|
|
7026
7080
|
}), query, parameters, connectionHolder, 0, // high watermark
|
|
7027
7081
|
0 // low watermark
|
|
@@ -7061,7 +7115,7 @@
|
|
|
7061
7115
|
}
|
|
7062
7116
|
}
|
|
7063
7117
|
else {
|
|
7064
|
-
throw (0, error_1$
|
|
7118
|
+
throw (0, error_1$3.newError)('No connection available');
|
|
7065
7119
|
}
|
|
7066
7120
|
});
|
|
7067
7121
|
})
|
|
@@ -7201,13 +7255,13 @@
|
|
|
7201
7255
|
};
|
|
7202
7256
|
return __assign$d.apply(this, arguments);
|
|
7203
7257
|
};
|
|
7204
|
-
var __importDefault$
|
|
7258
|
+
var __importDefault$H = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
7205
7259
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7206
7260
|
};
|
|
7207
7261
|
var _a$c;
|
|
7208
7262
|
Object.defineProperty(transactionPromise, "__esModule", { value: true });
|
|
7209
7263
|
/* eslint-disable @typescript-eslint/promise-function-async */
|
|
7210
|
-
var transaction_1 = __importDefault$
|
|
7264
|
+
var transaction_1 = __importDefault$H(transaction);
|
|
7211
7265
|
/**
|
|
7212
7266
|
* Represents a {@link Promise<Transaction>} object and a {@link Transaction} object.
|
|
7213
7267
|
*
|
|
@@ -7351,7 +7405,7 @@
|
|
|
7351
7405
|
* See the License for the specific language governing permissions and
|
|
7352
7406
|
* limitations under the License.
|
|
7353
7407
|
*/
|
|
7354
|
-
var __awaiter$
|
|
7408
|
+
var __awaiter$b = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7355
7409
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7356
7410
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7357
7411
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -7360,7 +7414,7 @@
|
|
|
7360
7414
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7361
7415
|
});
|
|
7362
7416
|
};
|
|
7363
|
-
var __generator$
|
|
7417
|
+
var __generator$d = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
7364
7418
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
7365
7419
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
7366
7420
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -7412,7 +7466,7 @@
|
|
|
7412
7466
|
}
|
|
7413
7467
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
7414
7468
|
};
|
|
7415
|
-
var __importDefault$
|
|
7469
|
+
var __importDefault$G = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
7416
7470
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7417
7471
|
};
|
|
7418
7472
|
Object.defineProperty(session, "__esModule", { value: true });
|
|
@@ -7420,14 +7474,14 @@
|
|
|
7420
7474
|
var observers_1 = observers;
|
|
7421
7475
|
var util_1$1 = util$4;
|
|
7422
7476
|
var constants_1$1 = constants$1;
|
|
7423
|
-
var error_1 = error;
|
|
7424
|
-
var result_1 = __importDefault$
|
|
7477
|
+
var error_1$2 = error;
|
|
7478
|
+
var result_1 = __importDefault$G(result);
|
|
7425
7479
|
var connection_holder_1 = connectionHolder$1;
|
|
7426
7480
|
var transaction_executor_1 = transactionExecutor$1;
|
|
7427
7481
|
var bookmarks_1$1 = bookmarks$1;
|
|
7428
7482
|
var tx_config_1 = txConfig$1;
|
|
7429
|
-
var transaction_promise_1 = __importDefault$
|
|
7430
|
-
var transaction_managed_1 = __importDefault$
|
|
7483
|
+
var transaction_promise_1 = __importDefault$G(transactionPromise);
|
|
7484
|
+
var transaction_managed_1 = __importDefault$G(transactionManaged);
|
|
7431
7485
|
/**
|
|
7432
7486
|
* A Session instance is used for handling the connection and
|
|
7433
7487
|
* sending queries through the connection.
|
|
@@ -7505,10 +7559,10 @@
|
|
|
7505
7559
|
var autoCommitTxConfig = (transactionConfig != null)
|
|
7506
7560
|
? new tx_config_1.TxConfig(transactionConfig)
|
|
7507
7561
|
: tx_config_1.TxConfig.empty();
|
|
7508
|
-
var result = this._run(validatedQuery, params, function (connection) { return __awaiter$
|
|
7562
|
+
var result = this._run(validatedQuery, params, function (connection) { return __awaiter$b(_this, void 0, void 0, function () {
|
|
7509
7563
|
var bookmarks;
|
|
7510
7564
|
var _this = this;
|
|
7511
|
-
return __generator$
|
|
7565
|
+
return __generator$d(this, function (_a) {
|
|
7512
7566
|
switch (_a.label) {
|
|
7513
7567
|
case 0: return [4 /*yield*/, this._bookmarks()];
|
|
7514
7568
|
case 1:
|
|
@@ -7537,7 +7591,7 @@
|
|
|
7537
7591
|
var observerPromise;
|
|
7538
7592
|
if (!this._open) {
|
|
7539
7593
|
observerPromise = Promise.resolve(new observers_1.FailedObserver({
|
|
7540
|
-
error: (0, error_1.newError)('Cannot run query in a closed session.')
|
|
7594
|
+
error: (0, error_1$2.newError)('Cannot run query in a closed session.')
|
|
7541
7595
|
}));
|
|
7542
7596
|
}
|
|
7543
7597
|
else if (!this._hasTx && connectionHolder.initializeConnection()) {
|
|
@@ -7548,7 +7602,7 @@
|
|
|
7548
7602
|
}
|
|
7549
7603
|
else {
|
|
7550
7604
|
observerPromise = Promise.resolve(new observers_1.FailedObserver({
|
|
7551
|
-
error: (0, error_1.newError)('Queries cannot be run directly on a ' +
|
|
7605
|
+
error: (0, error_1$2.newError)('Queries cannot be run directly on a ' +
|
|
7552
7606
|
'session with an open transaction; either run from within the ' +
|
|
7553
7607
|
'transaction or use a different session.')
|
|
7554
7608
|
}));
|
|
@@ -7561,14 +7615,14 @@
|
|
|
7561
7615
|
var promise;
|
|
7562
7616
|
var connectionHolder = this._connectionHolderWithMode(this._mode);
|
|
7563
7617
|
if (!this._open) {
|
|
7564
|
-
promise = Promise.reject((0, error_1.newError)('Cannot run query in a closed session.'));
|
|
7618
|
+
promise = Promise.reject((0, error_1$2.newError)('Cannot run query in a closed session.'));
|
|
7565
7619
|
}
|
|
7566
7620
|
else if (!this._hasTx && connectionHolder.initializeConnection()) {
|
|
7567
7621
|
promise = connectionHolder
|
|
7568
7622
|
.getConnection()
|
|
7569
7623
|
.then(function (connection) { return connectionConsumer(connection); })
|
|
7570
|
-
.then(function (result) { return __awaiter$
|
|
7571
|
-
return __generator$
|
|
7624
|
+
.then(function (result) { return __awaiter$b(_this, void 0, void 0, function () {
|
|
7625
|
+
return __generator$d(this, function (_a) {
|
|
7572
7626
|
switch (_a.label) {
|
|
7573
7627
|
case 0: return [4 /*yield*/, connectionHolder.releaseConnection()];
|
|
7574
7628
|
case 1:
|
|
@@ -7579,7 +7633,7 @@
|
|
|
7579
7633
|
}); });
|
|
7580
7634
|
}
|
|
7581
7635
|
else {
|
|
7582
|
-
promise = Promise.reject((0, error_1.newError)('Queries cannot be run directly on a ' +
|
|
7636
|
+
promise = Promise.reject((0, error_1$2.newError)('Queries cannot be run directly on a ' +
|
|
7583
7637
|
'session with an open transaction; either run from within the ' +
|
|
7584
7638
|
'transaction or use a different session.'));
|
|
7585
7639
|
}
|
|
@@ -7608,10 +7662,10 @@
|
|
|
7608
7662
|
Session.prototype._beginTransaction = function (accessMode, txConfig) {
|
|
7609
7663
|
var _this = this;
|
|
7610
7664
|
if (!this._open) {
|
|
7611
|
-
throw (0, error_1.newError)('Cannot begin a transaction on a closed session.');
|
|
7665
|
+
throw (0, error_1$2.newError)('Cannot begin a transaction on a closed session.');
|
|
7612
7666
|
}
|
|
7613
7667
|
if (this._hasTx) {
|
|
7614
|
-
throw (0, error_1.newError)('You cannot begin a transaction on a session with an open transaction; ' +
|
|
7668
|
+
throw (0, error_1$2.newError)('You cannot begin a transaction on a session with an open transaction; ' +
|
|
7615
7669
|
'either run from within the transaction or use a different session.');
|
|
7616
7670
|
}
|
|
7617
7671
|
var mode = Session._validateSessionMode(accessMode);
|
|
@@ -7638,7 +7692,7 @@
|
|
|
7638
7692
|
*/
|
|
7639
7693
|
Session.prototype._assertSessionIsOpen = function () {
|
|
7640
7694
|
if (!this._open) {
|
|
7641
|
-
throw (0, error_1.newError)('You cannot run more transactions on a closed session.');
|
|
7695
|
+
throw (0, error_1$2.newError)('You cannot run more transactions on a closed session.');
|
|
7642
7696
|
}
|
|
7643
7697
|
};
|
|
7644
7698
|
/**
|
|
@@ -7669,9 +7723,9 @@
|
|
|
7669
7723
|
};
|
|
7670
7724
|
Session.prototype._bookmarks = function () {
|
|
7671
7725
|
var _a;
|
|
7672
|
-
return __awaiter$
|
|
7726
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
7673
7727
|
var bookmarks;
|
|
7674
|
-
return __generator$
|
|
7728
|
+
return __generator$d(this, function (_b) {
|
|
7675
7729
|
switch (_b.label) {
|
|
7676
7730
|
case 0: return [4 /*yield*/, ((_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.getBookmarks())];
|
|
7677
7731
|
case 1:
|
|
@@ -7794,9 +7848,9 @@
|
|
|
7794
7848
|
};
|
|
7795
7849
|
Session.prototype._getConnectionAcquistionBookmarks = function () {
|
|
7796
7850
|
var _a;
|
|
7797
|
-
return __awaiter$
|
|
7851
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
7798
7852
|
var bookmarks;
|
|
7799
|
-
return __generator$
|
|
7853
|
+
return __generator$d(this, function (_b) {
|
|
7800
7854
|
switch (_b.label) {
|
|
7801
7855
|
case 0: return [4 /*yield*/, ((_a = this._bookmarkManager) === null || _a === void 0 ? void 0 : _a.getBookmarks())];
|
|
7802
7856
|
case 1:
|
|
@@ -7828,8 +7882,8 @@
|
|
|
7828
7882
|
* @return {Promise}
|
|
7829
7883
|
*/
|
|
7830
7884
|
Session.prototype.close = function () {
|
|
7831
|
-
return __awaiter$
|
|
7832
|
-
return __generator$
|
|
7885
|
+
return __awaiter$b(this, void 0, void 0, function () {
|
|
7886
|
+
return __generator$d(this, function (_a) {
|
|
7833
7887
|
switch (_a.label) {
|
|
7834
7888
|
case 0:
|
|
7835
7889
|
if (!this._open) return [3 /*break*/, 3];
|
|
@@ -7856,7 +7910,7 @@
|
|
|
7856
7910
|
return this._writeConnectionHolder;
|
|
7857
7911
|
}
|
|
7858
7912
|
else {
|
|
7859
|
-
throw (0, error_1.newError)('Unknown access mode: ' + mode);
|
|
7913
|
+
throw (0, error_1$2.newError)('Unknown access mode: ' + mode);
|
|
7860
7914
|
}
|
|
7861
7915
|
};
|
|
7862
7916
|
/**
|
|
@@ -7889,7 +7943,7 @@
|
|
|
7889
7943
|
Session._validateSessionMode = function (rawMode) {
|
|
7890
7944
|
var mode = rawMode !== null && rawMode !== void 0 ? rawMode : constants_1$1.ACCESS_MODE_WRITE;
|
|
7891
7945
|
if (mode !== constants_1$1.ACCESS_MODE_READ && mode !== constants_1$1.ACCESS_MODE_WRITE) {
|
|
7892
|
-
throw (0, error_1.newError)('Illegal session mode ' + mode);
|
|
7946
|
+
throw (0, error_1$2.newError)('Illegal session mode ' + mode);
|
|
7893
7947
|
}
|
|
7894
7948
|
return mode;
|
|
7895
7949
|
};
|
|
@@ -7909,73 +7963,702 @@
|
|
|
7909
7963
|
|
|
7910
7964
|
var driver = {};
|
|
7911
7965
|
|
|
7912
|
-
var
|
|
7913
|
-
|
|
7914
|
-
};
|
|
7915
|
-
Object.defineProperty(driver, "__esModule", { value: true });
|
|
7916
|
-
driver.SessionConfig = driver.WRITE = driver.READ = driver.Driver = void 0;
|
|
7917
|
-
var bookmarks_1 = bookmarks$1;
|
|
7918
|
-
var configured_custom_resolver_1 = __importDefault$E(configuredCustomResolver);
|
|
7919
|
-
var constants_1 = constants$1;
|
|
7920
|
-
var logger_1 = logger$1;
|
|
7921
|
-
var session_1 = __importDefault$E(session);
|
|
7922
|
-
var util_1 = util$4;
|
|
7923
|
-
var DEFAULT_MAX_CONNECTION_LIFETIME = 60 * 60 * 1000; // 1 hour
|
|
7924
|
-
/**
|
|
7925
|
-
* The default record fetch size. This is used in Bolt V4 protocol to pull query execution result in batches.
|
|
7926
|
-
* @type {number}
|
|
7927
|
-
*/
|
|
7928
|
-
var DEFAULT_FETCH_SIZE = 1000;
|
|
7929
|
-
/**
|
|
7930
|
-
* Constant that represents read session access mode.
|
|
7931
|
-
* Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.READ })`.
|
|
7932
|
-
* @type {string}
|
|
7933
|
-
*/
|
|
7934
|
-
var READ$3 = constants_1.ACCESS_MODE_READ;
|
|
7935
|
-
driver.READ = READ$3;
|
|
7966
|
+
var bookmarkManager$1 = {};
|
|
7967
|
+
|
|
7936
7968
|
/**
|
|
7937
|
-
*
|
|
7938
|
-
*
|
|
7939
|
-
*
|
|
7969
|
+
* Copyright (c) "Neo4j"
|
|
7970
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
7971
|
+
*
|
|
7972
|
+
* This file is part of Neo4j.
|
|
7973
|
+
*
|
|
7974
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7975
|
+
* you may not use this file except in compliance with the License.
|
|
7976
|
+
* You may obtain a copy of the License at
|
|
7977
|
+
*
|
|
7978
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7979
|
+
*
|
|
7980
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7981
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7982
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7983
|
+
* See the License for the specific language governing permissions and
|
|
7984
|
+
* limitations under the License.
|
|
7940
7985
|
*/
|
|
7941
|
-
var
|
|
7942
|
-
|
|
7943
|
-
|
|
7986
|
+
var __awaiter$a = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7987
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7988
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7989
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7990
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7991
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7992
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7993
|
+
});
|
|
7994
|
+
};
|
|
7995
|
+
var __generator$c = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
7996
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
7997
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
7998
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
7999
|
+
function step(op) {
|
|
8000
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8001
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
8002
|
+
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;
|
|
8003
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
8004
|
+
switch (op[0]) {
|
|
8005
|
+
case 0: case 1: t = op; break;
|
|
8006
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
8007
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
8008
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
8009
|
+
default:
|
|
8010
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
8011
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
8012
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
8013
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
8014
|
+
if (t[2]) _.ops.pop();
|
|
8015
|
+
_.trys.pop(); continue;
|
|
8016
|
+
}
|
|
8017
|
+
op = body.call(thisArg, _);
|
|
8018
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
8019
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8020
|
+
}
|
|
8021
|
+
};
|
|
8022
|
+
var __values$a = (commonjsGlobal && commonjsGlobal.__values) || function(o) {
|
|
8023
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
8024
|
+
if (m) return m.call(o);
|
|
8025
|
+
if (o && typeof o.length === "number") return {
|
|
8026
|
+
next: function () {
|
|
8027
|
+
if (o && i >= o.length) o = void 0;
|
|
8028
|
+
return { value: o && o[i++], done: !o };
|
|
8029
|
+
}
|
|
8030
|
+
};
|
|
8031
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
8032
|
+
};
|
|
8033
|
+
var __read$p = (commonjsGlobal && commonjsGlobal.__read) || function (o, n) {
|
|
8034
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8035
|
+
if (!m) return o;
|
|
8036
|
+
var i = m.call(o), r, ar = [], e;
|
|
8037
|
+
try {
|
|
8038
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8039
|
+
}
|
|
8040
|
+
catch (error) { e = { error: error }; }
|
|
8041
|
+
finally {
|
|
8042
|
+
try {
|
|
8043
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
8044
|
+
}
|
|
8045
|
+
finally { if (e) throw e.error; }
|
|
8046
|
+
}
|
|
8047
|
+
return ar;
|
|
8048
|
+
};
|
|
8049
|
+
var __spreadArray$j = (commonjsGlobal && commonjsGlobal.__spreadArray) || function (to, from, pack) {
|
|
8050
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8051
|
+
if (ar || !(i in from)) {
|
|
8052
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8053
|
+
ar[i] = from[i];
|
|
8054
|
+
}
|
|
8055
|
+
}
|
|
8056
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8057
|
+
};
|
|
8058
|
+
Object.defineProperty(bookmarkManager$1, "__esModule", { value: true });
|
|
8059
|
+
bookmarkManager$1.bookmarkManager = void 0;
|
|
7944
8060
|
/**
|
|
7945
|
-
*
|
|
7946
|
-
*
|
|
8061
|
+
* Interface for the piece of software responsible for keeping track of current active bookmarks accross the driver.
|
|
7947
8062
|
* @interface
|
|
8063
|
+
* @since 5.0
|
|
8064
|
+
* @experimental
|
|
7948
8065
|
*/
|
|
7949
|
-
var
|
|
8066
|
+
var BookmarkManager = /** @class */ (function () {
|
|
7950
8067
|
/**
|
|
7951
8068
|
* @constructor
|
|
7952
8069
|
* @private
|
|
7953
8070
|
*/
|
|
7954
|
-
function
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
8071
|
+
function BookmarkManager() {
|
|
8072
|
+
throw new Error('Not implemented');
|
|
8073
|
+
}
|
|
8074
|
+
/**
|
|
8075
|
+
* Method called when the bookmarks get updated when a transaction finished.
|
|
8076
|
+
*
|
|
8077
|
+
* This method will be called when auto-commit queries finish and when explicit transactions
|
|
8078
|
+
* get committed.
|
|
8079
|
+
*
|
|
8080
|
+
* @param {Iterable<string>} previousBookmarks The bookmarks used when starting the transaction
|
|
8081
|
+
* @param {Iterable<string>} newBookmarks The new bookmarks received at the end of the transaction.
|
|
8082
|
+
* @returns {void}
|
|
8083
|
+
*/
|
|
8084
|
+
BookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
|
|
8085
|
+
return __awaiter$a(this, void 0, void 0, function () {
|
|
8086
|
+
return __generator$c(this, function (_a) {
|
|
8087
|
+
throw new Error('Not implemented');
|
|
8088
|
+
});
|
|
8089
|
+
});
|
|
8090
|
+
};
|
|
8091
|
+
/**
|
|
8092
|
+
* Method called by the driver to get the bookmarks.
|
|
8093
|
+
*
|
|
8094
|
+
* @returns {Iterable<string>} The set of bookmarks
|
|
8095
|
+
*/
|
|
8096
|
+
BookmarkManager.prototype.getBookmarks = function () {
|
|
8097
|
+
return __awaiter$a(this, void 0, void 0, function () {
|
|
8098
|
+
return __generator$c(this, function (_a) {
|
|
8099
|
+
throw new Error('Not implemented');
|
|
8100
|
+
});
|
|
8101
|
+
});
|
|
8102
|
+
};
|
|
8103
|
+
return BookmarkManager;
|
|
8104
|
+
}());
|
|
8105
|
+
bookmarkManager$1.default = BookmarkManager;
|
|
8106
|
+
/**
|
|
8107
|
+
* @typedef {Object} BookmarkManagerConfig
|
|
8108
|
+
*
|
|
8109
|
+
* @since 5.0
|
|
8110
|
+
* @experimental
|
|
8111
|
+
* @property {Iterable<string>} [initialBookmarks] Defines the initial set of bookmarks. The key is the database name and the values are the bookmarks.
|
|
8112
|
+
* @property {function():Promise<Iterable<string>>} [bookmarksSupplier] Called for supplying extra bookmarks to the BookmarkManager
|
|
8113
|
+
* @property {function(bookmarks: Iterable<string>): Promise<void>} [bookmarksConsumer] Called when the set of bookmarks get updated
|
|
8114
|
+
*/
|
|
8115
|
+
/**
|
|
8116
|
+
* Provides an configured {@link BookmarkManager} instance.
|
|
8117
|
+
*
|
|
8118
|
+
* @since 5.0
|
|
8119
|
+
* @experimental
|
|
8120
|
+
* @param {BookmarkManagerConfig} [config={}]
|
|
8121
|
+
* @returns {BookmarkManager}
|
|
8122
|
+
*/
|
|
8123
|
+
function bookmarkManager(config) {
|
|
8124
|
+
if (config === void 0) { config = {}; }
|
|
8125
|
+
var initialBookmarks = new Set(config.initialBookmarks);
|
|
8126
|
+
return new Neo4jBookmarkManager(initialBookmarks, config.bookmarksSupplier, config.bookmarksConsumer);
|
|
8127
|
+
}
|
|
8128
|
+
bookmarkManager$1.bookmarkManager = bookmarkManager;
|
|
8129
|
+
var Neo4jBookmarkManager = /** @class */ (function () {
|
|
8130
|
+
function Neo4jBookmarkManager(_bookmarks, _bookmarksSupplier, _bookmarksConsumer) {
|
|
8131
|
+
this._bookmarks = _bookmarks;
|
|
8132
|
+
this._bookmarksSupplier = _bookmarksSupplier;
|
|
8133
|
+
this._bookmarksConsumer = _bookmarksConsumer;
|
|
8134
|
+
}
|
|
8135
|
+
Neo4jBookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
|
|
8136
|
+
return __awaiter$a(this, void 0, void 0, function () {
|
|
8137
|
+
var bookmarks, previousBookmarks_1, previousBookmarks_1_1, bm, newBookmarks_1, newBookmarks_1_1, bm;
|
|
8138
|
+
var e_1, _a, e_2, _b;
|
|
8139
|
+
return __generator$c(this, function (_c) {
|
|
8140
|
+
switch (_c.label) {
|
|
8141
|
+
case 0:
|
|
8142
|
+
bookmarks = this._bookmarks;
|
|
8143
|
+
try {
|
|
8144
|
+
for (previousBookmarks_1 = __values$a(previousBookmarks), previousBookmarks_1_1 = previousBookmarks_1.next(); !previousBookmarks_1_1.done; previousBookmarks_1_1 = previousBookmarks_1.next()) {
|
|
8145
|
+
bm = previousBookmarks_1_1.value;
|
|
8146
|
+
bookmarks.delete(bm);
|
|
8147
|
+
}
|
|
8148
|
+
}
|
|
8149
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8150
|
+
finally {
|
|
8151
|
+
try {
|
|
8152
|
+
if (previousBookmarks_1_1 && !previousBookmarks_1_1.done && (_a = previousBookmarks_1.return)) _a.call(previousBookmarks_1);
|
|
8153
|
+
}
|
|
8154
|
+
finally { if (e_1) throw e_1.error; }
|
|
8155
|
+
}
|
|
8156
|
+
try {
|
|
8157
|
+
for (newBookmarks_1 = __values$a(newBookmarks), newBookmarks_1_1 = newBookmarks_1.next(); !newBookmarks_1_1.done; newBookmarks_1_1 = newBookmarks_1.next()) {
|
|
8158
|
+
bm = newBookmarks_1_1.value;
|
|
8159
|
+
bookmarks.add(bm);
|
|
8160
|
+
}
|
|
8161
|
+
}
|
|
8162
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
8163
|
+
finally {
|
|
8164
|
+
try {
|
|
8165
|
+
if (newBookmarks_1_1 && !newBookmarks_1_1.done && (_b = newBookmarks_1.return)) _b.call(newBookmarks_1);
|
|
8166
|
+
}
|
|
8167
|
+
finally { if (e_2) throw e_2.error; }
|
|
8168
|
+
}
|
|
8169
|
+
if (!(typeof this._bookmarksConsumer === 'function')) return [3 /*break*/, 2];
|
|
8170
|
+
return [4 /*yield*/, this._bookmarksConsumer(__spreadArray$j([], __read$p(bookmarks), false))];
|
|
8171
|
+
case 1:
|
|
8172
|
+
_c.sent();
|
|
8173
|
+
_c.label = 2;
|
|
8174
|
+
case 2: return [2 /*return*/];
|
|
8175
|
+
}
|
|
8176
|
+
});
|
|
8177
|
+
});
|
|
8178
|
+
};
|
|
8179
|
+
Neo4jBookmarkManager.prototype.getBookmarks = function () {
|
|
8180
|
+
var _a;
|
|
8181
|
+
return __awaiter$a(this, void 0, void 0, function () {
|
|
8182
|
+
var bookmarks, suppliedBookmarks, suppliedBookmarks_1, suppliedBookmarks_1_1, bm;
|
|
8183
|
+
var e_3, _b;
|
|
8184
|
+
return __generator$c(this, function (_c) {
|
|
8185
|
+
switch (_c.label) {
|
|
8186
|
+
case 0:
|
|
8187
|
+
bookmarks = new Set(this._bookmarks);
|
|
8188
|
+
if (!(typeof this._bookmarksSupplier === 'function')) return [3 /*break*/, 2];
|
|
8189
|
+
return [4 /*yield*/, this._bookmarksSupplier()];
|
|
8190
|
+
case 1:
|
|
8191
|
+
suppliedBookmarks = (_a = _c.sent()) !== null && _a !== void 0 ? _a : [];
|
|
8192
|
+
try {
|
|
8193
|
+
for (suppliedBookmarks_1 = __values$a(suppliedBookmarks), suppliedBookmarks_1_1 = suppliedBookmarks_1.next(); !suppliedBookmarks_1_1.done; suppliedBookmarks_1_1 = suppliedBookmarks_1.next()) {
|
|
8194
|
+
bm = suppliedBookmarks_1_1.value;
|
|
8195
|
+
bookmarks.add(bm);
|
|
8196
|
+
}
|
|
8197
|
+
}
|
|
8198
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
8199
|
+
finally {
|
|
8200
|
+
try {
|
|
8201
|
+
if (suppliedBookmarks_1_1 && !suppliedBookmarks_1_1.done && (_b = suppliedBookmarks_1.return)) _b.call(suppliedBookmarks_1);
|
|
8202
|
+
}
|
|
8203
|
+
finally { if (e_3) throw e_3.error; }
|
|
8204
|
+
}
|
|
8205
|
+
_c.label = 2;
|
|
8206
|
+
case 2: return [2 /*return*/, __spreadArray$j([], __read$p(bookmarks), false)];
|
|
8207
|
+
}
|
|
8208
|
+
});
|
|
8209
|
+
});
|
|
8210
|
+
};
|
|
8211
|
+
return Neo4jBookmarkManager;
|
|
8212
|
+
}());
|
|
8213
|
+
|
|
8214
|
+
var resultTransformers$1 = {};
|
|
8215
|
+
|
|
8216
|
+
/**
|
|
8217
|
+
* Copyright (c) "Neo4j"
|
|
8218
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8219
|
+
*
|
|
8220
|
+
* This file is part of Neo4j.
|
|
8221
|
+
*
|
|
8222
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8223
|
+
* you may not use this file except in compliance with the License.
|
|
8224
|
+
* You may obtain a copy of the License at
|
|
8225
|
+
*
|
|
8226
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8227
|
+
*
|
|
8228
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8229
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8230
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8231
|
+
* See the License for the specific language governing permissions and
|
|
8232
|
+
* limitations under the License.
|
|
8233
|
+
*/
|
|
8234
|
+
var __awaiter$9 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8235
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8236
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8237
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8238
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8239
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8240
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8241
|
+
});
|
|
8242
|
+
};
|
|
8243
|
+
var __generator$b = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
8244
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8245
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
8246
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
8247
|
+
function step(op) {
|
|
8248
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8249
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
8250
|
+
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;
|
|
8251
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
8252
|
+
switch (op[0]) {
|
|
8253
|
+
case 0: case 1: t = op; break;
|
|
8254
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
8255
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
8256
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
8257
|
+
default:
|
|
8258
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
8259
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
8260
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
8261
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
8262
|
+
if (t[2]) _.ops.pop();
|
|
8263
|
+
_.trys.pop(); continue;
|
|
8264
|
+
}
|
|
8265
|
+
op = body.call(thisArg, _);
|
|
8266
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
8267
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8268
|
+
}
|
|
8269
|
+
};
|
|
8270
|
+
var __importDefault$F = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
8271
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8272
|
+
};
|
|
8273
|
+
Object.defineProperty(resultTransformers$1, "__esModule", { value: true });
|
|
8274
|
+
var result_eager_1 = __importDefault$F(resultEager);
|
|
8275
|
+
var error_1$1 = error;
|
|
8276
|
+
function createEagerResultFromResult(result) {
|
|
8277
|
+
return __awaiter$9(this, void 0, void 0, function () {
|
|
8278
|
+
var _a, summary, records, keys;
|
|
8279
|
+
return __generator$b(this, function (_b) {
|
|
8280
|
+
switch (_b.label) {
|
|
8281
|
+
case 0: return [4 /*yield*/, result];
|
|
8282
|
+
case 1:
|
|
8283
|
+
_a = _b.sent(), summary = _a.summary, records = _a.records;
|
|
8284
|
+
return [4 /*yield*/, result.keys()];
|
|
8285
|
+
case 2:
|
|
8286
|
+
keys = _b.sent();
|
|
8287
|
+
return [2 /*return*/, new result_eager_1.default(keys, records, summary)];
|
|
8288
|
+
}
|
|
8289
|
+
});
|
|
8290
|
+
});
|
|
8291
|
+
}
|
|
8292
|
+
/**
|
|
8293
|
+
* Protocol for transforming {@link Result}.
|
|
8294
|
+
*
|
|
8295
|
+
* @typedef {function<T>(result:Result):Promise<T>} ResultTransformer
|
|
8296
|
+
* @interface
|
|
8297
|
+
* @experimental This can be changed or removed anytime.
|
|
8298
|
+
*
|
|
8299
|
+
* @see {@link resultTransformers} for provided implementations.
|
|
8300
|
+
* @see {@link Driver#executeQuery} for usage.
|
|
8301
|
+
* @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
|
|
8302
|
+
*/
|
|
8303
|
+
/**
|
|
8304
|
+
* Defines the object which holds the common {@link ResultTransformer} used with {@link Driver#executeQuery}.
|
|
8305
|
+
*
|
|
8306
|
+
* @experimental This can be changed or removed anytime.
|
|
8307
|
+
* @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
|
|
8308
|
+
*/
|
|
8309
|
+
var ResultTransformers = /** @class */ (function () {
|
|
8310
|
+
function ResultTransformers() {
|
|
8311
|
+
}
|
|
8312
|
+
/**
|
|
8313
|
+
* Creates a {@link ResultTransformer} which transforms {@link Result} to {@link EagerResult}
|
|
8314
|
+
* by consuming the whole stream.
|
|
8315
|
+
*
|
|
8316
|
+
* This is the default implementation used in {@link Driver#executeQuery}
|
|
8317
|
+
*
|
|
8318
|
+
* @example
|
|
8319
|
+
* // This:
|
|
8320
|
+
* const { keys, records, summary } = await driver.executeQuery('CREATE (p:Person{ name: $name }) RETURN p', { name: 'Person1'}, {
|
|
8321
|
+
* resultTransformer: neo4j.resultTransformers.eagerResultTransformer()
|
|
8322
|
+
* })
|
|
8323
|
+
* // is equivalent to:
|
|
8324
|
+
* const { keys, records, summary } = await driver.executeQuery('CREATE (p:Person{ name: $name }) RETURN p', { name: 'Person1'})
|
|
8325
|
+
*
|
|
8326
|
+
*
|
|
8327
|
+
* @experimental This can be changed or removed anytime.
|
|
8328
|
+
* @returns {ResultTransformer<EagerResult<Entries>>} The result transformer
|
|
8329
|
+
* @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
|
|
8330
|
+
*/
|
|
8331
|
+
ResultTransformers.prototype.eagerResultTransformer = function () {
|
|
8332
|
+
return createEagerResultFromResult;
|
|
8333
|
+
};
|
|
8334
|
+
/**
|
|
8335
|
+
* Creates a {@link ResultTransformer} which maps the {@link Record} in the result and collects it
|
|
8336
|
+
* along with the {@link ResultSummary} and {@link Result#keys}.
|
|
8337
|
+
*
|
|
8338
|
+
* NOTE: The config object requires map or/and collect to be valid.
|
|
8339
|
+
*
|
|
8340
|
+
* @example
|
|
8341
|
+
* // Mapping the records
|
|
8342
|
+
* const { keys, records, summary } = await driver.executeQuery('MATCH (p:Person{ age: $age }) RETURN p.name as name', { age: 25 }, {
|
|
8343
|
+
* resultTransformer: neo4j.resultTransformers.mappedResultTransformer({
|
|
8344
|
+
* map(record) {
|
|
8345
|
+
* return record.get('name')
|
|
8346
|
+
* }
|
|
8347
|
+
* })
|
|
8348
|
+
* })
|
|
8349
|
+
*
|
|
8350
|
+
* records.forEach(name => console.log(`${name} has 25`))
|
|
8351
|
+
*
|
|
8352
|
+
* @example
|
|
8353
|
+
* // Mapping records and collect result
|
|
8354
|
+
* const names = await driver.executeQuery('MATCH (p:Person{ age: $age }) RETURN p.name as name', { age: 25 }, {
|
|
8355
|
+
* resultTransformer: neo4j.resultTransformers.mappedResultTransformer({
|
|
8356
|
+
* map(record) {
|
|
8357
|
+
* return record.get('name')
|
|
8358
|
+
* },
|
|
8359
|
+
* collect(records, summary, keys) {
|
|
8360
|
+
* return records
|
|
8361
|
+
* }
|
|
8362
|
+
* })
|
|
8363
|
+
* })
|
|
8364
|
+
*
|
|
8365
|
+
* names.forEach(name => console.log(`${name} has 25`))
|
|
8366
|
+
*
|
|
8367
|
+
* @example
|
|
8368
|
+
* // The transformer can be defined one and used everywhere
|
|
8369
|
+
* const getRecordsAsObjects = neo4j.resultTransformers.mappedResultTransformer({
|
|
8370
|
+
* map(record) {
|
|
8371
|
+
* return record.toObject()
|
|
8372
|
+
* },
|
|
8373
|
+
* collect(objects) {
|
|
8374
|
+
* return objects
|
|
8375
|
+
* }
|
|
8376
|
+
* })
|
|
8377
|
+
*
|
|
8378
|
+
* // The usage in a driver.executeQuery
|
|
8379
|
+
* const objects = await driver.executeQuery('MATCH (p:Person{ age: $age }) RETURN p.name as name', { age: 25 }, {
|
|
8380
|
+
* resultTransformer: getRecordsAsObjects
|
|
8381
|
+
* })
|
|
8382
|
+
* objects.forEach(object => console.log(`${object.name} has 25`))
|
|
8383
|
+
*
|
|
8384
|
+
*
|
|
8385
|
+
* // The usage in session.executeRead
|
|
8386
|
+
* const objects = await session.executeRead(tx => getRecordsAsObjects(tx.run('MATCH (p:Person{ age: $age }) RETURN p.name as name')))
|
|
8387
|
+
* objects.forEach(object => console.log(`${object.name} has 25`))
|
|
8388
|
+
*
|
|
8389
|
+
* @experimental This can be changed or removed anytime.
|
|
8390
|
+
* @param {object} config The result transformer configuration
|
|
8391
|
+
* @param {function(record:Record):R} [config.map=function(record) { return record }] Method called for mapping each record
|
|
8392
|
+
* @param {function(records:R[], summary:ResultSummary, keys:string[]):T} [config.collect=function(records, summary, keys) { return { records, summary, keys }}] Method called for mapping
|
|
8393
|
+
* the result data to the transformer output.
|
|
8394
|
+
* @returns {ResultTransformer<T>} The result transformer
|
|
8395
|
+
* @see {@link Driver#executeQuery}
|
|
8396
|
+
* @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
|
|
8397
|
+
*/
|
|
8398
|
+
ResultTransformers.prototype.mappedResultTransformer = function (config) {
|
|
8399
|
+
var _this = this;
|
|
8400
|
+
if (config == null || (config.collect == null && config.map == null)) {
|
|
8401
|
+
throw (0, error_1$1.newError)('Requires a map or/and a collect functions.');
|
|
8402
|
+
}
|
|
8403
|
+
return function (result) { return __awaiter$9(_this, void 0, void 0, function () {
|
|
8404
|
+
return __generator$b(this, function (_a) {
|
|
8405
|
+
switch (_a.label) {
|
|
8406
|
+
case 0: return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
8407
|
+
var state = { records: [], keys: [] };
|
|
8408
|
+
result.subscribe({
|
|
8409
|
+
onKeys: function (keys) {
|
|
8410
|
+
state.keys = keys;
|
|
8411
|
+
},
|
|
8412
|
+
onNext: function (record) {
|
|
8413
|
+
if (config.map != null) {
|
|
8414
|
+
state.records.push(config.map(record));
|
|
8415
|
+
}
|
|
8416
|
+
else {
|
|
8417
|
+
state.records.push(record);
|
|
8418
|
+
}
|
|
8419
|
+
},
|
|
8420
|
+
onCompleted: function (summary) {
|
|
8421
|
+
if (config.collect != null) {
|
|
8422
|
+
resolve(config.collect(state.records, summary, state.keys));
|
|
8423
|
+
}
|
|
8424
|
+
else {
|
|
8425
|
+
var obj = { records: state.records, summary: summary, keys: state.keys };
|
|
8426
|
+
resolve(obj);
|
|
8427
|
+
}
|
|
8428
|
+
},
|
|
8429
|
+
onError: function (error) {
|
|
8430
|
+
reject(error);
|
|
8431
|
+
}
|
|
8432
|
+
});
|
|
8433
|
+
})];
|
|
8434
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
8435
|
+
}
|
|
8436
|
+
});
|
|
8437
|
+
}); };
|
|
8438
|
+
};
|
|
8439
|
+
return ResultTransformers;
|
|
8440
|
+
}());
|
|
8441
|
+
/**
|
|
8442
|
+
* Holds the common {@link ResultTransformer} used with {@link Driver#executeQuery}.
|
|
8443
|
+
*
|
|
8444
|
+
* @experimental This can be changed or removed anytime.
|
|
8445
|
+
* @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
|
|
8446
|
+
*/
|
|
8447
|
+
var resultTransformers = new ResultTransformers();
|
|
8448
|
+
Object.freeze(resultTransformers);
|
|
8449
|
+
resultTransformers$1.default = resultTransformers;
|
|
8450
|
+
|
|
8451
|
+
var queryExecutor = {};
|
|
8452
|
+
|
|
8453
|
+
/**
|
|
8454
|
+
* Copyright (c) "Neo4j"
|
|
8455
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8456
|
+
*
|
|
8457
|
+
* This file is part of Neo4j.
|
|
8458
|
+
*
|
|
8459
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8460
|
+
* you may not use this file except in compliance with the License.
|
|
8461
|
+
* You may obtain a copy of the License at
|
|
8462
|
+
*
|
|
8463
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8464
|
+
*
|
|
8465
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8466
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8467
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8468
|
+
* See the License for the specific language governing permissions and
|
|
8469
|
+
* limitations under the License.
|
|
8470
|
+
*/
|
|
8471
|
+
var __awaiter$8 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8472
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8473
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8474
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8475
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8476
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8477
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8478
|
+
});
|
|
8479
|
+
};
|
|
8480
|
+
var __generator$a = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
8481
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8482
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
8483
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
8484
|
+
function step(op) {
|
|
8485
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8486
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
8487
|
+
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;
|
|
8488
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
8489
|
+
switch (op[0]) {
|
|
8490
|
+
case 0: case 1: t = op; break;
|
|
8491
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
8492
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
8493
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
8494
|
+
default:
|
|
8495
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
8496
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
8497
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
8498
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
8499
|
+
if (t[2]) _.ops.pop();
|
|
8500
|
+
_.trys.pop(); continue;
|
|
8501
|
+
}
|
|
8502
|
+
op = body.call(thisArg, _);
|
|
8503
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
8504
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8505
|
+
}
|
|
8506
|
+
};
|
|
8507
|
+
Object.defineProperty(queryExecutor, "__esModule", { value: true });
|
|
8508
|
+
var QueryExecutor = /** @class */ (function () {
|
|
8509
|
+
function QueryExecutor(_createSession) {
|
|
8510
|
+
this._createSession = _createSession;
|
|
8511
|
+
}
|
|
8512
|
+
QueryExecutor.prototype.execute = function (config, query, parameters) {
|
|
8513
|
+
return __awaiter$8(this, void 0, void 0, function () {
|
|
8514
|
+
var session, executeInTransaction;
|
|
8515
|
+
var _this = this;
|
|
8516
|
+
return __generator$a(this, function (_a) {
|
|
8517
|
+
switch (_a.label) {
|
|
8518
|
+
case 0:
|
|
8519
|
+
session = this._createSession({
|
|
8520
|
+
database: config.database,
|
|
8521
|
+
bookmarkManager: config.bookmarkManager,
|
|
8522
|
+
impersonatedUser: config.impersonatedUser
|
|
8523
|
+
});
|
|
8524
|
+
_a.label = 1;
|
|
8525
|
+
case 1:
|
|
8526
|
+
_a.trys.push([1, , 3, 5]);
|
|
8527
|
+
executeInTransaction = config.routing === 'READERS'
|
|
8528
|
+
? session.executeRead.bind(session)
|
|
8529
|
+
: session.executeWrite.bind(session);
|
|
8530
|
+
return [4 /*yield*/, executeInTransaction(function (tx) { return __awaiter$8(_this, void 0, void 0, function () {
|
|
8531
|
+
var result;
|
|
8532
|
+
return __generator$a(this, function (_a) {
|
|
8533
|
+
switch (_a.label) {
|
|
8534
|
+
case 0:
|
|
8535
|
+
result = tx.run(query, parameters);
|
|
8536
|
+
return [4 /*yield*/, config.resultTransformer(result)];
|
|
8537
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
8538
|
+
}
|
|
8539
|
+
});
|
|
8540
|
+
}); })];
|
|
8541
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
8542
|
+
case 3: return [4 /*yield*/, session.close()];
|
|
8543
|
+
case 4:
|
|
8544
|
+
_a.sent();
|
|
8545
|
+
return [7 /*endfinally*/];
|
|
8546
|
+
case 5: return [2 /*return*/];
|
|
8547
|
+
}
|
|
8548
|
+
});
|
|
8549
|
+
});
|
|
8550
|
+
};
|
|
8551
|
+
return QueryExecutor;
|
|
8552
|
+
}());
|
|
8553
|
+
queryExecutor.default = QueryExecutor;
|
|
8554
|
+
|
|
8555
|
+
var __awaiter$7 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8556
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8557
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8558
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8559
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8560
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8561
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8562
|
+
});
|
|
8563
|
+
};
|
|
8564
|
+
var __generator$9 = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
8565
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8566
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
8567
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
8568
|
+
function step(op) {
|
|
8569
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8570
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
8571
|
+
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;
|
|
8572
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
8573
|
+
switch (op[0]) {
|
|
8574
|
+
case 0: case 1: t = op; break;
|
|
8575
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
8576
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
8577
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
8578
|
+
default:
|
|
8579
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
8580
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
8581
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
8582
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
8583
|
+
if (t[2]) _.ops.pop();
|
|
8584
|
+
_.trys.pop(); continue;
|
|
8585
|
+
}
|
|
8586
|
+
op = body.call(thisArg, _);
|
|
8587
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
8588
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8589
|
+
}
|
|
8590
|
+
};
|
|
8591
|
+
var __importDefault$E = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
8592
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8593
|
+
};
|
|
8594
|
+
Object.defineProperty(driver, "__esModule", { value: true });
|
|
8595
|
+
driver.QueryConfig = driver.SessionConfig = driver.routing = driver.WRITE = driver.READ = driver.Driver = void 0;
|
|
8596
|
+
var bookmarks_1 = bookmarks$1;
|
|
8597
|
+
var configured_custom_resolver_1 = __importDefault$E(configuredCustomResolver);
|
|
8598
|
+
var constants_1 = constants$1;
|
|
8599
|
+
var logger_1 = logger$1;
|
|
8600
|
+
var session_1 = __importDefault$E(session);
|
|
8601
|
+
var util_1 = util$4;
|
|
8602
|
+
var bookmark_manager_1 = bookmarkManager$1;
|
|
8603
|
+
var result_transformers_1 = __importDefault$E(resultTransformers$1);
|
|
8604
|
+
var query_executor_1 = __importDefault$E(queryExecutor);
|
|
8605
|
+
var error_1 = error;
|
|
8606
|
+
var DEFAULT_MAX_CONNECTION_LIFETIME = 60 * 60 * 1000; // 1 hour
|
|
8607
|
+
/**
|
|
8608
|
+
* The default record fetch size. This is used in Bolt V4 protocol to pull query execution result in batches.
|
|
8609
|
+
* @type {number}
|
|
8610
|
+
*/
|
|
8611
|
+
var DEFAULT_FETCH_SIZE = 1000;
|
|
8612
|
+
/**
|
|
8613
|
+
* Constant that represents read session access mode.
|
|
8614
|
+
* Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.READ })`.
|
|
8615
|
+
* @type {string}
|
|
8616
|
+
*/
|
|
8617
|
+
var READ$3 = constants_1.ACCESS_MODE_READ;
|
|
8618
|
+
driver.READ = READ$3;
|
|
8619
|
+
/**
|
|
8620
|
+
* Constant that represents write session access mode.
|
|
8621
|
+
* Should be used like this: `driver.session({ defaultAccessMode: neo4j.session.WRITE })`.
|
|
8622
|
+
* @type {string}
|
|
8623
|
+
*/
|
|
8624
|
+
var WRITE$3 = constants_1.ACCESS_MODE_WRITE;
|
|
8625
|
+
driver.WRITE = WRITE$3;
|
|
8626
|
+
var idGenerator$1 = 0;
|
|
8627
|
+
/**
|
|
8628
|
+
* The session configuration
|
|
8629
|
+
*
|
|
8630
|
+
* @interface
|
|
8631
|
+
*/
|
|
8632
|
+
var SessionConfig = /** @class */ (function () {
|
|
8633
|
+
/**
|
|
8634
|
+
* @constructor
|
|
8635
|
+
* @private
|
|
8636
|
+
*/
|
|
8637
|
+
function SessionConfig() {
|
|
8638
|
+
/**
|
|
8639
|
+
* The access mode of this session, allowed values are {@link READ} and {@link WRITE}.
|
|
8640
|
+
* **Default**: {@link WRITE}
|
|
8641
|
+
* @type {string}
|
|
8642
|
+
*/
|
|
8643
|
+
this.defaultAccessMode = WRITE$3;
|
|
8644
|
+
/**
|
|
8645
|
+
* The initial reference or references to some previous
|
|
8646
|
+
* transactions. Value is optional and absence indicates that that the bookmarks do not exist or are unknown.
|
|
8647
|
+
* @type {string|string[]|undefined}
|
|
8648
|
+
*/
|
|
8649
|
+
this.bookmarks = [];
|
|
8650
|
+
/**
|
|
8651
|
+
* The database this session will operate on.
|
|
8652
|
+
*
|
|
8653
|
+
* This option has no explicit value by default, but it is recommended to set
|
|
8654
|
+
* one if the target database is known in advance. This has the benefit of
|
|
8655
|
+
* ensuring a consistent target database name throughout the session in a
|
|
8656
|
+
* straightforward way and potentially simplifies driver logic as well as
|
|
8657
|
+
* reduces network communication resulting in better performance.
|
|
8658
|
+
*
|
|
8659
|
+
* Usage of Cypher clauses like USE is not a replacement for this option.
|
|
8660
|
+
* The driver does not parse any Cypher.
|
|
8661
|
+
*
|
|
7979
8662
|
* When no explicit name is set, the driver behavior depends on the connection
|
|
7980
8663
|
* URI scheme supplied to the driver on instantiation and Bolt protocol
|
|
7981
8664
|
* version.
|
|
@@ -8065,6 +8748,77 @@
|
|
|
8065
8748
|
return SessionConfig;
|
|
8066
8749
|
}());
|
|
8067
8750
|
driver.SessionConfig = SessionConfig;
|
|
8751
|
+
var WRITERS = 'WRITERS';
|
|
8752
|
+
var READERS = 'READERS';
|
|
8753
|
+
/**
|
|
8754
|
+
* @typedef {'WRITERS'|'READERS'} RoutingControl
|
|
8755
|
+
*/
|
|
8756
|
+
/**
|
|
8757
|
+
* Constants that represents routing modes.
|
|
8758
|
+
*
|
|
8759
|
+
* @example
|
|
8760
|
+
* driver.executeQuery("<QUERY>", <PARAMETERS>, { routing: neo4j.routing.WRITERS })
|
|
8761
|
+
*/
|
|
8762
|
+
var routing = {
|
|
8763
|
+
WRITERS: WRITERS,
|
|
8764
|
+
READERS: READERS
|
|
8765
|
+
};
|
|
8766
|
+
driver.routing = routing;
|
|
8767
|
+
Object.freeze(routing);
|
|
8768
|
+
/**
|
|
8769
|
+
* The query configuration
|
|
8770
|
+
* @interface
|
|
8771
|
+
* @experimental This can be changed or removed anytime.
|
|
8772
|
+
* @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
|
|
8773
|
+
*/
|
|
8774
|
+
var QueryConfig = /** @class */ (function () {
|
|
8775
|
+
/**
|
|
8776
|
+
* @constructor
|
|
8777
|
+
* @private
|
|
8778
|
+
*/
|
|
8779
|
+
function QueryConfig() {
|
|
8780
|
+
/**
|
|
8781
|
+
* Define the type of cluster member the query will be routed to.
|
|
8782
|
+
*
|
|
8783
|
+
* @type {RoutingControl}
|
|
8784
|
+
*/
|
|
8785
|
+
this.routing = routing.WRITERS;
|
|
8786
|
+
/**
|
|
8787
|
+
* Define the transformation will be applied to the Result before return from the
|
|
8788
|
+
* query method.
|
|
8789
|
+
*
|
|
8790
|
+
* @type {ResultTransformer}
|
|
8791
|
+
* @see {@link resultTransformers} for provided implementations.
|
|
8792
|
+
*/
|
|
8793
|
+
this.resultTransformer = undefined;
|
|
8794
|
+
/**
|
|
8795
|
+
* The database this session will operate on.
|
|
8796
|
+
*
|
|
8797
|
+
* @type {string|undefined}
|
|
8798
|
+
*/
|
|
8799
|
+
this.database = '';
|
|
8800
|
+
/**
|
|
8801
|
+
* The username which the user wants to impersonate for the duration of the query.
|
|
8802
|
+
*
|
|
8803
|
+
* @type {string|undefined}
|
|
8804
|
+
*/
|
|
8805
|
+
this.impersonatedUser = undefined;
|
|
8806
|
+
/**
|
|
8807
|
+
* Configure a BookmarkManager for the session to use
|
|
8808
|
+
*
|
|
8809
|
+
* A BookmarkManager is a piece of software responsible for keeping casual consistency between different pieces of work by sharing bookmarks
|
|
8810
|
+
* between the them.
|
|
8811
|
+
*
|
|
8812
|
+
* By default, it uses the driver's non mutable driver level bookmark manager. See, {@link Driver.queryBookmarkManager}
|
|
8813
|
+
*
|
|
8814
|
+
* Can be set to null to disable causal chaining.
|
|
8815
|
+
* @type {BookmarkManager|null}
|
|
8816
|
+
*/
|
|
8817
|
+
this.bookmarkManager = undefined;
|
|
8818
|
+
}
|
|
8819
|
+
return QueryConfig;
|
|
8820
|
+
}());
|
|
8821
|
+
driver.QueryConfig = QueryConfig;
|
|
8068
8822
|
/**
|
|
8069
8823
|
* A driver maintains one or more {@link Session}s with a remote
|
|
8070
8824
|
* Neo4j instance. Through the {@link Session}s you can send queries
|
|
@@ -8082,12 +8836,13 @@
|
|
|
8082
8836
|
* @protected
|
|
8083
8837
|
* @param {Object} meta Metainformation about the driver
|
|
8084
8838
|
* @param {Object} config
|
|
8085
|
-
* @param {function(id: number, config:Object, log:Logger, hostNameResolver: ConfiguredCustomResolver): ConnectionProvider }
|
|
8839
|
+
* @param {function(id: number, config:Object, log:Logger, hostNameResolver: ConfiguredCustomResolver): ConnectionProvider } createConnectionProvider Creates the connection provider
|
|
8086
8840
|
* @param {function(args): Session } createSession Creates the a session
|
|
8087
8841
|
*/
|
|
8088
|
-
function Driver(meta, config,
|
|
8842
|
+
function Driver(meta, config, createConnectionProvider, createSession, createQueryExecutor) {
|
|
8089
8843
|
if (config === void 0) { config = {}; }
|
|
8090
8844
|
if (createSession === void 0) { createSession = function (args) { return new session_1.default(args); }; }
|
|
8845
|
+
if (createQueryExecutor === void 0) { createQueryExecutor = function (createQuery) { return new query_executor_1.default(createQuery); }; }
|
|
8091
8846
|
sanitizeConfig(config);
|
|
8092
8847
|
var log = logger_1.Logger.create(config);
|
|
8093
8848
|
validateConfig(config, log);
|
|
@@ -8095,8 +8850,10 @@
|
|
|
8095
8850
|
this._meta = meta;
|
|
8096
8851
|
this._config = config;
|
|
8097
8852
|
this._log = log;
|
|
8098
|
-
this._createConnectionProvider =
|
|
8853
|
+
this._createConnectionProvider = createConnectionProvider;
|
|
8099
8854
|
this._createSession = createSession;
|
|
8855
|
+
this._queryBookmarkManager = (0, bookmark_manager_1.bookmarkManager)();
|
|
8856
|
+
this._queryExecutor = createQueryExecutor(this.session.bind(this));
|
|
8100
8857
|
/**
|
|
8101
8858
|
* Reference to the connection provider. Initialized lazily by {@link _getOrCreateConnectionProvider}.
|
|
8102
8859
|
* @type {ConnectionProvider}
|
|
@@ -8105,6 +8862,124 @@
|
|
|
8105
8862
|
this._connectionProvider = null;
|
|
8106
8863
|
this._afterConstruction();
|
|
8107
8864
|
}
|
|
8865
|
+
Object.defineProperty(Driver.prototype, "queryBookmarkManager", {
|
|
8866
|
+
/**
|
|
8867
|
+
* The bookmark managed used by {@link Driver.executeQuery}
|
|
8868
|
+
*
|
|
8869
|
+
* @experimental This can be changed or removed anytime.
|
|
8870
|
+
* @type {BookmarkManager}
|
|
8871
|
+
* @returns {BookmarkManager}
|
|
8872
|
+
*/
|
|
8873
|
+
get: function () {
|
|
8874
|
+
return this._queryBookmarkManager;
|
|
8875
|
+
},
|
|
8876
|
+
enumerable: false,
|
|
8877
|
+
configurable: true
|
|
8878
|
+
});
|
|
8879
|
+
/**
|
|
8880
|
+
* Executes a query in a retriable context and returns a {@link EagerResult}.
|
|
8881
|
+
*
|
|
8882
|
+
* This method is a shortcut for a {@link Session#executeRead} and {@link Session#executeWrite}.
|
|
8883
|
+
*
|
|
8884
|
+
* NOTE: Because it is an explicit transaction from the server point of view, Cypher queries using
|
|
8885
|
+
* "CALL {} IN TRANSACTIONS" or the older "USING PERIODIC COMMIT" construct will not work (call
|
|
8886
|
+
* {@link Session#run} for these).
|
|
8887
|
+
*
|
|
8888
|
+
* @example
|
|
8889
|
+
* // Run a simple write query
|
|
8890
|
+
* const { keys, records, summary } = await driver.executeQuery('CREATE (p:Person{ name: $name }) RETURN p', { name: 'Person1'})
|
|
8891
|
+
*
|
|
8892
|
+
* @example
|
|
8893
|
+
* // Run a read query
|
|
8894
|
+
* const { keys, records, summary } = await driver.executeQuery(
|
|
8895
|
+
* 'MATCH (p:Person{ name: $name }) RETURN p',
|
|
8896
|
+
* { name: 'Person1'},
|
|
8897
|
+
* { routing: neo4j.routing.READERS})
|
|
8898
|
+
*
|
|
8899
|
+
* @example
|
|
8900
|
+
* // Run a read query returning a Person Nodes per elementId
|
|
8901
|
+
* const peopleMappedById = await driver.executeQuery(
|
|
8902
|
+
* 'MATCH (p:Person{ name: $name }) RETURN p',
|
|
8903
|
+
* { name: 'Person1'},
|
|
8904
|
+
* {
|
|
8905
|
+
* resultTransformer: neo4j.resultTransformers.mappedResultTransformer({
|
|
8906
|
+
* map(record) {
|
|
8907
|
+
* const p = record.get('p')
|
|
8908
|
+
* return [p.elementId, p]
|
|
8909
|
+
* },
|
|
8910
|
+
* collect(elementIdPersonPairArray) {
|
|
8911
|
+
* return new Map(elementIdPersonPairArray)
|
|
8912
|
+
* }
|
|
8913
|
+
* })
|
|
8914
|
+
* }
|
|
8915
|
+
* )
|
|
8916
|
+
*
|
|
8917
|
+
* const person = peopleMappedById.get("<ELEMENT_ID>")
|
|
8918
|
+
*
|
|
8919
|
+
* @example
|
|
8920
|
+
* // these lines
|
|
8921
|
+
* const transformedResult = await driver.executeQuery(
|
|
8922
|
+
* "<QUERY>",
|
|
8923
|
+
* <PARAMETERS>,
|
|
8924
|
+
* {
|
|
8925
|
+
* routing: neo4j.routing.WRITERS,
|
|
8926
|
+
* resultTransformer: transformer,
|
|
8927
|
+
* database: "<DATABASE>",
|
|
8928
|
+
* impersonatedUser: "<USER>",
|
|
8929
|
+
* bookmarkManager: bookmarkManager
|
|
8930
|
+
* })
|
|
8931
|
+
* // are equivalent to those
|
|
8932
|
+
* const session = driver.session({
|
|
8933
|
+
* database: "<DATABASE>",
|
|
8934
|
+
* impersonatedUser: "<USER>",
|
|
8935
|
+
* bookmarkManager: bookmarkManager
|
|
8936
|
+
* })
|
|
8937
|
+
*
|
|
8938
|
+
* try {
|
|
8939
|
+
* const transformedResult = await session.executeWrite(tx => {
|
|
8940
|
+
* const result = tx.run("<QUERY>", <PARAMETERS>)
|
|
8941
|
+
* return transformer(result)
|
|
8942
|
+
* })
|
|
8943
|
+
* } finally {
|
|
8944
|
+
* await session.close()
|
|
8945
|
+
* }
|
|
8946
|
+
*
|
|
8947
|
+
* @public
|
|
8948
|
+
* @experimental This can be changed or removed anytime.
|
|
8949
|
+
* @param {string | {text: string, parameters?: object}} query - Cypher query to execute
|
|
8950
|
+
* @param {Object} parameters - Map with parameters to use in the query
|
|
8951
|
+
* @param {QueryConfig<T>} config - The query configuration
|
|
8952
|
+
* @returns {Promise<T>}
|
|
8953
|
+
*
|
|
8954
|
+
* @see {@link resultTransformers} for provided result transformers.
|
|
8955
|
+
* @see https://github.com/neo4j/neo4j-javascript-driver/discussions/1052
|
|
8956
|
+
*/
|
|
8957
|
+
Driver.prototype.executeQuery = function (query, parameters, config) {
|
|
8958
|
+
var _a, _b, _c;
|
|
8959
|
+
if (config === void 0) { config = {}; }
|
|
8960
|
+
return __awaiter$7(this, void 0, void 0, function () {
|
|
8961
|
+
var bookmarkManager, resultTransformer, routingConfig;
|
|
8962
|
+
return __generator$9(this, function (_d) {
|
|
8963
|
+
switch (_d.label) {
|
|
8964
|
+
case 0:
|
|
8965
|
+
bookmarkManager = config.bookmarkManager === null ? undefined : ((_a = config.bookmarkManager) !== null && _a !== void 0 ? _a : this.queryBookmarkManager);
|
|
8966
|
+
resultTransformer = ((_b = config.resultTransformer) !== null && _b !== void 0 ? _b : result_transformers_1.default.eagerResultTransformer());
|
|
8967
|
+
routingConfig = (_c = config.routing) !== null && _c !== void 0 ? _c : routing.WRITERS;
|
|
8968
|
+
if (routingConfig !== routing.READERS && routingConfig !== routing.WRITERS) {
|
|
8969
|
+
throw (0, error_1.newError)("Illegal query routing config: \"".concat(routingConfig, "\""));
|
|
8970
|
+
}
|
|
8971
|
+
return [4 /*yield*/, this._queryExecutor.execute({
|
|
8972
|
+
resultTransformer: resultTransformer,
|
|
8973
|
+
bookmarkManager: bookmarkManager,
|
|
8974
|
+
routing: routingConfig,
|
|
8975
|
+
database: config.database,
|
|
8976
|
+
impersonatedUser: config.impersonatedUser
|
|
8977
|
+
}, query, parameters)];
|
|
8978
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
8979
|
+
}
|
|
8980
|
+
});
|
|
8981
|
+
});
|
|
8982
|
+
};
|
|
8108
8983
|
/**
|
|
8109
8984
|
* Verifies connectivity of this driver by trying to open a connection with the provided driver options.
|
|
8110
8985
|
*
|
|
@@ -8257,6 +9132,7 @@
|
|
|
8257
9132
|
};
|
|
8258
9133
|
/**
|
|
8259
9134
|
* @protected
|
|
9135
|
+
* @returns {void}
|
|
8260
9136
|
*/
|
|
8261
9137
|
Driver.prototype._afterConstruction = function () {
|
|
8262
9138
|
this._log.info("".concat(this._meta.typename, " driver ").concat(this._id, " created for server address ").concat(this._meta.address.toString()));
|
|
@@ -8467,254 +9343,6 @@
|
|
|
8467
9343
|
}
|
|
8468
9344
|
auth$1.default = auth;
|
|
8469
9345
|
|
|
8470
|
-
var bookmarkManager$1 = {};
|
|
8471
|
-
|
|
8472
|
-
/**
|
|
8473
|
-
* Copyright (c) "Neo4j"
|
|
8474
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
8475
|
-
*
|
|
8476
|
-
* This file is part of Neo4j.
|
|
8477
|
-
*
|
|
8478
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8479
|
-
* you may not use this file except in compliance with the License.
|
|
8480
|
-
* You may obtain a copy of the License at
|
|
8481
|
-
*
|
|
8482
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8483
|
-
*
|
|
8484
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8485
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8486
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8487
|
-
* See the License for the specific language governing permissions and
|
|
8488
|
-
* limitations under the License.
|
|
8489
|
-
*/
|
|
8490
|
-
var __awaiter$7 = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8491
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8492
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8493
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8494
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8495
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8496
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8497
|
-
});
|
|
8498
|
-
};
|
|
8499
|
-
var __generator$9 = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
|
|
8500
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
8501
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
8502
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
8503
|
-
function step(op) {
|
|
8504
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8505
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
8506
|
-
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;
|
|
8507
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
8508
|
-
switch (op[0]) {
|
|
8509
|
-
case 0: case 1: t = op; break;
|
|
8510
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
8511
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
8512
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
8513
|
-
default:
|
|
8514
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
8515
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
8516
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
8517
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
8518
|
-
if (t[2]) _.ops.pop();
|
|
8519
|
-
_.trys.pop(); continue;
|
|
8520
|
-
}
|
|
8521
|
-
op = body.call(thisArg, _);
|
|
8522
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
8523
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
8524
|
-
}
|
|
8525
|
-
};
|
|
8526
|
-
var __values$a = (commonjsGlobal && commonjsGlobal.__values) || function(o) {
|
|
8527
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
8528
|
-
if (m) return m.call(o);
|
|
8529
|
-
if (o && typeof o.length === "number") return {
|
|
8530
|
-
next: function () {
|
|
8531
|
-
if (o && i >= o.length) o = void 0;
|
|
8532
|
-
return { value: o && o[i++], done: !o };
|
|
8533
|
-
}
|
|
8534
|
-
};
|
|
8535
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
8536
|
-
};
|
|
8537
|
-
var __read$p = (commonjsGlobal && commonjsGlobal.__read) || function (o, n) {
|
|
8538
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8539
|
-
if (!m) return o;
|
|
8540
|
-
var i = m.call(o), r, ar = [], e;
|
|
8541
|
-
try {
|
|
8542
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8543
|
-
}
|
|
8544
|
-
catch (error) { e = { error: error }; }
|
|
8545
|
-
finally {
|
|
8546
|
-
try {
|
|
8547
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
8548
|
-
}
|
|
8549
|
-
finally { if (e) throw e.error; }
|
|
8550
|
-
}
|
|
8551
|
-
return ar;
|
|
8552
|
-
};
|
|
8553
|
-
var __spreadArray$j = (commonjsGlobal && commonjsGlobal.__spreadArray) || function (to, from, pack) {
|
|
8554
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8555
|
-
if (ar || !(i in from)) {
|
|
8556
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8557
|
-
ar[i] = from[i];
|
|
8558
|
-
}
|
|
8559
|
-
}
|
|
8560
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8561
|
-
};
|
|
8562
|
-
Object.defineProperty(bookmarkManager$1, "__esModule", { value: true });
|
|
8563
|
-
bookmarkManager$1.bookmarkManager = void 0;
|
|
8564
|
-
/**
|
|
8565
|
-
* Interface for the piece of software responsible for keeping track of current active bookmarks accross the driver.
|
|
8566
|
-
* @interface
|
|
8567
|
-
* @since 5.0
|
|
8568
|
-
* @experimental
|
|
8569
|
-
*/
|
|
8570
|
-
var BookmarkManager = /** @class */ (function () {
|
|
8571
|
-
/**
|
|
8572
|
-
* @constructor
|
|
8573
|
-
* @private
|
|
8574
|
-
*/
|
|
8575
|
-
function BookmarkManager() {
|
|
8576
|
-
throw new Error('Not implemented');
|
|
8577
|
-
}
|
|
8578
|
-
/**
|
|
8579
|
-
* Method called when the bookmarks get updated when a transaction finished.
|
|
8580
|
-
*
|
|
8581
|
-
* This method will be called when auto-commit queries finish and when explicit transactions
|
|
8582
|
-
* get committed.
|
|
8583
|
-
*
|
|
8584
|
-
* @param {Iterable<string>} previousBookmarks The bookmarks used when starting the transaction
|
|
8585
|
-
* @param {Iterable<string>} newBookmarks The new bookmarks received at the end of the transaction.
|
|
8586
|
-
* @returns {void}
|
|
8587
|
-
*/
|
|
8588
|
-
BookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
|
|
8589
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8590
|
-
return __generator$9(this, function (_a) {
|
|
8591
|
-
throw new Error('Not implemented');
|
|
8592
|
-
});
|
|
8593
|
-
});
|
|
8594
|
-
};
|
|
8595
|
-
/**
|
|
8596
|
-
* Method called by the driver to get the bookmarks.
|
|
8597
|
-
*
|
|
8598
|
-
* @returns {Iterable<string>} The set of bookmarks
|
|
8599
|
-
*/
|
|
8600
|
-
BookmarkManager.prototype.getBookmarks = function () {
|
|
8601
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8602
|
-
return __generator$9(this, function (_a) {
|
|
8603
|
-
throw new Error('Not implemented');
|
|
8604
|
-
});
|
|
8605
|
-
});
|
|
8606
|
-
};
|
|
8607
|
-
return BookmarkManager;
|
|
8608
|
-
}());
|
|
8609
|
-
bookmarkManager$1.default = BookmarkManager;
|
|
8610
|
-
/**
|
|
8611
|
-
* @typedef {Object} BookmarkManagerConfig
|
|
8612
|
-
*
|
|
8613
|
-
* @since 5.0
|
|
8614
|
-
* @experimental
|
|
8615
|
-
* @property {Iterable<string>} [initialBookmarks] Defines the initial set of bookmarks. The key is the database name and the values are the bookmarks.
|
|
8616
|
-
* @property {function():Promise<Iterable<string>>} [bookmarksSupplier] Called for supplying extra bookmarks to the BookmarkManager
|
|
8617
|
-
* @property {function(bookmarks: Iterable<string>): Promise<void>} [bookmarksConsumer] Called when the set of bookmarks get updated
|
|
8618
|
-
*/
|
|
8619
|
-
/**
|
|
8620
|
-
* Provides an configured {@link BookmarkManager} instance.
|
|
8621
|
-
*
|
|
8622
|
-
* @since 5.0
|
|
8623
|
-
* @experimental
|
|
8624
|
-
* @param {BookmarkManagerConfig} [config={}]
|
|
8625
|
-
* @returns {BookmarkManager}
|
|
8626
|
-
*/
|
|
8627
|
-
function bookmarkManager(config) {
|
|
8628
|
-
if (config === void 0) { config = {}; }
|
|
8629
|
-
var initialBookmarks = new Set(config.initialBookmarks);
|
|
8630
|
-
return new Neo4jBookmarkManager(initialBookmarks, config.bookmarksSupplier, config.bookmarksConsumer);
|
|
8631
|
-
}
|
|
8632
|
-
bookmarkManager$1.bookmarkManager = bookmarkManager;
|
|
8633
|
-
var Neo4jBookmarkManager = /** @class */ (function () {
|
|
8634
|
-
function Neo4jBookmarkManager(_bookmarks, _bookmarksSupplier, _bookmarksConsumer) {
|
|
8635
|
-
this._bookmarks = _bookmarks;
|
|
8636
|
-
this._bookmarksSupplier = _bookmarksSupplier;
|
|
8637
|
-
this._bookmarksConsumer = _bookmarksConsumer;
|
|
8638
|
-
}
|
|
8639
|
-
Neo4jBookmarkManager.prototype.updateBookmarks = function (previousBookmarks, newBookmarks) {
|
|
8640
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8641
|
-
var bookmarks, previousBookmarks_1, previousBookmarks_1_1, bm, newBookmarks_1, newBookmarks_1_1, bm;
|
|
8642
|
-
var e_1, _a, e_2, _b;
|
|
8643
|
-
return __generator$9(this, function (_c) {
|
|
8644
|
-
switch (_c.label) {
|
|
8645
|
-
case 0:
|
|
8646
|
-
bookmarks = this._bookmarks;
|
|
8647
|
-
try {
|
|
8648
|
-
for (previousBookmarks_1 = __values$a(previousBookmarks), previousBookmarks_1_1 = previousBookmarks_1.next(); !previousBookmarks_1_1.done; previousBookmarks_1_1 = previousBookmarks_1.next()) {
|
|
8649
|
-
bm = previousBookmarks_1_1.value;
|
|
8650
|
-
bookmarks.delete(bm);
|
|
8651
|
-
}
|
|
8652
|
-
}
|
|
8653
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8654
|
-
finally {
|
|
8655
|
-
try {
|
|
8656
|
-
if (previousBookmarks_1_1 && !previousBookmarks_1_1.done && (_a = previousBookmarks_1.return)) _a.call(previousBookmarks_1);
|
|
8657
|
-
}
|
|
8658
|
-
finally { if (e_1) throw e_1.error; }
|
|
8659
|
-
}
|
|
8660
|
-
try {
|
|
8661
|
-
for (newBookmarks_1 = __values$a(newBookmarks), newBookmarks_1_1 = newBookmarks_1.next(); !newBookmarks_1_1.done; newBookmarks_1_1 = newBookmarks_1.next()) {
|
|
8662
|
-
bm = newBookmarks_1_1.value;
|
|
8663
|
-
bookmarks.add(bm);
|
|
8664
|
-
}
|
|
8665
|
-
}
|
|
8666
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
8667
|
-
finally {
|
|
8668
|
-
try {
|
|
8669
|
-
if (newBookmarks_1_1 && !newBookmarks_1_1.done && (_b = newBookmarks_1.return)) _b.call(newBookmarks_1);
|
|
8670
|
-
}
|
|
8671
|
-
finally { if (e_2) throw e_2.error; }
|
|
8672
|
-
}
|
|
8673
|
-
if (!(typeof this._bookmarksConsumer === 'function')) return [3 /*break*/, 2];
|
|
8674
|
-
return [4 /*yield*/, this._bookmarksConsumer(__spreadArray$j([], __read$p(bookmarks), false))];
|
|
8675
|
-
case 1:
|
|
8676
|
-
_c.sent();
|
|
8677
|
-
_c.label = 2;
|
|
8678
|
-
case 2: return [2 /*return*/];
|
|
8679
|
-
}
|
|
8680
|
-
});
|
|
8681
|
-
});
|
|
8682
|
-
};
|
|
8683
|
-
Neo4jBookmarkManager.prototype.getBookmarks = function () {
|
|
8684
|
-
var _a;
|
|
8685
|
-
return __awaiter$7(this, void 0, void 0, function () {
|
|
8686
|
-
var bookmarks, suppliedBookmarks, suppliedBookmarks_1, suppliedBookmarks_1_1, bm;
|
|
8687
|
-
var e_3, _b;
|
|
8688
|
-
return __generator$9(this, function (_c) {
|
|
8689
|
-
switch (_c.label) {
|
|
8690
|
-
case 0:
|
|
8691
|
-
bookmarks = new Set(this._bookmarks);
|
|
8692
|
-
if (!(typeof this._bookmarksSupplier === 'function')) return [3 /*break*/, 2];
|
|
8693
|
-
return [4 /*yield*/, this._bookmarksSupplier()];
|
|
8694
|
-
case 1:
|
|
8695
|
-
suppliedBookmarks = (_a = _c.sent()) !== null && _a !== void 0 ? _a : [];
|
|
8696
|
-
try {
|
|
8697
|
-
for (suppliedBookmarks_1 = __values$a(suppliedBookmarks), suppliedBookmarks_1_1 = suppliedBookmarks_1.next(); !suppliedBookmarks_1_1.done; suppliedBookmarks_1_1 = suppliedBookmarks_1.next()) {
|
|
8698
|
-
bm = suppliedBookmarks_1_1.value;
|
|
8699
|
-
bookmarks.add(bm);
|
|
8700
|
-
}
|
|
8701
|
-
}
|
|
8702
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
8703
|
-
finally {
|
|
8704
|
-
try {
|
|
8705
|
-
if (suppliedBookmarks_1_1 && !suppliedBookmarks_1_1.done && (_b = suppliedBookmarks_1.return)) _b.call(suppliedBookmarks_1);
|
|
8706
|
-
}
|
|
8707
|
-
finally { if (e_3) throw e_3.error; }
|
|
8708
|
-
}
|
|
8709
|
-
_c.label = 2;
|
|
8710
|
-
case 2: return [2 /*return*/, __spreadArray$j([], __read$p(bookmarks), false)];
|
|
8711
|
-
}
|
|
8712
|
-
});
|
|
8713
|
-
});
|
|
8714
|
-
};
|
|
8715
|
-
return Neo4jBookmarkManager;
|
|
8716
|
-
}());
|
|
8717
|
-
|
|
8718
9346
|
var types$1 = {};
|
|
8719
9347
|
|
|
8720
9348
|
/**
|
|
@@ -8783,8 +9411,8 @@
|
|
|
8783
9411
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8784
9412
|
};
|
|
8785
9413
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8786
|
-
exports.
|
|
8787
|
-
exports.bookmarkManager = exports.auth = exports.json = exports.driver = exports.types = exports.Driver = exports.Session = void 0;
|
|
9414
|
+
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;
|
|
9415
|
+
exports.resultTransformers = exports.routing = exports.bookmarkManager = exports.auth = exports.json = exports.driver = exports.types = exports.Driver = exports.Session = exports.TransactionPromise = void 0;
|
|
8788
9416
|
var error_1 = error;
|
|
8789
9417
|
Object.defineProperty(exports, "newError", { enumerable: true, get: function () { return error_1.newError; } });
|
|
8790
9418
|
Object.defineProperty(exports, "Neo4jError", { enumerable: true, get: function () { return error_1.Neo4jError; } });
|
|
@@ -8836,6 +9464,8 @@
|
|
|
8836
9464
|
Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return result_summary_1.Stats; } });
|
|
8837
9465
|
var result_1 = __importDefault(result);
|
|
8838
9466
|
exports.Result = result_1.default;
|
|
9467
|
+
var result_eager_1 = __importDefault(resultEager);
|
|
9468
|
+
exports.EagerResult = result_eager_1.default;
|
|
8839
9469
|
var connection_provider_1 = __importDefault(connectionProvider$1);
|
|
8840
9470
|
exports.ConnectionProvider = connection_provider_1.default;
|
|
8841
9471
|
var connection_1 = __importDefault(connection$2);
|
|
@@ -8855,10 +9485,14 @@
|
|
|
8855
9485
|
exports.auth = auth_1.default;
|
|
8856
9486
|
var bookmark_manager_1 = bookmarkManager$1;
|
|
8857
9487
|
Object.defineProperty(exports, "bookmarkManager", { enumerable: true, get: function () { return bookmark_manager_1.bookmarkManager; } });
|
|
9488
|
+
var driver_2 = driver;
|
|
9489
|
+
Object.defineProperty(exports, "routing", { enumerable: true, get: function () { return driver_2.routing; } });
|
|
8858
9490
|
var types = __importStar(types$1);
|
|
8859
9491
|
exports.types = types;
|
|
8860
9492
|
var json$1 = __importStar(json);
|
|
8861
9493
|
exports.json = json$1;
|
|
9494
|
+
var result_transformers_1 = __importDefault(resultTransformers$1);
|
|
9495
|
+
exports.resultTransformers = result_transformers_1.default;
|
|
8862
9496
|
var internal$1 = __importStar(internal); // todo: removed afterwards
|
|
8863
9497
|
exports.internal = internal$1;
|
|
8864
9498
|
/**
|
|
@@ -8919,6 +9553,7 @@
|
|
|
8919
9553
|
QueryStatistics: result_summary_1.QueryStatistics,
|
|
8920
9554
|
Stats: result_summary_1.Stats,
|
|
8921
9555
|
Result: result_1.default,
|
|
9556
|
+
EagerResult: result_eager_1.default,
|
|
8922
9557
|
Transaction: transaction_1.default,
|
|
8923
9558
|
ManagedTransaction: transaction_managed_1.default,
|
|
8924
9559
|
TransactionPromise: transaction_promise_1.default,
|
|
@@ -8929,7 +9564,9 @@
|
|
|
8929
9564
|
driver: driver$1,
|
|
8930
9565
|
json: json$1,
|
|
8931
9566
|
auth: auth_1.default,
|
|
8932
|
-
bookmarkManager: bookmark_manager_1.bookmarkManager
|
|
9567
|
+
bookmarkManager: bookmark_manager_1.bookmarkManager,
|
|
9568
|
+
routing: driver_2.routing,
|
|
9569
|
+
resultTransformers: result_transformers_1.default
|
|
8933
9570
|
};
|
|
8934
9571
|
exports.default = forExport;
|
|
8935
9572
|
}(lib$1));
|
|
@@ -17950,7 +18587,7 @@
|
|
|
17950
18587
|
// This is set up this way to keep the version in the code in
|
|
17951
18588
|
// sync with the npm package version, and to allow the build
|
|
17952
18589
|
// system to control version names at packaging time.
|
|
17953
|
-
version$1.default = '5.
|
|
18590
|
+
version$1.default = '5.5.0';
|
|
17954
18591
|
|
|
17955
18592
|
var lib = {};
|
|
17956
18593
|
|
|
@@ -30814,8 +31451,8 @@
|
|
|
30814
31451
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30815
31452
|
};
|
|
30816
31453
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30817
|
-
exports.
|
|
30818
|
-
exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = void 0;
|
|
31454
|
+
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;
|
|
31455
|
+
exports.resultTransformers = exports.bookmarkManager = exports.DateTime = exports.LocalDateTime = exports.Date = exports.Time = exports.LocalTime = exports.Duration = exports.Integer = exports.Point = void 0;
|
|
30819
31456
|
/**
|
|
30820
31457
|
* Copyright (c) "Neo4j"
|
|
30821
31458
|
* Neo4j Sweden AB [http://neo4j.com]
|
|
@@ -30876,11 +31513,14 @@
|
|
|
30876
31513
|
Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return neo4j_driver_core_1.Notification; } });
|
|
30877
31514
|
Object.defineProperty(exports, "ServerInfo", { enumerable: true, get: function () { return neo4j_driver_core_1.ServerInfo; } });
|
|
30878
31515
|
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return neo4j_driver_core_1.Result; } });
|
|
31516
|
+
Object.defineProperty(exports, "EagerResult", { enumerable: true, get: function () { return neo4j_driver_core_1.EagerResult; } });
|
|
30879
31517
|
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return neo4j_driver_core_1.auth; } });
|
|
30880
31518
|
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return neo4j_driver_core_1.Session; } });
|
|
30881
31519
|
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return neo4j_driver_core_1.Transaction; } });
|
|
30882
31520
|
Object.defineProperty(exports, "ManagedTransaction", { enumerable: true, get: function () { return neo4j_driver_core_1.ManagedTransaction; } });
|
|
30883
31521
|
Object.defineProperty(exports, "bookmarkManager", { enumerable: true, get: function () { return neo4j_driver_core_1.bookmarkManager; } });
|
|
31522
|
+
Object.defineProperty(exports, "routing", { enumerable: true, get: function () { return neo4j_driver_core_1.routing; } });
|
|
31523
|
+
Object.defineProperty(exports, "resultTransformers", { enumerable: true, get: function () { return neo4j_driver_core_1.resultTransformers; } });
|
|
30884
31524
|
var neo4j_driver_bolt_connection_1 = lib;
|
|
30885
31525
|
var session_rx_1 = __importDefault(sessionRx);
|
|
30886
31526
|
exports.RxSession = session_rx_1.default;
|
|
@@ -31171,6 +31811,7 @@
|
|
|
31171
31811
|
PathSegment: neo4j_driver_core_1.PathSegment,
|
|
31172
31812
|
Path: neo4j_driver_core_1.Path,
|
|
31173
31813
|
Result: neo4j_driver_core_1.Result,
|
|
31814
|
+
EagerResult: neo4j_driver_core_1.EagerResult,
|
|
31174
31815
|
ResultSummary: neo4j_driver_core_1.ResultSummary,
|
|
31175
31816
|
Record: neo4j_driver_core_1.Record,
|
|
31176
31817
|
Point: neo4j_driver_core_1.Point,
|
|
@@ -31257,6 +31898,7 @@
|
|
|
31257
31898
|
logging: logging,
|
|
31258
31899
|
types: types,
|
|
31259
31900
|
session: session,
|
|
31901
|
+
routing: neo4j_driver_core_1.routing,
|
|
31260
31902
|
error: neo4j_driver_core_1.error,
|
|
31261
31903
|
graph: graph,
|
|
31262
31904
|
spatial: spatial,
|
|
@@ -31266,6 +31908,7 @@
|
|
|
31266
31908
|
Transaction: neo4j_driver_core_1.Transaction,
|
|
31267
31909
|
ManagedTransaction: neo4j_driver_core_1.ManagedTransaction,
|
|
31268
31910
|
Result: neo4j_driver_core_1.Result,
|
|
31911
|
+
EagerResult: neo4j_driver_core_1.EagerResult,
|
|
31269
31912
|
RxSession: session_rx_1.default,
|
|
31270
31913
|
RxTransaction: transaction_rx_1.default,
|
|
31271
31914
|
RxManagedTransaction: transaction_managed_rx_1.default,
|
|
@@ -31290,7 +31933,8 @@
|
|
|
31290
31933
|
Date: neo4j_driver_core_1.Date,
|
|
31291
31934
|
LocalDateTime: neo4j_driver_core_1.LocalDateTime,
|
|
31292
31935
|
DateTime: neo4j_driver_core_1.DateTime,
|
|
31293
|
-
bookmarkManager: neo4j_driver_core_1.bookmarkManager
|
|
31936
|
+
bookmarkManager: neo4j_driver_core_1.bookmarkManager,
|
|
31937
|
+
resultTransformers: neo4j_driver_core_1.resultTransformers
|
|
31294
31938
|
};
|
|
31295
31939
|
exports.default = forExport;
|
|
31296
31940
|
}(lib$2));
|