@@ -0,0 +1,16 @@ | |||||
root = true | |||||
[*] | |||||
indent_style = space | |||||
indent_size = 2 | |||||
end_of_line = lf | |||||
charset = utf-8 | |||||
trim_trailing_whitespace = true | |||||
insert_final_newline = true | |||||
[{package.json,*.yml}] | |||||
indent_style = space | |||||
indent_size = 2 | |||||
[*.md] | |||||
trim_trailing_whitespace = false |
@@ -0,0 +1,2 @@ | |||||
HOST=0.0.0.0 | |||||
PORT=1337 |
@@ -0,0 +1,3 @@ | |||||
.cache | |||||
build | |||||
**/node_modules/** |
@@ -0,0 +1,27 @@ | |||||
{ | |||||
"parser": "babel-eslint", | |||||
"extends": "eslint:recommended", | |||||
"env": { | |||||
"commonjs": true, | |||||
"es6": true, | |||||
"node": true, | |||||
"browser": false | |||||
}, | |||||
"parserOptions": { | |||||
"ecmaFeatures": { | |||||
"experimentalObjectRestSpread": true, | |||||
"jsx": false | |||||
}, | |||||
"sourceType": "module" | |||||
}, | |||||
"globals": { | |||||
"strapi": true | |||||
}, | |||||
"rules": { | |||||
"indent": ["error", 2, { "SwitchCase": 1 }], | |||||
"linebreak-style": ["error", "unix"], | |||||
"no-console": 0, | |||||
"quotes": ["error", "single"], | |||||
"semi": ["error", "always"] | |||||
} | |||||
} |
@@ -0,0 +1,114 @@ | |||||
############################ | |||||
# OS X | |||||
############################ | |||||
.DS_Store | |||||
.AppleDouble | |||||
.LSOverride | |||||
Icon | |||||
.Spotlight-V100 | |||||
.Trashes | |||||
._* | |||||
############################ | |||||
# Linux | |||||
############################ | |||||
*~ | |||||
############################ | |||||
# Windows | |||||
############################ | |||||
Thumbs.db | |||||
ehthumbs.db | |||||
Desktop.ini | |||||
$RECYCLE.BIN/ | |||||
*.cab | |||||
*.msi | |||||
*.msm | |||||
*.msp | |||||
############################ | |||||
# Packages | |||||
############################ | |||||
*.7z | |||||
*.csv | |||||
*.dat | |||||
*.dmg | |||||
*.gz | |||||
*.iso | |||||
*.jar | |||||
*.rar | |||||
*.tar | |||||
*.zip | |||||
*.com | |||||
*.class | |||||
*.dll | |||||
*.exe | |||||
*.o | |||||
*.seed | |||||
*.so | |||||
*.swo | |||||
*.swp | |||||
*.swn | |||||
*.swm | |||||
*.out | |||||
*.pid | |||||
############################ | |||||
# Logs and databases | |||||
############################ | |||||
.tmp | |||||
*.log | |||||
*.sql | |||||
*.sqlite | |||||
*.sqlite3 | |||||
############################ | |||||
# Misc. | |||||
############################ | |||||
*# | |||||
ssl | |||||
.idea | |||||
nbproject | |||||
public/uploads/* | |||||
!public/uploads/.gitkeep | |||||
############################ | |||||
# Node.js | |||||
############################ | |||||
lib-cov | |||||
lcov.info | |||||
pids | |||||
logs | |||||
results | |||||
node_modules | |||||
.node_history | |||||
############################ | |||||
# Tests | |||||
############################ | |||||
testApp | |||||
coverage | |||||
############################ | |||||
# Strapi | |||||
############################ | |||||
.env | |||||
license.txt | |||||
exports | |||||
*.cache | |||||
build | |||||
.strapi-updater.json |
@@ -0,0 +1,3 @@ | |||||
# Strapi application | |||||
A quick description of your strapi application |
@@ -0,0 +1,52 @@ | |||||
{ | |||||
"routes": [ | |||||
{ | |||||
"method": "GET", | |||||
"path": "/message-templates", | |||||
"handler": "message-template.find", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/message-templates/count", | |||||
"handler": "message-template.count", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/message-templates/:id", | |||||
"handler": "message-template.findOne", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "POST", | |||||
"path": "/message-templates", | |||||
"handler": "message-template.create", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "PUT", | |||||
"path": "/message-templates/:id", | |||||
"handler": "message-template.update", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "DELETE", | |||||
"path": "/message-templates/:id", | |||||
"handler": "message-template.delete", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
} | |||||
] | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) | |||||
* to customize this controller | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) | |||||
* to customize this model | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,25 @@ | |||||
{ | |||||
"kind": "collectionType", | |||||
"collectionName": "message_templates", | |||||
"info": { | |||||
"name": "Message_Template", | |||||
"description": "" | |||||
}, | |||||
"options": { | |||||
"increments": true, | |||||
"timestamps": true, | |||||
"draftAndPublish": true | |||||
}, | |||||
"attributes": { | |||||
"body": { | |||||
"type": "text", | |||||
"required": true | |||||
}, | |||||
"state": { | |||||
"type": "string" | |||||
}, | |||||
"name": { | |||||
"type": "string" | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) | |||||
* to customize this service | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,52 @@ | |||||
{ | |||||
"routes": [ | |||||
{ | |||||
"method": "GET", | |||||
"path": "/messages", | |||||
"handler": "message.find", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/messages/count", | |||||
"handler": "message.count", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/messages/:id", | |||||
"handler": "message.findOne", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "POST", | |||||
"path": "/messages", | |||||
"handler": "message.create", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "PUT", | |||||
"path": "/messages/:id", | |||||
"handler": "message.update", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "DELETE", | |||||
"path": "/messages/:id", | |||||
"handler": "message.delete", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
} | |||||
] | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) | |||||
* to customize this controller | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) | |||||
* to customize this model | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,52 @@ | |||||
{ | |||||
"kind": "collectionType", | |||||
"collectionName": "messages", | |||||
"info": { | |||||
"name": "message", | |||||
"description": "" | |||||
}, | |||||
"options": { | |||||
"increments": true, | |||||
"timestamps": true, | |||||
"draftAndPublish": true | |||||
}, | |||||
"attributes": { | |||||
"send_from": { | |||||
"type": "string", | |||||
"regex": "\\+?([ -]?\\d+)+|\\(\\d+\\)([ -]\\d+)", | |||||
"required": true | |||||
}, | |||||
"send_to": { | |||||
"type": "string", | |||||
"regex": "\\+?([ -]?\\d+)+|\\(\\d+\\)([ -]\\d+)", | |||||
"required": true | |||||
}, | |||||
"body_var": { | |||||
"type": "json", | |||||
"required": false | |||||
}, | |||||
"uuid": { | |||||
"type": "uid", | |||||
"targetField": "send_to", | |||||
"required": false | |||||
}, | |||||
"attachment": { | |||||
"collection": "file", | |||||
"via": "related", | |||||
"allowedTypes": [ | |||||
"files", | |||||
"images", | |||||
"videos" | |||||
], | |||||
"plugin": "upload", | |||||
"required": false | |||||
}, | |||||
"template_key": { | |||||
"model": "message-template" | |||||
}, | |||||
"state": { | |||||
"type": "string", | |||||
"private": false | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) | |||||
* to customize this service | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,52 @@ | |||||
{ | |||||
"routes": [ | |||||
{ | |||||
"method": "GET", | |||||
"path": "/session-data", | |||||
"handler": "session-data.find", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/session-data/count", | |||||
"handler": "session-data.count", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "GET", | |||||
"path": "/session-data/:id", | |||||
"handler": "session-data.findOne", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "POST", | |||||
"path": "/session-data", | |||||
"handler": "session-data.create", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "PUT", | |||||
"path": "/session-data/:id", | |||||
"handler": "session-data.update", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
}, | |||||
{ | |||||
"method": "DELETE", | |||||
"path": "/session-data/:id", | |||||
"handler": "session-data.delete", | |||||
"config": { | |||||
"policies": [] | |||||
} | |||||
} | |||||
] | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers) | |||||
* to customize this controller | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks) | |||||
* to customize this model | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,37 @@ | |||||
{ | |||||
"kind": "collectionType", | |||||
"collectionName": "session_data", | |||||
"info": { | |||||
"name": "Session_Data", | |||||
"description": "" | |||||
}, | |||||
"options": { | |||||
"increments": true, | |||||
"timestamps": true, | |||||
"draftAndPublish": true | |||||
}, | |||||
"attributes": { | |||||
"name": { | |||||
"type": "string" | |||||
}, | |||||
"device_manufacturer": { | |||||
"type": "string" | |||||
}, | |||||
"device_model": { | |||||
"type": "string" | |||||
}, | |||||
"platform": { | |||||
"type": "string" | |||||
}, | |||||
"os_version": { | |||||
"type": "string" | |||||
}, | |||||
"session_data": { | |||||
"type": "json" | |||||
}, | |||||
"phonenumber": { | |||||
"type": "string", | |||||
"required": true | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,8 @@ | |||||
'use strict'; | |||||
/** | |||||
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) | |||||
* to customize this service | |||||
*/ | |||||
module.exports = {}; |
@@ -0,0 +1,18 @@ | |||||
module.exports = ({ env }) => ({ | |||||
defaultConnection: 'default', | |||||
connections: { | |||||
default: { | |||||
connector: 'bookshelf', | |||||
settings: { | |||||
client: 'mysql', | |||||
host: env('DATABASE_HOST', '127.0.0.1'), | |||||
port: env.int('DATABASE_PORT', 3306), | |||||
database: env('DATABASE_NAME', 'wa_web'), | |||||
username: env('DATABASE_USERNAME', 'root'), | |||||
password: env('DATABASE_PASSWORD', 'root'), | |||||
ssl: env.bool('DATABASE_SSL', false), | |||||
}, | |||||
options: {} | |||||
}, | |||||
}, | |||||
}); |
@@ -0,0 +1,13 @@ | |||||
'use strict'; | |||||
/** | |||||
* An asynchronous bootstrap function that runs before | |||||
* your application gets started. | |||||
* | |||||
* This gives you an opportunity to set up your data model, | |||||
* run jobs, or perform some special logic. | |||||
* | |||||
* See more details here: https://strapi.io/documentation/developer-docs/latest/concepts/configurations.html#bootstrap | |||||
*/ | |||||
module.exports = () => {}; |
@@ -0,0 +1,21 @@ | |||||
'use strict'; | |||||
/** | |||||
* Cron config that gives you an opportunity | |||||
* to run scheduled jobs. | |||||
* | |||||
* The cron format consists of: | |||||
* [SECOND (optional)] [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK] | |||||
* | |||||
* See more details here: https://strapi.io/documentation/developer-docs/latest/concepts/configurations.html#cron-tasks | |||||
*/ | |||||
module.exports = { | |||||
/** | |||||
* Simple example. | |||||
* Every monday at 1am. | |||||
*/ | |||||
// '0 1 * * 1': () => { | |||||
// | |||||
// } | |||||
}; |
@@ -0,0 +1,5 @@ | |||||
'use strict'; | |||||
module.exports = async (/* ctx */) => { | |||||
// return ctx.notFound('My custom message 404'); | |||||
}; |
@@ -0,0 +1,9 @@ | |||||
module.exports = ({ env }) => ({ | |||||
host: env('HOST', '0.0.0.0'), | |||||
port: env.int('PORT', 1337), | |||||
admin: { | |||||
auth: { | |||||
secret: env('ADMIN_JWT_SECRET', 'f4b5b7ba9c157b7f1f921ee91be34b8a'), | |||||
}, | |||||
}, | |||||
}); |
@@ -0,0 +1,3 @@ | |||||
module.exports = { | |||||
jwtSecret: process.env.JWT_SECRET || '10700acf-3bb1-4d43-bd02-a0d3fac3a901' | |||||
}; |
@@ -0,0 +1,38 @@ | |||||
{ | |||||
"name": "wa-api", | |||||
"private": true, | |||||
"version": "0.1.0", | |||||
"description": "A Strapi application", | |||||
"scripts": { | |||||
"develop": "strapi develop", | |||||
"start": "strapi start", | |||||
"build": "strapi build", | |||||
"strapi": "strapi" | |||||
}, | |||||
"devDependencies": {}, | |||||
"dependencies": { | |||||
"knex": "<0.20.0", | |||||
"mysql": "latest", | |||||
"strapi": "3.4.1", | |||||
"strapi-admin": "3.4.1", | |||||
"strapi-connector-bookshelf": "3.4.1", | |||||
"strapi-plugin-content-manager": "3.4.1", | |||||
"strapi-plugin-content-type-builder": "3.4.1", | |||||
"strapi-plugin-email": "3.4.1", | |||||
"strapi-plugin-graphql": "3.4.1", | |||||
"strapi-plugin-upload": "3.4.1", | |||||
"strapi-plugin-users-permissions": "3.4.1", | |||||
"strapi-utils": "3.4.1" | |||||
}, | |||||
"author": { | |||||
"name": "A Strapi developer" | |||||
}, | |||||
"strapi": { | |||||
"uuid": "27db9377-526f-4a5a-9bc6-4ce3cb7316ee" | |||||
}, | |||||
"engines": { | |||||
"node": ">=10.16.0 <=14.x.x", | |||||
"npm": ">=6.0.0" | |||||
}, | |||||
"license": "MIT" | |||||
} |
@@ -0,0 +1,3 @@ | |||||
# To prevent search engines from seeing the site altogether, uncomment the next two lines: | |||||
# User-Agent: * | |||||
# Disallow: / |