Comparing version 0.1.2 to 0.1.3
@@ -93,6 +93,15 @@ var mongoose = require('mongoose'); | ||
options.getAllForms = true; | ||
return require('./impl/getForms.js')(connections, options, cb); | ||
return require('./impl/getForm.js')(connections, options, cb); | ||
}); | ||
}, | ||
deleteForm : function(options, cb){ | ||
self.initConnection(options, function(err, connections) { | ||
if(err) return cb(err); | ||
var key = options.key || options.uri; | ||
return cb(new Error("Not Implemented Yet")); //TODO Implemenet deleteForm | ||
}); | ||
}, | ||
getTheme: function(options, cb) { | ||
@@ -105,2 +114,7 @@ var self = this; | ||
var key = options.key || options.uri; | ||
if(options.themeId){ | ||
return cb(new Error("Using ThemeId not implemented yet for getTheme")); //TODO Implement themeId into getTHeme. Currently using appId | ||
} | ||
return require('./impl/getTheme.js')(connections, options, cb); | ||
@@ -110,2 +124,29 @@ }); | ||
updateTheme : function(options, cb){ | ||
self.initConnection(options, function(err, connections) { | ||
if(err) return cb(err); | ||
var key = options.key || options.uri; | ||
return cb(new Error("Not Implemented Yet")); //TODO Implemenet updateTheme | ||
}); | ||
}, | ||
deleteTheme : function(options, cb){ | ||
self.initConnection(options, function(err, connections) { | ||
if(err) return cb(err); | ||
var key = options.key || options.uri; | ||
return cb(new Error("Not Implemented Yet")); //TODO Implemenet deleteTheme | ||
}); | ||
}, | ||
getThemes : function(options, cb){ | ||
self.initConnection(options, function(err, connections) { | ||
if(err) return cb(err); | ||
var key = options.key || options.uri; | ||
return cb(new Error("Not Implemented Yet")); //TODO Implement getThemes | ||
}); | ||
}, | ||
updateForm: function(options, formData, cb) { | ||
@@ -163,2 +204,20 @@ var self = this; | ||
}); | ||
}, | ||
updateSubmission : function(options, cb){ | ||
self.initConnection(options, function(err, connections) { | ||
if(err) return cb(err); | ||
var key = options.key || options.uri; | ||
return cb(new Error("Not Implemented Yet")); //TODO Implemenet updateSubmission | ||
}); | ||
}, | ||
updateSubmissionFile : function(options, cb){ | ||
self.initConnection(options, function(err, connections) { | ||
if(err) return cb(err); | ||
var key = options.key || options.uri; | ||
return cb(new Error("Not Implemented Yet")); //TODO Implemenet updateSubmissionFile | ||
}); | ||
} | ||
@@ -165,0 +224,0 @@ }; |
{ | ||
"name": "fh-forms", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Cloud Forms API for form submission", | ||
@@ -5,0 +5,0 @@ "main": "lib/forms.js", |
@@ -59,2 +59,12 @@ require('./../Fixtures/env.js'); | ||
module.exports.testGetFormWorksAllForms = function(finish){ | ||
forms.getAllForms({"uri": process.env.FH_DOMAIN_DB_CONN_URL}, function(err, result){ | ||
assert.ok(!err); | ||
assert.ok(result); | ||
assert.ok(result.forms); | ||
assert.equal(2, result.forms.length); | ||
finish(); | ||
}); | ||
}; | ||
//Adding data needed for the test | ||
@@ -61,0 +71,0 @@ function createTestData(assert, cb){ |
@@ -73,17 +73,18 @@ require('./../Fixtures/env.js'); | ||
module.exports.testGetFormWorksAllForms = function(finish){ | ||
forms.getAllForms({"uri": process.env.FH_DOMAIN_DB_CONN_URL}, function(err, result){ | ||
assert.ok(!err); | ||
assert.ok(result); | ||
assert.ok(result.forms); | ||
assert.equal(2, result.forms.length); | ||
//TODO merge back in later when switching to smaller form returns.... | ||
//module.exports.testGetFormWorksAllForms = function(finish){ | ||
// forms.getAllForms({"uri": process.env.FH_DOMAIN_DB_CONN_URL}, function(err, result){ | ||
// assert.ok(!err); | ||
// assert.ok(result); | ||
// assert.ok(result.forms); | ||
// assert.equal(2, result.forms.length); | ||
// | ||
// checkAllForms(result.forms[0], {"formName": "Test Form 1", "description" : "This is a test form 1."}); | ||
// checkAllForms(result.forms[1], {"formName": "Test Form 2", "description" : "This is a test form 2."}); | ||
// | ||
// | ||
// finish(); | ||
// }); | ||
//}; | ||
checkAllForms(result.forms[0], {"formName": "Test Form 1", "description" : "This is a test form 1."}); | ||
checkAllForms(result.forms[1], {"formName": "Test Form 2", "description" : "This is a test form 2."}); | ||
finish(); | ||
}); | ||
}; | ||
function checkAllForms(formToCheck, options){ | ||
@@ -90,0 +91,0 @@ checkForm(formToCheck, options); |
@@ -1104,3 +1104,3 @@ require('./../Fixtures/env.js'); | ||
assert.ok(result.submissionStartedTimestamp); //Checking for the masterFormTimestamp | ||
assert.ok(result.submissionCompletedTimestamp); //Checking for the masterFormTimestamp | ||
assert.ok(result.submissionCompletedTimestamp); //Checking for the submissionCompletedTimestamp -- This will be default 0 as complete has not been called yet | ||
@@ -1107,0 +1107,0 @@ var submissionJSON = result.toJSON(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1060862
5994