lib/services/uris.js
function del(uri, user, locals) {
  const callHooks = _.get(locals, 'hooks') !== 'false';

  return db.get(uri).then(oldPageUri => {
    return db.del(uri).then(() => {
      const prefix = getPrefix(uri),
        site = siteService.getSiteFromPrefix(prefix),
        pageUrl = buf.decode(uri.split('/').pop());

      if (!callHooks) {
        return Promise.resolve(oldPageUri);
      }

      bus.publish('unpublishPage', { uri: oldPageUri, url: pageUrl, user });
      notifications.notify(site, 'unpublished', { url: pageUrl, uri: oldPageUri });
      return meta.unpublishPage(oldPageUri, user)
        .then(() => oldPageUri);
    });
  });
}
function del(uri, user, locals) {
  const callHooks = _.get(locals, 'hooks') !== 'false';

  return db.get(uri).then(oldPageUri => {
    return db.del(uri).then(() => {
      const prefix = getPrefix(uri),
        site = siteService.getSiteFromPrefix(prefix),
        pageUrl = buf.decode(uri.split('/').pop());

      if (!callHooks) {
        return Promise.resolve(oldPageUri);
      }

      bus.publish('unpublishPage', { uri: oldPageUri, url: pageUrl, user });
      notifications.notify(site, 'unpublished', { url: pageUrl, uri: oldPageUri });
      return meta.unpublishPage(oldPageUri, user)
        .then(() => oldPageUri);
    });
  });
}
function del ( uri , user , locals ) { const callHooks = _ . get ( locals , 'hooks' ) !== 'false' ; return db . get ( uri ) . then ( oldPageUri => { return db . del ( uri ) . then ( ( ) => { const prefix = getPrefix ( uri ) , site = siteService . getSiteFromPrefix ( prefix ) , pageUrl = buf . decode ( uri . split ( '/' ) . pop ( ) ) ; if ( ! callHooks ) { return Promise . resolve ( oldPageUri ) ; } bus . publish ( 'unpublishPage' , { uri : oldPageUri , url : pageUrl , user } ) ; notifications . notify ( site , 'unpublished' , { url : pageUrl , uri : oldPageUri } ) ; return meta . unpublishPage ( oldPageUri , user ) . then ( ( ) => oldPageUri ) ; } ) ; } ) ; }
Deletes a URI

NOTE: Return the data it used to contain.  This is often used to create queues or messaging on the client-side,
because clients can guarantee that only one client was allowed to be the last one to fetch a particular item.

@param {string} uri
@param {object} user
@param {object} locals
@returns {Promise}
Deletes a URI