Comparing version 0.3.3 to 0.3.4
# CHANGELOG.md | ||
## 0.3.4 | ||
###### _2019-05-30_ | ||
- Add TypeScript declaration file. @abair91 | ||
## 0.3.3 | ||
@@ -3,0 +7,0 @@ ###### _2019-05-16_ |
@@ -76,3 +76,3 @@ 'use strict'; | ||
* @async | ||
* @param {string[]} ids - Array of document identifiers | ||
* @param {string|string[]} ids - Array of document identifiers | ||
* @returns {Promise.<Model[]>} Array of model instances | ||
@@ -79,0 +79,0 @@ * @throws {InvalidParameterError} An invalid parameter was passed to the function |
@@ -33,2 +33,9 @@ 'use strict'; | ||
/** | ||
* Source of the error - always "mvom" | ||
* @member {string} source | ||
* @memberof BaseError | ||
* @instance | ||
*/ | ||
this.source = 'mvom'; | ||
/** | ||
* Name of the class that was being instantiated | ||
@@ -35,0 +42,0 @@ * @member {string} className |
49
index.js
@@ -6,8 +6,4 @@ 'use strict'; | ||
}); | ||
exports.Schema = exports.Errors = undefined; | ||
exports.createConnection = exports.Schema = exports.Errors = undefined; | ||
var _Connection = require('./Connection'); | ||
var _Connection2 = _interopRequireDefault(_Connection); | ||
var _Errors = require('./Errors'); | ||
@@ -21,10 +17,6 @@ | ||
var _InvalidParameter = require('./Errors/InvalidParameter'); | ||
var _createConnection = require('./createConnection'); | ||
var _InvalidParameter2 = _interopRequireDefault(_InvalidParameter); | ||
var _createConnection2 = _interopRequireDefault(_createConnection); | ||
var _dummyLogger = require('./utils/dummyLogger'); | ||
var _dummyLogger2 = _interopRequireDefault(_dummyLogger); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -47,33 +39,3 @@ | ||
Schema: _Schema2.default, | ||
/** | ||
* Create a new connection instance | ||
* @function createConnection | ||
* @memberof mvom | ||
* @param {string} connectionManagerUri - URI of the connection manager which faciliates access to the mv database | ||
* @param {string} account - Database account that connection will be used against | ||
* @param {Object} [options = {}] | ||
* @param {Object} [options.logger] - Logger object used for emitting log messages. winston is recommended, but any object with methods conforming to the names of the standard npm log levels will work. | ||
* @param {number} [options.cacheMaxAge=3600] - Maximum age, in seconds, of the cache of db server tier information | ||
* @param {number} [options.timeout=0] - Request timeout, in milliseconds; defaults to no timeout | ||
* @returns {Connection} Connection instance | ||
* @throws {InvalidParameterError} An invalid parameter was passed to the function | ||
*/ | ||
createConnection: (connectionManagerUri, account, { logger = _dummyLogger2.default, cacheMaxAge = 3600, timeout = 0 } = {}) => { | ||
if (connectionManagerUri == null) { | ||
throw new _InvalidParameter2.default({ parameterName: 'connectionManagerUri' }); | ||
} | ||
if (account == null) { | ||
throw new _InvalidParameter2.default({ parameterName: 'account' }); | ||
} | ||
if (!Number.isInteger(cacheMaxAge)) { | ||
throw new _InvalidParameter2.default({ parameterName: 'cacheMaxAge' }); | ||
} | ||
if (!Number.isInteger(timeout)) { | ||
throw new _InvalidParameter2.default({ parameterName: 'timeout' }); | ||
} | ||
// do some stuff | ||
return new _Connection2.default({ connectionManagerUri, account, logger, cacheMaxAge, timeout }); | ||
} | ||
createConnection: _createConnection2.default | ||
}; | ||
@@ -83,2 +45,3 @@ | ||
exports.Errors = _Errors2.default; | ||
exports.Schema = _Schema2.default; | ||
exports.Schema = _Schema2.default; | ||
exports.createConnection = _createConnection2.default; |
{ | ||
"name": "mvom", | ||
"author": "STORIS", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Multivalue Object Mapper", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
@@ -54,3 +54,3 @@ 'use strict'; | ||
* @param {Object} [definition = {}] - Data definition | ||
* @param {Number[]} [definition.path = null] - 0-indexed Array path | ||
* @param {string} [definition.path = null] - 1-index string path | ||
* @param {string} [definition.dictionary = null] - Multivalue dictionary id | ||
@@ -57,0 +57,0 @@ * @param {Boolean|Function} [definition.required = false] Indicates that a value is required when validating |
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
236095
64
3912