lib/file-client/index.js
function create(fileToCreate) {
  //Creating a unique channel to get the response
  var topicUid = shortid.generate();
  var topicParams = {topicUid: topicUid, itemToCreate: fileToCreate};
  var donePromise = mediator.promise(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE, CONSTANTS.DONE_PREFIX, topicUid));
  var errorPromise = mediator.promise(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE, CONSTANTS.ERROR_PREFIX, topicUid));
  mediator.publish(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE), topicParams);

  return getTopicPromises(donePromise, errorPromise);
}
function create(fileToCreate) {
  //Creating a unique channel to get the response
  var topicUid = shortid.generate();
  var topicParams = {topicUid: topicUid, itemToCreate: fileToCreate};
  var donePromise = mediator.promise(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE, CONSTANTS.DONE_PREFIX, topicUid));
  var errorPromise = mediator.promise(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE, CONSTANTS.ERROR_PREFIX, topicUid));
  mediator.publish(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE), topicParams);

  return getTopicPromises(donePromise, errorPromise);
}
function create ( fileToCreate ) { //Creating a unique channel to get the response var topicUid = shortid . generate ( ) ; var topicParams = { topicUid : topicUid , itemToCreate : fileToCreate } ; var donePromise = mediator . promise ( fileSubscribers . getTopic ( CONSTANTS . TOPICS . CREATE , CONSTANTS . DONE_PREFIX , topicUid ) ) ; var errorPromise = mediator . promise ( fileSubscribers . getTopic ( CONSTANTS . TOPICS . CREATE , CONSTANTS . ERROR_PREFIX , topicUid ) ) ; mediator . publish ( fileSubscribers . getTopic ( CONSTANTS . TOPICS . CREATE ) , topicParams ) ; return getTopicPromises ( donePromise , errorPromise ) ; }
Creating a new file.

@param {object} fileToCreate - The File to create.
Creating a new file .