var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if(!regex.test(address)){
reject(address + " is not valid e-mail address.");
//validate object's values as values for new resource
var type = value.type;
if(type===undefined){
return Promise.reject("Reference resource type undefined. `type` attribute should be set to one of these values: " + this.params.allowed_types.join(", ") + ".");
return Promise.reject("Resource of id `" + supposed_resource_id + "` is not of allowed type. Allowed types are: [" + this.params.allowed_types.join(", ") +"]");
var datastore_chip_name = ConfigurationManager.get_dispatcher_config().datastore_chip;
if(datastore_chip_name===undefined){
throw new Sealious.Errors.Error("Chip manager was requested to return a datastore chip. Multiple chips of type `datastore` have been registered, and no default provided in configuration.")
throw new Sealious.Errors.DeveloperError("In declaration of resource type '" + resource_type.name +"': unknown field type '"+this.type_name+"' in field '"+this.name+"'.");
}
var type_constructor = Sealious.ChipManager.get_chip("field_type", declaration.type);
this.type_parameters = declaration.params;
this.type = new type_constructor();
this.type.set_params(declaration.params);
this.type.init && this.type.init();
this.required = declaration.required || false;
this.derived = declaration.derived || false;
};
ResourceTypeField.prototype = new function(){
/**
* Shorthand for ResourceTypeField.type.isProperValue
Sealious.ChipTypes[chip_type_name] = Sealious.ChipTypes[chip_type_name].bind(Sealious.ChipTypes[chip_type_name], null); //null here corresponds to "module_path" of chip's constructor
}
Sealious.init = function(mode, layer_name){
require("./base-chips/_base-chips.js");
Sealious.PluginManager.load_plugins();
this.mode = mode ? mode : "local";
this.layer_name = layer_name ? layer_name : null;
}
Sealious.start = function(){
Core.check_version();
var dispatcher = Core.get_dispatcher(this.mode, this.layer_name);
dispatcher.init();
dispatcher.start();
Sealious.Dispatcher = dispatcher;
var chip_types_to_start = Core.decide_chip_types_to_start(this.mode, this.layer_name);