/**
 * @author Daniel
 */
define(["remoteStorage"], function(remoteStorage) {

    remoteStorage.defineModule("FRCScouting", function(privateClient, publicClient) {

        var teamClient = privateClient.scope("teams/");
        var eventClient = privateClient.scope("event/");

        // Define a common data type using JSON Schema
        teamClient.declareType("Team", {
            "description" : "An object representing a team",
            "type" : "object",
            "properties" : {
                "nickname" : {
                    "type" : "string"
                },
                "name" : {
                    "type" : "string"
                },
                "location" : {
                    "type" : "object",
                    "properties" : {
                        "locality" : {
                            "type" : "string"
                        },
                        "region" : {
                            "type" : "string"
                        },
                        "country" : {
                            "type" : "string"
                        }
                    }
                },
                "website" : {
                    "type" : "string"
                },
                "events" : {
                    "type" : "array"
                }
            }
        });

        eventClient.declareType("Event", {
            "description" : "An object representing a team",
            "type" : "object",
            "properties" : {
                "end_date" : {
                    "type" : "string"
                },
                "short_name" : {
                    "type" : "string"
                },
                "official" : {
                    "type" : "boolean"
                },
                "location" : {
                    "type" : "string"
                },
                "event_code" : {
                    "type" : "string"
                },
                "year" : {
                    "type" : "number"
                },
                "event_type_string" : {
                    "type" : "string"
                },
                "start_date" : {
                    "type" : "string"
                },
                "event_type" : {
                    "type" : "number"
                },
                "teams" : {
                    "type" : "array"
                }
            }
        });

        return {
            exports : {
                init : function() {
                    privateClient.cache('');
                },
                listTeams : function() {
                    return teamClient.getAll("");
                },
                listEvents : function () {
                    return eventClient.getAll("");
                }
            }
        };
    });

    remoteStorage.access.claim("FRCScouting", "rw");
});

@@ -2708,17 +2708,16 @@
 function
- 
 () %7B%0A   
@@ -2756,32 +2756,170 @@
 ent.getAll(%22%22);%0A
+                %7D,%0A                addEvent : function(id, data) %7B%0A                    return eventClient.storeObject('Event', id, data);%0A
                 

add function to store data