'use strict';


/**
 * Upload `contact` (containing contact data) onto Cluestr.
 *
 * 
 * @param {Object} contact Contact to upload, plus cluestrClient
 * @param {Function} cb Callback to call once contacts has been uploaded.
 */
module.exports = function(contact, cluestrClient, cb) {
  console.log("Uploading ", contact.url);
  var identifier = contact.url;
  
  if(contact.deleted) {
    return cluestrClient.deleteDocument(identifier, cb);
  }

  // Build contact "the right way"
  contact = {
    identifier: identifier,
    metadatas: contact,
    semantic_document_type: 'contact',
    actions: {
      'show': contact.url
    },
    user_access: [cluestrClient.accessToken]
  };
  delete contact.metadatas.url;
  delete contact.metadatas.id;

  cluestrClient.sendDocument(contact, cb);
};

@@ -145,16 +145,189 @@
 rClient%0A
+ * @param %7BObject%7D cluestrClient Client for upload%0A * @param %7BObject%7D datas Datas about the current account%0A * @param %7BObject%7D contact Contact to upload, plus cluestrClient%0A
  * @para
@@ -445,16 +445,23 @@
 rClient,
+ datas,
  cb) %7B%0A 

Add datas as parameter for v0.2.4