diff --git a/lib/ble/index.js b/lib/ble/index.js index 60b1d73..5b6b5fc 100644 --- a/lib/ble/index.js +++ b/lib/ble/index.js @@ -173,7 +173,7 @@ class BLE { bleno.on('stateChange', state => { log.info('stateChange', { state : state }) if (state === 'poweredOn') { - log.info('Starting advertising', { DEVICE_NAME: DEVICE_NAME, DEVICE_ID : process.env.BLENO_DEVICE_NAME }) + log.info('Starting advertising', { DEVICE_NAME, DEVICE_ID : process.env.BLENO_DEVICE_NAME }) bleno.startAdvertising(DEVICE_NAME, [CHAR_ID]) } else { bleno.stopAdvertising() diff --git a/lib/intval/index.js b/lib/intval/index.js index 46718d0..002c2d0 100644 --- a/lib/intval/index.js +++ b/lib/intval/index.js @@ -1,423 +1,461 @@ -'use strict' - -const db = require('../db') -const log = require('../log')('intval') -const storage = require('node-persist') -const fs = require('fs') - -let Gpio +'use strict'; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const db = require('../db'); +const log = require('../log')('intval'); +const storage = __importStar(require("node-persist")); +const fs_extra_1 = require("fs-extra"); +require("../delay"); +let Gpio; try { - Gpio = require('onoff').Gpio -} catch (e) { - log.warn('Failed including Gpio, using sim') - Gpio = require('../../lib/onoffsim').Gpio + Gpio = require('onoff').Gpio; +} +catch (e) { + log.warn('Failed including Gpio, using sim'); + Gpio = require('../../lib/onoffsim').Gpio; } - - const PINS = { - fwd : { - pin : 13, - dir : 'out' - }, - bwd : { - pin : 19, - dir : 'out' - }, - micro : { - pin : 5, - dir : 'in', - edge : 'both' - }, - release : { - pin : 6, - dir : 'in', - edge : 'both' - } + fwd: { + pin: 13, + dir: 'out' + }, + bwd: { + pin: 19, + dir: 'out' + }, + micro: { + pin: 5, + dir: 'in', + edge: 'both' + }, + release: { + pin: 6, + dir: 'in', + edge: 'both' + } +}; +/** class representing the intval3 features */ +class Intval { + constructor() { + this.STATE_DIR = '~/state'; + this._frame = { + open: 250, + openBwd: 400, + closed: 100, + expected: 530 //expected length of frame, in ms + }; + this._release = { + min: 20, + seq: 1000 + }; + this._microDelay = 10; // delay after stop signal before stopping motors + this._pin = {}; + this._state = {}; + this._init(); + } + /** + * Initialize the storage object and bind functions to process events. + */ + async _init() { + let dirExists; + try { + dirExists = await fs_extra_1.exists(this.STATE_DIR); + } + catch (err) { + log.error('init', `Error locating state directory ${this.STATE_DIR}`); + } + if (!dirExists) { + try { + await fs_extra_1.mkdir(this.STATE_DIR); + } + catch (err) { + log.error('init', `Error creating state directory ${this.STATE_DIR}`); + } + } + storage.init({ + dir: this.STATE_DIR, + stringify: JSON.stringify, + parse: JSON.parse, + encoding: 'utf8', + logging: false, + continuous: true, + interval: false, + ttl: false, + }).then(this._restoreState).catch((err) => { + log.warn('init', err); + this.reset(); + this._declarePins(); + }); + process.on('SIGINT', this._undeclarePins); + process.on('uncaughtException', this._undeclarePins); + } + /** + * Restore the state from the storage object + */ + _restoreState() { + storage.getItem('_state', 'test').then(this._setState).catch((err) => { + this._setState(); + log.error('_restoreState', err); + }); + this._declarePins(); + } + /** + * Creating the state object. + */ + _setState(data = undefined) { + if (typeof data !== 'undefined') { + this._state = data; + this._state.frame.cb = () => { }; + log.info('_setState', 'Restored intval state from disk'); + return true; + } + log.info('_setState', 'Setting state from defaults'); + this._state = { + frame: { + dir: true, + start: 0, + active: false, + paused: false, + exposure: 0, + delay: 0, + current: {}, + cb: () => { } + }, + release: { + time: 0, + active: false //is pressed + }, + micro: { + time: 0, + primed: false //is ready to stop frame + }, + counter: 0, + sequence: false + }; + this._storeState(); + } + /** + * Store the state object. + */ + _storeState() { + storage.setItem('_state', this._state) + .then(() => { }) + .catch((err) => { + log.error('_storeState', err); + }); + } + /** + * (internal function) Declares all Gpio pins that will be used. + */ + _declarePins() { + let pin; + for (let p in PINS) { + pin = PINS[p]; + if (pin.edge) + this._pin[p] = new Gpio(pin.pin, pin.dir, pin.edge); + if (!pin.edge) + this._pin[p] = new Gpio(pin.pin, pin.dir); + log.info('_declarePins', { pin: pin.pin, dir: pin.dir, edge: pin.edge }); + } + this._pin.release.watch(this._watchRelease); + } + /** + * (internal function) Undeclares all Gpio in event of uncaught error + * that interupts the node process. + */ + _undeclarePins(e) { + log.error('_undeclarePins', e); + if (!this._pin) { + log.warn('_undeclarePins', { reason: 'No pins' }); + return process.exit(); + } + log.warn('_undeclarePins', { pin: PINS.fwd.pin, val: 0, reason: 'exiting' }); + this._pin.fwd.writeSync(0); + log.warn('_undeclarePins', { pin: PINS.bwd.pin, val: 0, reason: 'exiting' }); + this._pin.bwd.writeSync(0); + this._pin.fwd.unexport(); + this._pin.bwd.unexport(); + this._pin.micro.unexport(); + this._pin.release.unexport(); + process.exit(); + } + /** + * Start motor in forward direction by setting correct pins in h-bridge + */ + _startFwd() { + this._pin.fwd.writeSync(1); + this._pin.bwd.writeSync(0); + } + /** + * Start motor in backward direction by setting correct pins in h-bridge + */ + _startBwd() { + this._pin.fwd.writeSync(0); + this._pin.bwd.writeSync(1); + } + /** + * Turn off all directions + */ + _pause() { + this._pin.fwd.writeSync(0); + this._pin.bwd.writeSync(0); + //log.info('_pause', 'frame paused') + } + /** + * Stop motor by setting both motor pins to 0 (LOW) + */ + _stop() { + const entry = {}; + const now = +new Date(); + const len = now - this._state.frame.start; + this._pin.fwd.writeSync(0); + this._pin.bwd.writeSync(0); + log.info(`_stop`, { frame: len }); + this._pin.micro.unwatch(); + this._state.frame.active = false; + if (this._state.frame.cb) + this._state.frame.cb(len); + entry.start = this._state.frame.start; + entry.stop = now; + entry.len = len; + entry.dir = this._state.frame.current.dir ? 1 : 0; + entry.exposure = this._state.frame.current.exposure; + entry.counter = this._state.counter; + entry.sequence = this._state.sequence ? 1 : 0; + db.insert(entry); + this._state.frame.current = {}; + } + /** + * Callback for watching relese switch state changes. + * Using GPIO 06 on Raspberry Pi Zero W. + * + * 1) If closed AND frame active, start timer, set state primed to `true`. + * 1) If opened AND frame active, stop frame + * + * Microswitch + 10K ohm resistor + * * 1 === open + * * 0 === closed + * + * + * @param {object} err Error object present if problem reading pin + * @param {integer} val Current value of the pin + * + */ + _watchMicro(err, val) { + const now = +new Date(); + if (err) { + log.error('_watchMicro', err); + } + //log.info(`Microswitch val: ${val}`) + //determine when to stop + if (val === 0 && this._state.frame.active) { + if (!this._state.micro.primed) { + this._state.micro.primed = true; + this._state.micro.time = now; + log.info('Microswitch primed to stop motor'); + } + } + else if (val === 1 && this._state.frame.active) { + if (this._state.micro.primed && !this._state.micro.paused && (now - this._state.frame.start) > this._frame.open) { + this._state.micro.primed = false; + this._state.micro.time = 0; + setTimeout(() => { + this._stop(); + }, this._microDelay); + } + } + } + /** + * Callback for watching relese switch state changes. + * Using GPIO 05 on Raspberry Pi Zero W. + * + * 1) If closed, start timer. + * 2) If opened, check timer AND + * 3) If `press` (`now - this._state.release.time`) greater than minimum and less than `this._release.seq`, start frame + * 4) If `press` greater than `this._release.seq`, start sequence + * + * Button + 10K ohm resistor + * * 1 === open + * * 0 === closed + * + * @param {object} err Error object present if problem reading pin + * @param {integer} val Current value of the pin + * + */ + _watchRelease(err, val) { + const now = +new Date(); + let press = 0; + if (err) { + return log.error(err); + } + //log.info(`Release switch val: ${val}`) + if (val === 0) { + //closed + if (this._releaseClosedState(now)) { + this._state.release.time = now; + this._state.release.active = true; //maybe unncecessary + } + } + else if (val === 1) { + //opened + if (this._state.release.active) { + press = now - this._state.release.time; + if (press > this._release.min && press < this._release.seq) { + this.frame(); + } + else if (press >= this._release.seq) { + this.sequence(); + } + //log.info(`Release closed for ${press}ms`) + this._state.release.time = 0; + this._state.release.active = false; + } + } + } + /** + * + */ + _releaseClosedState(now) { + if (!this._state.release.active && this._state.release.time === 0) { + return true; + } + if (this._state.release.active && (now - this._state.release.time) > (this._release.seq * 10)) { + return true; + } + return false; + } + /** + * Reset the state and store it. + */ + reset() { + this._setState(); + this._storeState(); + } + /** + * Set the default direction of the camera. + * * forward = true + * * backward = false + * + * @param {boolean} [dir=true] Direction of the camera + */ + setDir(val = true) { + if (typeof val !== 'boolean') { + return log.warn('Direction must be represented as either true or false'); + } + this._state.frame.dir = val; + this._storeState(); + log.info('setDir', { direction: val ? 'forward' : 'backward' }); + } + /** + * Set the exposure value for a single frame. + * + * @param {integer} val Length in milliseconds + */ + setExposure(val = 0) { + this._state.frame.exposure = val; + this._storeState(); + log.info('setExposure', { exposure: val }); + } + /** + * Set the delay time between each frame. + * + * @param {integer} val Length in milliseconds + */ + setDelay(val = 0) { + this._state.frame.delay = val; + this._storeState(); + log.info('setDelay', { delay: val }); + } + /** + * Set the counter to the value. + * + * @param {integer} val Frame number + */ + setCounter(val = 0) { + this._state.counter = val; + this._storeState(); + log.info('setCounter', { counter: val }); + } + /** + * Begin a single frame with set variables or defaults + * + * @param {?boolean} [dir="null"] (optional) Direction of the frame + * @param {?integer} [exposure="null"] (optional) Exposure time, 0 = minimum + * + */ + frame(dir = null, exposure = null, cb = () => { }) { + if (dir === true || (dir === null && this._state.frame.dir === true)) { + dir = true; + } + else { + dir = false; + } + if (exposure === null && this._state.frame.exposure !== 0) { + exposure = this._state.frame.exposure; + } + else if (exposure === null) { + exposure = 0; //default speed + } + this._state.frame.start = +new Date(); + this._state.frame.active = true; + this._pin.micro.watch(this._watchMicro); + log.info('frame', { dir: dir ? 'forward' : 'backward', exposure: exposure }); + if (dir) { + this._startFwd(); + } + else { + this._startBwd(); + } + if (exposure !== 0) { + this._state.frame.paused = true; + if (dir) { + setTimeout(this._pause, this._frame.open); + //log.info('frame', { pausing : time + this._frame.open }) + setTimeout(() => { + this._state.frame.paused = false; + this._startFwd(); + }, exposure + this._frame.closed); + } + else { + setTimeout(this._pause, this._frame.openBwd); + setTimeout(() => { + //log.info('frame', 'restarting') + this._state.frame.paused = false; + this._startBwd(); + }, exposure + this._frame.closed); + } + } + if (dir) { + this._state.frame.cb = (len) => { + this._state.counter++; + this._storeState(); + cb(len); + }; + } + else { + this._state.frame.cb = (len) => { + this._state.counter--; + this._storeState(); + cb(len); + }; + } + this._state.frame.current = { + dir: dir, + exposure: exposure + }; + } + /** + * + */ + status() { + return this._state; + } } - -/** Object representing the intval3 features */ -const intval = {} - -intval._frame = { - open : 250, //delay before pausing frame in open state - openBwd : 400, - closed : 100, //time that frame actually remains closed for - expected : 530 //expected length of frame, in ms -} -intval._release = { - min : 20, - seq : 1000 -} -intval._microDelay = 10 // delay after stop signal before stopping motors -intval._pin = {} - -/** - * - */ - -intval.init = function () { - if (!fs.existsSync('./state')) fs.mkdirSync('./state') - storage.init({ - dir: './state', - stringify: JSON.stringify, - parse: JSON.parse, - encoding: 'utf8', - logging: false, // can also be custom logging function - continuous: true, // continously persist to disk - interval: false, // milliseconds, persist to disk on an interval - ttl: false, // ttl* [NEW], can be true for 24h default or a number in MILLISECONDS - expiredInterval: 2 * 60 * 1000, // [NEW] every 2 minutes the process will clean-up the expired cache - forgiveParseErrors: false // [NEW] - }).then(intval._restoreState).catch((err) => { - log.warn('init', err) - intval.reset() - intval._declarePins() - }) - - process.on('SIGINT', intval._undeclarePins) - process.on('uncaughtException', intval._undeclarePins) -} - -intval._restoreState = function (res) { - storage.getItem('_state', 'test').then(intval._setState).catch((err) => { - intval._setState(undefined) - log.error('_restoreState', err) - }) - intval._declarePins() -} - -intval._setState = function (data) { - if (typeof data !== 'undefined') { - intval._state = data - intval._state.frame.cb = () => {} - log.info('_setState', 'Restored intval state from disk') - return true - } - log.info('_setState', 'Setting state from defaults') - intval._state = { - frame : { - dir : true, //forward - start : 0, //time frame started, timestamp - active : false, //should frame be running - paused : false, - exposure : 0, //length of frame exposure, in ms - delay : 0, //delay before start of frame, in ms - current : {}, //current settings - cb : () => {} - }, - release : { - time: 0, - active : false //is pressed - }, - micro : { - time : 0, - primed : false //is ready to stop frame - }, - counter : 0, - sequence : false - } - intval._storeState() -} - -intval._storeState = function () { - storage.setItem('_state', intval._state) - .then(() => {}) - .catch((err) => { - log.error('_storeState', err) - }) -} - -/** -* (internal function) Declares all Gpio pins that will be used -* -*/ -intval._declarePins = function () { - let pin - for (let p in PINS) { - pin = PINS[p] - if (pin.edge) intval._pin[p] = new Gpio(pin.pin, pin.dir, pin.edge) - if (!pin.edge) intval._pin[p] = new Gpio(pin.pin, pin.dir) - log.info('_declarePins', { pin : pin.pin, dir : pin.dir, edge : pin.edge }) - } - intval._pin.release.watch(intval._watchRelease) -} -/** -* (internal function) Undeclares all Gpio in event of uncaught error -* that interupts the node process -* -*/ -intval._undeclarePins = function (e) { - log.error(e) - if (!intval._pin) { - log.warn('_undeclarePins', { reason : 'No pins'}) - return process.exit() - } - log.warn('_undeclarePins', { pin : PINS.fwd.pin, val : 0, reason : 'exiting'}) - intval._pin.fwd.writeSync(0) - log.warn('_undeclarePins', { pin : PINS.bwd.pin, val : 0, reason : 'exiting'}) - intval._pin.bwd.writeSync(0) - intval._pin.fwd.unexport() - intval._pin.bwd.unexport() - intval._pin.micro.unexport() - intval._pin.release.unexport() - process.exit() -} -/** -* Start motor in forward direction by setting correct pins in h-bridge -* -*/ -intval._startFwd = function () { - intval._pin.fwd.writeSync(1) - intval._pin.bwd.writeSync(0) -} -/** -* Start motor in backward direction by setting correct pins in h-bridge -* -*/ -intval._startBwd = function () { - intval._pin.fwd.writeSync(0) - intval._pin.bwd.writeSync(1) -} - -intval._pause = function () { - intval._pin.fwd.writeSync(0) - intval._pin.bwd.writeSync(0) - //log.info('_pause', 'frame paused') -} -/** -* Stop motor by setting both motor pins to 0 (LOW) -* -*/ -intval._stop = function () { - const entry = {} - const now = +new Date() - const len = now - intval._state.frame.start - - intval._pin.fwd.writeSync(0) - intval._pin.bwd.writeSync(0) - - log.info(`_stop`, { frame : len }) - - intval._pin.micro.unwatch() - intval._state.frame.active = false - - if (intval._state.frame.cb) intval._state.frame.cb(len) - - entry.start = intval._state.frame.start - entry.stop = now - entry.len = len - entry.dir = intval._state.frame.current.dir ? 1 : 0 - entry.exposure = intval._state.frame.current.exposure - entry.counter = intval._state.counter - entry.sequence = intval._state.sequence ? 1 : 0 - - db.insert(entry) - - intval._state.frame.current = {} -} -/** -* Callback for watching relese switch state changes. -* Using GPIO 06 on Raspberry Pi Zero W. -* -* 1) If closed AND frame active, start timer, set state primed to `true`. -* 1) If opened AND frame active, stop frame -* -* Microswitch + 10K ohm resistor -* * 1 === open -* * 0 === closed -* -* -* @param {object} err Error object present if problem reading pin -* @param {integer} val Current value of the pin -* -*/ -intval._watchMicro = function (err, val) { - const now = +new Date() - if (err) { - log.error('_watchMicro', err) - } - //log.info(`Microswitch val: ${val}`) - //determine when to stop - if (val === 0 && intval._state.frame.active) { - if (!intval._state.micro.primed) { - intval._state.micro.primed = true - intval._state.micro.time = now - log.info('Microswitch primed to stop motor') - } - } else if (val === 1 && intval._state.frame.active) { - if (intval._state.micro.primed && !intval._state.micro.paused && (now - intval._state.frame.start) > intval._frame.open) { - intval._state.micro.primed = false - intval._state.micro.time = 0 - setTimeout( () => { - intval._stop() - }, intval._microDelay) - } - } -} -/** -* Callback for watching relese switch state changes. -* Using GPIO 05 on Raspberry Pi Zero W. -* -* 1) If closed, start timer. -* 2) If opened, check timer AND -* 3) If `press` (`now - intval._state.release.time`) greater than minimum and less than `intval._release.seq`, start frame -* 4) If `press` greater than `intval._release.seq`, start sequence -* -* Button + 10K ohm resistor -* * 1 === open -* * 0 === closed -* -* @param {object} err Error object present if problem reading pin -* @param {integer} val Current value of the pin -* -*/ -intval._watchRelease = function (err, val) { - const now = +new Date() - let press = 0 - if (err) { - return log.error(err) - } - //log.info(`Release switch val: ${val}`) - if (val === 0) { - //closed - if (intval._releaseClosedState(now)) { - intval._state.release.time = now - intval._state.release.active = true //maybe unncecessary - } - } else if (val === 1) { - //opened - if (intval._state.release.active) { - press = now - intval._state.release.time - if (press > intval._release.min && press < intval._release.seq) { - intval.frame() - } else if (press >= intval._release.seq) { - intval.sequence() - } - //log.info(`Release closed for ${press}ms`) - intval._state.release.time = 0 - intval._state.release.active = false - } - } -} - -intval._releaseClosedState = function (now) { - if (!intval._state.release.active && intval._state.release.time === 0) { - return true - } - if (intval._state.release.active && (now - intval._state.release.time) > (intval._release.seq * 10)) { - return true - } - return false -} - -intval.reset = function () { - intval._setState() - intval._storeState() -} - -/** -* Set the default direction of the camera. -* * forward = true -* * backward = false -* -* @param {boolean} [dir=true] Direction of the camera -* -*/ -intval.setDir = function (val = true) { - if (typeof val !== 'boolean') { - return log.warn('Direction must be represented as either true or false') - } - intval._state.frame.dir = val - intval._storeState() - log.info('setDir', { direction : val ? 'forward' : 'backward' }) -} - -intval.setExposure = function (val = 0) { - intval._state.frame.exposure = val - intval._storeState() - log.info('setExposure', { exposure : val }) -} - -intval.setDelay = function (val = 0) { - intval._state.frame.delay = val - intval._storeState() - log.info('setDelay', { delay : val }) -} -intval.setCounter = function (val = 0) { - intval._state.counter = val - intval._storeState() - log.info('setCounter', { counter : val }) -} -/** -* Begin a single frame with set variables or defaults -* -* @param {?boolean} [dir="null"] (optional) Direction of the frame -* @param {?integer} [exposure="null"] (optional) Exposure time, 0 = minimum -* -*/ -intval.frame = function (dir = null, exposure = null, cb = () => {}) { - if (dir === true || (dir === null && intval._state.frame.dir === true) ) { - dir = true - } else { - dir = false - } - - if (exposure === null && intval._state.frame.exposure !== 0) { - exposure = intval._state.frame.exposure - } else if (exposure === null) { - exposure = 0 //default speed - } - - intval._state.frame.start = +new Date() - intval._state.frame.active = true - intval._pin.micro.watch(intval._watchMicro) - - log.info('frame', {dir : dir ? 'forward' : 'backward', exposure : exposure}) - - if (dir) { - intval._startFwd() - } else { - intval._startBwd() - } - if (exposure !== 0) { - intval._state.frame.paused = true - if (dir) { - setTimeout(intval._pause, intval._frame.open) - //log.info('frame', { pausing : time + intval._frame.open }) - setTimeout( () => { - intval._state.frame.paused = false - intval._startFwd() - }, exposure + intval._frame.closed) - } else { - setTimeout(intval._pause, intval._frame.openBwd) - setTimeout( () => { - //log.info('frame', 'restarting') - intval._state.frame.paused = false - intval._startBwd() - }, exposure + intval._frame.closed) - } - } - if (dir) { - intval._state.frame.cb = (len) => { - intval._state.counter++ - intval._storeState() - cb(len) - } - } else { - intval._state.frame.cb = (len) => { - intval._state.counter-- - intval._storeState() - cb(len) - } - } - intval._state.frame.current = { - dir: dir, - exposure: exposure - } -} - -intval.status = function () { - return intval._state -} - -module.exports = intval \ No newline at end of file +module.exports = new Intval(); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/intval/index.js.map b/lib/intval/index.js.map new file mode 100644 index 0000000..0a5151c --- /dev/null +++ b/lib/intval/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/intval/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;;;AAEZ,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;AACxC,sDAAwC;AACxC,uCAAyC;AACzC,oBAAkB;AAElB,IAAI,IAAU,CAAA;AACd,IAAI;IACH,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAA;CAC5B;AAAC,OAAO,CAAC,EAAE;IACX,GAAG,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;IAC5C,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAA;CACzC;AAGD,MAAM,IAAI,GAAG;IACZ,GAAG,EAAG;QACL,GAAG,EAAG,EAAE;QACR,GAAG,EAAG,KAAK;KACX;IACD,GAAG,EAAG;QACL,GAAG,EAAG,EAAE;QACR,GAAG,EAAG,KAAK;KACX;IACD,KAAK,EAAG;QACP,GAAG,EAAG,CAAC;QACP,GAAG,EAAG,IAAI;QACV,IAAI,EAAG,MAAM;KACb;IACD,OAAO,EAAG;QACT,GAAG,EAAG,CAAC;QACP,GAAG,EAAI,IAAI;QACX,IAAI,EAAG,MAAM;KACb;CACD,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,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aAClC;iBAAM;gBACN,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC7C,UAAU,CAAE,GAAG,EAAE;oBAChB,iCAAiC;oBACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;oBACjC,IAAI,CAAC,SAAS,EAAE,CAAC;gBAClB,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aAClC;SACD;QACD,IAAI,GAAG,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,GAAY,EAAE,EAAE;gBACvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACtB,IAAI,CAAC,WAAW,EAAE,CAAC;gBACnB,EAAE,CAAC,GAAG,CAAC,CAAC;YACT,CAAC,CAAA;SACD;aAAM;YACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,GAAY,EAAE,EAAE;gBACvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACtB,IAAI,CAAC,WAAW,EAAE,CAAC;gBACnB,EAAE,CAAC,GAAG,CAAC,CAAC;YACT,CAAC,CAAA;SACD;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG;YAC3B,GAAG,EAAE,GAAG;YACR,QAAQ,EAAE,QAAQ;SAClB,CAAA;IACF,CAAC;IAED;;OAEG;IAEI,MAAM;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/sequence/index.js b/lib/sequence/index.js index cdd8164..7bd06bb 100644 --- a/lib/sequence/index.js +++ b/lib/sequence/index.js @@ -1,43 +1,50 @@ 'use strict'; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -const uuid = require('uuid').v4; +const v4_1 = __importDefault(require("uuid/v4")); const log = require('../log')('seq'); require("../delay"); /** Object sequence features */ class Sequence { constructor() { this._state = { - arr: [], - active: false, - paused: false, - frame: false, - delay: false, - count: 0, - stop: null + arr: [] }; + this.active = false; + this.paused = false; + this.frame = false; + this.delay = false; + this.count = 0; + this._stop = null; this._loop = { arr: [], count: 0, max: 0 }; this.stop = function () { - this._state.active = false; - this._state.count = 0; + this.active = false; + this.count = 0; this._state.arr = []; this._loop.count = 0; this._loop.max = 0; this._loop.arr = []; - if (this._state.stop) - this._state.stop(); - this._state.stop = null; + if (this._stop) + this._stop(); + this._stop = null; }; } + /** + * Start running a "sequence" of frames. Shoots a continuous sequence + * of single frames with a delay in between each one. + **/ start(options, cb) { if (this._state.active) { return false; } - this._state.active = true; - this._state.count = 0; + this.active = true; + this.count = 0; if (options.arr) { this._state.arr = options.arr; } @@ -51,44 +58,44 @@ class Sequence { else { this._loop.max = 0; } - this._state.stop = cb; + this._stop = cb; this.step(); - this._state.id = uuid(); - return this._state.id; + this.id = v4_1.default(); + return this.id; } setStop() { - this._state.active = false; + this.active = false; } pause() { - this._state.paused = true; + this.paused = true; } resume() { - this._state.paused = false; + this.paused = false; this.step(); } step() { - if (this._state.active && !this._state.paused) { + if (this.active && !this.paused) { if (this._state.arr.length > 0) { - if (this._state.count > this._state.arr.length - 1) { + if (this.count > this._state.arr.length - 1) { return this.stop(); } - log.info('step', { count: this._state.count, id: this._state.id }); - return this._state.arr[this._state.count](() => { - this._state.count++; + log.info('step', { count: this.count, id: this._state.id }); + return this._state.arr[this.count](() => { + this.count++; this.step(); }); } else if (this._loop.arr.length > 0) { - if (this._state.count > this._loop.arr.length - 1) { - this._state.count = 0; + if (this.count > this._loop.arr.length - 1) { + this.count = 0; this._loop.count++; } if (this._loop.max > 0 && this._loop.count > this._loop.max) { return this.stop(); } - log.info('step', { count: this._state.count, id: this._state.id }); - return this._loop.arr[this._state.count](() => { - this._state.count++; + log.info('step', { count: this.count, id: this.id }); + return this._loop.arr[this.count](() => { + this.count++; this.step(); }); } @@ -96,11 +103,11 @@ class Sequence { return this.stop(); } } - else if (this._state.paused) { - log.info('step', 'Sequence paused', { loop: this._loop.count, count: this._state.count }); + else if (this.paused) { + log.info('step', 'Sequence paused', { loop: this._loop.count, count: this.count }); } - else if (!this._state.active) { - log.info('step', 'Sequence stopped', { loop: this._loop.count, count: this._state.count }); + else if (!this.active) { + log.info('step', 'Sequence stopped', { loop: this._loop.count, count: this.count }); } } } diff --git a/lib/sequence/index.js.map b/lib/sequence/index.js.map index 3dc8814..ad64c2d 100644 --- a/lib/sequence/index.js.map +++ b/lib/sequence/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sequence/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAA;AAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA;AACpC,oBAAiB;AAEjB,+BAA+B;AAC/B,MAAM,QAAQ;IAiBb;QAhBO,WAAM,GAAS;YACrB,GAAG,EAAG,EAAE;YACR,MAAM,EAAG,KAAK;YACd,MAAM,EAAG,KAAK;YACd,KAAK,EAAE,KAAK;YACZ,KAAK,EAAG,KAAK;YACb,KAAK,EAAG,CAAC;YACT,IAAI,EAAG,IAAI;SACX,CAAA;QAEM,UAAK,GAAS;YACpB,GAAG,EAAG,EAAE;YACR,KAAK,EAAG,CAAC;YACT,GAAG,EAAG,CAAC;SACP,CAAA;QAsCM,SAAI,GAAG;YACb,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAA;YAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,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AAE,EAAE,IAAI,EAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;SACpF;aAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,kBAAkB,EAAE,EAAE,IAAI,EAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;SACrF;IACF,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7656354..f0dd626 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,9 +15,9 @@ "resolved": "https://registry.npmjs.org/@netflix/nerror/-/nerror-1.1.2.tgz", "integrity": "sha512-c01MmkM3Oi0BkTV4odMpr+58uXlxRKUPcu1ONR+sU3YAFAW4pP1j2b0opS9jX+an3ldpBJtiompzAEFZdlc8YQ==", "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.4.0", - "lodash": "4.17.15" + "assert-plus": "^1.0.0", + "extsprintf": "^1.4.0", + "lodash": "^4.17.15" }, "dependencies": { "extsprintf": { @@ -32,12 +32,46 @@ } } }, + "@types/fs-extra": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.0.0.tgz", + "integrity": "sha512-bCtL5v9zdbQW86yexOlXWTEGvLNqWxMFyi7gQA7Gcthbezr2cPSOb8SkESVKA937QD5cIwOFLDFt0MQoXOEr9Q==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/node": { "version": "12.7.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.12.tgz", "integrity": "sha512-KPYGmfD0/b1eXurQ59fXD1GBzhSQfz6/lKBxkaHX9dKTzjXbK68Zt7yGUxUsCS1jeTy/8aL+d9JEr+S54mpkWQ==", "dev": true }, + "@types/node-persist": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/node-persist/-/node-persist-0.0.33.tgz", + "integrity": "sha512-JY/aQpndK6Nb/9ccfAaptSgzUpZp2VXillSXNrD40CURfFACWTMyGnFYzz4L44iKu7CTIg6hqjRZbBCr60URdw==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/q": "^0" + } + }, + "@types/q": { + "version": "0.0.37", + "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.37.tgz", + "integrity": "sha512-vjFGX1zMTMz/kUp3xgfJcxMVLkMWVMrdlyc0RwVyve1y9jxwqNaT8wTcv6M51ylq2a/zn5lm8g7qPSoIS4uvZQ==", + "dev": true + }, + "@types/uuid": { + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.5.tgz", + "integrity": "sha512-MNL15wC3EKyw1VLF+RoVO4hJJdk9t/Hlv3rt1OL65Qvuadm4BYo6g9ZJQqoq7X8NBFSsQXgAujWciovh2lpVjA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -48,10 +82,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ansi-escape-sequences": { @@ -60,7 +94,7 @@ "integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==", "dev": true, "requires": { - "array-back": "3.1.0" + "array-back": "^3.0.1" }, "dependencies": { "array-back": { @@ -86,8 +120,8 @@ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "argparse": { @@ -96,7 +130,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "array-back": { @@ -110,7 +144,7 @@ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "~2.1.0" } }, "assert-plus": { @@ -123,7 +157,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "requires": { - "lodash": "4.17.15" + "lodash": "^4.17.11" } }, "asynckit": { @@ -151,7 +185,7 @@ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "bindings": { @@ -167,10 +201,10 @@ "resolved": "https://registry.npmjs.org/bleno/-/bleno-0.5.0.tgz", "integrity": "sha1-gLZM4yrZAhJnkBZmEYOCM9gpI5Y=", "requires": { - "bluetooth-hci-socket": "0.5.1", + "bluetooth-hci-socket": "^0.5.1", "bplist-parser": "0.0.6", - "debug": "2.6.9", - "xpc-connection": "0.1.4" + "debug": "^2.2.0", + "xpc-connection": "~0.1.4" } }, "bluebird": { @@ -185,9 +219,9 @@ "integrity": "sha1-774hUk/Bz10/rl1RNl1WHUq77Qs=", "optional": true, "requires": { - "debug": "2.6.9", - "nan": "2.12.1", - "usb": "1.5.0" + "debug": "^2.2.0", + "nan": "^2.0.5", + "usb": "^1.1.0" } }, "bplist-parser": { @@ -201,7 +235,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -210,10 +244,10 @@ "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", "integrity": "sha1-8VDw9nSKvdcq6uhPBEA74u8RN5c=", "requires": { - "dtrace-provider": "0.8.8", - "moment": "2.24.0", - "mv": "2.1.1", - "safe-json-stringify": "1.2.0" + "dtrace-provider": "~0.8", + "moment": "^2.10.6", + "mv": "~2", + "safe-json-stringify": "~1" } }, "cache-point": { @@ -222,9 +256,9 @@ "integrity": "sha512-4TgWfe9SF+bUy5cCql8gWHqKNrviufNwSYxLjf2utB0pY4+bdcuFwMmY1hDB+67Gz/L1vmhFNhePAjJTFBtV+Q==", "dev": true, "requires": { - "array-back": "2.0.0", - "fs-then-native": "2.0.0", - "mkdirp2": "1.0.4" + "array-back": "^2.0.0", + "fs-then-native": "^2.0.0", + "mkdirp2": "^1.0.3" }, "dependencies": { "array-back": { @@ -233,7 +267,7 @@ "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.1" } } } @@ -249,7 +283,7 @@ "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", "dev": true, "requires": { - "lodash": "4.17.15" + "lodash": "^4.17.14" }, "dependencies": { "lodash": { @@ -281,8 +315,8 @@ "integrity": "sha512-0y0rBgoX8IzIjBAUnO73SEtSb4Mhk3IoceWJq5zZSxb9mWORhWH8xLYo4EDSOE1jRBk1LhmfjqWFFt10h/+MEA==", "dev": true, "requires": { - "stream-connect": "1.0.2", - "stream-via": "1.0.4" + "stream-connect": "^1.0.2", + "stream-via": "^1.0.4" } }, "color": { @@ -290,8 +324,8 @@ "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", "requires": { - "color-convert": "1.9.3", - "color-string": "1.5.3" + "color-convert": "^1.9.1", + "color-string": "^1.5.2" } }, "color-convert": { @@ -312,8 +346,8 @@ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", "requires": { - "color-name": "1.1.3", - "simple-swizzle": "0.2.2" + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" } }, "colornames": { @@ -331,8 +365,8 @@ "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.1.tgz", "integrity": "sha512-pI3btWyiuz7Ken0BWh9Elzsmv2bM9AhA7psXib4anUXy/orfZ/E0MbQwhSOG/9L8hLlalqrU0UhOuqxW1YjmVw==", "requires": { - "color": "3.0.0", - "text-hex": "1.0.0" + "color": "3.0.x", + "text-hex": "1.0.x" } }, "combined-stream": { @@ -340,7 +374,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "command-line-args": { @@ -349,10 +383,10 @@ "integrity": "sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg==", "dev": true, "requires": { - "array-back": "3.1.0", - "find-replace": "3.0.0", - "lodash.camelcase": "4.3.0", - "typical": "4.0.0" + "array-back": "^3.0.1", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" }, "dependencies": { "array-back": { @@ -375,11 +409,11 @@ "integrity": "sha512-Xw18HVx/QzQV3Sc5k1vy3kgtOeGmsKIqwtFFoyjI4bbcpSgnw2CWVULvtakyw4s6fhyAdI6soQQhXc2OzJy62g==", "dev": true, "requires": { - "ansi-escape-sequences": "4.1.0", - "array-back": "2.0.0", - "command-line-args": "5.1.1", - "command-line-usage": "4.1.0", - "typical": "2.6.1" + "ansi-escape-sequences": "^4.0.0", + "array-back": "^2.0.0", + "command-line-args": "^5.0.0", + "command-line-usage": "^4.1.0", + "typical": "^2.6.1" }, "dependencies": { "array-back": { @@ -388,7 +422,7 @@ "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.1" } } } @@ -399,10 +433,10 @@ "integrity": "sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g==", "dev": true, "requires": { - "ansi-escape-sequences": "4.1.0", - "array-back": "2.0.0", - "table-layout": "0.4.5", - "typical": "2.6.1" + "ansi-escape-sequences": "^4.0.0", + "array-back": "^2.0.0", + "table-layout": "^0.4.2", + "typical": "^2.6.1" }, "dependencies": { "array-back": { @@ -411,7 +445,7 @@ "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.1" } } } @@ -440,7 +474,7 @@ "integrity": "sha1-ZnZjWQUFooO/JqSE1oSJ10xUhdo=", "dev": true, "requires": { - "walk-back": "2.0.1" + "walk-back": "^2.0.1" }, "dependencies": { "walk-back": { @@ -466,7 +500,7 @@ "resolved": "https://registry.npmjs.org/cron/-/cron-1.7.2.tgz", "integrity": "sha512-+SaJ2OfeRvfQqwXQ2kgr0Y5pzBR/lijf5OpnnaruwWnmI799JfWr2jN2ItOV9s3A/+TFOt6mxvKzQq5F0Jp6VQ==", "requires": { - "moment-timezone": "0.5.26" + "moment-timezone": "^0.5.x" } }, "csv": { @@ -474,10 +508,10 @@ "resolved": "https://registry.npmjs.org/csv/-/csv-5.1.3.tgz", "integrity": "sha512-uHPF5nxxFgcBQ/Mkicjh+IcQJeooIcN8gS/5mnvIdIccLh3Qf792jXE00ovdYDmABhE0yTMNCZgx3ZsBrR2GoQ==", "requires": { - "csv-generate": "3.2.3", - "csv-parse": "4.6.3", - "csv-stringify": "5.3.3", - "stream-transform": "2.0.1" + "csv-generate": "^3.2.3", + "csv-parse": "^4.4.6", + "csv-stringify": "^5.3.3", + "stream-transform": "^2.0.1" } }, "csv-generate": { @@ -490,7 +524,7 @@ "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.6.3.tgz", "integrity": "sha512-pAxEb5kabSaKEwqSXv7vpq6eucXQgY67MLpeLwnYCd21YjTD5OCIIIXGKyUKN/uNQNnzW/elNfxJfozQ1EjB/g==", "requires": { - "pad": "3.2.0" + "pad": "^3.2.0" } }, "csv-stringify": { @@ -503,7 +537,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "debug": { @@ -524,7 +558,7 @@ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "requires": { - "clone": "1.0.4" + "clone": "^1.0.2" } }, "delayed-stream": { @@ -562,9 +596,9 @@ "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", "requires": { - "colorspace": "1.1.1", - "enabled": "1.0.2", - "kuler": "1.0.1" + "colorspace": "1.1.x", + "enabled": "1.0.x", + "kuler": "1.0.x" } }, "dmd": { @@ -573,18 +607,18 @@ "integrity": "sha512-ZbHUPKUp5Tl8nVVMZw8rc/MQmFVKusvfR10X/lPAXjBUc/LRW7AaXnYrK2LnVIPfTGEw7T6OmsxkvNRX7GnjIQ==", "dev": true, "requires": { - "array-back": "4.0.0", - "cache-point": "0.4.1", - "common-sequence": "1.0.2", - "file-set": "2.0.1", - "handlebars": "4.4.3", - "marked": "0.7.0", - "object-get": "2.1.0", - "reduce-flatten": "2.0.0", - "reduce-unique": "2.0.1", - "reduce-without": "1.0.1", - "test-value": "3.0.0", - "walk-back": "3.0.1" + "array-back": "^4.0.0", + "cache-point": "^0.4.1", + "common-sequence": "^1.0.2", + "file-set": "^2.0.1", + "handlebars": "^4.2.0", + "marked": "^0.7.0", + "object-get": "^2.1.0", + "reduce-flatten": "^2.0.0", + "reduce-unique": "^2.0.1", + "reduce-without": "^1.0.1", + "test-value": "^3.0.0", + "walk-back": "^3.0.1" }, "dependencies": { "reduce-flatten": { @@ -601,7 +635,7 @@ "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", "optional": true, "requires": { - "nan": "2.14.0" + "nan": "^2.14.0" }, "dependencies": { "nan": { @@ -622,8 +656,8 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { - "jsbn": "0.1.1", - "safer-buffer": "2.1.2" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "ee-first": { @@ -636,7 +670,7 @@ "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", "requires": { - "env-variable": "0.0.5" + "env-variable": "0.0.x" } }, "encodeurl": { @@ -660,8 +694,8 @@ "resolved": "https://registry.npmjs.org/epoll/-/epoll-3.0.0.tgz", "integrity": "sha512-Cr4yBZUkoKeTfi9Vr+7h1VhUYPP6t9f1/jgJOmEc2UEcWQqEOr5c4jdM0htJf+uB6KTGffDZGyR1UUUoclTwMQ==", "requires": { - "bindings": "1.5.0", - "nan": "2.14.0" + "bindings": "^1.5.0", + "nan": "^2.14.0" }, "dependencies": { "nan": { @@ -702,7 +736,7 @@ "resolved": "https://registry.npmjs.org/ewma/-/ewma-2.0.1.tgz", "integrity": "sha512-MYYK17A76cuuyvkR7MnqLW4iFYPEi5Isl2qb8rXiWpLiwFS9dxW/rncuNnjjgSENuVqZQkIuR4+DChVL4g1lnw==", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "extend": { @@ -746,8 +780,8 @@ "integrity": "sha512-XgOUUpgR6FbbfYcniLw0qm1Am7PnNYIAkd+eXxRt42LiYhjaso0WiuQ+VmrNdtwotyM+cLCfZ56AZrySP3QnKA==", "dev": true, "requires": { - "array-back": "2.0.0", - "glob": "7.1.3" + "array-back": "^2.0.0", + "glob": "^7.1.3" }, "dependencies": { "array-back": { @@ -756,7 +790,7 @@ "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.1" } } } @@ -771,9 +805,9 @@ "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.2.1.tgz", "integrity": "sha512-pzZA9/PlhDGG5PRzmd4vH4AbKW7FO68RE7q2I3NzjJHcVPukYbDA7bPdArg7ySKfS6pKki+qhrawFoN6aNZfjA==", "requires": { - "fast-decode-uri-component": "1.0.1", - "safe-regex2": "2.0.0", - "semver-store": "0.3.0" + "fast-decode-uri-component": "^1.0.0", + "safe-regex2": "^2.0.0", + "semver-store": "^0.3.0" } }, "find-replace": { @@ -782,7 +816,7 @@ "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", "dev": true, "requires": { - "array-back": "3.1.0" + "array-back": "^3.0.1" }, "dependencies": { "array-back": { @@ -803,9 +837,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.8", - "mime-types": "2.1.24" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" } }, "formidable": { @@ -818,12 +852,22 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "fs-minipass": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "requires": { - "minipass": "2.3.5" + "minipass": "^2.2.1" } }, "fs-then-native": { @@ -842,14 +886,14 @@ "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, "getpass": { @@ -857,7 +901,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "glob": { @@ -865,19 +909,18 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "graceful-fs": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", - "dev": true + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" }, "handle-thing": { "version": "2.0.0", @@ -890,10 +933,10 @@ "integrity": "sha512-B0W4A2U1ww3q7VVthTKfh+epHx+q4mCt6iK+zEAzbMBpWQAwxCeKxEGpj/1oQTpzPXDNSOG7hmG14TsISH50yw==", "dev": true, "requires": { - "neo-async": "2.6.1", - "optimist": "0.6.1", - "source-map": "0.6.1", - "uglify-js": "3.6.1" + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" } }, "har-schema": { @@ -906,8 +949,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "requires": { - "ajv": "6.10.2", - "har-schema": "2.0.0" + "ajv": "^6.5.5", + "har-schema": "^2.0.0" } }, "has-unicode": { @@ -920,10 +963,10 @@ "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", "requires": { - "inherits": "2.0.3", - "obuf": "1.1.2", - "readable-stream": "2.3.6", - "wbuf": "1.7.3" + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" } }, "http-deceiver": { @@ -936,10 +979,10 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { - "depd": "1.1.2", + "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": "1.4.0" + "statuses": ">= 1.4.0 < 2" } }, "http-signature": { @@ -947,9 +990,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.16.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { @@ -957,7 +1000,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore-walk": { @@ -965,7 +1008,7 @@ "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.4" } }, "inflight": { @@ -973,8 +1016,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -997,7 +1040,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-stream": { @@ -1030,7 +1073,7 @@ "resolved": "https://registry.npmjs.org/js-queue/-/js-queue-2.0.0.tgz", "integrity": "sha1-NiITz4YPRo8BJfxslqvBdCUx+Ug=", "requires": { - "easy-stack": "1.0.0" + "easy-stack": "^1.0.0" } }, "js-reporters": { @@ -1045,7 +1088,7 @@ "integrity": "sha512-WuNgdZOXVmBk5kUPMcTcVUpbGRzLfNkv7+7APq7WiDihpXVKrgxo6wwRpRl9OQeEBgKCVk9mR7RbzrnNWC8oBw==", "dev": true, "requires": { - "xmlcreate": "2.0.1" + "xmlcreate": "^2.0.0" } }, "jsbn": { @@ -1059,20 +1102,20 @@ "integrity": "sha512-Yf1ZKA3r9nvtMWHO1kEuMZTlHOF8uoQ0vyo5eH7SQy5YeIiHM+B0DgKnn+X6y6KDYZcF7G2SPkKF+JORCXWE/A==", "dev": true, "requires": { - "@babel/parser": "7.6.4", - "bluebird": "3.7.0", - "catharsis": "0.8.11", - "escape-string-regexp": "2.0.0", - "js2xmlparser": "4.0.0", - "klaw": "3.0.0", - "markdown-it": "8.4.2", - "markdown-it-anchor": "5.2.4", - "marked": "0.7.0", - "mkdirp": "0.5.1", - "requizzle": "0.2.3", - "strip-json-comments": "3.0.1", + "@babel/parser": "^7.4.4", + "bluebird": "^3.5.4", + "catharsis": "^0.8.11", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.0", + "klaw": "^3.0.0", + "markdown-it": "^8.4.2", + "markdown-it-anchor": "^5.0.2", + "marked": "^0.7.0", + "mkdirp": "^0.5.1", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.0.1", "taffydb": "2.6.2", - "underscore": "1.9.1" + "underscore": "~1.9.1" }, "dependencies": { "strip-json-comments": { @@ -1089,15 +1132,15 @@ "integrity": "sha512-7F/FR1DCRmRFlyuccpeRwW/4H5GtUD9detREDO/gxLjyEaVfRdD1JDzwZ4tMg32f0jP97PCDTy9CdSr8mW0txQ==", "dev": true, "requires": { - "array-back": "4.0.0", - "cache-point": "0.4.1", - "collect-all": "1.0.3", - "file-set": "2.0.1", - "fs-then-native": "2.0.0", - "jsdoc": "3.6.3", - "object-to-spawn-args": "1.1.1", - "temp-path": "1.0.0", - "walk-back": "3.0.1" + "array-back": "^4.0.0", + "cache-point": "^0.4.1", + "collect-all": "^1.0.3", + "file-set": "^2.0.1", + "fs-then-native": "^2.0.0", + "jsdoc": "^3.6.3", + "object-to-spawn-args": "^1.1.1", + "temp-path": "^1.0.0", + "walk-back": "^3.0.1" } }, "jsdoc-parse": { @@ -1106,12 +1149,12 @@ "integrity": "sha512-qIObw8yqYZjrP2qxWROB5eLQFLTUX2jRGLhW9hjo2CC2fQVlskidCIzjCoctwsDvauBp2a/lR31jkSleczSo8Q==", "dev": true, "requires": { - "array-back": "4.0.0", - "lodash.omit": "4.5.0", - "lodash.pick": "4.4.0", - "reduce-extract": "1.0.0", - "sort-array": "2.0.0", - "test-value": "3.0.0" + "array-back": "^4.0.0", + "lodash.omit": "^4.5.0", + "lodash.pick": "^4.4.0", + "reduce-extract": "^1.0.0", + "sort-array": "^2.0.0", + "test-value": "^3.0.0" } }, "jsdoc-to-markdown": { @@ -1120,13 +1163,13 @@ "integrity": "sha512-Rcs9/3+NO1odClVhLDk0lDNFe11RiYUHh/PnROT5QU2Fpad2zBESmJD+DcmeK7lg1jalFfGG1MKOGuJHs27jsA==", "dev": true, "requires": { - "array-back": "4.0.0", - "command-line-tool": "0.8.0", - "config-master": "3.1.0", - "dmd": "4.0.4", - "jsdoc-api": "5.0.3", - "jsdoc-parse": "4.0.1", - "walk-back": "3.0.1" + "array-back": "^4.0.0", + "command-line-tool": "^0.8.0", + "config-master": "^3.1.0", + "dmd": "^4.0.4", + "jsdoc-api": "^5.0.3", + "jsdoc-parse": "^4.0.1", + "walk-back": "^3.0.1" } }, "json-schema": { @@ -1144,6 +1187,14 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -1161,7 +1212,7 @@ "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", "dev": true, "requires": { - "graceful-fs": "4.2.2" + "graceful-fs": "^4.1.9" } }, "kuler": { @@ -1169,7 +1220,7 @@ "resolved": "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz", "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", "requires": { - "colornames": "1.1.1" + "colornames": "^1.1.1" } }, "linkify-it": { @@ -1178,7 +1229,7 @@ "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", "dev": true, "requires": { - "uc.micro": "1.0.6" + "uc.micro": "^1.0.1" } }, "lodash": { @@ -1220,11 +1271,11 @@ "resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz", "integrity": "sha512-+lZh4OpERDBLqjiwDLpAWNQu6KMjnlXH2ByZwCuSqVPJletw0kTWJf5CgSNAUKn1KUkv3m2cUz/LK8zyEy7wzQ==", "requires": { - "colors": "1.3.3", - "fast-safe-stringify": "2.0.6", - "fecha": "2.3.3", - "ms": "2.1.1", - "triple-beam": "1.3.0" + "colors": "^1.2.1", + "fast-safe-stringify": "^2.0.4", + "fecha": "^2.3.3", + "ms": "^2.1.1", + "triple-beam": "^1.3.0" }, "dependencies": { "ms": { @@ -1239,7 +1290,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "requires": { - "yallist": "3.0.3" + "yallist": "^3.0.2" } }, "markdown-it": { @@ -1248,11 +1299,11 @@ "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", "dev": true, "requires": { - "argparse": "1.0.10", - "entities": "1.1.2", - "linkify-it": "2.2.0", - "mdurl": "1.0.1", - "uc.micro": "1.0.6" + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" } }, "markdown-it-anchor": { @@ -1301,7 +1352,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -1314,8 +1365,8 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" } }, "minizlib": { @@ -1323,7 +1374,7 @@ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "requires": { - "minipass": "2.3.5" + "minipass": "^2.2.1" } }, "mixme": { @@ -1355,7 +1406,7 @@ "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.26.tgz", "integrity": "sha512-sFP4cgEKTCymBBKgoxZjYzlSovC20Y6J7y3nanDc5RoBIXKlZhoYwBoZGe3flwU6A372AcRwScH8KiwV6zjy1g==", "requires": { - "moment": "2.24.0" + "moment": ">= 2.9.0" } }, "ms": { @@ -1369,9 +1420,9 @@ "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", "optional": true, "requires": { - "mkdirp": "0.5.1", - "ncp": "2.0.0", - "rimraf": "2.4.5" + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "rimraf": "~2.4.0" }, "dependencies": { "glob": { @@ -1380,11 +1431,11 @@ "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", "optional": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "rimraf": { @@ -1393,7 +1444,7 @@ "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", "optional": true, "requires": { - "glob": "6.0.4" + "glob": "^6.0.1" } } } @@ -1414,9 +1465,9 @@ "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.24", - "sax": "1.2.4" + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" } }, "negotiator": { @@ -1445,7 +1496,7 @@ "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-3.0.5.tgz", "integrity": "sha512-zJmBA58kI9QAxXLMc4NLswgzXVIqKfsfQtiySMF6eEQ3kVvoM3YHzcP0//L9u30Fqx3cYe1FL/a+fyB3VwO/oQ==", "requires": { - "mkdirp": "0.5.1" + "mkdirp": "~0.5.1" } }, "node-pre-gyp": { @@ -1453,16 +1504,16 @@ "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.4", - "nopt": "4.0.1", - "npm-packlist": "1.4.1", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.3", - "semver": "5.6.0", - "tar": "4.4.8" + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" } }, "node-watch": { @@ -1476,8 +1527,8 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" + "abbrev": "1", + "osenv": "^0.1.4" } }, "npm-bundled": { @@ -1490,8 +1541,8 @@ "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.6" + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" } }, "npmlog": { @@ -1499,10 +1550,10 @@ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "number-is-nan": { @@ -1550,7 +1601,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "one-time": { @@ -1563,8 +1614,8 @@ "resolved": "https://registry.npmjs.org/onoff/-/onoff-5.0.0.tgz", "integrity": "sha512-c334ArDb+GVNGN0y/joMGBB8F3mJwawaJqRR4NATpFsk5TdViLl6p6lqCwYFmxKT2u6KZAgqlXEPCF6neiguIA==", "requires": { - "epoll": "3.0.0", - "lodash.debounce": "4.0.8" + "epoll": "^3.0.0", + "lodash.debounce": "^4.0.8" } }, "optimist": { @@ -1573,8 +1624,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" } }, "os-homedir": { @@ -1592,8 +1643,8 @@ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "pad": { @@ -1601,7 +1652,7 @@ "resolved": "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz", "integrity": "sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==", "requires": { - "wcwidth": "1.0.1" + "wcwidth": "^1.0.1" } }, "path-is-absolute": { @@ -1625,7 +1676,7 @@ "resolved": "https://registry.npmjs.org/pidusage/-/pidusage-2.0.17.tgz", "integrity": "sha512-N8X5v18rBmlBoArfS83vrnD0gIFyZkXEo7a5pAS2aT0i2OLVymFb2AzVg+v8l/QcXnE1JwZcaXR8daJcoJqtjw==", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.1.2" } }, "process-nextick-args": { @@ -1679,10 +1730,10 @@ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -1697,13 +1748,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "reduce-extract": { @@ -1712,7 +1763,7 @@ "integrity": "sha1-Z/I4W+2mUGG19fQxJmLosIDKFSU=", "dev": true, "requires": { - "test-value": "1.1.0" + "test-value": "^1.0.1" }, "dependencies": { "array-back": { @@ -1721,7 +1772,7 @@ "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.0" } }, "test-value": { @@ -1730,8 +1781,8 @@ "integrity": "sha1-oJE29y7AQ9J8iTcHwrFZv6196T8=", "dev": true, "requires": { - "array-back": "1.0.4", - "typical": "2.6.1" + "array-back": "^1.0.2", + "typical": "^2.4.2" } } } @@ -1754,7 +1805,7 @@ "integrity": "sha1-aK0OrRGFXJo31OglbBW7+Hly/Iw=", "dev": true, "requires": { - "test-value": "2.1.0" + "test-value": "^2.0.0" }, "dependencies": { "array-back": { @@ -1763,7 +1814,7 @@ "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.0" } }, "test-value": { @@ -1772,8 +1823,8 @@ "integrity": "sha1-Edpv9nDzRxpztiXKTz/c97t0gpE=", "dev": true, "requires": { - "array-back": "1.0.4", - "typical": "2.6.1" + "array-back": "^1.0.3", + "typical": "^2.6.0" } } } @@ -1783,26 +1834,26 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.8.0", - "caseless": "0.12.0", - "combined-stream": "1.0.8", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.3.3", - "har-validator": "5.1.3", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.24", - "oauth-sign": "0.9.0", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.4.3", - "tunnel-agent": "0.6.0", - "uuid": "3.3.3" + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" }, "dependencies": { "qs": { @@ -1818,7 +1869,7 @@ "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", "dev": true, "requires": { - "lodash": "4.17.15" + "lodash": "^4.17.14" }, "dependencies": { "lodash": { @@ -1835,7 +1886,7 @@ "integrity": "sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==", "dev": true, "requires": { - "path-parse": "1.0.6" + "path-parse": "^1.0.6" } }, "restify": { @@ -1843,28 +1894,28 @@ "resolved": "https://registry.npmjs.org/restify/-/restify-8.4.0.tgz", "integrity": "sha512-yqS/wJI0ZU78whO2VfCCnFY7/JSqJt7wTDIdaQUo/a4TzAaC5KXUzxbs+xW4afJCk3NefGYYuiSrFSBWwVw/NA==", "requires": { - "assert-plus": "1.0.0", - "bunyan": "1.8.12", - "csv": "5.1.3", - "dtrace-provider": "0.8.8", - "escape-regexp-component": "1.0.2", - "ewma": "2.0.1", - "find-my-way": "2.2.1", - "formidable": "1.2.1", - "http-signature": "1.2.0", - "lodash": "4.17.15", - "lru-cache": "5.1.1", - "mime": "2.4.4", - "negotiator": "0.6.2", - "once": "1.4.0", - "pidusage": "2.0.17", - "qs": "6.9.0", - "restify-errors": "8.0.1", - "semver": "6.3.0", - "send": "0.16.2", - "spdy": "4.0.1", - "uuid": "3.3.3", - "vasync": "2.2.0" + "assert-plus": "^1.0.0", + "bunyan": "^1.8.12", + "csv": "^5.1.1", + "dtrace-provider": "^0.8.1", + "escape-regexp-component": "^1.0.2", + "ewma": "^2.0.1", + "find-my-way": "^2.0.1", + "formidable": "^1.2.1", + "http-signature": "^1.2.0", + "lodash": "^4.17.11", + "lru-cache": "^5.1.1", + "mime": "^2.4.3", + "negotiator": "^0.6.2", + "once": "^1.4.0", + "pidusage": "^2.0.17", + "qs": "^6.7.0", + "restify-errors": "^8.0.0", + "semver": "^6.1.1", + "send": "^0.16.2", + "spdy": "^4.0.0", + "uuid": "^3.3.2", + "vasync": "^2.2.0" }, "dependencies": { "semver": { @@ -1879,10 +1930,10 @@ "resolved": "https://registry.npmjs.org/restify-errors/-/restify-errors-8.0.1.tgz", "integrity": "sha512-EFQpxS828J0SBTNuJjh+rHD0OE8BoqnaxMAzuKHRNnGt5BV/212HHQIelZG4zjZYpTDEiuVAhQYHwSGSzAz0Ag==", "requires": { - "@netflix/nerror": "1.1.2", - "assert-plus": "1.0.0", - "lodash": "4.17.15", - "safe-json-stringify": "1.2.0" + "@netflix/nerror": "^1.0.0", + "assert-plus": "^1.0.0", + "lodash": "^4.17.15", + "safe-json-stringify": "^1.0.4" }, "dependencies": { "lodash": { @@ -1902,7 +1953,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "requires": { - "glob": "7.1.3" + "glob": "^7.1.3" } }, "safe-buffer": { @@ -1921,7 +1972,7 @@ "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz", "integrity": "sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==", "requires": { - "ret": "0.2.2" + "ret": "~0.2.0" } }, "safer-buffer": { @@ -1955,18 +2006,18 @@ "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.3", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.1", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "mime": { @@ -1996,7 +2047,7 @@ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", "requires": { - "is-arrayish": "0.3.2" + "is-arrayish": "^0.3.1" } }, "sort-array": { @@ -2005,9 +2056,9 @@ "integrity": "sha1-OKnG2if9fRR7QuYFVPKBGHtN9HI=", "dev": true, "requires": { - "array-back": "1.0.4", - "object-get": "2.1.0", - "typical": "2.6.1" + "array-back": "^1.0.4", + "object-get": "^2.1.0", + "typical": "^2.6.0" }, "dependencies": { "array-back": { @@ -2016,7 +2067,7 @@ "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.0" } } } @@ -2032,11 +2083,11 @@ "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.1.tgz", "integrity": "sha512-HeZS3PBdMA+sZSu0qwpCxl3DeALD5ASx8pAX0jZdKXSpPWbQ6SYGnlg3BBmYLx5LtiZrmkAZfErCm2oECBcioA==", "requires": { - "debug": "4.1.1", - "handle-thing": "2.0.0", - "http-deceiver": "1.2.7", - "select-hose": "2.0.0", - "spdy-transport": "3.0.0" + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" }, "dependencies": { "debug": { @@ -2044,7 +2095,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { - "ms": "2.1.2" + "ms": "^2.1.1" } }, "ms": { @@ -2059,12 +2110,12 @@ "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", "requires": { - "debug": "4.1.1", - "detect-node": "2.0.4", - "hpack.js": "2.1.6", - "obuf": "1.1.2", - "readable-stream": "3.4.0", - "wbuf": "1.7.3" + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" }, "dependencies": { "debug": { @@ -2072,7 +2123,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { - "ms": "2.1.2" + "ms": "^2.1.1" } }, "ms": { @@ -2085,9 +2136,9 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "requires": { - "inherits": "2.0.3", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } } } @@ -2103,9 +2154,9 @@ "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.1.0.tgz", "integrity": "sha512-RvqoKxq+8pDHsJo7aXxsFR18i+dU2Wp5o12qAJOV5LNcDt+fgJsc2QKKg3sIRfXrN9ZjzY1T7SNe/DFVqAXjaw==", "requires": { - "nan": "2.12.1", - "node-pre-gyp": "0.11.0", - "request": "2.88.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.11.0", + "request": "^2.87.0" } }, "squel": { @@ -2118,15 +2169,15 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "requires": { - "asn1": "0.2.4", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.2", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.2", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "safer-buffer": "2.1.2", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, "stack-trace": { @@ -2145,7 +2196,7 @@ "integrity": "sha1-GLyB8u2zW4tdmoAJIAqYUxRCipc=", "dev": true, "requires": { - "array-back": "1.0.4" + "array-back": "^1.0.2" }, "dependencies": { "array-back": { @@ -2154,7 +2205,7 @@ "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.0" } } } @@ -2164,7 +2215,7 @@ "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-2.0.1.tgz", "integrity": "sha512-GiTcO/rRvZP2R8WPwxmxCFP+Of1yIATuFAmYkvSLDfcD93X2WHiPwdgIqeFT2CvL1gyAsjQvu1nB6RDNQ5b2jw==", "requires": { - "mixme": "0.3.2" + "mixme": "^0.3.1" } }, "stream-via": { @@ -2178,9 +2229,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string_decoder": { @@ -2188,7 +2239,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { @@ -2196,7 +2247,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-json-comments": { @@ -2210,11 +2261,11 @@ "integrity": "sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==", "dev": true, "requires": { - "array-back": "2.0.0", - "deep-extend": "0.6.0", - "lodash.padend": "4.6.1", - "typical": "2.6.1", - "wordwrapjs": "3.0.0" + "array-back": "^2.0.0", + "deep-extend": "~0.6.0", + "lodash.padend": "^4.6.1", + "typical": "^2.6.1", + "wordwrapjs": "^3.0.0" }, "dependencies": { "array-back": { @@ -2223,7 +2274,7 @@ "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.1" } } } @@ -2239,13 +2290,13 @@ "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" } }, "temp-path": { @@ -2260,8 +2311,8 @@ "integrity": "sha512-sVACdAWcZkSU9x7AOmJo5TqE+GyNJknHaHsMrR6ZnhjVlVN9Yx6FjHrsKZ3BjIpPCT68zYesPWkakrNupwfOTQ==", "dev": true, "requires": { - "array-back": "2.0.0", - "typical": "2.6.1" + "array-back": "^2.0.0", + "typical": "^2.6.1" }, "dependencies": { "array-back": { @@ -2270,7 +2321,7 @@ "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", "dev": true, "requires": { - "typical": "2.6.1" + "typical": "^2.6.1" } } } @@ -2285,8 +2336,8 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "requires": { - "psl": "1.4.0", - "punycode": "1.4.1" + "psl": "^1.1.24", + "punycode": "^1.4.1" }, "dependencies": { "punycode": { @@ -2306,7 +2357,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -2340,7 +2391,7 @@ "optional": true, "requires": { "commander": "2.20.0", - "source-map": "0.6.1" + "source-map": "~0.6.1" } }, "underscore": { @@ -2349,12 +2400,17 @@ "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", "dev": true }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "requires": { - "punycode": "2.1.1" + "punycode": "^2.1.0" } }, "usb": { @@ -2363,8 +2419,8 @@ "integrity": "sha512-/0stiQEmweuO2BKv2avzQQ8ypDUjo4Osz5sSEi+d0F4Rc+ddX1xED3uf4Tkelc1eADlfn0JQZYHP0bI7CNDA0Q==", "optional": true, "requires": { - "nan": "2.12.1", - "node-pre-gyp": "0.11.0" + "nan": "^2.8.0", + "node-pre-gyp": "^0.11.0" } }, "util-deprecate": { @@ -2390,9 +2446,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "walk-back": { @@ -2406,7 +2462,7 @@ "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", "requires": { - "minimalistic-assert": "1.0.1" + "minimalistic-assert": "^1.0.0" } }, "wcwidth": { @@ -2414,7 +2470,7 @@ "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", "requires": { - "defaults": "1.0.3" + "defaults": "^1.0.3" } }, "wide-align": { @@ -2422,7 +2478,7 @@ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.2 || 2" } }, "winston": { @@ -2430,15 +2486,15 @@ "resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz", "integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==", "requires": { - "async": "2.6.2", - "diagnostics": "1.1.1", - "is-stream": "1.1.0", - "logform": "2.1.2", + "async": "^2.6.1", + "diagnostics": "^1.1.1", + "is-stream": "^1.1.0", + "logform": "^2.1.1", "one-time": "0.0.4", - "readable-stream": "3.1.1", - "stack-trace": "0.0.10", - "triple-beam": "1.3.0", - "winston-transport": "4.3.0" + "readable-stream": "^3.1.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.3.0" }, "dependencies": { "readable-stream": { @@ -2446,9 +2502,9 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", "requires": { - "inherits": "2.0.3", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } } } @@ -2458,8 +2514,8 @@ "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz", "integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==", "requires": { - "readable-stream": "2.3.6", - "triple-beam": "1.3.0" + "readable-stream": "^2.3.6", + "triple-beam": "^1.2.0" } }, "wordwrap": { @@ -2474,8 +2530,8 @@ "integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==", "dev": true, "requires": { - "reduce-flatten": "1.0.1", - "typical": "2.6.1" + "reduce-flatten": "^1.0.1", + "typical": "^2.6.1" } }, "wrappy": { @@ -2495,7 +2551,7 @@ "integrity": "sha1-3Nf6oq7Gt6bhjMXdrQQvejTHcVY=", "optional": true, "requires": { - "nan": "2.12.1" + "nan": "^2.0.5" } }, "yallist": { diff --git a/package.json b/package.json index 1534970..aa30aa1 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "dependencies": { "bleno": "^0.5.0", "cron": "^1.7.2", + "fs-extra": "^8.1.0", "node-ipc": "^9.1.1", "node-persist": "^3.0.5", "onoff": "^5.0.0", @@ -37,7 +38,10 @@ "winston": "^3.2.1" }, "devDependencies": { + "@types/fs-extra": "^8.0.0", "@types/node": "^12.7.12", + "@types/node-persist": "0.0.33", + "@types/uuid": "^3.4.5", "jsdoc-to-markdown": "^5.0.2", "qunit": "^2.9.3", "typescript": "^3.6.4" diff --git a/scripts/update.sh b/scripts/update.sh index a866bc5..239cd53 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -1,5 +1,5 @@ #!/bin/bash sudo -u pi -i<< EOF - cd /home/pi/intval3 && git pull + cd /home/pi/intval3 && git reset --hard && git pull && npm i EOF \ No newline at end of file diff --git a/src/intval/index.ts b/src/intval/index.ts new file mode 100644 index 0000000..0b802ff --- /dev/null +++ b/src/intval/index.ts @@ -0,0 +1,519 @@ +'use strict' + +const db = require('../db'); +const log = require('../log')('intval'); +import * as storage from 'node-persist'; +import { exists, mkdir } from 'fs-extra'; +import '../delay'; + +let Gpio : any +try { + Gpio = require('onoff').Gpio +} catch (e) { + log.warn('Failed including Gpio, using sim') + Gpio = require('../../lib/onoffsim').Gpio +} + + +const PINS = { + fwd : { + pin : 13, + dir : 'out' + }, + bwd : { + pin : 19, + dir : 'out' + }, + micro : { + pin : 5, + dir : 'in', + edge : 'both' + }, + release : { + pin : 6, + dir : 'in', + edge : 'both' + } +} + +interface State { + +} + +interface Entry { + start : number; + stop : number; + len : number; + dir : number; + exposure : number; + counter : number; + sequence : number; +} + +/** class representing the intval3 features */ +class Intval { + private STATE_DIR : string = '~/state'; + + private _frame : any = { + open : 250, //delay before pausing frame in open state + openBwd : 400, + closed : 100, //time that frame actually remains closed for + expected : 530 //expected length of frame, in ms + } + private _release : any = { + min : 20, + seq : 1000 + } + private _microDelay : number = 10; // delay after stop signal before stopping motors + private _pin : any = {}; + private _state : any = {}; + + + constructor() { + this._init(); + } + + /** + * Initialize the storage object and bind functions to process events. + */ + + private async _init () { + let dirExists : boolean; + + try { + dirExists = await exists(this.STATE_DIR); + } catch (err) { + log.error('init', `Error locating state directory ${this.STATE_DIR}`); + } + + if (!dirExists) { + try { + await mkdir(this.STATE_DIR); + } catch (err) { + log.error('init', `Error creating state directory ${this.STATE_DIR}`) + } + } + + storage.init({ + dir: this.STATE_DIR, + stringify: JSON.stringify, + parse: JSON.parse, + encoding: 'utf8', + logging: false, // can also be custom logging function + continuous: true, // continously persist to disk + interval: false, // milliseconds, persist to disk on an interval + ttl: false, // ttl* [NEW], can be true for 24h default or a number in MILLISECONDS + //expiredInterval: 2 * 60 * 1000, // [NEW] every 2 minutes the process will clean-up the expired cache + //forgiveParseErrors: false // [NEW] + }).then(this._restoreState).catch((err) => { + log.warn('init', err) + this.reset(); + this._declarePins(); + }) + + process.on('SIGINT', this._undeclarePins); + process.on('uncaughtException', this._undeclarePins); + } + + /** + * Restore the state from the storage object + */ + + private _restoreState () { + storage.getItem('_state', 'test').then(this._setState).catch((err) => { + this._setState(); + log.error('_restoreState', err); + }) + this._declarePins(); + } + + /** + * Creating the state object. + */ + + private _setState (data : any = undefined) { + if (typeof data !== 'undefined') { + this._state = data; + this._state.frame.cb = () => {}; + log.info('_setState', 'Restored intval state from disk'); + return true; + } + log.info('_setState', 'Setting state from defaults'); + this._state = { + frame : { + dir : true, //forward + start : 0, //time frame started, timestamp + active : false, //should frame be running + paused : false, + exposure : 0, //length of frame exposure, in ms + delay : 0, //delay before start of frame, in ms + current : {}, //current settings + cb : () => {} + }, + release : { + time: 0, + active : false //is pressed + }, + micro : { + time : 0, + primed : false //is ready to stop frame + }, + counter : 0, + sequence : false + } + this._storeState(); + } + + /** + * Store the state object. + */ + + private _storeState () { + storage.setItem('_state', this._state) + .then(() => {}) + .catch((err) => { + log.error('_storeState', err); + }) + } + + /** + * (internal function) Declares all Gpio pins that will be used. + */ + + private _declarePins () { + let pin; + for (let p in PINS) { + pin = PINS[p]; + if (pin.edge) this._pin[p] = new Gpio(pin.pin, pin.dir, pin.edge); + if (!pin.edge) this._pin[p] = new Gpio(pin.pin, pin.dir); + log.info('_declarePins', { pin : pin.pin, dir : pin.dir, edge : pin.edge }); + } + this._pin.release.watch(this._watchRelease); + } + + /** + * (internal function) Undeclares all Gpio in event of uncaught error + * that interupts the node process. + */ + + private _undeclarePins (e : Error) { + log.error('_undeclarePins', e); + if (!this._pin) { + log.warn('_undeclarePins', { reason : 'No pins'}); + return process.exit(); + } + log.warn('_undeclarePins', { pin : PINS.fwd.pin, val : 0, reason : 'exiting'}); + this._pin.fwd.writeSync(0); + log.warn('_undeclarePins', { pin : PINS.bwd.pin, val : 0, reason : 'exiting'}); + this._pin.bwd.writeSync(0); + this._pin.fwd.unexport(); + this._pin.bwd.unexport(); + this._pin.micro.unexport(); + this._pin.release.unexport(); + process.exit(); + } + + /** + * Start motor in forward direction by setting correct pins in h-bridge + */ + + private _startFwd () { + this._pin.fwd.writeSync(1); + this._pin.bwd.writeSync(0); + } + + /** + * Start motor in backward direction by setting correct pins in h-bridge + */ + + private _startBwd () { + this._pin.fwd.writeSync(0); + this._pin.bwd.writeSync(1); + } + + /** + * Turn off all directions + */ + + private _pause () { + this._pin.fwd.writeSync(0); + this._pin.bwd.writeSync(0); + //log.info('_pause', 'frame paused') + } + + /** + * Stop motor by setting both motor pins to 0 (LOW) + */ + + private _stop () { + const entry : any = {}; + const now : number = +new Date(); + const len : number = now - this._state.frame.start; + + this._pin.fwd.writeSync(0); + this._pin.bwd.writeSync(0); + + log.info(`_stop`, { frame : len }); + + this._pin.micro.unwatch(); + this._state.frame.active = false; + + if (this._state.frame.cb) this._state.frame.cb(len); + + entry.start = this._state.frame.start; + entry.stop = now; + entry.len = len; + entry.dir = this._state.frame.current.dir ? 1 : 0; + entry.exposure = this._state.frame.current.exposure; + entry.counter = this._state.counter; + entry.sequence = this._state.sequence ? 1 : 0; + + db.insert(entry); + + this._state.frame.current = {}; + } + + /** + * Callback for watching relese switch state changes. + * Using GPIO 06 on Raspberry Pi Zero W. + * + * 1) If closed AND frame active, start timer, set state primed to `true`. + * 1) If opened AND frame active, stop frame + * + * Microswitch + 10K ohm resistor + * * 1 === open + * * 0 === closed + * + * + * @param {object} err Error object present if problem reading pin + * @param {integer} val Current value of the pin + * + */ + + private _watchMicro (err : Error, val : number) { + const now : number = +new Date(); + if (err) { + log.error('_watchMicro', err); + } + //log.info(`Microswitch val: ${val}`) + //determine when to stop + if (val === 0 && this._state.frame.active) { + if (!this._state.micro.primed) { + this._state.micro.primed = true; + this._state.micro.time = now; + log.info('Microswitch primed to stop motor'); + } + } else if (val === 1 && this._state.frame.active) { + if (this._state.micro.primed && !this._state.micro.paused && (now - this._state.frame.start) > this._frame.open) { + this._state.micro.primed = false; + this._state.micro.time = 0; + setTimeout( () => { + this._stop(); + }, this._microDelay); + } + } + } + + /** + * Callback for watching relese switch state changes. + * Using GPIO 05 on Raspberry Pi Zero W. + * + * 1) If closed, start timer. + * 2) If opened, check timer AND + * 3) If `press` (`now - this._state.release.time`) greater than minimum and less than `this._release.seq`, start frame + * 4) If `press` greater than `this._release.seq`, start sequence + * + * Button + 10K ohm resistor + * * 1 === open + * * 0 === closed + * + * @param {object} err Error object present if problem reading pin + * @param {integer} val Current value of the pin + * + */ + + private _watchRelease (err : Error, val : number) { + const now : number = +new Date(); + let press : number = 0; + if (err) { + return log.error(err); + } + //log.info(`Release switch val: ${val}`) + if (val === 0) { + //closed + if (this._releaseClosedState(now)) { + this._state.release.time = now; + this._state.release.active = true; //maybe unncecessary + } + } else if (val === 1) { + //opened + if (this._state.release.active) { + press = now - this._state.release.time; + if (press > this._release.min && press < this._release.seq) { + this.frame(); + } else if (press >= this._release.seq) { + this.sequence(); + } + //log.info(`Release closed for ${press}ms`) + this._state.release.time = 0; + this._state.release.active = false; + } + } + } + + /** + * + */ + + private _releaseClosedState (now : number) { + if (!this._state.release.active && this._state.release.time === 0) { + return true; + } + if (this._state.release.active && (now - this._state.release.time) > (this._release.seq * 10)) { + return true; + } + return false; + } + + /** + * Reset the state and store it. + */ + + public reset () { + this._setState(); + this._storeState(); + } + + /** + * Set the default direction of the camera. + * * forward = true + * * backward = false + * + * @param {boolean} [dir=true] Direction of the camera + */ + + public setDir (val : boolean = true) { + if (typeof val !== 'boolean') { + return log.warn('Direction must be represented as either true or false'); + } + this._state.frame.dir = val; + this._storeState(); + log.info('setDir', { direction : val ? 'forward' : 'backward' }); + } + + /** + * Set the exposure value for a single frame. + * + * @param {integer} val Length in milliseconds + */ + + public setExposure (val : number = 0) { + this._state.frame.exposure = val; + this._storeState(); + log.info('setExposure', { exposure : val }); + } + + /** + * Set the delay time between each frame. + * + * @param {integer} val Length in milliseconds + */ + + public setDelay (val : number = 0) { + this._state.frame.delay = val; + this._storeState(); + log.info('setDelay', { delay : val }); + } + + /** + * Set the counter to the value. + * + * @param {integer} val Frame number + */ + + public setCounter (val : number = 0) { + this._state.counter = val; + this._storeState(); + log.info('setCounter', { counter : val }); + } + + /** + * Begin a single frame with set variables or defaults + * + * @param {?boolean} [dir="null"] (optional) Direction of the frame + * @param {?integer} [exposure="null"] (optional) Exposure time, 0 = minimum + * + */ + + public frame (dir : boolean = null, exposure : number = null, cb : Function = () => {}) { + if (dir === true || (dir === null && this._state.frame.dir === true) ) { + dir = true; + } else { + dir = false; + } + + if (exposure === null && this._state.frame.exposure !== 0) { + exposure = this._state.frame.exposure; + } else if (exposure === null) { + exposure = 0; //default speed + } + + this._state.frame.current.exposure = exposure; + this._state.frame.current.dir = dir; + + this._state.frame.start = +new Date(); + this._state.frame.active = true; + this._pin.micro.watch(this._watchMicro); + + log.info('frame', {dir : dir ? 'forward' : 'backward', exposure : exposure}); + + if (dir) { + this._startFwd(); + } else { + this._startBwd(); + } + if (exposure !== 0) { + this._state.frame.paused = true; + if (dir) { + setTimeout(this._pause, this._frame.open); + //log.info('frame', { pausing : time + this._frame.open }) + setTimeout( () => { + this._state.frame.paused = false; + this._startFwd(); + }, exposure + this._frame.closed); + } else { + setTimeout(this._pause, this._frame.openBwd); + setTimeout( () => { + //log.info('frame', 'restarting') + this._state.frame.paused = false; + this._startBwd(); + }, exposure + this._frame.closed); + } + } + if (dir) { + this._state.frame.cb = (len : number) => { + this._state.counter++; + this._storeState(); + cb(len); + } + } else { + this._state.frame.cb = (len : number) => { + this._state.counter--; + this._storeState(); + cb(len); + } + } + } + + /** + * Returns the state of the + */ + + public status () { + return this._state; + } +} + +module.exports = new Intval(); + +export default Intval; \ No newline at end of file diff --git a/src/sequence/index.ts b/src/sequence/index.ts index 22ee5fb..d3b7704 100644 --- a/src/sequence/index.ts +++ b/src/sequence/index.ts @@ -1,20 +1,30 @@ 'use strict' -const uuid = require('uuid').v4 -const log = require('../log')('seq') -import '../delay' +import uuid from 'uuid/v4'; +const log = require('../log')('seq'); +import '../delay'; + +const MAX_INTEGER = 2147483647; + +interface Options { + len? : number; +} /** Object sequence features */ class Sequence { public _state : any = { - arr : [], - active : false, - paused : false, - frame: false, - delay : false, - count : 0, - stop : null + arr : [] } + private id : string; + + private active : boolean = false; + private paused : boolean = false; + + private frame : boolean = false; + private delay : boolean = false; + private count : number = 0; + + private _stop : Function = null; public _loop : any = { arr : [], @@ -22,17 +32,20 @@ class Sequence { max : 0 } - constructor () { + constructor (intval : Intval) { } - - public start (options : any, cb : Function) { + /** + * Start running a "sequence" of frames. Shoots a continuous sequence + * of single frames with a delay in between each one. + **/ + public startOld (options : any, cb : Function) { if (this._state.active) { return false } - this._state.active = true - this._state.count = 0 + this.active = true + this.count = 0 if (options.arr) { this._state.arr = options.arr @@ -48,70 +61,74 @@ class Sequence { } else { this._loop.max = 0 } - this._state.stop = cb + this._stop = cb this.step() - this._state.id = uuid() - return this._state.id + this.id = uuid() + return this.id + } + + public async start (options : Options) { + } public setStop () { - this._state.active = false + this.active = false } public stop = function () { - this._state.active = false - this._state.count = 0 + this.active = false + this.count = 0 this._state.arr = [] this._loop.count = 0 this._loop.max = 0 this._loop.arr = [] - if (this._state.stop) this._state.stop() + if (this._stop) this._stop() - this._state.stop = null + this._stop = null } public pause () { - this._state.paused = true + this.paused = true } public resume () { - this._state.paused = false + this.paused = false this.step() } public step () { - if (this._state.active && !this._state.paused) { + if (this.active && !this.paused) { if (this._state.arr.length > 0) { - if (this._state.count > this._state.arr.length - 1) { + if (this.count > this._state.arr.length - 1) { return this.stop() } - log.info('step', { count : this._state.count, id : this._state.id }) - return this._state.arr[this._state.count](() => { - this._state.count++ + log.info('step', { count : this.count, id : this._state.id }) + return this._state.arr[this.count](() => { + this.count++ this.step() }) } else if (this._loop.arr.length > 0) { - if (this._state.count > this._loop.arr.length - 1) { - this._state.count = 0 + if (this.count > this._loop.arr.length - 1) { + this.count = 0 this._loop.count++ } if (this._loop.max > 0 && this._loop.count > this._loop.max) { return this.stop() } - log.info('step', { count : this._state.count, id : this._state.id }) - return this._loop.arr[this._state.count](() => { - this._state.count++ + log.info('step', { count : this.count, id : this.id }) + return this._loop.arr[this.count](() => { + this.count++ this.step() }) } else{ return this.stop() } - } else if (this._state.paused) { - log.info('step', 'Sequence paused', { loop : this._loop.count, count : this._state.count }) - } else if (!this._state.active) { - log.info('step', 'Sequence stopped', { loop : this._loop.count, count : this._state.count }) + } else if (this.paused) { + log.info('step', 'Sequence paused', { loop : this._loop.count, count : this.count }) + } else if (!this.active) { + log.info('step', 'Sequence stopped', { loop : this._loop.count, count : this.count }) } } } diff --git a/tsconfig.json b/tsconfig.json index bad2738..9b5a94d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "esModuleInterop": true, "target": "ES2017", "noImplicitAny": true, + "allowSyntheticDefaultImports" : true, "moduleResolution": "node", "sourceMap": true, "removeComments" : false,