diff --git a/@salix-services/customer/.editorconfig b/@salix-services/customer/.editorconfig
new file mode 100644
index 000000000..3ee22e5d3
--- /dev/null
+++ b/@salix-services/customer/.editorconfig
@@ -0,0 +1,13 @@
+# EditorConfig helps developers define and maintain consistent
+# coding styles between different editors and IDEs
+# http://editorconfig.org
+
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
diff --git a/@salix-services/customer/.eslintignore b/@salix-services/customer/.eslintignore
new file mode 100644
index 000000000..44f397018
--- /dev/null
+++ b/@salix-services/customer/.eslintignore
@@ -0,0 +1 @@
+/client/
\ No newline at end of file
diff --git a/@salix-services/customer/.eslintrc b/@salix-services/customer/.eslintrc
new file mode 100644
index 000000000..a6e52975a
--- /dev/null
+++ b/@salix-services/customer/.eslintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "loopback"
+}
\ No newline at end of file
diff --git a/@salix-services/customer/.gitignore b/@salix-services/customer/.gitignore
new file mode 100644
index 000000000..aff1045b4
--- /dev/null
+++ b/@salix-services/customer/.gitignore
@@ -0,0 +1,19 @@
+*.csv
+*.dat
+*.iml
+*.log
+*.out
+*.pid
+*.seed
+*.sublime-*
+*.swo
+*.swp
+*.tgz
+*.xml
+.DS_Store
+.idea
+.project
+.strong-pm
+coverage
+node_modules
+npm-debug.log
diff --git a/@salix-services/customer/.yo-rc.json b/@salix-services/customer/.yo-rc.json
new file mode 100644
index 000000000..02f3fc17b
--- /dev/null
+++ b/@salix-services/customer/.yo-rc.json
@@ -0,0 +1,3 @@
+{
+ "generator-loopback": {}
+}
\ No newline at end of file
diff --git a/@salix-services/customer/client/README.md b/@salix-services/customer/client/README.md
new file mode 100644
index 000000000..dd00c9e9c
--- /dev/null
+++ b/@salix-services/customer/client/README.md
@@ -0,0 +1,3 @@
+## Client
+
+This is the place for your application front-end files.
diff --git a/@salix-services/customer/client/index.ejs b/@salix-services/customer/client/index.ejs
new file mode 100644
index 000000000..3f258702d
--- /dev/null
+++ b/@salix-services/customer/client/index.ejs
@@ -0,0 +1,14 @@
+
+
+
+
+ Salix
+
+
+
+
+
+
diff --git a/@salix-services/customer/common/models/AccessTokenIp.json b/@salix-services/customer/common/models/AccessTokenIp.json
new file mode 100644
index 000000000..a2ed91c89
--- /dev/null
+++ b/@salix-services/customer/common/models/AccessTokenIp.json
@@ -0,0 +1,15 @@
+{
+ "name": "AccessTokenIp",
+ "base": "AccessToken",
+ "idInjection": false,
+ "properties": {
+ "ip": {
+ "type": "string",
+ "default": "1.1.1.1"
+ }
+ },
+ "validations": [],
+ "relations": {},
+ "acls": [],
+ "methods": {}
+}
diff --git a/@salix-services/customer/common/models/UserIp.json b/@salix-services/customer/common/models/UserIp.json
new file mode 100644
index 000000000..f25c2b0e9
--- /dev/null
+++ b/@salix-services/customer/common/models/UserIp.json
@@ -0,0 +1,18 @@
+{
+ "name": "UserIp",
+ "base": "User",
+ "properties": {},
+ "validations": [],
+ "relations": {
+ "accessTokens": {
+ "type": "hasMany",
+ "model": "AccessTokenIp",
+ "foreignKey": "userId",
+ "options": {
+ "disableInclude": true
+ }
+ }
+ },
+ "acls": [],
+ "methods": {}
+}
diff --git a/@salix-services/customer/common/models/customer.json b/@salix-services/customer/common/models/customer.json
new file mode 100644
index 000000000..ca90e88c2
--- /dev/null
+++ b/@salix-services/customer/common/models/customer.json
@@ -0,0 +1,30 @@
+{
+ "name": "Customer",
+ "properties": {
+ "name": {
+ "type": "String",
+ "required": "true"
+ },
+ "id": {
+ "type": "Number",
+ "id": true,
+ "description": "Customer ID"
+ }
+ },
+ "validations": [],
+ "relations": {},
+ "acls": [
+ {
+ "principalType": "ROLE",
+ "principalId": "$unauthenticated",
+ "permission": "DENY"
+ },
+ {
+ "principalType": "ROLE",
+ "principalId": "$everyone",
+ "permission": "ALLOW",
+ "property": "create"
+ }
+ ],
+ "methods": {}
+}
diff --git a/@salix-services/customer/common/models/message.js b/@salix-services/customer/common/models/message.js
new file mode 100644
index 000000000..fc94c5a3b
--- /dev/null
+++ b/@salix-services/customer/common/models/message.js
@@ -0,0 +1,8 @@
+module.exports = function(Message) {
+ Message.greet = function(msg, cb) {
+ process.nextTick(function() {
+ msg = msg || 'hello';
+ cb(null, 'Sender says ' + msg + ' to receiver');
+ });
+ };
+};
diff --git a/@salix-services/customer/common/models/message.json b/@salix-services/customer/common/models/message.json
new file mode 100644
index 000000000..ebd6606f8
--- /dev/null
+++ b/@salix-services/customer/common/models/message.json
@@ -0,0 +1,29 @@
+{
+ "name": "Message",
+ "base": "Model",
+ "properties": {},
+ "validations": [],
+ "relations": {},
+ "acls": [],
+ "methods": {
+ "greet": {
+ "isStatic": true,
+ "accepts": [
+ {
+ "arg": "msg",
+ "type": "string",
+ "http": {
+ "source": "query"
+ }
+ }
+ ],
+ "returns": {
+ "arg": "greeting",
+ "type": "string"
+ },
+ "http": {
+ "verb": "get"
+ }
+ }
+ }
+}
diff --git a/@salix-services/customer/common/models/user-a.js b/@salix-services/customer/common/models/user-a.js
new file mode 100644
index 000000000..38b9de5bc
--- /dev/null
+++ b/@salix-services/customer/common/models/user-a.js
@@ -0,0 +1,5 @@
+'use strict';
+
+module.exports = function(Usera) {
+
+};
diff --git a/@salix-services/customer/common/models/user-a.json b/@salix-services/customer/common/models/user-a.json
new file mode 100644
index 000000000..15ab14096
--- /dev/null
+++ b/@salix-services/customer/common/models/user-a.json
@@ -0,0 +1,13 @@
+{
+ "name": "UserA",
+ "base": "PersistedModel",
+ "idInjection": true,
+ "options": {
+ "validateUpsert": true
+ },
+ "properties": {},
+ "validations": [],
+ "relations": {},
+ "acls": [],
+ "methods": {}
+}
diff --git a/@salix-services/customer/package.json b/@salix-services/customer/package.json
new file mode 100644
index 000000000..eaa4ab7a3
--- /dev/null
+++ b/@salix-services/customer/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "customer",
+ "version": "1.0.0",
+ "main": "server/server.js",
+ "scripts": {
+ "lint": "eslint .",
+ "start": "node .",
+ "posttest": "npm run lint && nsp check"
+ },
+ "dependencies": {
+ "compression": "^1.0.3",
+ "cors": "^2.5.2",
+ "helmet": "^1.3.0",
+ "loopback-boot": "^2.6.5",
+ "loopback-component-explorer": "^2.4.0",
+ "serve-favicon": "^2.0.1",
+ "strong-error-handler": "^1.0.1",
+ "loopback-datasource-juggler": "^2.39.0",
+ "loopback": "^2.22.0"
+ },
+ "devDependencies": {
+ "eslint": "^2.13.1",
+ "eslint-config-loopback": "^4.0.0",
+ "nsp": "^2.1.0"
+ },
+ "repository": {
+ "type": "",
+ "url": ""
+ },
+ "license": "UNLICENSED",
+ "description": "customer"
+}
diff --git a/@salix-services/customer/server/boot/authentication.js b/@salix-services/customer/server/boot/authentication.js
new file mode 100644
index 000000000..3ca9ee315
--- /dev/null
+++ b/@salix-services/customer/server/boot/authentication.js
@@ -0,0 +1,6 @@
+'use strict';
+
+module.exports = function enableAuthentication(server) {
+ // enable authentication
+ // server.enableAuth();
+};
diff --git a/@salix-services/customer/server/boot/root.js b/@salix-services/customer/server/boot/root.js
new file mode 100644
index 000000000..0aa2d58fd
--- /dev/null
+++ b/@salix-services/customer/server/boot/root.js
@@ -0,0 +1,12 @@
+'use strict';
+
+module.exports = function(server) {
+ // Install a `/` route that returns server status
+ var router = server.loopback.Router();
+
+ router.get('/', server.loopback.status());
+ server.use(router);
+
+};
+
+
diff --git a/@salix-services/customer/server/component-config.json b/@salix-services/customer/server/component-config.json
new file mode 100644
index 000000000..f36959a48
--- /dev/null
+++ b/@salix-services/customer/server/component-config.json
@@ -0,0 +1,5 @@
+{
+ "loopback-component-explorer": {
+ "mountPath": "/explorer"
+ }
+}
diff --git a/@salix-services/customer/server/config.json b/@salix-services/customer/server/config.json
new file mode 100644
index 000000000..40d45f4d6
--- /dev/null
+++ b/@salix-services/customer/server/config.json
@@ -0,0 +1,23 @@
+{
+ "restApiRoot": "/api",
+ "host": "0.0.0.0",
+ "port": 3000,
+ "remoting": {
+ "context": false,
+ "rest": {
+ "normalizeHttpPath": false,
+ "xml": false
+ },
+ "json": {
+ "strict": false,
+ "limit": "100kb"
+ },
+ "urlencoded": {
+ "extended": true,
+ "limit": "100kb"
+ },
+ "cors": false,
+ "handleErrors": false
+ },
+ "legacyExplorer": false
+}
diff --git a/@salix-services/customer/server/datasources.json b/@salix-services/customer/server/datasources.json
new file mode 100644
index 000000000..d6caf56d4
--- /dev/null
+++ b/@salix-services/customer/server/datasources.json
@@ -0,0 +1,6 @@
+{
+ "db": {
+ "name": "db",
+ "connector": "memory"
+ }
+}
diff --git a/@salix-services/customer/server/middleware.development.json b/@salix-services/customer/server/middleware.development.json
new file mode 100644
index 000000000..071c11a30
--- /dev/null
+++ b/@salix-services/customer/server/middleware.development.json
@@ -0,0 +1,10 @@
+{
+ "final:after": {
+ "strong-error-handler": {
+ "params": {
+ "debug": true,
+ "log": true
+ }
+ }
+ }
+}
diff --git a/@salix-services/customer/server/middleware.json b/@salix-services/customer/server/middleware.json
new file mode 100644
index 000000000..0d5c5e38d
--- /dev/null
+++ b/@salix-services/customer/server/middleware.json
@@ -0,0 +1,44 @@
+{
+ "initial:before": {
+ "loopback#favicon": {}
+ },
+ "initial": {
+ "compression": {},
+ "./middleware/cors": {},
+ "helmet#xssFilter": {},
+ "helmet#frameguard": {
+ "params": [
+ "deny"
+ ]
+ },
+ "helmet#hsts": {
+ "params": {
+ "maxAge": 0,
+ "includeSubdomains": true
+ }
+ },
+ "helmet#hidePoweredBy": {},
+ "helmet#ieNoOpen": {},
+ "helmet#noSniff": {},
+ "helmet#noCache": {
+ "enabled": false
+ }
+ },
+ "session": {},
+ "auth": {},
+ "parse": {},
+ "routes": {
+ "loopback#rest": {
+ "paths": [
+ "${restApiRoot}"
+ ]
+ }
+ },
+ "files": {},
+ "final": {
+ "loopback#urlNotFound": {}
+ },
+ "final:after": {
+ "strong-error-handler": {}
+ }
+}
diff --git a/@salix-services/customer/server/middleware/cors.js b/@salix-services/customer/server/middleware/cors.js
new file mode 100644
index 000000000..9d8ad644c
--- /dev/null
+++ b/@salix-services/customer/server/middleware/cors.js
@@ -0,0 +1,15 @@
+var cors = require('cors');
+
+var whitelist = ['http://localhost:8080'];
+var corsOptions = {
+ origin: function(origin, callback){
+ var originIsWhitelisted = whitelist.indexOf(origin) !== -1;
+ callback(originIsWhitelisted ? null : 'Bad Request', originIsWhitelisted);
+ }
+}
+
+module.exports = function() {
+ return cors(corsOptions);
+};
+
+
diff --git a/@salix-services/customer/server/middleware/datetime.js b/@salix-services/customer/server/middleware/datetime.js
new file mode 100644
index 000000000..d2fba2298
--- /dev/null
+++ b/@salix-services/customer/server/middleware/datetime.js
@@ -0,0 +1,4 @@
+module.exports = function() {
+ console.log('Date time middleware triggered.');
+ res.json({datetime: new Date()});
+};
\ No newline at end of file
diff --git a/@salix-services/customer/server/model-config.json b/@salix-services/customer/server/model-config.json
new file mode 100644
index 000000000..7cf58375a
--- /dev/null
+++ b/@salix-services/customer/server/model-config.json
@@ -0,0 +1,42 @@
+{
+ "_meta": {
+ "sources": [
+ "loopback/common/models",
+ "loopback/server/models",
+ "../common/models",
+ "./models"
+ ],
+ "mixins": [
+ "loopback/common/mixins",
+ "loopback/server/mixins",
+ "../common/mixins",
+ "./mixins"
+ ]
+ },
+ "User": {
+ "dataSource": "db"
+ },
+ "Customer": {
+ "dataSource": "db",
+ "public": true
+ },
+ "AccessToken": {
+ "dataSource": "db",
+ "public": false
+ },
+ "ACL": {
+ "dataSource": "db",
+ "public": false
+ },
+ "RoleMapping": {
+ "dataSource": "db",
+ "public": false
+ },
+ "Role": {
+ "dataSource": "db",
+ "public": false
+ },
+ "Message": {
+ "dataSource": null
+ }
+}
diff --git a/@salix-services/customer/server/server.js b/@salix-services/customer/server/server.js
new file mode 100644
index 000000000..3d28538cc
--- /dev/null
+++ b/@salix-services/customer/server/server.js
@@ -0,0 +1,30 @@
+'use strict';
+
+var loopback = require('loopback');
+var boot = require('loopback-boot');
+
+var app = module.exports = loopback();
+
+app.start = function() {
+ // start the web server
+ return app.listen(function() {
+ app.emit('started');
+ var baseUrl = app.get('url').replace(/\/$/, '');
+ console.log('Web server listening at: %s', baseUrl);
+ if (app.get('loopback-component-explorer')) {
+ var explorerPath = app.get('loopback-component-explorer').mountPath;
+ console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
+ }
+ });
+};
+
+// Bootstrap the application, configure models, datasources and middleware.
+// Sub-apps like REST API are mounted via boot scripts.
+boot(app, __dirname, function(err) {
+ if (err) throw err;
+
+ // start the server if `$ node server.js`
+ if (require.main === module)
+ app.start();
+});
+
diff --git a/@salix-services/salix/client/index.ejs b/@salix-services/salix/client/index.ejs
index 3ff44f9cc..b6845abfd 100644
--- a/@salix-services/salix/client/index.ejs
+++ b/@salix-services/salix/client/index.ejs
@@ -6,4 +6,4 @@
Párrafo de ejemplo