text: 'use strict';
  
  Object.defineProperty(exports, '__esModule', { value: true });
  
  var joi = require('../../../utils/joi.js');
  
  const flushResource = {
    options: {
      validate: {
        options: {
          allowUnknown: true,
          stripUnknown: true
        },
        query: joi.object().keys({
          path: joi.string().default('/'),
          cidBase: joi.string().default('base58btc'),
          timeout: joi.timeout()
        }).rename('arg', 'path', {
          override: true,
          ignoreUndefined: true
        }).rename('cid-base', 'cidBase', {
          override: true,
          ignoreUndefined: true
        })
      }
    },
    async handler(request, h) {
      const {
        app: {signal},
        server: {
          app: {ipfs}
        },
        query: {path, cidBase, timeout}
      } = request;
      const cid = await ipfs.files.flush(path, {
        signal,
        timeout
      });
      const base = await ipfs.bases.getBase(cidBase);
      return h.response({ Cid: cid.toString(base.encoder) });
    }
  };
  
  exports.flushResource = flushResource;
  