Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fh-forms

Package Overview
Dependencies
Maintainers
1
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fh-forms - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

61

lib/forms.js

@@ -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 @@ };

2

package.json
{
"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();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc