// es6 application code

import Human from './human.js'
import Github from './../client/github/github-client.js'
import lively4 from './../src/lively4-client.js'
import messaging from './../src/client/messaging.js'

let foo = new Human("Foo", "Bar");

messaging.postMessage({
    meta: {
        type: 'foo'
    },
    message: 'HELLOOO?'
}).then(e => {
    "use strict";

    console.log('+ + + ++  ++ + + + + + + + + + + + +');
    console.log(e.data);
});

Github.getRepo((result) => {
    "use strict";
    console.log('# # # # # # # # # # # # # # # # # # # # # ');
    console.log(result);
    console.log(Github);
});

document.querySelector("h1").innerHTML = `Hello ${foo.toString()}`;

@@ -457,31 +457,443 @@
 );%0A%0A
-Github.getRepo((result)
+messaging.postMessage(%7B%0A    meta: %7B%0A        type: 'github api'%0A    %7D,%0A    message: %7B%0A        // TODO: use .config file for such parametrization%0A        credentials: %7B%0A            token: 'f468386a26986cbe44a80584fd478da86be3d546',%0A            auth: 'oauth'%0A        %7D,%0A        topLevelAPI: 'getRepo',%0A        topLevelArguments: %5B'Lively4', 'manuallycreated'%5D,%0A        method: 'read',%0A        args: %5B'master', 'README.md'%5D%0A    %7D%0A%7D).then(e
  =%3E 
@@ -912,16 +912,17 @@
 trict%22;%0A
+%0A
     cons
@@ -934,109 +934,86 @@
 og('
-# # # # # # # # # # # # # # # # # # # # # ');%0A    console.log(result);%0A    console.log(Github
++ + + ++  ++ + + + + + + + + + + + +');%0A    console.log(e.data.message
 );%0A%7D);%0A%0A
 docu
@@ -1008,16 +1008,17 @@
 );%0A%7D);%0A%0A
+%0A
 document

use messaging api to access github in the sample application