1'use strict' 2 3const ls = require('../ls.js') 4const get = require('../get.js') 5const put = require('../put.js') 6const rm = require('../rm.js') 7const verify = require('../verify.js') 8const setLocale = require('../lib/util/y.js').setLocale 9const clearMemoized = require('../lib/memoization.js').clearMemoized 10const tmp = require('../lib/util/tmp.js') 11 12setLocale('es') 13 14const x = module.exports 15 16x.ls = cache => ls(cache) 17x.ls.flujo = cache => ls.stream(cache) 18 19x.saca = (cache, clave, ops) => get(cache, clave, ops) 20x.saca.porHacheo = (cache, hacheo, ops) => get.byDigest(cache, hacheo, ops) 21x.saca.sinc = (cache, clave, ops) => get.sync(cache, clave, ops) 22x.saca.sinc.porHacheo = (cache, hacheo, ops) => get.sync.byDigest(cache, hacheo, ops) 23x.saca.flujo = (cache, clave, ops) => get.stream(cache, clave, ops) 24x.saca.flujo.porHacheo = (cache, hacheo, ops) => get.stream.byDigest(cache, hacheo, ops) 25x.sava.copia = (cache, clave, destino, opts) => get.copy(cache, clave, destino, opts) 26x.sava.copia.porHacheo = (cache, hacheo, destino, opts) => get.copy.byDigest(cache, hacheo, destino, opts) 27x.saca.info = (cache, clave) => get.info(cache, clave) 28x.saca.tieneDatos = (cache, hacheo) => get.hasContent(cache, hacheo) 29x.saca.tieneDatos.sinc = (cache, hacheo) => get.hasContent.sync(cache, hacheo) 30 31x.mete = (cache, clave, datos, ops) => put(cache, clave, datos, ops) 32x.mete.flujo = (cache, clave, ops) => put.stream(cache, clave, ops) 33 34x.rm = (cache, clave) => rm.entry(cache, clave) 35x.rm.todo = cache => rm.all(cache) 36x.rm.entrada = x.rm 37x.rm.datos = (cache, hacheo) => rm.content(cache, hacheo) 38 39x.ponLenguaje = lang => setLocale(lang) 40x.limpiaMemoizado = () => clearMemoized() 41 42x.tmp = {} 43x.tmp.mkdir = (cache, ops) => tmp.mkdir(cache, ops) 44x.tmp.hazdir = x.tmp.mkdir 45x.tmp.conTmp = (cache, ops, cb) => tmp.withTmp(cache, ops, cb) 46 47x.verifica = (cache, ops) => verify(cache, ops) 48x.verifica.ultimaVez = cache => verify.lastRun(cache) 49x.verifica.últimaVez = x.verifica.ultimaVez 50