neo4j-driver 5.0.0 → 5.0.2
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.js +43 -34
- package/lib/browser/neo4j-web.min.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
package/lib/browser/neo4j-web.js
CHANGED
|
@@ -2426,13 +2426,15 @@ function getTimeInZoneId(timeZoneId, epochSecond, nano) {
|
|
|
2426
2426
|
hour12: false,
|
|
2427
2427
|
era: 'narrow'
|
|
2428
2428
|
});
|
|
2429
|
-
var
|
|
2430
|
-
|
|
2429
|
+
var utc = (0, neo4j_driver_core_1.int)(epochSecond)
|
|
2430
|
+
.multiply(1000)
|
|
2431
|
+
.add((0, neo4j_driver_core_1.int)(nano).div(1000000))
|
|
2432
|
+
.toNumber();
|
|
2431
2433
|
var formattedUtcParts = formatter.formatToParts(utc);
|
|
2432
2434
|
var localDateTime = formattedUtcParts.reduce(function (obj, currentValue) {
|
|
2433
2435
|
if (currentValue.type === 'era') {
|
|
2434
2436
|
obj.adjustEra =
|
|
2435
|
-
currentValue.value.
|
|
2437
|
+
currentValue.value.toUpperCase() === 'B'
|
|
2436
2438
|
? function (year) { return year.subtract(1).negate(); } // 1BC equals to year 0 in astronomical year numbering
|
|
2437
2439
|
: functional_1.identity;
|
|
2438
2440
|
}
|
|
@@ -3153,7 +3155,8 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
3153
3155
|
this._log.debug("S: FAILURE ".concat(neo4j_driver_core_1.json.stringify(msg)));
|
|
3154
3156
|
}
|
|
3155
3157
|
try {
|
|
3156
|
-
var
|
|
3158
|
+
var standardizedCode = _standardizeCode(payload.code);
|
|
3159
|
+
var error = (0, neo4j_driver_core_1.newError)(payload.message, standardizedCode);
|
|
3157
3160
|
this._currentFailure = this._observer.onErrorApplyTransformation(error);
|
|
3158
3161
|
this._currentObserver.onError(this._currentFailure);
|
|
3159
3162
|
}
|
|
@@ -3225,6 +3228,24 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
3225
3228
|
return ResponseHandler;
|
|
3226
3229
|
}());
|
|
3227
3230
|
exports.default = ResponseHandler;
|
|
3231
|
+
/**
|
|
3232
|
+
* Standardize error classification that are different between 5.x and previous versions.
|
|
3233
|
+
*
|
|
3234
|
+
* The transient error were clean-up for being retrieable and because of this
|
|
3235
|
+
* `Terminated` and `LockClientStopped` were reclassified as `ClientError`.
|
|
3236
|
+
*
|
|
3237
|
+
* @param {string} code
|
|
3238
|
+
* @returns {string} the standardized error code
|
|
3239
|
+
*/
|
|
3240
|
+
function _standardizeCode(code) {
|
|
3241
|
+
if (code === 'Neo.TransientError.Transaction.Terminated') {
|
|
3242
|
+
return 'Neo.ClientError.Transaction.Terminated';
|
|
3243
|
+
}
|
|
3244
|
+
else if (code === 'Neo.TransientError.Transaction.LockClientStopped') {
|
|
3245
|
+
return 'Neo.ClientError.Transaction.LockClientStopped';
|
|
3246
|
+
}
|
|
3247
|
+
return code;
|
|
3248
|
+
}
|
|
3228
3249
|
|
|
3229
3250
|
},{"neo4j-driver-core":75}],26:[function(require,module,exports){
|
|
3230
3251
|
"use strict";
|
|
@@ -9565,28 +9586,27 @@ var Pool = /** @class */ (function () {
|
|
|
9565
9586
|
};
|
|
9566
9587
|
Pool.prototype._purgeKey = function (key) {
|
|
9567
9588
|
return __awaiter(this, void 0, void 0, function () {
|
|
9568
|
-
var pool, resource;
|
|
9589
|
+
var pool, destructionList, resource;
|
|
9569
9590
|
return __generator(this, function (_a) {
|
|
9570
9591
|
switch (_a.label) {
|
|
9571
9592
|
case 0:
|
|
9572
9593
|
pool = this._pools[key];
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9594
|
+
destructionList = [];
|
|
9595
|
+
if (!pool) return [3 /*break*/, 2];
|
|
9596
|
+
while (pool.length) {
|
|
9597
|
+
resource = pool.pop();
|
|
9598
|
+
if (this._removeIdleObserver) {
|
|
9599
|
+
this._removeIdleObserver(resource);
|
|
9600
|
+
}
|
|
9601
|
+
destructionList.push(this._destroy(resource));
|
|
9580
9602
|
}
|
|
9581
|
-
return [4 /*yield*/, this._destroy(resource)];
|
|
9582
|
-
case 2:
|
|
9583
|
-
_a.sent();
|
|
9584
|
-
return [3 /*break*/, 1];
|
|
9585
|
-
case 3:
|
|
9586
9603
|
pool.close();
|
|
9587
9604
|
delete this._pools[key];
|
|
9588
|
-
|
|
9589
|
-
case
|
|
9605
|
+
return [4 /*yield*/, Promise.all(destructionList)];
|
|
9606
|
+
case 1:
|
|
9607
|
+
_a.sent();
|
|
9608
|
+
_a.label = 2;
|
|
9609
|
+
case 2: return [2 /*return*/];
|
|
9590
9610
|
}
|
|
9591
9611
|
});
|
|
9592
9612
|
});
|
|
@@ -11341,26 +11361,15 @@ function _isRetriableCode(code) {
|
|
|
11341
11361
|
return code === SERVICE_UNAVAILABLE ||
|
|
11342
11362
|
code === SESSION_EXPIRED ||
|
|
11343
11363
|
_isAuthorizationExpired(code) ||
|
|
11344
|
-
|
|
11364
|
+
_isTransientError(code);
|
|
11345
11365
|
}
|
|
11346
11366
|
/**
|
|
11347
11367
|
* @private
|
|
11348
11368
|
* @param {string} code the error to check
|
|
11349
11369
|
* @return {boolean} true if the error is a transient error
|
|
11350
11370
|
*/
|
|
11351
|
-
function
|
|
11352
|
-
|
|
11353
|
-
// Termination of transaction might result in two different error codes depending on where it was
|
|
11354
|
-
// terminated. These are really client errors but classification on the server is not entirely correct and
|
|
11355
|
-
// they are classified as transient.
|
|
11356
|
-
if ((code === null || code === void 0 ? void 0 : code.includes('TransientError')) === true) {
|
|
11357
|
-
if (code === 'Neo.TransientError.Transaction.Terminated' ||
|
|
11358
|
-
code === 'Neo.TransientError.Transaction.LockClientStopped') {
|
|
11359
|
-
return false;
|
|
11360
|
-
}
|
|
11361
|
-
return true;
|
|
11362
|
-
}
|
|
11363
|
-
return false;
|
|
11371
|
+
function _isTransientError(code) {
|
|
11372
|
+
return (code === null || code === void 0 ? void 0 : code.includes('TransientError')) === true;
|
|
11364
11373
|
}
|
|
11365
11374
|
/**
|
|
11366
11375
|
* @private
|
|
@@ -32660,7 +32669,7 @@ exports["default"] = void 0;
|
|
|
32660
32669
|
// This is set up this way to keep the version in the code in
|
|
32661
32670
|
// sync with the npm package version, and to allow the build
|
|
32662
32671
|
// system to control version names at packaging time.
|
|
32663
|
-
var _default = '5.0.
|
|
32672
|
+
var _default = '5.0.2';
|
|
32664
32673
|
exports["default"] = _default;
|
|
32665
32674
|
|
|
32666
32675
|
},{}]},{},[350])(350)
|