got api subdomain to work with docs
This commit is contained in:
parent
8d2e502c44
commit
74c4f0b416
|
@ -14,10 +14,18 @@ exports.index = function(req, res) {
|
|||
|
||||
exports.form = function(req, res) {
|
||||
//Allow form to be embeded
|
||||
res.removeHeader('X-Frame-Options');
|
||||
res.removeHeader('X-Frame-Options');
|
||||
|
||||
res.render('form', {
|
||||
user: req.user || null,
|
||||
request: req
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
exports.redoc = function(req, res) {
|
||||
res.render('redoc', {
|
||||
request: req
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -69,74 +69,6 @@ exports.uploadPDF = function(req, res, next) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Upload PDF
|
||||
*/
|
||||
/*
|
||||
exports.uploadSubmissionFile = function(req, res, next) {
|
||||
|
||||
console.log('inside uploadPDF');
|
||||
|
||||
// console.log('\n\nProperty Descriptor\n-----------');
|
||||
// console.log(Object.getOwnPropertyDescriptor(req.files.file, 'path'));
|
||||
|
||||
console.log(req.files);
|
||||
|
||||
if(req.files){
|
||||
var file, _user, _path;
|
||||
|
||||
for(var i=0; i<req.files.length; i++){
|
||||
file = req.files[i];
|
||||
_user = req.user;
|
||||
_path = file.path;
|
||||
|
||||
|
||||
if (file.size === 0) {
|
||||
return next(new Error('File uploaded is EMPTY'));
|
||||
}else if(file.size > 100000000){
|
||||
return next(new Error('File uploaded exceeds MAX SIZE of 100MB'));
|
||||
}else {
|
||||
fs.exists(_path, function(exists) {
|
||||
|
||||
//If file exists move to user's form directory
|
||||
if(exists) {
|
||||
var newDestination = config.tmpUploadPath+_user.username;
|
||||
var stat = null;
|
||||
try {
|
||||
stat = fs.statSync(newDestination);
|
||||
} catch (err) {
|
||||
fs.mkdirSync(newDestination);
|
||||
}
|
||||
|
||||
if (stat && !stat.isDirectory()) {
|
||||
console.log('Directory cannot be created');
|
||||
return next(new Error('Directory cannot be created because an inode of a different type exists at "' + newDestination + '"'));
|
||||
}
|
||||
|
||||
console.log(path.join(newDestination, pdfFile.filename));
|
||||
|
||||
fs.move(pdfFile.path, path.join(newDestination, pdfFile.filename), function (err) {
|
||||
if (err) {
|
||||
return next(new Error(err.message));
|
||||
}
|
||||
pdfFile.path = path.join(newDestination, pdfFile.filename);
|
||||
console.log(pdfFile.filename + ' uploaded to ' + pdfFile.path);
|
||||
res.json(pdfFile);
|
||||
});
|
||||
|
||||
} else {
|
||||
return next(new Error('Did NOT get your file!'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
return next(new Error('Uploaded files were NOT detected'));
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
/**
|
||||
* Delete a forms submissions
|
||||
*/
|
||||
|
@ -254,23 +186,27 @@ exports.listSubmissions = function(req, res) {
|
|||
* Create a new form
|
||||
*/
|
||||
exports.create = function(req, res) {
|
||||
|
||||
|
||||
if(!req.body.form){
|
||||
console.log(err);
|
||||
return res.status(400).send({
|
||||
message: "Invalid Input"
|
||||
});
|
||||
}
|
||||
var form = new Form(req.body.form);
|
||||
|
||||
form.admin = req.user._id;
|
||||
console.log('Create a new form');
|
||||
console.log(form);
|
||||
console.log(req.body.form);
|
||||
console.log(req.user);
|
||||
|
||||
form.save(function(err) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
res.status(400).send({
|
||||
return res.status(405).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
} else {
|
||||
res.json(form);
|
||||
}
|
||||
|
||||
res.json(form);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -300,7 +236,7 @@ exports.update = function(req, res) {
|
|||
delete req.body.form.__v;
|
||||
delete req.body.form._id;
|
||||
|
||||
//Unless we have 'admin' priviledges, updating form admin is disabled
|
||||
//Unless we have 'admin' privileges, updating form admin is disabled
|
||||
if(req.user.roles.indexOf('admin') === -1) delete req.body.form.admin;
|
||||
|
||||
//Do this so we can create duplicate fields
|
||||
|
@ -317,7 +253,7 @@ exports.update = function(req, res) {
|
|||
form.save(function(err, form) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
res.status(400).send({
|
||||
res.status(405).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
} else {
|
||||
|
@ -377,7 +313,7 @@ exports.formByID = function(req, res, next, id) {
|
|||
if (err) {
|
||||
return next(err);
|
||||
} else if (form === undefined || form === null) {
|
||||
res.status(400).send({
|
||||
res.status(404).send({
|
||||
message: 'Form not found'
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,8 +9,9 @@ var forms = require('../../app/controllers/forms.server.controller'),
|
|||
module.exports = function(app) {
|
||||
// Root routing
|
||||
app.route('/').get(core.index);
|
||||
app.route('/subdomain/([a-zA-Z0-9]+)/').get(core.form);
|
||||
app.route('/subdomain/*/forms/:formId([a-zA-Z0-9]+)')
|
||||
app.route('/subdomain/api/').get(core.redoc);
|
||||
app.route('/subdomain/^(?!api$)[A-Za-z0-9]*/').get(core.form);
|
||||
app.route('/subdomain/^(?!api$)[A-Za-z0-9]*/forms/:formId([a-zA-Z0-9]+)')
|
||||
.get(forms.read)
|
||||
.post(forms.createSubmission);
|
||||
};
|
||||
|
|
100
app/views/redoc.server.view.html
Normal file
100
app/views/redoc.server.view.html
Normal file
|
@ -0,0 +1,100 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
<title>{{title}}</title>
|
||||
|
||||
<!-- General META -->
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<!-- Semantic META -->
|
||||
<meta name="keywords" content="{{keywords}}">
|
||||
<meta name="description" content="{{description}}">
|
||||
|
||||
<!-- Facebook META -->
|
||||
<meta property="og:site_name" content="{{title}}">
|
||||
<meta property="og:title" content="{{title}}">
|
||||
<meta property="og:description" content="{{description}}">
|
||||
<meta property="og:url" content="{{url}}">
|
||||
<meta property="og:image" content="/img/brand/logo.png">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<!-- Twitter META -->
|
||||
<meta name="twitter:title" content="{{title}}">
|
||||
<meta name="twitter:description" content="{{description}}">
|
||||
<meta name="twitter:url" content="{{url}}">
|
||||
<meta name="twitter:image" content="/img/brand/logo.png">
|
||||
|
||||
<!-- Fav Icon -->
|
||||
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="/static/lib/bootstrap/dist/css/bootstrap.min.css">
|
||||
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900'>
|
||||
|
||||
<!--Bower CSS dependencies-->
|
||||
{% for bowerCssFile in bowerCssFiles %}
|
||||
<link rel="stylesheet" href="{{bowerCssFile}}">
|
||||
{% endfor %}
|
||||
<link rel="stylesheet" href="/static//lib/jquery-ui/themes/flick/jquery-ui.css"/>
|
||||
|
||||
<!-- end Bower CSS dependencies-->
|
||||
|
||||
<!--Application CSS Files-->
|
||||
{% for cssFile in cssFiles %}
|
||||
<link rel="stylesheet" href="{{cssFile}}">
|
||||
{% endfor %}
|
||||
<!-- end Application CSS Files-->
|
||||
|
||||
|
||||
<!-- HTML5 Shim -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<redoc spec-url='/static/swagger.json'></redoc>
|
||||
<script src="https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js"> </script>
|
||||
|
||||
<!--Bower JS dependencies-->
|
||||
{% for bowerJSFile in bowerJSFiles %}
|
||||
<script type="text/javascript" src="{{bowerJSFile}}"></script>
|
||||
{% endfor %}
|
||||
<!-- end Bower JS dependencies-->
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js"></script>
|
||||
|
||||
{% if process.env.NODE_ENV === 'development' %}
|
||||
|
||||
<script src="https://cdn.ravenjs.com/2.3.0/angular/raven.min.js"></script>
|
||||
|
||||
<script>
|
||||
Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
|
||||
</script>
|
||||
|
||||
<!-- [if lt IE 9]>
|
||||
<section class="browsehappy jumbotron hide">
|
||||
<h1>Hello there!</h1>
|
||||
<p>You are using an old browser which we unfortunately do not support.</p>
|
||||
<p>Please <a href="http://browsehappy.com/">click here</a> to update your browser before using the website.</p>
|
||||
<p><a href="http://browsehappy.com" class="btn btn-primary btn-lg" role="button">Yes, upgrade my browser!</a></p>
|
||||
</section>
|
||||
<![endif] -->
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '{{google_analytics_id}}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -72,7 +72,6 @@ module.exports = function(db) {
|
|||
var subdomains = req.subdomains;
|
||||
var host = req.hostname;
|
||||
|
||||
|
||||
if(subdomains.slice(0, 4).join('.')+'' === '1.0.0.127'){
|
||||
subdomains = subdomains.slice(4);
|
||||
}
|
||||
|
@ -81,16 +80,29 @@ module.exports = function(db) {
|
|||
if (!subdomains.length) return next();
|
||||
|
||||
var urlPath = url.parse(req.url).path.split('/');
|
||||
if(urlPath.indexOf('static')){
|
||||
if(urlPath.indexOf('static') > -1){
|
||||
urlPath.splice(1,1);
|
||||
req.root = 'https://' + config.baseUrl + urlPath.join('/');
|
||||
return next();
|
||||
}
|
||||
|
||||
if(subdomains.indexOf('stage') || subdomains.indexOf('admin')){
|
||||
if(subdomains.indexOf('stage') > -1 || subdomains.indexOf('admin') > -1){
|
||||
return next();
|
||||
}
|
||||
|
||||
console.log(subdomains);
|
||||
console.log("is api subdomain: "+ (subdomains.indexOf("api") > -1));
|
||||
console.log(req.url);
|
||||
if(subdomains.indexOf('api') > -1){
|
||||
// rebuild url
|
||||
path += 'api' + req.url;
|
||||
console.log(req.url);
|
||||
// TODO: check path and query strings are preserved
|
||||
// reassign url
|
||||
req.url = path;
|
||||
console.log(req.url);
|
||||
return next();
|
||||
}
|
||||
|
||||
User.findOne({username: req.subdomains.reverse()[0]}).exec(function (err, user) {
|
||||
if (err) {
|
||||
|
|
|
@ -5,14 +5,10 @@
|
|||
"title": "TellForm API",
|
||||
"contact": {
|
||||
"name": "TellForm Team",
|
||||
"url": "http://tellform.com"
|
||||
},
|
||||
"license": {
|
||||
"name": "Creative Commons 4.0 International",
|
||||
"url": "http://creativecommons.org/licenses/by/4.0/"
|
||||
"url": "http://www.tellform.com"
|
||||
}
|
||||
},
|
||||
"host": "tellform.com",
|
||||
"host": "api.tellform.com",
|
||||
"basePath": "/api",
|
||||
"schemes": [
|
||||
"http"
|
||||
|
@ -23,8 +19,17 @@
|
|||
"tags": [
|
||||
"Form Operations"
|
||||
],
|
||||
"summary": "Finds forms in the system",
|
||||
"summary": "Finds all forms",
|
||||
"responses": {
|
||||
"405": {
|
||||
"description": "Missing Form Input"
|
||||
},
|
||||
"400": {
|
||||
"description": "Form is Invalid"
|
||||
},
|
||||
"404": {
|
||||
"description": "Form not Found"
|
||||
},
|
||||
"200": {
|
||||
"description": "forms response",
|
||||
"schema": {
|
||||
|
@ -41,7 +46,125 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/form/:form_id": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Form Operations"
|
||||
],
|
||||
"summary": "Find form by ID",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "forms response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Form"
|
||||
},
|
||||
"headers": {
|
||||
"x-expires": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
"Form Operations"
|
||||
],
|
||||
"summary": "Create a new form",
|
||||
"description": "Create and save a new form",
|
||||
"operationId": "addForm",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "body",
|
||||
"name": "form",
|
||||
"description": "Form object that is to be created",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Form"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"405": {
|
||||
"description": "Missing Form Input"
|
||||
},
|
||||
"400": {
|
||||
"description": "Form is Invalid"
|
||||
},
|
||||
"404": {
|
||||
"description": "Form not Found"
|
||||
},
|
||||
"200": {
|
||||
"description": "successful operation",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Form"
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
],
|
||||
"x-code-samples": [
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"tags": [
|
||||
"Form Operations"
|
||||
],
|
||||
"summary": "Update an existing form",
|
||||
"description": "",
|
||||
"operationId": "updateForm",
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/xml"
|
||||
],
|
||||
"produces": [
|
||||
"application/xml",
|
||||
"application/json"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "body",
|
||||
"name": "form",
|
||||
"description": "Form object that needs to be updated",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Form"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"405": {
|
||||
"description": "Missing Form Input"
|
||||
},
|
||||
"400": {
|
||||
"description": "Form is Invalid"
|
||||
},
|
||||
"404": {
|
||||
"description": "Form not Found"
|
||||
},
|
||||
"200": {
|
||||
"description": "successful operation",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Form"
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
}
|
||||
],
|
||||
"x-code-samples": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
"definitions": {
|
||||
"User": {
|
||||
|
@ -63,7 +186,13 @@
|
|||
},
|
||||
"language": {
|
||||
"type": "string",
|
||||
"enum": ["en", "fr", "es", "it", "de"],
|
||||
"enum": [
|
||||
"en",
|
||||
"fr",
|
||||
"es",
|
||||
"it",
|
||||
"de"
|
||||
],
|
||||
"default": "en",
|
||||
"required": "User must have a language"
|
||||
},
|
||||
|
@ -75,7 +204,7 @@
|
|||
},
|
||||
"username": {
|
||||
"type": "string",
|
||||
"required": "Username cannot be blank"
|
||||
"required": "Username cannot be blank",
|
||||
"unique": "true"
|
||||
},
|
||||
"passwordHash": {
|
||||
|
@ -86,9 +215,9 @@
|
|||
"type": "string"
|
||||
},
|
||||
"provider": {
|
||||
"type": "string",
|
||||
"required": "provider is required",
|
||||
"default": "local"
|
||||
"type": "string",
|
||||
"required": "provider is required",
|
||||
"default": "local"
|
||||
},
|
||||
"providerData": {
|
||||
"type": "object"
|
||||
|
@ -100,11 +229,17 @@
|
|||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": ["user", "admin", "superuser"]
|
||||
"enum": [
|
||||
"user",
|
||||
"admin",
|
||||
"superuser"
|
||||
]
|
||||
},
|
||||
"default": ["user"]
|
||||
"default": [
|
||||
"user"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"lastModified": {
|
||||
"type": "date"
|
||||
},
|
||||
|
@ -127,9 +262,34 @@
|
|||
"sparse": true
|
||||
}
|
||||
},
|
||||
|
||||
"LogicJump":
|
||||
|
||||
"LogicJump": {
|
||||
"expressionString": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"field == static",
|
||||
"field != static",
|
||||
"field > static",
|
||||
"field >= static",
|
||||
"field <= static",
|
||||
"field < static",
|
||||
"field contains static",
|
||||
"field !contains static",
|
||||
"field begins static",
|
||||
"field !begins static",
|
||||
"field ends static",
|
||||
"field !ends static"
|
||||
]
|
||||
},
|
||||
"fieldA": {
|
||||
$ref: "#/definitions/FormField",
|
||||
},
|
||||
"valueB": {
|
||||
"type": "string"
|
||||
},
|
||||
"jumpTo": {
|
||||
"$ref": "#/definitions/FormField",
|
||||
}
|
||||
},
|
||||
"FieldOption": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -145,7 +305,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
"RatingField": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -174,20 +333,18 @@
|
|||
},
|
||||
"validShapes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"FormField": {
|
||||
"required":[
|
||||
"required": [
|
||||
"title",
|
||||
"fieldType"
|
||||
],
|
||||
"properties": {
|
||||
|
||||
"isSubmission": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
|
@ -204,11 +361,9 @@
|
|||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
|
||||
"logicJump": {
|
||||
"$ref": "#/definitions/FormFields"
|
||||
"$ref": "#/definitions/FormField"
|
||||
},
|
||||
|
||||
"ratingOptions": {
|
||||
"type": "#/definitions/RatingField",
|
||||
},
|
||||
|
@ -224,7 +379,6 @@
|
|||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
|
||||
"deletePreserved": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
|
@ -265,10 +419,8 @@
|
|||
"fieldValue": {
|
||||
"type": "string"
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
"VisitorData": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -293,7 +445,12 @@
|
|||
},
|
||||
"deviceType": {
|
||||
"type": "string",
|
||||
"enum": ["desktop", "phone", "tablet", "other"],
|
||||
"enum": [
|
||||
"desktop",
|
||||
"phone",
|
||||
"tablet",
|
||||
"other"
|
||||
],
|
||||
"default": "other"
|
||||
},
|
||||
"userAgent": {
|
||||
|
@ -306,7 +463,7 @@
|
|||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"pattern": "/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/"
|
||||
"format": "url"
|
||||
},
|
||||
"action": {
|
||||
"type": "string"
|
||||
|
@ -326,6 +483,76 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"FormSubmission": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"language",
|
||||
"admin",
|
||||
"title"
|
||||
],
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"required": "Form Title cannot be blank"
|
||||
},
|
||||
"language": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"en",
|
||||
"fr",
|
||||
"es",
|
||||
"it",
|
||||
"de"
|
||||
],
|
||||
"default": "en",
|
||||
"required": "Form must have a language"
|
||||
},
|
||||
"admin": {
|
||||
"$ref": "#/definitions/User",
|
||||
},
|
||||
"ipAddr": {
|
||||
"type": "string"
|
||||
},
|
||||
"geoLocation": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Country": {
|
||||
"type": "string"
|
||||
},
|
||||
"Region": {
|
||||
"type": "string"
|
||||
},
|
||||
"City": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"device": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"pdfFilePath": {
|
||||
"type": "string"
|
||||
},
|
||||
"pdf": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
"timeElapsed": {
|
||||
"type": "number"
|
||||
},
|
||||
"percentageComplete": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Form": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
@ -343,11 +570,18 @@
|
|||
},
|
||||
"language": {
|
||||
"type": "string",
|
||||
"enum": ["en", "fr", "es", "it", "de"],
|
||||
"enum": [
|
||||
"en",
|
||||
"fr",
|
||||
"es",
|
||||
"it",
|
||||
"de"
|
||||
],
|
||||
"default": "en",
|
||||
"required": "Form must have a language"
|
||||
},
|
||||
"analytics": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"gaCode": {
|
||||
"type": "string"
|
||||
|
@ -360,10 +594,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
"form_fields": {
|
||||
"type": "array",
|
||||
"items": "#/definitions/FormFields"
|
||||
"items": "#/definitions/FormField"
|
||||
},
|
||||
"submissions": {
|
||||
"type": "array",
|
||||
|
@ -371,19 +604,15 @@
|
|||
"$ref": "#/definitions/FormSubmission"
|
||||
}
|
||||
},
|
||||
|
||||
"admin": {
|
||||
"$ref": "#/definitions/User",
|
||||
"required": "Form must have an Admin"
|
||||
"$ref": "#/definitions/User"
|
||||
},
|
||||
|
||||
"pdf": {
|
||||
"type": "object"
|
||||
},
|
||||
"pdfFieldMap": {
|
||||
"type": "object"
|
||||
},
|
||||
|
||||
"startPage": {
|
||||
"properties": {
|
||||
"showStart": {
|
||||
|
@ -407,7 +636,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
"hideFooter": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
|
@ -424,9 +652,8 @@
|
|||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
|
||||
"design": {
|
||||
"colors":{
|
||||
"colors": {
|
||||
"backgroundColor": {
|
||||
"type": "string",
|
||||
"pattern": "/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/",
|
||||
|
@ -437,32 +664,25 @@
|
|||
"match": "/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/",
|
||||
"default": "#333"
|
||||
},
|
||||
"answerColor"": {
|
||||
"answerColor": {
|
||||
"type": "string",
|
||||
"match": "/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/",
|
||||
"default": "#333"
|
||||
},
|
||||
"buttonColor": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"match": "/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/",
|
||||
"default": "#fff"
|
||||
},
|
||||
"buttonTextColor": {
|
||||
"type": "string",
|
||||
"pattern": "[/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/]",
|
||||
"pattern": "/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/",
|
||||
"default": "#333"
|
||||
}
|
||||
},
|
||||
"font": "string"
|
||||
}
|
||||
},
|
||||
"Address": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"addressLine1": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue