lib/services/metadata.js
function publishPage(uri, publishMeta, user) {
  const NOW = new Date().toISOString(),
    update = {
      published: true,
      publishTime: NOW,
      history: [{ action: 'publish', timestamp: NOW, users: [userOrRobot(user)] }]
    };

  return changeMetaState(uri, Object.assign(publishMeta, update));
}
function publishPage(uri, publishMeta, user) {
  const NOW = new Date().toISOString(),
    update = {
      published: true,
      publishTime: NOW,
      history: [{ action: 'publish', timestamp: NOW, users: [userOrRobot(user)] }]
    };

  return changeMetaState(uri, Object.assign(publishMeta, update));
}
function publishPage ( uri , publishMeta , user ) { const NOW = new Date ( ) . toISOString ( ) , update = { published : true , publishTime : NOW , history : [ { action : 'publish' , timestamp : NOW , users : [ userOrRobot ( user ) ] } ] } ; return changeMetaState ( uri , Object . assign ( publishMeta , update ) ) ; }
On publish of a page, update the
metadara for the page

@param {String} uri
@param {Object} publishMeta
@param {Object|Undefined} user
@returns {Promise}
On publish of a page update the metadara for the page