neo4j-driver-core
Advanced tools
Comparing version 4.3.3 to 4.3.4
@@ -28,3 +28,3 @@ "use strict"; | ||
* @param {Array<string>} labels - Array for all labels | ||
* @param {Object} properties - Map with node properties | ||
* @param {Properties} properties - Map with node properties | ||
*/ | ||
@@ -44,3 +44,3 @@ function Node(identity, labels, properties) { | ||
* Properties of the node. | ||
* @type {Object} | ||
* @type {Properties} | ||
*/ | ||
@@ -63,3 +63,3 @@ this.properties = properties; | ||
s += ','; | ||
s += keys[i] + ':' + json_1.stringify(this.properties[keys[i]]); | ||
s += keys[i] + ':' + (0, json_1.stringify)(this.properties[keys[i]]); | ||
} | ||
@@ -95,3 +95,3 @@ s += '}'; | ||
* @param {string} type - Relationship type | ||
* @param {Object} properties - Map with relationship properties | ||
* @param {Properties} properties - Map with relationship properties | ||
*/ | ||
@@ -121,3 +121,3 @@ function Relationship(identity, start, end, type, properties) { | ||
* Properties of the relationship. | ||
* @type {Object} | ||
* @type {Properties} | ||
*/ | ||
@@ -137,3 +137,3 @@ this.properties = properties; | ||
s += ','; | ||
s += keys[i] + ':' + json_1.stringify(this.properties[keys[i]]); | ||
s += keys[i] + ':' + (0, json_1.stringify)(this.properties[keys[i]]); | ||
} | ||
@@ -168,3 +168,3 @@ s += '}'; | ||
* @param {string} type - Relationship type | ||
* @param {Object} properties - Map with relationship properties | ||
* @param {Properties} properties - Map with relationship properties | ||
*/ | ||
@@ -184,3 +184,3 @@ function UnboundRelationship(identity, type, properties) { | ||
* Properties of the relationship. | ||
* @type {Object} | ||
* @type {Properties} | ||
*/ | ||
@@ -211,3 +211,3 @@ this.properties = properties; | ||
s += ','; | ||
s += keys[i] + ':' + json_1.stringify(this.properties[keys[i]]); | ||
s += keys[i] + ':' + (0, json_1.stringify)(this.properties[keys[i]]); | ||
} | ||
@@ -214,0 +214,0 @@ s += '}'; |
@@ -473,3 +473,3 @@ "use strict"; | ||
if (theDivisor.isZero()) { | ||
throw error_1.newError('division by zero'); | ||
throw (0, error_1.newError)('division by zero'); | ||
} | ||
@@ -710,3 +710,3 @@ if (this.isZero()) { | ||
if (str.length === 0) { | ||
throw error_1.newError('number format error: empty string'); | ||
throw (0, error_1.newError)('number format error: empty string'); | ||
} | ||
@@ -721,7 +721,7 @@ if (str === 'NaN' || | ||
if (radix < 2 || radix > 36) { | ||
throw error_1.newError('radix out of range: ' + radix); | ||
throw (0, error_1.newError)('radix out of range: ' + radix); | ||
} | ||
var p; | ||
if ((p = str.indexOf('-')) > 0) { | ||
throw error_1.newError('number format error: interior "-" character: ' + str); | ||
throw (0, error_1.newError)('number format error: interior "-" character: ' + str); | ||
} | ||
@@ -728,0 +728,0 @@ else if (p === 0) { |
@@ -56,3 +56,3 @@ "use strict"; | ||
this._mode = mode; | ||
this._database = database ? util_1.assertString(database, 'database') : ''; | ||
this._database = database ? (0, util_1.assertString)(database, 'database') : ''; | ||
this._bookmark = bookmark || bookmark_1.Bookmark.empty(); | ||
@@ -211,3 +211,3 @@ this._connectionProvider = connectionProvider; | ||
EmptyConnectionHolder.prototype.getConnection = function () { | ||
return Promise.reject(error_1.newError('This connection holder does not serve connections')); | ||
return Promise.reject((0, error_1.newError)('This connection holder does not serve connections')); | ||
}; | ||
@@ -214,0 +214,0 @@ EmptyConnectionHolder.prototype.releaseConnection = function () { |
@@ -65,3 +65,3 @@ "use strict"; | ||
if (!connection) { | ||
throw error_1.newError('Unexpected error acquiring transaction'); | ||
throw (0, error_1.newError)('Unexpected error acquiring transaction'); | ||
} | ||
@@ -68,0 +68,0 @@ return connectionHolder.close().then(function () { return connection.server; }); |
@@ -194,3 +194,3 @@ "use strict"; | ||
if (!value && value !== 0) { | ||
throw error_1.newError("Illegal logging level: " + configuredLevel + ". Supported levels are: " + Object.keys(levels)); | ||
throw (0, error_1.newError)("Illegal logging level: " + configuredLevel + ". Supported levels are: " + Object.keys(levels)); | ||
} | ||
@@ -213,3 +213,3 @@ return configuredLevel; | ||
} | ||
throw error_1.newError("Illegal logger function: " + loggingConfig.logger); | ||
throw (0, error_1.newError)("Illegal logger function: " + loggingConfig.logger); | ||
} |
@@ -45,5 +45,5 @@ "use strict"; | ||
function ServerAddress(host, resolved, port, hostPort) { | ||
this._host = util_1.assertString(host, 'host'); | ||
this._resolved = resolved ? util_1.assertString(resolved, 'resolved') : null; | ||
this._port = util_1.assertNumber(port, 'port'); | ||
this._host = (0, util_1.assertString)(host, 'host'); | ||
this._resolved = resolved ? (0, util_1.assertString)(resolved, 'resolved') : null; | ||
this._port = (0, util_1.assertNumber)(port, 'port'); | ||
this._hostPort = hostPort; | ||
@@ -50,0 +50,0 @@ this._stringValue = resolved ? hostPort + "(" + resolved + ")" : "" + hostPort; |
@@ -58,7 +58,7 @@ "use strict"; | ||
this._maxNumber = max; | ||
this._minInteger = integer_1.int(min); | ||
this._maxInteger = integer_1.int(max); | ||
this._minInteger = (0, integer_1.int)(min); | ||
this._maxInteger = (0, integer_1.int)(max); | ||
} | ||
ValueRange.prototype.contains = function (value) { | ||
if (integer_1.isInt(value) && value instanceof integer_1.default) { | ||
if ((0, integer_1.isInt)(value) && value instanceof integer_1.default) { | ||
return (value.greaterThanOrEqual(this._minInteger) && | ||
@@ -68,3 +68,3 @@ value.lessThanOrEqual(this._maxInteger)); | ||
else if (typeof value === 'bigint') { | ||
var intValue = integer_1.int(value); | ||
var intValue = (0, integer_1.int)(value); | ||
return (intValue.greaterThanOrEqual(this._minInteger) && | ||
@@ -100,3 +100,3 @@ intValue.lessThanOrEqual(this._maxInteger)); | ||
function normalizeSecondsForDuration(seconds, nanoseconds) { | ||
return integer_1.int(seconds).add(floorDiv(nanoseconds, exports.NANOS_PER_SECOND)); | ||
return (0, integer_1.int)(seconds).add(floorDiv(nanoseconds, exports.NANOS_PER_SECOND)); | ||
} | ||
@@ -117,6 +117,6 @@ exports.normalizeSecondsForDuration = normalizeSecondsForDuration; | ||
function localTimeToNanoOfDay(hour, minute, second, nanosecond) { | ||
hour = integer_1.int(hour); | ||
minute = integer_1.int(minute); | ||
second = integer_1.int(second); | ||
nanosecond = integer_1.int(nanosecond); | ||
hour = (0, integer_1.int)(hour); | ||
minute = (0, integer_1.int)(minute); | ||
second = (0, integer_1.int)(second); | ||
nanosecond = (0, integer_1.int)(nanosecond); | ||
var totalNanos = hour.multiply(exports.NANOS_PER_HOUR); | ||
@@ -153,5 +153,5 @@ totalNanos = totalNanos.add(minute.multiply(exports.NANOS_PER_MINUTE)); | ||
function dateToEpochDay(year, month, day) { | ||
year = integer_1.int(year); | ||
month = integer_1.int(month); | ||
day = integer_1.int(day); | ||
year = (0, integer_1.int)(year); | ||
month = (0, integer_1.int)(month); | ||
day = (0, integer_1.int)(day); | ||
var epochDay = year.multiply(365); | ||
@@ -222,3 +222,3 @@ if (year.greaterThanOrEqual(0)) { | ||
function timeZoneOffsetToIsoString(offsetSeconds) { | ||
offsetSeconds = integer_1.int(offsetSeconds); | ||
offsetSeconds = (0, integer_1.int)(offsetSeconds); | ||
if (offsetSeconds.equals(0)) { | ||
@@ -249,3 +249,3 @@ return 'Z'; | ||
function dateToIsoString(year, month, day) { | ||
year = integer_1.int(year); | ||
year = (0, integer_1.int)(year); | ||
var isNegative = year.isNegative(); | ||
@@ -367,5 +367,5 @@ if (isNegative) { | ||
function assertValidTemporalValue(value, range, name) { | ||
util_1.assertNumberOrInteger(value, name); | ||
(0, util_1.assertNumberOrInteger)(value, name); | ||
if (!range.contains(value)) { | ||
throw error_1.newError(name + " is expected to be in range " + range + " but was: " + value); | ||
throw (0, error_1.newError)(name + " is expected to be in range " + range + " but was: " + value); | ||
} | ||
@@ -382,5 +382,5 @@ return value; | ||
function localTimeToSecondOfDay(hour, minute, second) { | ||
hour = integer_1.int(hour); | ||
minute = integer_1.int(minute); | ||
second = integer_1.int(second); | ||
hour = (0, integer_1.int)(hour); | ||
minute = (0, integer_1.int)(minute); | ||
second = (0, integer_1.int)(second); | ||
var totalSeconds = hour.multiply(exports.SECONDS_PER_HOUR); | ||
@@ -396,3 +396,3 @@ totalSeconds = totalSeconds.add(minute.multiply(exports.SECONDS_PER_MINUTE)); | ||
function isLeapYear(year) { | ||
year = integer_1.int(year); | ||
year = (0, integer_1.int)(year); | ||
if (!year.modulo(4).equals(0)) { | ||
@@ -417,4 +417,4 @@ return false; | ||
function floorDiv(x, y) { | ||
x = integer_1.int(x); | ||
y = integer_1.int(y); | ||
x = (0, integer_1.int)(x); | ||
y = (0, integer_1.int)(y); | ||
var result = x.div(y); | ||
@@ -433,4 +433,4 @@ if (x.isPositive() !== y.isPositive() && result.multiply(y).notEquals(x)) { | ||
function floorMod(x, y) { | ||
x = integer_1.int(x); | ||
y = integer_1.int(y); | ||
x = (0, integer_1.int)(x); | ||
y = (0, integer_1.int)(y); | ||
return x.subtract(floorDiv(x, y).multiply(y)); | ||
@@ -445,4 +445,4 @@ } | ||
function formatSecondsAndNanosecondsForDuration(seconds, nanoseconds) { | ||
seconds = integer_1.int(seconds); | ||
nanoseconds = integer_1.int(nanoseconds); | ||
seconds = (0, integer_1.int)(seconds); | ||
nanoseconds = (0, integer_1.int)(nanoseconds); | ||
var secondsString; | ||
@@ -481,3 +481,3 @@ var nanosecondsString; | ||
function formatNanosecond(value) { | ||
value = integer_1.int(value); | ||
value = (0, integer_1.int)(value); | ||
return value.equals(0) ? '' : '.' + formatNumber(value, 9); | ||
@@ -491,3 +491,3 @@ } | ||
function formatNumber(num, stringLength) { | ||
num = integer_1.int(num); | ||
num = (0, integer_1.int)(num); | ||
var isNegative = num.isNegative(); | ||
@@ -494,0 +494,0 @@ if (isNegative) { |
@@ -55,3 +55,3 @@ "use strict"; | ||
var elapsedTimeMs = Date.now() - retryStartTime; | ||
if (elapsedTimeMs > this._maxRetryTimeMs || !retry_strategy_1.canRetryOn(error)) { | ||
if (elapsedTimeMs > this._maxRetryTimeMs || !(0, retry_strategy_1.canRetryOn)(error)) { | ||
return Promise.reject(error); | ||
@@ -145,12 +145,12 @@ } | ||
if (this._maxRetryTimeMs < 0) { | ||
throw error_1.newError('Max retry time should be >= 0: ' + this._maxRetryTimeMs); | ||
throw (0, error_1.newError)('Max retry time should be >= 0: ' + this._maxRetryTimeMs); | ||
} | ||
if (this._initialRetryDelayMs < 0) { | ||
throw error_1.newError('Initial retry delay should >= 0: ' + this._initialRetryDelayMs); | ||
throw (0, error_1.newError)('Initial retry delay should >= 0: ' + this._initialRetryDelayMs); | ||
} | ||
if (this._multiplier < 1.0) { | ||
throw error_1.newError('Multiplier should be >= 1.0: ' + this._multiplier); | ||
throw (0, error_1.newError)('Multiplier should be >= 1.0: ' + this._multiplier); | ||
} | ||
if (this._jitterFactor < 0 || this._jitterFactor > 1) { | ||
throw error_1.newError('Jitter factor should be in [0.0, 1.0]: ' + this._jitterFactor); | ||
throw (0, error_1.newError)('Jitter factor should be in [0.0, 1.0]: ' + this._jitterFactor); | ||
} | ||
@@ -157,0 +157,0 @@ }; |
@@ -84,8 +84,8 @@ "use strict"; | ||
util.assertNumberOrInteger(config.timeout, 'Transaction timeout'); | ||
var timeout = integer_1.int(config.timeout); | ||
var timeout = (0, integer_1.int)(config.timeout); | ||
if (timeout.isZero()) { | ||
throw error_1.newError('Transaction timeout should not be zero'); | ||
throw (0, error_1.newError)('Transaction timeout should not be zero'); | ||
} | ||
if (timeout.isNegative()) { | ||
throw error_1.newError('Transaction timeout should not be negative'); | ||
throw (0, error_1.newError)('Transaction timeout should not be negative'); | ||
} | ||
@@ -92,0 +92,0 @@ return timeout; |
@@ -91,3 +91,3 @@ "use strict"; | ||
function parseDatabaseUrl(url) { | ||
util_1.assertString(url, 'URL'); | ||
(0, util_1.assertString)(url, 'URL'); | ||
var sanitized = sanitizeUrl(url); | ||
@@ -94,0 +94,0 @@ var parsedUrl = uriJsParse(sanitized.url); |
@@ -94,3 +94,3 @@ "use strict"; | ||
if (!isObject(obj)) { | ||
throw new TypeError(objName + ' expected to be an object but was: ' + json_1.stringify(obj)); | ||
throw new TypeError(objName + ' expected to be an object but was: ' + (0, json_1.stringify)(obj)); | ||
} | ||
@@ -109,3 +109,3 @@ return obj; | ||
if (!isString(obj)) { | ||
throw new TypeError(objName + ' expected to be string but was: ' + json_1.stringify(obj)); | ||
throw new TypeError(objName + ' expected to be string but was: ' + (0, json_1.stringify)(obj)); | ||
} | ||
@@ -124,3 +124,3 @@ return obj; | ||
if (typeof obj !== 'number') { | ||
throw new TypeError(objName + ' expected to be a number but was: ' + json_1.stringify(obj)); | ||
throw new TypeError(objName + ' expected to be a number but was: ' + (0, json_1.stringify)(obj)); | ||
} | ||
@@ -138,6 +138,6 @@ return obj; | ||
function assertNumberOrInteger(obj, objName) { | ||
if (typeof obj !== 'number' && typeof obj !== 'bigint' && !integer_1.isInt(obj)) { | ||
if (typeof obj !== 'number' && typeof obj !== 'bigint' && !(0, integer_1.isInt)(obj)) { | ||
throw new TypeError(objName + | ||
' expected to be either a number or an Integer object but was: ' + | ||
json_1.stringify(obj)); | ||
(0, json_1.stringify)(obj)); | ||
} | ||
@@ -158,3 +158,3 @@ return obj; | ||
' expected to be a standard JavaScript Date but was: ' + | ||
json_1.stringify(obj)); | ||
(0, json_1.stringify)(obj)); | ||
} | ||
@@ -164,3 +164,3 @@ if (Number.isNaN(obj.getTime())) { | ||
' expected to be valid JavaScript Date but its time was NaN: ' + | ||
json_1.stringify(obj)); | ||
(0, json_1.stringify)(obj)); | ||
} | ||
@@ -167,0 +167,0 @@ return obj; |
@@ -292,3 +292,3 @@ "use strict"; | ||
if (index === undefined) { | ||
throw error_1.newError("This record has no field with key '" + | ||
throw (0, error_1.newError)("This record has no field with key '" + | ||
key + | ||
@@ -304,3 +304,3 @@ "', available key are: [" + | ||
if (index > this._fields.length - 1 || index < 0) { | ||
throw error_1.newError("This record has no field with index '" + | ||
throw (0, error_1.newError)("This record has no field with index '" + | ||
index + | ||
@@ -307,0 +307,0 @@ "'. Remember that indexes start at `0`, " + |
@@ -445,3 +445,3 @@ "use strict"; | ||
else if (typeof value == 'bigint') { | ||
return integer_1.int(value).toInt(); | ||
return (0, integer_1.int)(value).toInt(); | ||
} | ||
@@ -448,0 +448,0 @@ else { |
@@ -127,3 +127,3 @@ "use strict"; | ||
var _this = this; | ||
var _a = util_1.validateQueryAndParameters(query, parameters), validatedQuery = _a.validatedQuery, params = _a.params; | ||
var _a = (0, util_1.validateQueryAndParameters)(query, parameters), validatedQuery = _a.validatedQuery, params = _a.params; | ||
var autoCommitTxConfig = transactionConfig | ||
@@ -150,3 +150,3 @@ ? new tx_config_1.TxConfig(transactionConfig) | ||
observerPromise = Promise.resolve(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot run query in a closed session.') | ||
error: (0, error_1.newError)('Cannot run query in a closed session.') | ||
})); | ||
@@ -162,3 +162,3 @@ } | ||
observerPromise = Promise.resolve(new observers_1.FailedObserver({ | ||
error: error_1.newError('Queries cannot be run directly on a ' + | ||
error: (0, error_1.newError)('Queries cannot be run directly on a ' + | ||
'session with an open transaction; either run from within the ' + | ||
@@ -177,3 +177,3 @@ 'transaction or use a different session.') | ||
if (!this._open) { | ||
promise = Promise.reject(error_1.newError('Cannot run query in a closed session.')); | ||
promise = Promise.reject((0, error_1.newError)('Cannot run query in a closed session.')); | ||
} | ||
@@ -196,3 +196,3 @@ else if (!this._hasTx && connectionHolder.initializeConnection()) { | ||
else { | ||
promise = Promise.reject(error_1.newError('Queries cannot be run directly on a ' + | ||
promise = Promise.reject((0, error_1.newError)('Queries cannot be run directly on a ' + | ||
'session with an open transaction; either run from within the ' + | ||
@@ -227,6 +227,6 @@ 'transaction or use a different session.')); | ||
if (!this._open) { | ||
throw error_1.newError('Cannot begin a transaction on a closed session.'); | ||
throw (0, error_1.newError)('Cannot begin a transaction on a closed session.'); | ||
} | ||
if (this._hasTx) { | ||
throw error_1.newError('You cannot begin a transaction on a session with an open transaction; ' + | ||
throw (0, error_1.newError)('You cannot begin a transaction on a session with an open transaction; ' + | ||
'either run from within the transaction or use a different session.'); | ||
@@ -255,3 +255,3 @@ } | ||
if (!this._open) { | ||
throw error_1.newError('You cannot run more transactions on a closed session.'); | ||
throw (0, error_1.newError)('You cannot run more transactions on a closed session.'); | ||
} | ||
@@ -357,3 +357,3 @@ }; | ||
else { | ||
throw error_1.newError('Unknown access mode: ' + mode); | ||
throw (0, error_1.newError)('Unknown access mode: ' + mode); | ||
} | ||
@@ -375,3 +375,3 @@ }; | ||
if (mode !== constants_1.ACCESS_MODE_READ && mode !== constants_1.ACCESS_MODE_WRITE) { | ||
throw error_1.newError('Illegal session mode ' + mode); | ||
throw (0, error_1.newError)('Illegal session mode ' + mode); | ||
} | ||
@@ -378,0 +378,0 @@ return mode; |
@@ -41,3 +41,3 @@ "use strict"; | ||
*/ | ||
this.srid = util_1.assertNumberOrInteger(srid, 'SRID'); | ||
this.srid = (0, util_1.assertNumberOrInteger)(srid, 'SRID'); | ||
/** | ||
@@ -47,3 +47,3 @@ * The `x` coordinate of the point. | ||
*/ | ||
this.x = util_1.assertNumber(x, 'X coordinate'); | ||
this.x = (0, util_1.assertNumber)(x, 'X coordinate'); | ||
/** | ||
@@ -53,3 +53,3 @@ * The `y` coordinate of the point. | ||
*/ | ||
this.y = util_1.assertNumber(y, 'Y coordinate'); | ||
this.y = (0, util_1.assertNumber)(y, 'Y coordinate'); | ||
/** | ||
@@ -59,3 +59,3 @@ * The `z` coordinate of the point or `undefined` if point is 2-dimensional. | ||
*/ | ||
this.z = z === null || z === undefined ? z : util_1.assertNumber(z, 'Z coordinate'); | ||
this.z = z === null || z === undefined ? z : (0, util_1.assertNumber)(z, 'Z coordinate'); | ||
Object.freeze(this); | ||
@@ -62,0 +62,0 @@ } |
@@ -90,3 +90,3 @@ "use strict"; | ||
*/ | ||
this.months = util_1.assertNumberOrInteger(months, 'Months'); | ||
this.months = (0, util_1.assertNumberOrInteger)(months, 'Months'); | ||
/** | ||
@@ -96,5 +96,5 @@ * The number of days. | ||
*/ | ||
this.days = util_1.assertNumberOrInteger(days, 'Days'); | ||
util_1.assertNumberOrInteger(seconds, 'Seconds'); | ||
util_1.assertNumberOrInteger(nanoseconds, 'Nanoseconds'); | ||
this.days = (0, util_1.assertNumberOrInteger)(days, 'Days'); | ||
(0, util_1.assertNumberOrInteger)(seconds, 'Seconds'); | ||
(0, util_1.assertNumberOrInteger)(nanoseconds, 'Nanoseconds'); | ||
/** | ||
@@ -179,3 +179,3 @@ * The number of seconds. | ||
: typeof totalNanoseconds === 'bigint' | ||
? integer_1.int(totalNanoseconds).toInt() | ||
? (0, integer_1.int)(totalNanoseconds).toInt() | ||
: totalNanoseconds); | ||
@@ -241,3 +241,3 @@ }; | ||
*/ | ||
this.timeZoneOffsetSeconds = util_1.assertNumberOrInteger(timeZoneOffsetSeconds, 'Time zone offset in seconds'); | ||
this.timeZoneOffsetSeconds = (0, util_1.assertNumberOrInteger)(timeZoneOffsetSeconds, 'Time zone offset in seconds'); | ||
Object.freeze(this); | ||
@@ -254,3 +254,3 @@ } | ||
verifyStandardDateAndNanos(standardDate, nanosecond); | ||
return new Time(standardDate.getHours(), standardDate.getMinutes(), standardDate.getSeconds(), integer_1.toNumber(util.totalNanoseconds(standardDate, nanosecond)), util.timeZoneOffsetInSeconds(standardDate)); | ||
return new Time(standardDate.getHours(), standardDate.getMinutes(), standardDate.getSeconds(), (0, integer_1.toNumber)(util.totalNanoseconds(standardDate, nanosecond)), util.timeZoneOffsetInSeconds(standardDate)); | ||
}; | ||
@@ -396,3 +396,3 @@ /** | ||
verifyStandardDateAndNanos(standardDate, nanosecond); | ||
return new LocalDateTime(standardDate.getFullYear(), standardDate.getMonth() + 1, standardDate.getDate(), standardDate.getHours(), standardDate.getMinutes(), standardDate.getSeconds(), integer_1.toNumber(util.totalNanoseconds(standardDate, nanosecond))); | ||
return new LocalDateTime(standardDate.getFullYear(), standardDate.getMonth() + 1, standardDate.getDate(), standardDate.getHours(), standardDate.getMinutes(), standardDate.getSeconds(), (0, integer_1.toNumber)(util.totalNanoseconds(standardDate, nanosecond))); | ||
}; | ||
@@ -500,3 +500,3 @@ /** | ||
verifyStandardDateAndNanos(standardDate, nanosecond); | ||
return new DateTime(standardDate.getFullYear(), standardDate.getMonth() + 1, standardDate.getDate(), standardDate.getHours(), standardDate.getMinutes(), standardDate.getSeconds(), integer_1.toNumber(util.totalNanoseconds(standardDate, nanosecond)), util.timeZoneOffsetInSeconds(standardDate), null /* no time zone id */); | ||
return new DateTime(standardDate.getFullYear(), standardDate.getMonth() + 1, standardDate.getDate(), standardDate.getHours(), standardDate.getMinutes(), standardDate.getSeconds(), (0, integer_1.toNumber)(util.totalNanoseconds(standardDate, nanosecond)), util.timeZoneOffsetInSeconds(standardDate), null /* no time zone id */); | ||
}; | ||
@@ -544,14 +544,14 @@ /** | ||
if (offsetDefined && !idDefined) { | ||
util_1.assertNumberOrInteger(timeZoneOffsetSeconds, 'Time zone offset in seconds'); | ||
(0, util_1.assertNumberOrInteger)(timeZoneOffsetSeconds, 'Time zone offset in seconds'); | ||
return [timeZoneOffsetSeconds, undefined]; | ||
} | ||
else if (!offsetDefined && idDefined) { | ||
util_1.assertString(timeZoneId, 'Time zone ID'); | ||
(0, util_1.assertString)(timeZoneId, 'Time zone ID'); | ||
return [undefined, timeZoneId]; | ||
} | ||
else if (offsetDefined && idDefined) { | ||
throw error_1.newError("Unable to create DateTime with both time zone offset and id. Please specify either of them. Given offset: " + timeZoneOffsetSeconds + " and id: " + timeZoneId); | ||
throw (0, error_1.newError)("Unable to create DateTime with both time zone offset and id. Please specify either of them. Given offset: " + timeZoneOffsetSeconds + " and id: " + timeZoneId); | ||
} | ||
else { | ||
throw error_1.newError("Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: " + timeZoneOffsetSeconds + " and id: " + timeZoneId); | ||
throw (0, error_1.newError)("Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: " + timeZoneOffsetSeconds + " and id: " + timeZoneId); | ||
} | ||
@@ -566,6 +566,6 @@ } | ||
function verifyStandardDateAndNanos(standardDate, nanosecond) { | ||
util_1.assertValidDate(standardDate, 'Standard date'); | ||
(0, util_1.assertValidDate)(standardDate, 'Standard date'); | ||
if (nanosecond !== null && nanosecond !== undefined) { | ||
util_1.assertNumberOrInteger(nanosecond, 'Nanosecond'); | ||
(0, util_1.assertNumberOrInteger)(nanosecond, 'Nanosecond'); | ||
} | ||
} |
@@ -83,3 +83,3 @@ "use strict"; | ||
else { | ||
throw error_1.newError('No connection available'); | ||
throw (0, error_1.newError)('No connection available'); | ||
} | ||
@@ -98,3 +98,3 @@ }) | ||
Transaction.prototype.run = function (query, parameters) { | ||
var _a = util_1.validateQueryAndParameters(query, parameters), validatedQuery = _a.validatedQuery, params = _a.params; | ||
var _a = (0, util_1.validateQueryAndParameters)(query, parameters), validatedQuery = _a.validatedQuery, params = _a.params; | ||
var result = this._state.run(validatedQuery, params, { | ||
@@ -224,3 +224,3 @@ connectionHolder: this._connectionHolder, | ||
else { | ||
throw error_1.newError('No connection available'); | ||
throw (0, error_1.newError)('No connection available'); | ||
} | ||
@@ -239,3 +239,3 @@ }) | ||
result: newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination.'), | ||
error: (0, error_1.newError)('Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination.'), | ||
onError: onError | ||
@@ -256,3 +256,3 @@ }), 'COMMIT', {}, connectionHolder), | ||
return newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination.'), | ||
error: (0, error_1.newError)('Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination.'), | ||
onError: onError | ||
@@ -268,3 +268,3 @@ }), query, parameters, connectionHolder); | ||
result: newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot commit this transaction, because it has already been committed.'), | ||
error: (0, error_1.newError)('Cannot commit this transaction, because it has already been committed.'), | ||
onError: onError | ||
@@ -280,3 +280,3 @@ }), 'COMMIT', {}), | ||
result: newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot rollback this transaction, because it has already been committed.'), | ||
error: (0, error_1.newError)('Cannot rollback this transaction, because it has already been committed.'), | ||
onError: onError | ||
@@ -291,3 +291,3 @@ }), 'ROLLBACK', {}), | ||
return newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot run query in this transaction, because it has already been committed.'), | ||
error: (0, error_1.newError)('Cannot run query in this transaction, because it has already been committed.'), | ||
onError: onError | ||
@@ -303,3 +303,3 @@ }), query, parameters, connectionHolder); | ||
result: newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot commit this transaction, because it has already been rolled back.'), | ||
error: (0, error_1.newError)('Cannot commit this transaction, because it has already been rolled back.'), | ||
onError: onError | ||
@@ -314,3 +314,3 @@ }), 'COMMIT', {}, connectionHolder), | ||
result: newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot rollback this transaction, because it has already been rolled back.') | ||
error: (0, error_1.newError)('Cannot rollback this transaction, because it has already been rolled back.') | ||
}), 'ROLLBACK', {}, connectionHolder), | ||
@@ -323,3 +323,3 @@ state: _states.ROLLED_BACK | ||
return newCompletedResult(new observers_1.FailedObserver({ | ||
error: error_1.newError('Cannot run query in this transaction, because it has already been rolled back.'), | ||
error: (0, error_1.newError)('Cannot run query in this transaction, because it has already been rolled back.'), | ||
onError: onError | ||
@@ -361,3 +361,3 @@ }), query, parameters, connectionHolder); | ||
else { | ||
throw error_1.newError('No connection available'); | ||
throw (0, error_1.newError)('No connection available'); | ||
} | ||
@@ -364,0 +364,0 @@ }); |
{ | ||
"name": "neo4j-driver-core", | ||
"version": "4.3.3", | ||
"version": "4.3.4", | ||
"description": "Internals of neo4j-driver", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -22,9 +22,12 @@ /** | ||
declare type NumberOrInteger = number | Integer | bigint; | ||
declare type Properties = { | ||
[key: string]: any; | ||
}; | ||
/** | ||
* Class for Node Type. | ||
*/ | ||
declare class Node<T extends NumberOrInteger = Integer> { | ||
declare class Node<T extends NumberOrInteger = Integer, P extends Properties = Properties> { | ||
identity: T; | ||
labels: string[]; | ||
properties: any; | ||
properties: P; | ||
/** | ||
@@ -35,5 +38,5 @@ * @constructor | ||
* @param {Array<string>} labels - Array for all labels | ||
* @param {Object} properties - Map with node properties | ||
* @param {Properties} properties - Map with node properties | ||
*/ | ||
constructor(identity: T, labels: string[], properties: any); | ||
constructor(identity: T, labels: string[], properties: P); | ||
/** | ||
@@ -49,7 +52,7 @@ * @ignore | ||
*/ | ||
declare function isNode(obj: object): boolean; | ||
declare function isNode(obj: object): obj is Node; | ||
/** | ||
* Class for Relationship Type. | ||
*/ | ||
declare class Relationship<T extends NumberOrInteger = Integer> { | ||
declare class Relationship<T extends NumberOrInteger = Integer, P extends Properties = Properties> { | ||
identity: T; | ||
@@ -59,3 +62,3 @@ start: T; | ||
type: string; | ||
properties: any; | ||
properties: P; | ||
/** | ||
@@ -68,5 +71,5 @@ * @constructor | ||
* @param {string} type - Relationship type | ||
* @param {Object} properties - Map with relationship properties | ||
* @param {Properties} properties - Map with relationship properties | ||
*/ | ||
constructor(identity: T, start: T, end: T, type: string, properties: any); | ||
constructor(identity: T, start: T, end: T, type: string, properties: P); | ||
/** | ||
@@ -82,3 +85,3 @@ * @ignore | ||
*/ | ||
declare function isRelationship(obj: object): boolean; | ||
declare function isRelationship(obj: object): obj is Relationship; | ||
/** | ||
@@ -88,6 +91,6 @@ * Class for UnboundRelationship Type. | ||
*/ | ||
declare class UnboundRelationship<T extends NumberOrInteger = Integer> { | ||
declare class UnboundRelationship<T extends NumberOrInteger = Integer, P extends Properties = Properties> { | ||
identity: T; | ||
type: string; | ||
properties: any; | ||
properties: P; | ||
/** | ||
@@ -98,3 +101,3 @@ * @constructor | ||
* @param {string} type - Relationship type | ||
* @param {Object} properties - Map with relationship properties | ||
* @param {Properties} properties - Map with relationship properties | ||
*/ | ||
@@ -121,3 +124,3 @@ constructor(identity: T, type: string, properties: any); | ||
*/ | ||
declare function isUnboundRelationship(obj: object): boolean; | ||
declare function isUnboundRelationship(obj: object): obj is UnboundRelationship; | ||
/** | ||
@@ -144,3 +147,3 @@ * Class for PathSegment Type. | ||
*/ | ||
declare function isPathSegment(obj: object): boolean; | ||
declare function isPathSegment(obj: object): obj is PathSegment; | ||
/** | ||
@@ -168,3 +171,3 @@ * Class for Path Type. | ||
*/ | ||
declare function isPath(obj: object): boolean; | ||
declare function isPath(obj: object): obj is Path; | ||
export { StandardDate, NumberOrInteger, Node, isNode, Relationship, isRelationship, UnboundRelationship, isUnboundRelationship, Path, isPath, PathSegment, isPathSegment }; |
@@ -307,3 +307,3 @@ /** | ||
*/ | ||
static isInteger(obj: any): boolean; | ||
static isInteger(obj: any): obj is Integer; | ||
/** | ||
@@ -310,0 +310,0 @@ * Returns a Integer representing the given 32 bit integer value. |
@@ -97,3 +97,3 @@ /** | ||
*/ | ||
declare function isString(str: any): boolean; | ||
declare function isString(str: any): str is string; | ||
export { isEmptyObjectOrNull, isObject, isString, assertObject, assertString, assertNumber, assertNumberOrInteger, assertValidDate, validateQueryAndParameters, ENCRYPTION_ON, ENCRYPTION_OFF }; |
@@ -30,2 +30,2 @@ import { NumberOrInteger } from './graph-types'; | ||
*/ | ||
export declare function isPoint(obj?: any): boolean; | ||
export declare function isPoint(obj?: any): obj is Point; |
@@ -48,3 +48,3 @@ /** | ||
*/ | ||
export declare function isDuration(obj: object): boolean; | ||
export declare function isDuration(obj: object): obj is Duration; | ||
/** | ||
@@ -124,3 +124,3 @@ * Represents an instant capturing the time of day, but not the date, nor the timezone. | ||
*/ | ||
export declare function isTime(obj: object): boolean; | ||
export declare function isTime(obj: object): obj is Time; | ||
/** | ||
@@ -200,3 +200,3 @@ * Represents an instant capturing the date, but not the time, nor the timezone. | ||
*/ | ||
export declare function isLocalDateTime(obj: any): boolean; | ||
export declare function isLocalDateTime(obj: any): obj is LocalDateTime; | ||
/** | ||
@@ -203,0 +203,0 @@ * Represents an instant capturing the date, the time and the timezone identifier. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
400800
10257