From 8ea2cbe70a946e1d002110734fee342ed9b1ca80 Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 11:02:59 -0400 Subject: [PATCH 01/17] added our names --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 47801d7..b4718ab 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # project_mimirs_market A Viking eCommerce store for Thunder Gods that like to buy "Antique Wooden Pizzas" + +Name: Ian Halverson and Eric Glover From 4bd7b5b18ef38f2eda71a08e356f14c992fb85f3 Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 11:09:18 -0400 Subject: [PATCH 02/17] basic setup --- .gitignore | 2 ++ app.js | 0 config/mongo.json | 0 config/sequelize.json | 0 mongo.js | 0 repl.js | 0 schema.txt | 0 views/layouts/application.handlebars | 0 views/partials/head.handlebars | 0 views/partials/navbar.handlebars | 0 10 files changed, 2 insertions(+) create mode 100644 .gitignore create mode 100644 app.js create mode 100644 config/mongo.json create mode 100644 config/sequelize.json create mode 100644 mongo.js create mode 100644 repl.js create mode 100644 schema.txt create mode 100644 views/layouts/application.handlebars create mode 100644 views/partials/head.handlebars create mode 100644 views/partials/navbar.handlebars diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9daa824 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules diff --git a/app.js b/app.js new file mode 100644 index 0000000..e69de29 diff --git a/config/mongo.json b/config/mongo.json new file mode 100644 index 0000000..e69de29 diff --git a/config/sequelize.json b/config/sequelize.json new file mode 100644 index 0000000..e69de29 diff --git a/mongo.js b/mongo.js new file mode 100644 index 0000000..e69de29 diff --git a/repl.js b/repl.js new file mode 100644 index 0000000..e69de29 diff --git a/schema.txt b/schema.txt new file mode 100644 index 0000000..e69de29 diff --git a/views/layouts/application.handlebars b/views/layouts/application.handlebars new file mode 100644 index 0000000..e69de29 diff --git a/views/partials/head.handlebars b/views/partials/head.handlebars new file mode 100644 index 0000000..e69de29 diff --git a/views/partials/navbar.handlebars b/views/partials/navbar.handlebars new file mode 100644 index 0000000..e69de29 From 81395e180d3bc9f22d27750c87e56a352957cd2d Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 11:32:58 -0400 Subject: [PATCH 03/17] more basic setup --- .gitignore | 1 + config/mongo.json | 13 +++++++++++++ config/sequelize.json | 20 ++++++++++++++++++++ package.json | 39 +++++++++++++++++++++++++++++++++++++++ schema.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 9daa824..9d8cbfe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store node_modules +config diff --git a/config/mongo.json b/config/mongo.json index e69de29..7872c17 100644 --- a/config/mongo.json +++ b/config/mongo.json @@ -0,0 +1,13 @@ +{ + "development": { + "database": "mimirs_market_development", + "host": "localhost" + }, + "test": { + "database": "mimirs_market_test", + "host": "localhost" + }, + "production": { + "use_env_variable": "MONGODB_URI" + } +} diff --git a/config/sequelize.json b/config/sequelize.json index e69de29..c4d482a 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -0,0 +1,20 @@ +{ + "development": { + "username": "IanDavid", + "password": null, + "database": "mimirs_market_development", + "host": "127.0.0.1", + "dialect": "postgres" + }, + "test": { + "username": "IanDavid", + "password": null, + "database": "mimirs_market_test", + "host": "127.0.0.1", + "dialect": "postgres" + }, + "production": { + "use_env_variable": "DATABASE_URL", + "dialect": "postgres" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..ba371e3 --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "project_mimirs_market", + "version": "1.0.0", + "description": "A Viking eCommerce store for Thunder Gods that like to buy \"Antique Wooden Pizzas\"", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/IDHalverson/project_mimirs_market.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/IDHalverson/project_mimirs_market/issues" + }, + "homepage": "https://github.com/IDHalverson/project_mimirs_market#readme", + "dependencies": { + "bluebird": "^3.5.0", + "body-parser": "^1.17.2", + "cookie-parser": "^1.4.3", + "cookie-session": "^1.3.0", + "express": "^4.15.4", + "express-handlebars": "^3.0.0", + "express-method-override-get-post-support": "0.0.7", + "express-session": "^1.15.5", + "method-override": "^2.3.9", + "mongoose": "^4.11.6", + "mongoose-findorcreate": "^2.0.0", + "mongooseeder": "^2.0.5", + "morgan": "^1.8.2", + "morgan-toolkit": "^1.0.2", + "pg": "^7.1.0", + "pg-hstore": "^2.3.2", + "sequelize": "^4.4.2", + "sequelize-cli": "^2.8.0" + } +} diff --git a/schema.txt b/schema.txt index e69de29..d31ffad 100644 --- a/schema.txt +++ b/schema.txt @@ -0,0 +1,40 @@ +SEQUELIZE + +User +- id +- name +- email + +States +- id +- Name +- Abbreviation + +Category +- id +- name + +Product +- id +- categoryId +- name +- description +- price +- SKU + +--> SUBMITTING ORDER --> userId, name, email, state, items(id, name, categoryid, quantity) + + +MONGODB + +Orders: [{ +- id +- userId (Sequelize) +- name +- email +- state +- items: [{ +id (sequelize), name, categoryId (sequelize), quantity +}, {}, {}] + +}] From b139e1a169b9bb5dca2e2c339b7aadbb629c7693 Mon Sep 17 00:00:00 2001 From: Eric Glover Date: Wed, 9 Aug 2017 11:03:20 -0500 Subject: [PATCH 04/17] model create --- .sequelizerc | 17 + config/sequelize.json | 4 +- .../sequelize/20170809155208-create-state.js | 30 + .../sequelize/20170809155228-create-user.js | 30 + .../20170809155307-create-category.js | 27 + .../20170809155314-create-product.js | 39 + models/mongoose/index.js | 0 models/sequelize/category.js | 13 + models/sequelize/index.js | 0 models/sequelize/product.js | 17 + models/sequelize/state.js | 14 + models/sequelize/user.js | 14 + mongo.js | 10 + package-lock.json | 3642 +++++++++++++++++ package.json | 12 +- repl.js | 46 + schema.txt | 14 + 17 files changed, 3926 insertions(+), 3 deletions(-) create mode 100644 .sequelizerc create mode 100644 migrations/sequelize/20170809155208-create-state.js create mode 100644 migrations/sequelize/20170809155228-create-user.js create mode 100644 migrations/sequelize/20170809155307-create-category.js create mode 100644 migrations/sequelize/20170809155314-create-product.js create mode 100644 models/mongoose/index.js create mode 100644 models/sequelize/category.js create mode 100644 models/sequelize/index.js create mode 100644 models/sequelize/product.js create mode 100644 models/sequelize/state.js create mode 100644 models/sequelize/user.js create mode 100644 package-lock.json diff --git a/.sequelizerc b/.sequelizerc new file mode 100644 index 0000000..5e15393 --- /dev/null +++ b/.sequelizerc @@ -0,0 +1,17 @@ +var path = require('path'); + +// Set options +var config = { + "config": "./config/sequelize.json", + "migrations-path": "./migrations/sequelize", + "seeders-path": "./seeds/sequelize", + "models-path": "./models/sequelize" +}; + +// Resolve paths to absolute paths +Object.keys(config).forEach((key) => { + config[key] = path.resolve(config[key]); +}); + +// Export like any normal module +module.exports = config; diff --git a/config/sequelize.json b/config/sequelize.json index c4d482a..ec5107b 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -1,13 +1,13 @@ { "development": { - "username": "IanDavid", + "username": "ericglover", "password": null, "database": "mimirs_market_development", "host": "127.0.0.1", "dialect": "postgres" }, "test": { - "username": "IanDavid", + "username": "ericglover", "password": null, "database": "mimirs_market_test", "host": "127.0.0.1", diff --git a/migrations/sequelize/20170809155208-create-state.js b/migrations/sequelize/20170809155208-create-state.js new file mode 100644 index 0000000..34359b1 --- /dev/null +++ b/migrations/sequelize/20170809155208-create-state.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable('States', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + abbreviation: { + type: Sequelize.CHAR + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable('States'); + } +}; \ No newline at end of file diff --git a/migrations/sequelize/20170809155228-create-user.js b/migrations/sequelize/20170809155228-create-user.js new file mode 100644 index 0000000..a6009a5 --- /dev/null +++ b/migrations/sequelize/20170809155228-create-user.js @@ -0,0 +1,30 @@ +'use strict'; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable('Users', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + email: { + type: Sequelize.CHAR + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable('Users'); + } +}; \ No newline at end of file diff --git a/migrations/sequelize/20170809155307-create-category.js b/migrations/sequelize/20170809155307-create-category.js new file mode 100644 index 0000000..a9272bb --- /dev/null +++ b/migrations/sequelize/20170809155307-create-category.js @@ -0,0 +1,27 @@ +'use strict'; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable('Categories', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable('Categories'); + } +}; \ No newline at end of file diff --git a/migrations/sequelize/20170809155314-create-product.js b/migrations/sequelize/20170809155314-create-product.js new file mode 100644 index 0000000..e36e181 --- /dev/null +++ b/migrations/sequelize/20170809155314-create-product.js @@ -0,0 +1,39 @@ +'use strict'; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable('Products', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + description: { + type: Sequelize.CHAR + }, + price: { + type: Sequelize.INTEGER + }, + sku: { + type: Sequelize.INTEGER + }, + categoryId: { + type: Sequelize.INTEGER + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable('Products'); + } +}; \ No newline at end of file diff --git a/models/mongoose/index.js b/models/mongoose/index.js new file mode 100644 index 0000000..e69de29 diff --git a/models/sequelize/category.js b/models/sequelize/category.js new file mode 100644 index 0000000..1a34de0 --- /dev/null +++ b/models/sequelize/category.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = function(sequelize, DataTypes) { + var Category = sequelize.define('Category', { + name: DataTypes.CHAR + }, { + classMethods: { + associate: function(models) { + // associations can be defined here + } + } + }); + return Category; +}; \ No newline at end of file diff --git a/models/sequelize/index.js b/models/sequelize/index.js new file mode 100644 index 0000000..e69de29 diff --git a/models/sequelize/product.js b/models/sequelize/product.js new file mode 100644 index 0000000..759758f --- /dev/null +++ b/models/sequelize/product.js @@ -0,0 +1,17 @@ +'use strict'; +module.exports = function(sequelize, DataTypes) { + var Product = sequelize.define('Product', { + name: DataTypes.CHAR, + description: DataTypes.CHAR, + price: DataTypes.INTEGER, + sku: DataTypes.INTEGER, + categoryId: DataTypes.INTEGER + }, { + classMethods: { + associate: function(models) { + // associations can be defined here + } + } + }); + return Product; +}; \ No newline at end of file diff --git a/models/sequelize/state.js b/models/sequelize/state.js new file mode 100644 index 0000000..3814f4c --- /dev/null +++ b/models/sequelize/state.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function(sequelize, DataTypes) { + var State = sequelize.define('State', { + name: DataTypes.CHAR, + abbreviation: DataTypes.CHAR + }, { + classMethods: { + associate: function(models) { + // associations can be defined here + } + } + }); + return State; +}; \ No newline at end of file diff --git a/models/sequelize/user.js b/models/sequelize/user.js new file mode 100644 index 0000000..fa39568 --- /dev/null +++ b/models/sequelize/user.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function(sequelize, DataTypes) { + var User = sequelize.define('User', { + name: DataTypes.CHAR, + email: DataTypes.CHAR + }, { + classMethods: { + associate: function(models) { + // associations can be defined here + } + } + }); + return User; +}; \ No newline at end of file diff --git a/mongo.js b/mongo.js index e69de29..62ea4c0 100644 --- a/mongo.js +++ b/mongo.js @@ -0,0 +1,10 @@ +const mongoose = require("mongoose"); +var env = process.env.NODE_ENV || "development"; +var config = require("./config/mongo")[env]; + +module.exports = () => { + var envUrl = process.env[config.use_env_variable]; + var localUrl = `mongodb://${config.host}/${config.database}`; + var mongoUrl = envUrl ? envUrl : localUrl; + return mongoose.connect(mongoUrl); +}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..52401f7 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3642 @@ +{ + "name": "project_mimirs_market", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/geojson": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.2.tgz", + "integrity": "sha1-sC0QqwKOKSisWSoFGqpJgaGUHQM=" + }, + "@types/node": { + "version": "6.0.85", + "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.85.tgz", + "integrity": "sha512-6qLZpfQFO/g5Ns2e7RsW6brk0Q6Xzwiw7kVVU/XiQNOiJXSojhX76GP457PBYIsNMH2WfcGgcnZB4awFDHrwpA==" + }, + "abbrev": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=" + }, + "accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "requires": { + "mime-types": "2.1.16", + "negotiator": "0.6.1" + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "requires": { + "color-convert": "1.9.0" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "ap": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ap/-/ap-0.2.0.tgz", + "integrity": "sha1-rglCYAspkS8NKxTsYMRejzMLYRA=" + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=" + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "array-slice": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz", + "integrity": "sha1-5zA08A3MH0CHYAj9IP6ud71LfC8=" + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "basic-auth": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", + "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=" + }, + "beeper": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", + "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=" + }, + "bluebird": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" + }, + "body-parser": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.17.2.tgz", + "integrity": "sha1-+IkqvI+eYn1Crtr7yma/WrmRBO4=", + "requires": { + "bytes": "2.4.0", + "content-type": "1.0.2", + "debug": "2.6.7", + "depd": "1.1.1", + "http-errors": "1.6.2", + "iconv-lite": "0.4.15", + "on-finished": "2.3.0", + "qs": "6.4.0", + "raw-body": "2.2.0", + "type-is": "1.6.15" + } + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "bson": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz", + "integrity": "sha1-k8ENOeqltYQVy8QFLz5T5WKwtyw=" + }, + "buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" + }, + "buffer-writer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz", + "integrity": "sha1-Iqk2kB4wKa/NdUfrRIfOtpejvwg=" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "bytes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", + "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=" + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "optional": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.2.1" + } + }, + "cli-color": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.2.0.tgz", + "integrity": "sha1-OlrnT9drYmevZm5p4q+70B3vNNE=", + "requires": { + "ansi-regex": "2.1.1", + "d": "1.0.0", + "es5-ext": "0.10.26", + "es6-iterator": "2.0.1", + "memoizee": "0.4.5", + "timers-ext": "0.1.2" + } + }, + "cli-highlight": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-1.1.4.tgz", + "integrity": "sha1-5FWQwU+xjhOGXjiZ6CTFWSzCKSY=", + "requires": { + "chalk": "1.1.3", + "he": "1.1.1", + "highlight.js": "9.12.0", + "mz": "2.6.0", + "yargs": "4.8.1" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + }, + "yargs": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "requires": { + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "lodash.assign": "4.2.0", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "window-size": "0.2.0", + "y18n": "3.2.1", + "yargs-parser": "2.4.1" + } + } + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "optional": true + } + } + }, + "clone": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=" + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=" + }, + "cls-bluebird": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/cls-bluebird/-/cls-bluebird-2.0.1.tgz", + "integrity": "sha1-wlmkgK4CwOUGE0MHuxPbMERu4uc=", + "requires": { + "is-bluebird": "1.0.2", + "shimmer": "1.1.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "color-convert": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", + "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "config-chain": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", + "integrity": "sha1-q6CXR9++TD5w52am5BWG4YWfxvI=", + "requires": { + "ini": "1.3.4", + "proto-list": "1.2.4" + } + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", + "integrity": "sha1-t9ETrueo3Se9IRM8TcJSnfFyHu0=" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-parser": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz", + "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6" + } + }, + "cookie-session": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-1.3.0.tgz", + "integrity": "sha512-ql3gtHDd0yn3fX3Kjtm1aS8wkpwr3qbx8MhQMYuPFu5ENQTNukSFCIxiX6mPtw2AKWYer8BMWdXk2V3Sbnft0g==", + "requires": { + "cookies": "0.7.0", + "debug": "2.6.8", + "on-headers": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cookies": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.7.0.tgz", + "integrity": "sha1-C8lh2RDDUlSYD8fJ7/XaEgEbvwA=", + "requires": { + "depd": "1.1.1", + "keygrip": "1.0.1" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "crc": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.4.4.tgz", + "integrity": "sha1-naHpgOO9RPxck79as9ozeNheRms=" + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "requires": { + "es5-ext": "0.10.26" + } + }, + "dateformat": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.0.0.tgz", + "integrity": "sha1-J0Pjq7XD/CRi5SfcpEXgTp9N7hc=" + }, + "debug": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", + "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "requires": { + "clone": "1.0.2" + } + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "deprecated": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", + "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "detect-file": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", + "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", + "requires": { + "fs-exists-sync": "0.1.0" + } + }, + "dottie": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.0.tgz", + "integrity": "sha1-2hkZgci41xPKARXViYzzl8Lw3dA=" + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "requires": { + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "editorconfig": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.2.tgz", + "integrity": "sha1-jleSbZ7mmrbLmZ8CfCFxRnrM6zU=", + "requires": { + "bluebird": "3.5.0", + "commander": "2.11.0", + "lru-cache": "3.2.0", + "sigmund": "1.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", + "requires": { + "pseudomap": "1.0.2" + } + } + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", + "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" + }, + "end-of-stream": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", + "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", + "requires": { + "once": "1.3.3" + }, + "dependencies": { + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "requires": { + "wrappy": "1.0.2" + } + } + } + }, + "env-cmd": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/env-cmd/-/env-cmd-5.1.0.tgz", + "integrity": "sha1-AjbbOTw/AzAFIE/NCpLuQHI6nJ4=", + "requires": { + "cross-spawn": "5.1.0" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es5-ext": { + "version": "0.10.26", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.26.tgz", + "integrity": "sha1-UbISilMbcMT2dkCTpzy+u4IYY3I=", + "requires": { + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" + } + }, + "es6-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.26", + "es6-symbol": "3.1.1" + } + }, + "es6-promise": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", + "integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q=" + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.26" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.26", + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "etag": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", + "integrity": "sha1-b2Ma7zNtbEY2K1F2QETOIWvjwFE=" + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.26" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "requires": { + "fill-range": "2.2.3" + } + }, + "expand-tilde": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", + "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", + "requires": { + "os-homedir": "1.0.2" + } + }, + "express": { + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.4.tgz", + "integrity": "sha1-Ay4iU0ic+PzgJma+yj0R7XotrtE=", + "requires": { + "accepts": "1.3.3", + "array-flatten": "1.1.1", + "content-disposition": "0.5.2", + "content-type": "1.0.2", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.8", + "depd": "1.1.1", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.0", + "finalhandler": "1.0.4", + "fresh": "0.5.0", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.1", + "path-to-regexp": "0.1.7", + "proxy-addr": "1.1.5", + "qs": "6.5.0", + "range-parser": "1.2.0", + "send": "0.15.4", + "serve-static": "1.12.4", + "setprototypeof": "1.0.3", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.0", + "vary": "1.1.1" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + }, + "qs": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", + "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==" + } + } + }, + "express-handlebars": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/express-handlebars/-/express-handlebars-3.0.0.tgz", + "integrity": "sha1-gKBwu4GbCeSvLKbQeA91zgXnXC8=", + "requires": { + "glob": "6.0.4", + "graceful-fs": "4.1.11", + "handlebars": "4.0.10", + "object.assign": "4.0.4", + "promise": "7.3.1" + } + }, + "express-method-override-get-post-support": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/express-method-override-get-post-support/-/express-method-override-get-post-support-0.0.7.tgz", + "integrity": "sha512-aHO/iYL9GV4FoRZACHkhOYfHXVljwu5LbGMOuq8++6K2JpG6437oZt64w1k3Ff6oPq1/0AtsGYnZwyivKUi67A==" + }, + "express-session": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.5.tgz", + "integrity": "sha512-BBVy6E/XqjB507wqe5T+7Ia2N/gtur/dT/fKmvGGKQqUrzI4dcBPGJgV4t2ciX7FoxZPhZcKTDTmb4+5nCyQOw==", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "crc": "3.4.4", + "debug": "2.6.8", + "depd": "1.1.1", + "on-headers": "1.0.1", + "parseurl": "1.3.1", + "uid-safe": "2.1.5", + "utils-merge": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "requires": { + "is-extglob": "1.0.0" + } + }, + "fancy-log": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", + "integrity": "sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg=", + "requires": { + "chalk": "1.1.3", + "time-stamp": "1.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "finalhandler": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.4.tgz", + "integrity": "sha512-16l/r8RgzlXKmFOhZpHBztvye+lAhC5SU7hXavnerC9UfZqZxxXl3BzL8MhffPT3kF61lj9Oav2LKEzh0ei7tg==", + "requires": { + "debug": "2.6.8", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.1", + "statuses": "1.3.1", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "find-index": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", + "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=" + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "findup-sync": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-1.0.0.tgz", + "integrity": "sha1-b35LV7buOkA3tEFOrt6j9Y9x4Ow=", + "requires": { + "detect-file": "0.1.0", + "is-glob": "2.0.1", + "micromatch": "2.3.11", + "resolve-dir": "0.1.1" + } + }, + "fined": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", + "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", + "requires": { + "expand-tilde": "2.0.2", + "is-plain-object": "2.0.4", + "object.defaults": "1.1.0", + "object.pick": "1.2.0", + "parse-filepath": "1.0.1" + }, + "dependencies": { + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "requires": { + "homedir-polyfill": "1.0.1" + } + } + } + }, + "first-chunk-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", + "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=" + }, + "flagged-respawn": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-0.3.2.tgz", + "integrity": "sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU=" + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "requires": { + "for-in": "1.0.2" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + }, + "forwarded": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz", + "integrity": "sha1-Ge+YdMSuHCl7zweP3mOgm2aoQ2M=" + }, + "fresh": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", + "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=" + }, + "fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=" + }, + "fs-extra": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.1.tgz", + "integrity": "sha1-f8DGyJV/mD9X8waiTlud3Y0N2IA=", + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "3.0.1", + "universalify": "0.1.1" + } + }, + "function-bind": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", + "integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=" + }, + "gaze": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", + "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "requires": { + "globule": "0.1.0" + } + }, + "generic-pool": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.1.7.tgz", + "integrity": "sha1-2sIrLHp6BOQXMvfY0tJaMDyI9mI=" + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "2.0.1" + } + }, + "glob-stream": { + "version": "3.1.18", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", + "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", + "requires": { + "glob": "4.5.3", + "glob2base": "0.0.12", + "minimatch": "2.0.10", + "ordered-read-streams": "0.1.0", + "through2": "0.6.5", + "unique-stream": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "requires": { + "brace-expansion": "1.1.8" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + } + } + }, + "glob-watcher": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", + "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", + "requires": { + "gaze": "0.5.2" + } + }, + "glob2base": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", + "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "requires": { + "find-index": "0.1.1" + } + }, + "global-modules": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", + "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "requires": { + "global-prefix": "0.1.5", + "is-windows": "0.2.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", + "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "requires": { + "homedir-polyfill": "1.0.1", + "ini": "1.3.4", + "is-windows": "0.2.0", + "which": "1.3.0" + } + }, + "globule": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", + "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", + "requires": { + "glob": "3.1.21", + "lodash": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=" + }, + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=" + }, + "lodash": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", + "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=" + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "glogg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", + "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", + "requires": { + "sparkles": "1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "gulp": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", + "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", + "requires": { + "archy": "1.0.0", + "chalk": "1.1.3", + "deprecated": "0.0.1", + "gulp-util": "3.0.8", + "interpret": "1.0.3", + "liftoff": "2.3.0", + "minimist": "1.2.0", + "orchestrator": "0.3.8", + "pretty-hrtime": "1.0.3", + "semver": "4.3.6", + "tildify": "1.2.0", + "v8flags": "2.1.1", + "vinyl-fs": "0.3.14" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "gulp-help": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/gulp-help/-/gulp-help-1.6.1.tgz", + "integrity": "sha1-Jh2xhuGDl/7z9qLCLpwxW/qIrgw=", + "requires": { + "chalk": "1.1.3", + "object-assign": "3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "gulp-util": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", + "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", + "requires": { + "array-differ": "1.0.0", + "array-uniq": "1.0.3", + "beeper": "1.1.1", + "chalk": "1.1.3", + "dateformat": "2.0.0", + "fancy-log": "1.3.0", + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash._reescape": "3.0.0", + "lodash._reevaluate": "3.0.0", + "lodash._reinterpolate": "3.0.0", + "lodash.template": "3.6.2", + "minimist": "1.2.0", + "multipipe": "0.1.2", + "object-assign": "3.0.0", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl": "0.5.3" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "requires": { + "glogg": "1.0.0" + } + }, + "handlebars": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.10.tgz", + "integrity": "sha1-PTDHGLCaPZbyPqTMH0A8TTup/08=", + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "requires": { + "sparkles": "1.0.0" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + }, + "highlight.js": { + "version": "9.12.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.12.0.tgz", + "integrity": "sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4=" + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "requires": { + "parse-passwd": "1.0.0" + } + }, + "hooks-fixed": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-2.0.0.tgz", + "integrity": "sha1-oB2JTVKsf2WZu7H2PfycQR33DLo=" + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1" + } + }, + "iconv-lite": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", + "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=" + }, + "inflection": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.10.0.tgz", + "integrity": "sha1-W//LEZetPoEFD44X4hZoCH7p6y8=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" + }, + "interpret": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", + "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "ipaddr.js": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz", + "integrity": "sha1-KWrKh4qCGBbluF0KKFqZvP9FgvA=" + }, + "is-absolute": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", + "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "requires": { + "is-relative": "0.2.1", + "is-windows": "0.2.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-bluebird": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz", + "integrity": "sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI=" + }, + "is-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "requires": { + "kind-of": "3.2.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-relative": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", + "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "requires": { + "is-unc-path": "0.1.2" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-unc-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", + "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "requires": { + "unc-path-regex": "0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + }, + "js-beautify": { + "version": "1.6.14", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.6.14.tgz", + "integrity": "sha1-07j3Mi0CuSd9WL0jgmTDJ+WARM0=", + "requires": { + "config-chain": "1.1.11", + "editorconfig": "0.13.2", + "mkdirp": "0.5.1", + "nopt": "3.0.6" + } + }, + "jsonfile": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", + "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", + "requires": { + "graceful-fs": "4.1.11" + } + }, + "kareem": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-1.5.0.tgz", + "integrity": "sha1-4+QQHZ3P3imXadr0tNtk2JXRdEg=" + }, + "keygrip": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.0.1.tgz", + "integrity": "sha1-sC+kgW7vIajEs1yp5Skh/8iaMOk=" + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "optional": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } + }, + "liftoff": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.3.0.tgz", + "integrity": "sha1-qY8v9nGD2Lp8+soQVIvX/wVQs4U=", + "requires": { + "extend": "3.0.1", + "findup-sync": "0.4.3", + "fined": "1.1.0", + "flagged-respawn": "0.3.2", + "lodash.isplainobject": "4.0.6", + "lodash.isstring": "4.0.1", + "lodash.mapvalues": "4.6.0", + "rechoir": "0.6.2", + "resolve": "1.4.0" + }, + "dependencies": { + "findup-sync": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz", + "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=", + "requires": { + "detect-file": "0.1.0", + "is-glob": "2.0.1", + "micromatch": "2.3.11", + "resolve-dir": "0.1.1" + } + } + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + } + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" + }, + "lodash._basetostring": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", + "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=" + }, + "lodash._basevalues": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", + "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=" + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" + }, + "lodash._reescape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", + "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=" + }, + "lodash._reevaluate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", + "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=" + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=" + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, + "lodash.escape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", + "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", + "requires": { + "lodash._root": "3.0.1" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.mapvalues": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", + "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=" + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" + }, + "lodash.template": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", + "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", + "requires": { + "lodash._basecopy": "3.0.1", + "lodash._basetostring": "3.0.1", + "lodash._basevalues": "3.0.0", + "lodash._isiterateecall": "3.0.9", + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0", + "lodash.keys": "3.1.2", + "lodash.restparam": "3.6.1", + "lodash.templatesettings": "3.1.1" + } + }, + "lodash.templatesettings": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", + "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0" + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "requires": { + "es5-ext": "0.10.26" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "1.1.0" + } + }, + "memoizee": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.5.tgz", + "integrity": "sha1-G8PqHkvgVt1HXVIZede+PV5bIcg=", + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.26", + "es6-weak-map": "2.0.2", + "event-emitter": "0.3.5", + "is-promise": "2.1.0", + "lru-queue": "0.1.0", + "next-tick": "1.0.0", + "timers-ext": "0.1.2" + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "method-override": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/method-override/-/method-override-2.3.9.tgz", + "integrity": "sha1-vRUfLONM8Bp2ykAKuVwBKxAtj3E=", + "requires": { + "debug": "2.6.8", + "methods": "1.1.2", + "parseurl": "1.3.1", + "vary": "1.1.1" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.3" + } + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" + }, + "mime-db": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", + "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=" + }, + "mime-types": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", + "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", + "requires": { + "mime-db": "1.29.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "moment": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz", + "integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8=" + }, + "moment-timezone": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.13.tgz", + "integrity": "sha1-mc5cfYJyYusPH3AgRBd/YHRde5A=", + "requires": { + "moment": "2.18.1" + } + }, + "mongodb": { + "version": "2.2.30", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.30.tgz", + "integrity": "sha1-jM2AH2dsgXIEDC8rR+lgKg1WNKs=", + "requires": { + "es6-promise": "3.2.1", + "mongodb-core": "2.1.14", + "readable-stream": "2.2.7" + } + }, + "mongodb-core": { + "version": "2.1.14", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.14.tgz", + "integrity": "sha1-E8uidkImtb49GJkq8Mljzl6g8P0=", + "requires": { + "bson": "1.0.4", + "require_optional": "1.0.1" + } + }, + "mongoose": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.11.6.tgz", + "integrity": "sha512-TZQo1u8zd67ixiWFFoOhu3P7CB73XthLDX0GuGlFGR+49mi5L3I688GsMuayJo7bJhvCrMsG1d8BKJ2Lqdrsvg==", + "requires": { + "async": "2.1.4", + "bson": "1.0.4", + "hooks-fixed": "2.0.0", + "kareem": "1.5.0", + "mongodb": "2.2.30", + "mpath": "0.3.0", + "mpromise": "0.5.5", + "mquery": "2.3.1", + "ms": "2.0.0", + "muri": "1.2.2", + "regexp-clone": "0.0.1", + "sliced": "1.0.1" + }, + "dependencies": { + "async": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", + "integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=", + "requires": { + "lodash": "4.17.4" + } + } + } + }, + "mongoose-findorcreate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mongoose-findorcreate/-/mongoose-findorcreate-2.0.0.tgz", + "integrity": "sha1-Er+dyrBYvL6WQEA//eJfxYKdLPw=" + }, + "mongooseeder": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/mongooseeder/-/mongooseeder-2.0.5.tgz", + "integrity": "sha512-w1+g48UdomQKOukO4Kr89MikmX06qLXs8GvPVJMng1TRRbeZCEv5ZnL0cutoLvDeFfouH+xYB+qDpnqut7beFQ==" + }, + "morgan": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.8.2.tgz", + "integrity": "sha1-eErHc05KRTqcbm6GgKkyknXItoc=", + "requires": { + "basic-auth": "1.1.0", + "debug": "2.6.8", + "depd": "1.1.1", + "on-finished": "2.3.0", + "on-headers": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "morgan-toolkit": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/morgan-toolkit/-/morgan-toolkit-1.0.2.tgz", + "integrity": "sha512-tFhfamRSNrnGlaVfY384lFyeHZl8Y4IwSt2219+6YEuVeEJKVBlAQHT/NSAF5hlHrloI0G578zRy0Hxv4Iv10Q==", + "requires": { + "chalk": "2.1.0", + "cli-highlight": "1.1.4" + } + }, + "mpath": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.3.0.tgz", + "integrity": "sha1-elj3iem1/TyUUgY0FXlg8mvV70Q=" + }, + "mpromise": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.5.tgz", + "integrity": "sha1-9bJCWddjrMIlewoMjG2Gb9UXMuY=" + }, + "mquery": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-2.3.1.tgz", + "integrity": "sha1-mrNnSXFIAP8LtTpoHOS8TV8HyHs=", + "requires": { + "bluebird": "2.10.2", + "debug": "2.6.8", + "regexp-clone": "0.0.1", + "sliced": "0.0.5" + }, + "dependencies": { + "bluebird": { + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz", + "integrity": "sha1-AkpVFylTCIV/FPkfEQb8O1VfRGs=" + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + }, + "sliced": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", + "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multipipe": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "requires": { + "duplexer2": "0.0.2" + } + }, + "muri": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/muri/-/muri-1.2.2.tgz", + "integrity": "sha1-YxmBMmUNsIoEzHnM0A3Tia/SYxw=" + }, + "mz": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.6.0.tgz", + "integrity": "sha1-yLhSHZWN8KTydoAl22nHGe5O8c4=", + "requires": { + "any-promise": "1.3.0", + "object-assign": "4.1.1", + "thenify-all": "1.6.0" + } + }, + "natives": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", + "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1.1.0" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.4.1", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "1.0.2" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" + }, + "object.assign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.0.4.tgz", + "integrity": "sha1-scnMBE7xuf5jYG/BQau7MuFHMMw=", + "requires": { + "define-properties": "1.1.2", + "function-bind": "1.1.0", + "object-keys": "1.0.11" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "requires": { + "array-each": "1.0.1", + "array-slice": "1.0.0", + "for-own": "1.0.0", + "isobject": "3.0.1" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "requires": { + "for-in": "1.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "object.pick": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.2.0.tgz", + "integrity": "sha1-tTkr7peC2m2ft9avr1OXefEjTCs=", + "requires": { + "isobject": "2.1.0" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + } + }, + "orchestrator": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", + "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", + "requires": { + "end-of-stream": "0.1.5", + "sequencify": "0.0.7", + "stream-consume": "0.1.0" + } + }, + "ordered-read-streams": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz", + "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=" + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=" + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "1.1.0" + } + }, + "packet-reader": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-0.3.1.tgz", + "integrity": "sha1-zWLmCvjX/qinBexP+ZCHHEaHHyc=" + }, + "parse-filepath": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.1.tgz", + "integrity": "sha1-FZ1hVdQ5BNFsEO9piRHaHpGWm3M=", + "requires": { + "is-absolute": "0.2.6", + "map-cache": "0.2.2", + "path-root": "0.1.1" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "1.3.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + }, + "parseurl": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", + "integrity": "sha1-yKuMkiO6NIiKpkopeyiFO+wY2lY=" + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "requires": { + "path-root-regex": "0.1.2" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-7.1.0.tgz", + "integrity": "sha1-naPwnTmDUhUhwdg2m22aEwbP6f4=", + "requires": { + "buffer-writer": "1.0.1", + "packet-reader": "0.3.1", + "pg-connection-string": "0.1.3", + "pg-pool": "2.0.1", + "pg-types": "1.12.0", + "pgpass": "1.0.2", + "semver": "4.3.2" + }, + "dependencies": { + "semver": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz", + "integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c=" + } + } + }, + "pg-connection-string": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz", + "integrity": "sha1-2hhHsglA5C7hSSvq9l1J2RskXfc=" + }, + "pg-hstore": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/pg-hstore/-/pg-hstore-2.3.2.tgz", + "integrity": "sha1-9+8FPnubiSrphq8vfL6GQy388k8=", + "requires": { + "underscore": "1.8.3" + } + }, + "pg-pool": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.1.tgz", + "integrity": "sha1-ixJUHfJxtX9wIMUKP1VmRx+Cx34=" + }, + "pg-types": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-1.12.0.tgz", + "integrity": "sha1-itO3uJfj/UY+Yt4kGtX8ZAtKZvA=", + "requires": { + "ap": "0.2.0", + "postgres-array": "1.0.2", + "postgres-bytea": "1.0.0", + "postgres-date": "1.0.3", + "postgres-interval": "1.1.1" + } + }, + "pgpass": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz", + "integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=", + "requires": { + "split": "1.0.1" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "2.0.4" + } + }, + "postgres-array": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-1.0.2.tgz", + "integrity": "sha1-jgsy6wO/d6XAp4UeBEHBaaJWojg=" + }, + "postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=" + }, + "postgres-date": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.3.tgz", + "integrity": "sha1-4tiXAu/bJY/52c7g/pG9BpdSV6g=" + }, + "postgres-interval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.1.1.tgz", + "integrity": "sha512-OkuCi9t/3CZmeQreutGgx/OVNv9MKHGIT5jH8KldQ4NLYXkvmT9nDVxEuCENlNwhlGPE374oA/xMqn05G49pHA==", + "requires": { + "xtend": "4.0.1" + } + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "requires": { + "asap": "2.0.6" + } + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" + }, + "proxy-addr": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz", + "integrity": "sha1-ccDuOxAt4/IC87ZPYI0XP8uhqRg=", + "requires": { + "forwarded": "0.1.0", + "ipaddr.js": "1.4.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" + }, + "random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.2.0.tgz", + "integrity": "sha1-mUl2z2pQlqQRYoQEkvC9xdbn+5Y=", + "requires": { + "bytes": "2.4.0", + "iconv-lite": "0.4.15", + "unpipe": "1.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz", + "integrity": "sha1-BwV6y+JGeyIELTb5jFrVBwVOlbE=", + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "1.4.0" + } + }, + "redefine": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/redefine/-/redefine-0.2.1.tgz", + "integrity": "sha1-6J7npvJNGf/2JZBWkzLcYDgKiaM=" + }, + "regex-cache": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", + "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "requires": { + "is-equal-shallow": "0.1.3", + "is-primitive": "2.0.0" + } + }, + "regexp-clone": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", + "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" + }, + "remove-trailing-separator": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", + "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=" + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=" + }, + "require_optional": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", + "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", + "requires": { + "resolve-from": "2.0.0", + "semver": "5.4.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", + "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "requires": { + "expand-tilde": "1.2.2", + "global-modules": "0.2.3" + } + }, + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + }, + "retry-as-promised": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-2.3.0.tgz", + "integrity": "sha1-J79czZmZMrMWZWloJc82MMJ8Vi0=", + "requires": { + "bluebird": "3.5.0", + "debug": "2.6.7" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "send": { + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.4.tgz", + "integrity": "sha1-mF+qPihLAnPHkzZKNcZze9k5Bbk=", + "requires": { + "debug": "2.6.8", + "depd": "1.1.1", + "destroy": "1.0.4", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.0", + "fresh": "0.5.0", + "http-errors": "1.6.2", + "mime": "1.3.4", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "sequelize": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-4.4.2.tgz", + "integrity": "sha1-lSkuCnUuJYbskqDnI2K3bk/Ljq4=", + "requires": { + "bluebird": "3.5.0", + "cls-bluebird": "2.0.1", + "debug": "2.6.7", + "depd": "1.1.1", + "dottie": "2.0.0", + "env-cmd": "5.1.0", + "generic-pool": "3.1.7", + "inflection": "1.10.0", + "lodash": "4.17.4", + "moment": "2.18.1", + "moment-timezone": "0.5.13", + "retry-as-promised": "2.3.0", + "semver": "5.4.1", + "terraformer-wkt-parser": "1.1.2", + "toposort-class": "1.0.1", + "uuid": "3.1.0", + "validator": "6.3.0", + "wkx": "0.4.1" + } + }, + "sequelize-cli": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/sequelize-cli/-/sequelize-cli-2.8.0.tgz", + "integrity": "sha1-QwTM5g5JkWlgP4ON7bq0IcmEnnQ=", + "requires": { + "bluebird": "3.5.0", + "cli-color": "1.2.0", + "findup-sync": "1.0.0", + "fs-extra": "4.0.1", + "gulp": "3.9.1", + "gulp-help": "1.6.1", + "js-beautify": "1.6.14", + "lodash": "4.17.4", + "moment": "2.18.1", + "resolve": "1.4.0", + "umzug": "1.12.0", + "yargs": "8.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "2.0.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "requires": { + "pify": "2.3.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "yargs": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", + "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", + "requires": { + "camelcase": "4.1.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "read-pkg-up": "2.0.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "7.0.0" + } + }, + "yargs-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", + "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "sequencify": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz", + "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=" + }, + "serve-static": { + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.4.tgz", + "integrity": "sha1-m2qpjutyU8Tu3Ewfb9vKYJkBqWE=", + "requires": { + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "parseurl": "1.3.1", + "send": "0.15.4" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "shimmer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.1.0.tgz", + "integrity": "sha1-l9c3cTf/u6tCVSLkKf4KqJpIizU=" + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "requires": { + "amdefine": "1.0.1" + } + }, + "sparkles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", + "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=" + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=" + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=" + }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "requires": { + "through": "2.3.8" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + }, + "stream-consume": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz", + "integrity": "sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8=" + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "supports-color": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", + "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "requires": { + "has-flag": "2.0.0" + } + }, + "terraformer": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/terraformer/-/terraformer-1.0.8.tgz", + "integrity": "sha1-UeCtiXRvzyFh3G9lqnDkI3fItZM=", + "requires": { + "@types/geojson": "1.0.2" + } + }, + "terraformer-wkt-parser": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/terraformer-wkt-parser/-/terraformer-wkt-parser-1.1.2.tgz", + "integrity": "sha1-M2oMj8gglKWv+DKI9prt7NNpvww=", + "requires": { + "terraformer": "1.0.8" + } + }, + "thenify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", + "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "requires": { + "any-promise": "1.3.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": "3.3.0" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "2.2.7", + "xtend": "4.0.1" + } + }, + "tildify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", + "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", + "requires": { + "os-homedir": "1.0.2" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=" + }, + "timers-ext": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.2.tgz", + "integrity": "sha1-YcxHp2wavTGV8UUn+XjViulMUgQ=", + "requires": { + "es5-ext": "0.10.26", + "next-tick": "1.0.0" + } + }, + "toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg=" + }, + "type-is": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", + "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.16" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "optional": true, + "requires": { + "source-map": "0.5.6", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "optional": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true + }, + "uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "requires": { + "random-bytes": "1.0.0" + } + }, + "umzug": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/umzug/-/umzug-1.12.0.tgz", + "integrity": "sha1-p5yR8oYu7jEwxsNH8rkK1opm6Lg=", + "requires": { + "bluebird": "3.5.0", + "lodash": "4.17.4", + "moment": "2.18.1", + "redefine": "0.2.1", + "resolve": "1.4.0" + } + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + }, + "unique-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", + "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=" + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utils-merge": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "requires": { + "user-home": "1.1.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "validator": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-6.3.0.tgz", + "integrity": "sha1-R84j7Y1Ord+p1LjvAHG2zxB418g=" + }, + "vary": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz", + "integrity": "sha1-Z1Neu2lMHVIldFeYRmUyP1h+jTc=" + }, + "vinyl": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", + "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "requires": { + "clone": "1.0.2", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-fs": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", + "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", + "requires": { + "defaults": "1.0.3", + "glob-stream": "3.1.18", + "glob-watcher": "0.0.6", + "graceful-fs": "3.0.11", + "mkdirp": "0.5.1", + "strip-bom": "1.0.0", + "through2": "0.6.5", + "vinyl": "0.4.6" + }, + "dependencies": { + "clone": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", + "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=" + }, + "graceful-fs": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", + "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", + "requires": { + "natives": "1.1.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "strip-bom": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", + "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", + "requires": { + "first-chunk-stream": "1.0.0", + "is-utf8": "0.2.1" + } + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", + "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", + "requires": { + "clone": "0.2.0", + "clone-stats": "0.0.1" + } + } + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "optional": true + }, + "wkx": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.4.1.tgz", + "integrity": "sha1-L8FxtenLVcYlb+9L3h8hvkE77+4=", + "requires": { + "@types/node": "6.0.85" + } + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "requires": { + "camelcase": "3.0.0", + "lodash.assign": "4.2.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + } + } + } + } +} diff --git a/package.json b/package.json index ba371e3..d15abde 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,17 @@ "description": "A Viking eCommerce store for Thunder Gods that like to buy \"Antique Wooden Pizzas\"", "main": "app.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "start": "nodemon app.js", + "sql:migrate:undo": "npm run sql db:migrate:undo:all", + "sql:migrate": "npm run sql db:migrate", + "sql:seed:undo": "npm run sql db:seed:undo:all", + "sql:seed": "npm run sql db:seed:all", + "sql:s": "npm run sql:migrate:undo && npm run sql:migrate && npm run sql:seed", + "mg:seed": "node seeds/mongoose", + "console": "node repl.js", + "c": "node repl.js", + "sql": "./node_modules/sequelize-cli/bin/sequelize" }, "repository": { "type": "git", diff --git a/repl.js b/repl.js index e69de29..6267b63 100644 --- a/repl.js +++ b/repl.js @@ -0,0 +1,46 @@ +var mongoose = require("mongoose"); +var repl = require("repl").start({}); +var models = { + mongoose: require("./models/mongoose"), + sequelize: require("./models/sequelize") +}; +// var helpers = require('./helpers'); + +require("./mongo")().then(() => { + repl.context.models = models; + repl.context.helpers = helpers; + + // + // // ---------------------------------------- + // // Helpers + // // ---------------------------------------- + // Object.keys(helpers).forEach((key) => { + // repl.context[key] = helpers[key]; + // }); + + // ---------------------------------------- + // Mongoose + // ---------------------------------------- + Object.keys(models.mongoose).forEach(modelName => { + repl.context[modelName] = mongoose.model(modelName); + }); + + // ---------------------------------------- + // Sequelize + // ---------------------------------------- + Object.keys(models.sequelize).forEach(modelName => { + repl.context[modelName] = models.sequelize[modelName]; + }); + + // ---------------------------------------- + // Logging + // ---------------------------------------- + repl.context.lg = data => { + if (Array.isArray(data)) { + if (data.length && data[0].dataValues) { + data = data.map(item => item.dataValues); + } + } + console.log(data); + }; +}); diff --git a/schema.txt b/schema.txt index d31ffad..69f8846 100644 --- a/schema.txt +++ b/schema.txt @@ -22,8 +22,22 @@ Product - price - SKU +Relationships +Product belongs to one Category +Category has many Products + + --> SUBMITTING ORDER --> userId, name, email, state, items(id, name, categoryid, quantity) +CREATE COMMANDS +sequelize model:create --name State --attributes "name:char abbreviation:char" +sequelize model:create --name User --attributes "name:char email:char" +sequelize model:create --name Category --attributes "name:char" +sequelize model:create --name Product --attributes "name:char description:char price:integer sku:integer categoryId:integer" + + +mongod --dbpath=/Users/ericglover/data/ + MONGODB From 2115eef8172c5bd143fb0278c6c1232b6e5f96b1 Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 12:33:57 -0400 Subject: [PATCH 05/17] setting up seeds --- app.js | 68 +++++++++++++++++++ config/sequelize.json | 19 +++--- ...tate.js => 20170809162905-create-state.js} | 14 ++-- ...-user.js => 20170809162911-create-user.js} | 14 ++-- ...y.js => 20170809162916-create-category.js} | 14 ++-- ...ct.js => 20170809162921-create-product.js} | 14 ++-- models/sequelize/index.js | 36 ++++++++++ mongo.js | 2 +- routers/products.js | 2 + seeds/sequelize/20170809163150-products.js | 14 ++++ 10 files changed, 164 insertions(+), 33 deletions(-) rename migrations/sequelize/{20170809155208-create-state.js => 20170809162905-create-state.js} (64%) rename migrations/sequelize/{20170809155228-create-user.js => 20170809162911-create-user.js} (64%) rename migrations/sequelize/{20170809155307-create-category.js => 20170809162916-create-category.js} (61%) rename migrations/sequelize/{20170809155314-create-product.js => 20170809162921-create-product.js} (71%) create mode 100644 routers/products.js create mode 100644 seeds/sequelize/20170809163150-products.js diff --git a/app.js b/app.js index e69de29..da8c833 100644 --- a/app.js +++ b/app.js @@ -0,0 +1,68 @@ +var express = require("express"); +var app = express(); + +var bodyParser = require("body-parser"); +app.use(bodyParser.urlencoded({ extended: true })); +var cookieSession = require("cookie-session"); +app.use( + cookieSession({ + name: "session", + keys: ["asdf1234567890qwer"] + }) +); + +const methodOverride = require("method-override"); +const getPostSupport = require("express-method-override-get-post-support"); +app.use( + methodOverride( + getPostSupport.callback, + getPostSupport.options // { methods: ['POST', 'GET'] } + ) +); +app.use((req, res, next) => { + req.session.backUrl = req.header("Referer") || "/"; + next(); +}); +app.use(express.static(`${__dirname}/public`)); +var morgan = require("morgan"); +var morganToolkit = require("morgan-toolkit")(morgan); +app.use(morgan("tiny")); +app.use(morganToolkit()); + +const mongoose = require("mongoose"); +app.use((req, res, next) => { + if (mongoose.connection.readyState) { + next(); + } else { + require("./mongo")().then(() => next()); + } +}); + +// build routes here + +app.get("/", (req, res) => { + res.end("working"); +}); + +var expressHandlebars = require("express-handlebars"); +var hbs = expressHandlebars.create({ + partialsDir: "views/partials", + defaultLayout: "application" +}); + +app.engine("handlebars", hbs.engine); +app.set("view engine", "handlebars"); + +var port = process.env.PORT || process.argv[2] || 3000; +var host = "localhost"; + +var args; +process.env.NODE_ENV === "production" ? (args = [port]) : (args = [port, host]); + +args.push(() => { + console.log(`Listening: http://${host}:${port}`); +}); + +app.listen.apply(app, args); + +module.exports = app; diff --git a/config/sequelize.json b/config/sequelize.json index ec5107b..0f858c6 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -1,20 +1,23 @@ { "development": { - "username": "ericglover", + "username": "root", "password": null, - "database": "mimirs_market_development", + "database": "database_development", "host": "127.0.0.1", - "dialect": "postgres" + "dialect": "mysql" }, "test": { - "username": "ericglover", + "username": "root", "password": null, - "database": "mimirs_market_test", + "database": "database_test", "host": "127.0.0.1", - "dialect": "postgres" + "dialect": "mysql" }, "production": { - "use_env_variable": "DATABASE_URL", - "dialect": "postgres" + "username": "root", + "password": null, + "database": "database_production", + "host": "127.0.0.1", + "dialect": "mysql" } } diff --git a/migrations/sequelize/20170809155208-create-state.js b/migrations/sequelize/20170809162905-create-state.js similarity index 64% rename from migrations/sequelize/20170809155208-create-state.js rename to migrations/sequelize/20170809162905-create-state.js index 34359b1..a26435e 100644 --- a/migrations/sequelize/20170809155208-create-state.js +++ b/migrations/sequelize/20170809162905-create-state.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { up: function(queryInterface, Sequelize) { - return queryInterface.createTable('States', { + return queryInterface.createTable("States", { id: { allowNull: false, autoIncrement: true, @@ -16,15 +16,17 @@ module.exports = { }, createdAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") }, updatedAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") } }); }, down: function(queryInterface, Sequelize) { - return queryInterface.dropTable('States'); + return queryInterface.dropTable("States"); } -}; \ No newline at end of file +}; diff --git a/migrations/sequelize/20170809155228-create-user.js b/migrations/sequelize/20170809162911-create-user.js similarity index 64% rename from migrations/sequelize/20170809155228-create-user.js rename to migrations/sequelize/20170809162911-create-user.js index a6009a5..6fb3e04 100644 --- a/migrations/sequelize/20170809155228-create-user.js +++ b/migrations/sequelize/20170809162911-create-user.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { up: function(queryInterface, Sequelize) { - return queryInterface.createTable('Users', { + return queryInterface.createTable("Users", { id: { allowNull: false, autoIncrement: true, @@ -16,15 +16,17 @@ module.exports = { }, createdAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") }, updatedAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") } }); }, down: function(queryInterface, Sequelize) { - return queryInterface.dropTable('Users'); + return queryInterface.dropTable("Users"); } -}; \ No newline at end of file +}; diff --git a/migrations/sequelize/20170809155307-create-category.js b/migrations/sequelize/20170809162916-create-category.js similarity index 61% rename from migrations/sequelize/20170809155307-create-category.js rename to migrations/sequelize/20170809162916-create-category.js index a9272bb..d545406 100644 --- a/migrations/sequelize/20170809155307-create-category.js +++ b/migrations/sequelize/20170809162916-create-category.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { up: function(queryInterface, Sequelize) { - return queryInterface.createTable('Categories', { + return queryInterface.createTable("Categories", { id: { allowNull: false, autoIncrement: true, @@ -13,15 +13,17 @@ module.exports = { }, createdAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") }, updatedAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") } }); }, down: function(queryInterface, Sequelize) { - return queryInterface.dropTable('Categories'); + return queryInterface.dropTable("Categories"); } -}; \ No newline at end of file +}; diff --git a/migrations/sequelize/20170809155314-create-product.js b/migrations/sequelize/20170809162921-create-product.js similarity index 71% rename from migrations/sequelize/20170809155314-create-product.js rename to migrations/sequelize/20170809162921-create-product.js index e36e181..2a9e124 100644 --- a/migrations/sequelize/20170809155314-create-product.js +++ b/migrations/sequelize/20170809162921-create-product.js @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; module.exports = { up: function(queryInterface, Sequelize) { - return queryInterface.createTable('Products', { + return queryInterface.createTable("Products", { id: { allowNull: false, autoIncrement: true, @@ -25,15 +25,17 @@ module.exports = { }, createdAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") }, updatedAt: { allowNull: false, - type: Sequelize.DATE + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") } }); }, down: function(queryInterface, Sequelize) { - return queryInterface.dropTable('Products'); + return queryInterface.dropTable("Products"); } -}; \ No newline at end of file +}; diff --git a/models/sequelize/index.js b/models/sequelize/index.js index e69de29..87f9801 100644 --- a/models/sequelize/index.js +++ b/models/sequelize/index.js @@ -0,0 +1,36 @@ +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var Sequelize = require('sequelize'); +var basename = path.basename(module.filename); +var env = process.env.NODE_ENV || 'development'; +var config = require(__dirname + '/../../config/sequelize.json')[env]; +var db = {}; + +if (config.use_env_variable) { + var sequelize = new Sequelize(process.env[config.use_env_variable]); +} else { + var sequelize = new Sequelize(config.database, config.username, config.password, config); +} + +fs + .readdirSync(__dirname) + .filter(function(file) { + return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js'); + }) + .forEach(function(file) { + var model = sequelize['import'](path.join(__dirname, file)); + db[model.name] = model; + }); + +Object.keys(db).forEach(function(modelName) { + if (db[modelName].associate) { + db[modelName].associate(db); + } +}); + +db.sequelize = sequelize; +db.Sequelize = Sequelize; + +module.exports = db; diff --git a/mongo.js b/mongo.js index 62ea4c0..f31d03f 100644 --- a/mongo.js +++ b/mongo.js @@ -1,6 +1,6 @@ const mongoose = require("mongoose"); var env = process.env.NODE_ENV || "development"; -var config = require("./config/mongo")[env]; +var config = require("./config/mongo"); module.exports = () => { var envUrl = process.env[config.use_env_variable]; diff --git a/routers/products.js b/routers/products.js new file mode 100644 index 0000000..7c3714b --- /dev/null +++ b/routers/products.js @@ -0,0 +1,2 @@ +var express = require("express"); +var router = express.Router(); diff --git a/seeds/sequelize/20170809163150-products.js b/seeds/sequelize/20170809163150-products.js new file mode 100644 index 0000000..7123f41 --- /dev/null +++ b/seeds/sequelize/20170809163150-products.js @@ -0,0 +1,14 @@ +"use strict"; + +const model = require("../../models"); + +module.exports = { + up: function(queryInterface, Sequelize) { + //stuff + return queryInterface.bulkInsert("Product", [], {}); + }, + + down: function(queryInterface, Sequelize) { + return queryInterface.bulkDelete("Person", null, {}, model.Products); + } +}; From 6dfb0878454c2d0606becf9c128ed044d47a8551 Mon Sep 17 00:00:00 2001 From: Eric Glover Date: Wed, 9 Aug 2017 12:07:03 -0500 Subject: [PATCH 06/17] seeding Products --- config/sequelize.json | 19 ++++++++----------- package-lock.json | 10 ++++++++++ package.json | 2 ++ schema.txt | 2 -- seeds/sequelize/20170809163150-products.js | 20 +++++++++++++++++--- 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/config/sequelize.json b/config/sequelize.json index 0f858c6..ec5107b 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -1,23 +1,20 @@ { "development": { - "username": "root", + "username": "ericglover", "password": null, - "database": "database_development", + "database": "mimirs_market_development", "host": "127.0.0.1", - "dialect": "mysql" + "dialect": "postgres" }, "test": { - "username": "root", + "username": "ericglover", "password": null, - "database": "database_test", + "database": "mimirs_market_test", "host": "127.0.0.1", - "dialect": "mysql" + "dialect": "postgres" }, "production": { - "username": "root", - "password": null, - "database": "database_production", - "host": "127.0.0.1", - "dialect": "mysql" + "use_env_variable": "DATABASE_URL", + "dialect": "postgres" } } diff --git a/package-lock.json b/package-lock.json index 52401f7..af5c74c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -848,6 +848,16 @@ "is-extglob": "1.0.0" } }, + "faker": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/faker/-/faker-4.1.0.tgz", + "integrity": "sha1-HkW7vsxndLPBlfrSg1EJxtdIzD8=" + }, + "Faker": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/Faker/-/Faker-0.7.2.tgz", + "integrity": "sha1-wkdLx3ux14AYtod9MHvX/fCC+xQ=" + }, "fancy-log": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", diff --git a/package.json b/package.json index d15abde..e4cac23 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ }, "homepage": "https://github.com/IDHalverson/project_mimirs_market#readme", "dependencies": { + "Faker": "^0.7.2", "bluebird": "^3.5.0", "body-parser": "^1.17.2", "cookie-parser": "^1.4.3", @@ -35,6 +36,7 @@ "express-handlebars": "^3.0.0", "express-method-override-get-post-support": "0.0.7", "express-session": "^1.15.5", + "faker": "^4.1.0", "method-override": "^2.3.9", "mongoose": "^4.11.6", "mongoose-findorcreate": "^2.0.0", diff --git a/schema.txt b/schema.txt index 69f8846..1f6bf5f 100644 --- a/schema.txt +++ b/schema.txt @@ -36,8 +36,6 @@ sequelize model:create --name Category --attributes "name:char" sequelize model:create --name Product --attributes "name:char description:char price:integer sku:integer categoryId:integer" -mongod --dbpath=/Users/ericglover/data/ - MONGODB diff --git a/seeds/sequelize/20170809163150-products.js b/seeds/sequelize/20170809163150-products.js index 7123f41..de21d16 100644 --- a/seeds/sequelize/20170809163150-products.js +++ b/seeds/sequelize/20170809163150-products.js @@ -1,11 +1,25 @@ "use strict"; +const model = require("../../models/sequelize"); +const Product = model.Product; +let faker = require("Faker"); -const model = require("../../models"); +// module.exports = { up: function(queryInterface, Sequelize) { - //stuff - return queryInterface.bulkInsert("Product", [], {}); + let seeds = []; + for (var i = 0; i < 50; i++) { + let name = `${faker.random.catch_phrase_descriptor()} ${faker.random.bs_adjective()} ${faker.random.bs_noun()}`; + let p = { + name: name, + description: faker.Lorem.sentence(), + price: faker.random.number(5000), + sku: Math.random() * 122221, + categoryId: i + }; + seeds.push(p); + } + return queryInterface.bulkInsert("Products", seeds, {}); }, down: function(queryInterface, Sequelize) { From a319e7f44c258b98f78e4779ea91c340f4fbdb2e Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 14:59:25 -0400 Subject: [PATCH 07/17] did stuff --- .gitignore | 1 - config/sequelize.json | 7 ++- .../sequelize/20170809155208-create-state.js | 32 +++++++++++++ .../sequelize/20170809155228-create-user.js | 32 +++++++++++++ .../20170809155307-create-category.js | 29 ++++++++++++ .../20170809155314-create-product.js | 41 +++++++++++++++++ models/sequelize/index.js | 29 +++++++----- mongo.js | 2 +- npm-debug.log | 45 +++++++++++++++++++ repl.js | 1 + seeds/sequelize/20170809163150-products.js | 2 +- 11 files changed, 203 insertions(+), 18 deletions(-) create mode 100644 migrations/sequelize/20170809155208-create-state.js create mode 100644 migrations/sequelize/20170809155228-create-user.js create mode 100644 migrations/sequelize/20170809155307-create-category.js create mode 100644 migrations/sequelize/20170809155314-create-product.js create mode 100644 npm-debug.log diff --git a/.gitignore b/.gitignore index 9d8cbfe..9daa824 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .DS_Store node_modules -config diff --git a/config/sequelize.json b/config/sequelize.json index ec5107b..1f7f588 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -1,20 +1,19 @@ { "development": { - "username": "ericglover", + "username": "IanDavid", "password": null, "database": "mimirs_market_development", "host": "127.0.0.1", "dialect": "postgres" }, "test": { - "username": "ericglover", + "username": "IanDavid", "password": null, "database": "mimirs_market_test", "host": "127.0.0.1", "dialect": "postgres" }, "production": { - "use_env_variable": "DATABASE_URL", - "dialect": "postgres" + "use_env_variable": "MONGO_URL" } } diff --git a/migrations/sequelize/20170809155208-create-state.js b/migrations/sequelize/20170809155208-create-state.js new file mode 100644 index 0000000..a26435e --- /dev/null +++ b/migrations/sequelize/20170809155208-create-state.js @@ -0,0 +1,32 @@ +"use strict"; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable("States", { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + abbreviation: { + type: Sequelize.CHAR + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable("States"); + } +}; diff --git a/migrations/sequelize/20170809155228-create-user.js b/migrations/sequelize/20170809155228-create-user.js new file mode 100644 index 0000000..6fb3e04 --- /dev/null +++ b/migrations/sequelize/20170809155228-create-user.js @@ -0,0 +1,32 @@ +"use strict"; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable("Users", { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + email: { + type: Sequelize.CHAR + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable("Users"); + } +}; diff --git a/migrations/sequelize/20170809155307-create-category.js b/migrations/sequelize/20170809155307-create-category.js new file mode 100644 index 0000000..d545406 --- /dev/null +++ b/migrations/sequelize/20170809155307-create-category.js @@ -0,0 +1,29 @@ +"use strict"; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable("Categories", { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable("Categories"); + } +}; diff --git a/migrations/sequelize/20170809155314-create-product.js b/migrations/sequelize/20170809155314-create-product.js new file mode 100644 index 0000000..2a9e124 --- /dev/null +++ b/migrations/sequelize/20170809155314-create-product.js @@ -0,0 +1,41 @@ +"use strict"; +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.createTable("Products", { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.CHAR + }, + description: { + type: Sequelize.CHAR + }, + price: { + type: Sequelize.INTEGER + }, + sku: { + type: Sequelize.INTEGER + }, + categoryId: { + type: Sequelize.INTEGER + }, + createdAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + }, + updatedAt: { + allowNull: false, + type: Sequelize.DATE, + defaultValue: Sequelize.fn("NOW") + } + }); + }, + down: function(queryInterface, Sequelize) { + return queryInterface.dropTable("Products"); + } +}; diff --git a/models/sequelize/index.js b/models/sequelize/index.js index 87f9801..6bfd448 100644 --- a/models/sequelize/index.js +++ b/models/sequelize/index.js @@ -1,26 +1,33 @@ -'use strict'; +"use strict"; -var fs = require('fs'); -var path = require('path'); -var Sequelize = require('sequelize'); -var basename = path.basename(module.filename); -var env = process.env.NODE_ENV || 'development'; -var config = require(__dirname + '/../../config/sequelize.json')[env]; -var db = {}; +var fs = require("fs"); +var path = require("path"); +var Sequelize = require("sequelize"); +var basename = path.basename(module.filename); +var env = process.env.NODE_ENV || "development"; +var config = require(__dirname + "/../../config/sequelize.json")[env]; +var db = {}; if (config.use_env_variable) { var sequelize = new Sequelize(process.env[config.use_env_variable]); } else { - var sequelize = new Sequelize(config.database, config.username, config.password, config); + var sequelize = new Sequelize( + config.database, + config.username, + config.password, + config + ); } fs .readdirSync(__dirname) .filter(function(file) { - return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js'); + return ( + file.indexOf(".") !== 0 && file !== basename && file.slice(-3) === ".js" + ); }) .forEach(function(file) { - var model = sequelize['import'](path.join(__dirname, file)); + var model = sequelize["import"](path.join(__dirname, file)); db[model.name] = model; }); diff --git a/mongo.js b/mongo.js index f31d03f..62ea4c0 100644 --- a/mongo.js +++ b/mongo.js @@ -1,6 +1,6 @@ const mongoose = require("mongoose"); var env = process.env.NODE_ENV || "development"; -var config = require("./config/mongo"); +var config = require("./config/mongo")[env]; module.exports = () => { var envUrl = process.env[config.use_env_variable]; diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 0000000..5bc63ef --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,45 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'c' ] +2 info using npm@3.10.10 +3 info using node@v6.11.0 +4 verbose run-script [ 'prec', 'c', 'postc' ] +5 info lifecycle project_mimirs_market@1.0.0~prec: project_mimirs_market@1.0.0 +6 silly lifecycle project_mimirs_market@1.0.0~prec: no script for prec, continuing +7 info lifecycle project_mimirs_market@1.0.0~c: project_mimirs_market@1.0.0 +8 verbose lifecycle project_mimirs_market@1.0.0~c: unsafe-perm in lifecycle true +9 verbose lifecycle project_mimirs_market@1.0.0~c: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Macbook/dirs/project_mimirs_market/node_modules/.bin:/Users/Macbook/.rvm/gems/ruby-2.3.3/bin:/Users/Macbook/.rvm/gems/ruby-2.3.3@global/bin:/Users/Macbook/.rvm/rubies/ruby-2.3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/Macbook/.rvm/bin +10 verbose lifecycle project_mimirs_market@1.0.0~c: CWD: /Users/Macbook/dirs/project_mimirs_market +11 silly lifecycle project_mimirs_market@1.0.0~c: Args: [ '-c', 'node repl.js' ] +12 silly lifecycle project_mimirs_market@1.0.0~c: Returned: code: 1 signal: null +13 info lifecycle project_mimirs_market@1.0.0~c: Failed to exec c script +14 verbose stack Error: project_mimirs_market@1.0.0 c: `node repl.js` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at EventEmitter.emit (events.js:191:7) +14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at ChildProcess.emit (events.js:191:7) +14 verbose stack at maybeClose (internal/child_process.js:891:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) +15 verbose pkgid project_mimirs_market@1.0.0 +16 verbose cwd /Users/Macbook/dirs/project_mimirs_market +17 error Darwin 16.7.0 +18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "c" +19 error node v6.11.0 +20 error npm v3.10.10 +21 error code ELIFECYCLE +22 error project_mimirs_market@1.0.0 c: `node repl.js` +22 error Exit status 1 +23 error Failed at the project_mimirs_market@1.0.0 c script 'node repl.js'. +23 error Make sure you have the latest version of node.js and npm installed. +23 error If you do, this is most likely a problem with the project_mimirs_market package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error node repl.js +23 error You can get information on how to open an issue for this project with: +23 error npm bugs project_mimirs_market +23 error Or if that isn't available, you can get their info via: +23 error npm owner ls project_mimirs_market +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] diff --git a/repl.js b/repl.js index 6267b63..db74a1d 100644 --- a/repl.js +++ b/repl.js @@ -30,6 +30,7 @@ require("./mongo")().then(() => { // ---------------------------------------- Object.keys(models.sequelize).forEach(modelName => { repl.context[modelName] = models.sequelize[modelName]; + console.log(modelName); }); // ---------------------------------------- diff --git a/seeds/sequelize/20170809163150-products.js b/seeds/sequelize/20170809163150-products.js index de21d16..f9e265b 100644 --- a/seeds/sequelize/20170809163150-products.js +++ b/seeds/sequelize/20170809163150-products.js @@ -23,6 +23,6 @@ module.exports = { }, down: function(queryInterface, Sequelize) { - return queryInterface.bulkDelete("Person", null, {}, model.Products); + return queryInterface.bulkDelete("Products", null, {}, model.Products); } }; From ae2d3c06b5f13ac022da98cfbb972252bd2a8175 Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 15:10:11 -0400 Subject: [PATCH 08/17] schema adjust --- schema.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema.txt b/schema.txt index 1f6bf5f..083cb33 100644 --- a/schema.txt +++ b/schema.txt @@ -27,7 +27,7 @@ Product belongs to one Category Category has many Products ---> SUBMITTING ORDER --> userId, name, email, state, items(id, name, categoryid, quantity) +--> SUBMITTING ORDER --> userId, name, email, state, items(id, name, category, quantity) CREATE COMMANDS sequelize model:create --name State --attributes "name:char abbreviation:char" @@ -46,7 +46,7 @@ Orders: [{ - email - state - items: [{ -id (sequelize), name, categoryId (sequelize), quantity +id (sequelize), name, category, quantity }, {}, {}] }] From 66acd9f146c7d7dc235c22cd2816e26fdffb2bdc Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 15:47:45 -0400 Subject: [PATCH 09/17] stuff --- schema.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/schema.txt b/schema.txt index 083cb33..4578bd9 100644 --- a/schema.txt +++ b/schema.txt @@ -1,10 +1,5 @@ SEQUELIZE -User -- id -- name -- email - States - id - Name @@ -27,7 +22,7 @@ Product belongs to one Category Category has many Products ---> SUBMITTING ORDER --> userId, name, email, state, items(id, name, category, quantity) +--> SUBMITTING ORDER --> name, email, state, items(name, category, quantity) CREATE COMMANDS sequelize model:create --name State --attributes "name:char abbreviation:char" @@ -44,9 +39,17 @@ Orders: [{ - userId (Sequelize) - name - email -- state - items: [{ -id (sequelize), name, category, quantity +name, category, quantity }, {}, {}] - +- street address +- city +- state +- checkoutDate +- StripeToken +- CardType }] + +OrderItems: [{ +name, category, quantity +}, {}, {}] From ed61d1c4aaf4792cbfd140240010a10f1a10354c Mon Sep 17 00:00:00 2001 From: Eric Glover Date: Wed, 9 Aug 2017 15:22:12 -0500 Subject: [PATCH 10/17] seeding --- config/sequelize.json | 7 +++-- models/sequelize/category.js | 25 +++++++++------ models/sequelize/product.js | 33 +++++++++++--------- package.json | 1 + repl.js | 8 ++--- schema.txt | 4 +++ seeds/sequelize/20170809163150-products.js | 3 +- seeds/sequelize/20170809200347-categories.js | 33 ++++++++++++++++++++ 8 files changed, 80 insertions(+), 34 deletions(-) create mode 100644 seeds/sequelize/20170809200347-categories.js diff --git a/config/sequelize.json b/config/sequelize.json index 1f7f588..ec5107b 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -1,19 +1,20 @@ { "development": { - "username": "IanDavid", + "username": "ericglover", "password": null, "database": "mimirs_market_development", "host": "127.0.0.1", "dialect": "postgres" }, "test": { - "username": "IanDavid", + "username": "ericglover", "password": null, "database": "mimirs_market_test", "host": "127.0.0.1", "dialect": "postgres" }, "production": { - "use_env_variable": "MONGO_URL" + "use_env_variable": "DATABASE_URL", + "dialect": "postgres" } } diff --git a/models/sequelize/category.js b/models/sequelize/category.js index 1a34de0..cb5b3eb 100644 --- a/models/sequelize/category.js +++ b/models/sequelize/category.js @@ -1,13 +1,18 @@ -'use strict'; +"use strict"; module.exports = function(sequelize, DataTypes) { - var Category = sequelize.define('Category', { - name: DataTypes.CHAR - }, { - classMethods: { - associate: function(models) { - // associations can be defined here - } + var Category = sequelize.define( + "Category", + { + name: DataTypes.CHAR + }, + { + classMethods: {} } - }); + ); + Category.associate = function(models) { + Category.hasMany(models.Product, { + foreignKey: "categoryId" + }); + }; return Category; -}; \ No newline at end of file +}; diff --git a/models/sequelize/product.js b/models/sequelize/product.js index 759758f..449ecf1 100644 --- a/models/sequelize/product.js +++ b/models/sequelize/product.js @@ -1,17 +1,22 @@ -'use strict'; +"use strict"; module.exports = function(sequelize, DataTypes) { - var Product = sequelize.define('Product', { - name: DataTypes.CHAR, - description: DataTypes.CHAR, - price: DataTypes.INTEGER, - sku: DataTypes.INTEGER, - categoryId: DataTypes.INTEGER - }, { - classMethods: { - associate: function(models) { - // associations can be defined here - } + var Product = sequelize.define( + "Product", + { + name: DataTypes.CHAR, + description: DataTypes.CHAR, + price: DataTypes.INTEGER, + sku: DataTypes.INTEGER, + categoryId: DataTypes.INTEGER + }, + { + classMethods: {} } - }); + ); + Product.associate = function(models) { + Product.belongsTo(models.Category, { + foreignKey: "categoryId" + }); + }; return Product; -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index e4cac23..1a5b74c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "sql:migrate": "npm run sql db:migrate", "sql:seed:undo": "npm run sql db:seed:undo:all", "sql:seed": "npm run sql db:seed:all", + "sql:reseed": "npm run sql:seed:undo && npm run sql:seed", "sql:s": "npm run sql:migrate:undo && npm run sql:migrate && npm run sql:seed", "mg:seed": "node seeds/mongoose", "console": "node repl.js", diff --git a/repl.js b/repl.js index db74a1d..f2cecdc 100644 --- a/repl.js +++ b/repl.js @@ -4,17 +4,16 @@ var models = { mongoose: require("./models/mongoose"), sequelize: require("./models/sequelize") }; -// var helpers = require('./helpers'); +// var helpers = require("./helpers"); require("./mongo")().then(() => { repl.context.models = models; - repl.context.helpers = helpers; - + // repl.context.helpers = helpers; // // // ---------------------------------------- // // Helpers // // ---------------------------------------- - // Object.keys(helpers).forEach((key) => { + // Object.keys(helpers).forEach(key => { // repl.context[key] = helpers[key]; // }); @@ -30,7 +29,6 @@ require("./mongo")().then(() => { // ---------------------------------------- Object.keys(models.sequelize).forEach(modelName => { repl.context[modelName] = models.sequelize[modelName]; - console.log(modelName); }); // ---------------------------------------- diff --git a/schema.txt b/schema.txt index 4578bd9..f97aa7d 100644 --- a/schema.txt +++ b/schema.txt @@ -30,10 +30,14 @@ sequelize model:create --name User --attributes "name:char email:char" sequelize model:create --name Category --attributes "name:char" sequelize model:create --name Product --attributes "name:char description:char price:integer sku:integer categoryId:integer" +CREATE SEEDS +sequelize seed:create --name categories MONGODB +//possible Stripe + Orders: [{ - id - userId (Sequelize) diff --git a/seeds/sequelize/20170809163150-products.js b/seeds/sequelize/20170809163150-products.js index f9e265b..85c573a 100644 --- a/seeds/sequelize/20170809163150-products.js +++ b/seeds/sequelize/20170809163150-products.js @@ -1,6 +1,5 @@ "use strict"; const model = require("../../models/sequelize"); -const Product = model.Product; let faker = require("Faker"); // @@ -15,7 +14,7 @@ module.exports = { description: faker.Lorem.sentence(), price: faker.random.number(5000), sku: Math.random() * 122221, - categoryId: i + categoryId: i % 10 }; seeds.push(p); } diff --git a/seeds/sequelize/20170809200347-categories.js b/seeds/sequelize/20170809200347-categories.js new file mode 100644 index 0000000..5db782f --- /dev/null +++ b/seeds/sequelize/20170809200347-categories.js @@ -0,0 +1,33 @@ +"use strict"; +const model = require("../../models/sequelize"); +let faker = require("Faker"); + +let categoriesName = [ + "Weapons", + "Armor", + "Heads", + "Pelts", + "Parisols", + "Shields", + "Grog", + "Torches", + "Ships", + "Horses" +]; + +module.exports = { + up: function(queryInterface, Sequelize) { + let seeds = []; + for (var i = 0; i < 10; i++) { + let c = { + name: categoriesName[i] + }; + seeds.push(c); + } + return queryInterface.bulkInsert("Categories", seeds, {}); + }, + + down: function(queryInterface, Sequelize) { + return queryInterface.bulkDelete("Categories", null, {}, model.Categories); + } +}; From f2c7f2789127082f75e66446e7d557d350cf47e5 Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 16:48:56 -0400 Subject: [PATCH 11/17] working on router --- .gitignore | 5 +- app.js | 6 +- config/sequelize.json | 4 +- npm-debug.log | 45 ----- package.json | 2 +- routers/products.js | 7 + seeds/sequelize/20170809163150-products.js | 2 +- seeds/sequelize/20170809203600-state.js | 214 +++++++++++++++++++++ views/products/index.handlebars | 0 9 files changed, 232 insertions(+), 53 deletions(-) delete mode 100644 npm-debug.log create mode 100644 seeds/sequelize/20170809203600-state.js create mode 100644 views/products/index.handlebars diff --git a/.gitignore b/.gitignore index 9daa824..7043851 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .DS_Store -node_modules +node_modules/ +config/ +config/sequelize.json +config/mongo.json diff --git a/app.js b/app.js index da8c833..359fd37 100644 --- a/app.js +++ b/app.js @@ -38,11 +38,11 @@ app.use((req, res, next) => { } }); -// build routes here - app.get("/", (req, res) => { - res.end("working"); + res.redirect("/products"); }); +var productsRouter = require("routers/products"); +app.use("/products"); var expressHandlebars = require("express-handlebars"); var hbs = expressHandlebars.create({ diff --git a/config/sequelize.json b/config/sequelize.json index ec5107b..c4d482a 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -1,13 +1,13 @@ { "development": { - "username": "ericglover", + "username": "IanDavid", "password": null, "database": "mimirs_market_development", "host": "127.0.0.1", "dialect": "postgres" }, "test": { - "username": "ericglover", + "username": "IanDavid", "password": null, "database": "mimirs_market_test", "host": "127.0.0.1", diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 5bc63ef..0000000 --- a/npm-debug.log +++ /dev/null @@ -1,45 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'c' ] -2 info using npm@3.10.10 -3 info using node@v6.11.0 -4 verbose run-script [ 'prec', 'c', 'postc' ] -5 info lifecycle project_mimirs_market@1.0.0~prec: project_mimirs_market@1.0.0 -6 silly lifecycle project_mimirs_market@1.0.0~prec: no script for prec, continuing -7 info lifecycle project_mimirs_market@1.0.0~c: project_mimirs_market@1.0.0 -8 verbose lifecycle project_mimirs_market@1.0.0~c: unsafe-perm in lifecycle true -9 verbose lifecycle project_mimirs_market@1.0.0~c: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Macbook/dirs/project_mimirs_market/node_modules/.bin:/Users/Macbook/.rvm/gems/ruby-2.3.3/bin:/Users/Macbook/.rvm/gems/ruby-2.3.3@global/bin:/Users/Macbook/.rvm/rubies/ruby-2.3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/Macbook/.rvm/bin -10 verbose lifecycle project_mimirs_market@1.0.0~c: CWD: /Users/Macbook/dirs/project_mimirs_market -11 silly lifecycle project_mimirs_market@1.0.0~c: Args: [ '-c', 'node repl.js' ] -12 silly lifecycle project_mimirs_market@1.0.0~c: Returned: code: 1 signal: null -13 info lifecycle project_mimirs_market@1.0.0~c: Failed to exec c script -14 verbose stack Error: project_mimirs_market@1.0.0 c: `node repl.js` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at EventEmitter.emit (events.js:191:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at ChildProcess.emit (events.js:191:7) -14 verbose stack at maybeClose (internal/child_process.js:891:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) -15 verbose pkgid project_mimirs_market@1.0.0 -16 verbose cwd /Users/Macbook/dirs/project_mimirs_market -17 error Darwin 16.7.0 -18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "c" -19 error node v6.11.0 -20 error npm v3.10.10 -21 error code ELIFECYCLE -22 error project_mimirs_market@1.0.0 c: `node repl.js` -22 error Exit status 1 -23 error Failed at the project_mimirs_market@1.0.0 c script 'node repl.js'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the project_mimirs_market package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error node repl.js -23 error You can get information on how to open an issue for this project with: -23 error npm bugs project_mimirs_market -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls project_mimirs_market -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 1a5b74c..d144fdb 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "sql:seed:undo": "npm run sql db:seed:undo:all", "sql:seed": "npm run sql db:seed:all", "sql:reseed": "npm run sql:seed:undo && npm run sql:seed", - "sql:s": "npm run sql:migrate:undo && npm run sql:migrate && npm run sql:seed", + "sql:reset": "npm run sql:migrate:undo && npm run sql:migrate && npm run sql:seed", "mg:seed": "node seeds/mongoose", "console": "node repl.js", "c": "node repl.js", diff --git a/routers/products.js b/routers/products.js index 7c3714b..58e2187 100644 --- a/routers/products.js +++ b/routers/products.js @@ -1,2 +1,9 @@ var express = require("express"); var router = express.Router(); + +Router.get("/", () => { + //get products --> then + res.render("products/index"); +}); + +module.exports = router; diff --git a/seeds/sequelize/20170809163150-products.js b/seeds/sequelize/20170809163150-products.js index 85c573a..b086743 100644 --- a/seeds/sequelize/20170809163150-products.js +++ b/seeds/sequelize/20170809163150-products.js @@ -14,7 +14,7 @@ module.exports = { description: faker.Lorem.sentence(), price: faker.random.number(5000), sku: Math.random() * 122221, - categoryId: i % 10 + categoryId: i % 10 + 1 }; seeds.push(p); } diff --git a/seeds/sequelize/20170809203600-state.js b/seeds/sequelize/20170809203600-state.js new file mode 100644 index 0000000..fb21db9 --- /dev/null +++ b/seeds/sequelize/20170809203600-state.js @@ -0,0 +1,214 @@ +"use strict"; +const model = require("../../models/sequelize"); +let faker = require("Faker"); + +module.exports = { + up: function(queryInterface, Sequelize) { + return queryInterface.bulkInsert("States", [ + { + name: "Alabama", + abbreviation: "AL" + }, + { + name: "Alaska", + abbreviation: "AK" + }, + { + name: "Arizona", + abbreviation: "AZ" + }, + { + name: "Arkansas", + abbreviation: "AR" + }, + { + name: "California", + abbreviation: "CA" + }, + { + name: "Colorado", + abbreviation: "CO" + }, + { + name: "Connecticut", + abbreviation: "CT" + }, + { + name: "Delaware", + abbreviation: "DE" + }, + { + name: "Florida", + abbreviation: "FL" + }, + { + name: "Georgia", + abbreviation: "GA" + }, + { + name: "Hawaii", + abbreviation: "HI" + }, + { + name: "Idaho", + abbreviation: "ID" + }, + { + name: "Illinois", + abbreviation: "IL" + }, + { + name: "Indiana", + abbreviation: "IN" + }, + { + name: "Iowa", + abbreviation: "IA" + }, + { + name: "Kansas", + abbreviation: "KS" + }, + { + name: "Kentucky", + abbreviation: "KY" + }, + { + name: "Louisiana", + abbreviation: "LA" + }, + { + name: "Maine", + abbreviation: "ME" + }, + { + name: "Maryland", + abbreviation: "MD" + }, + { + name: "Massachusetts", + abbreviation: "MA" + }, + { + name: "Michigan", + abbreviation: "MI" + }, + { + name: "Minnesota", + abbreviation: "MN" + }, + { + name: "Mississippi", + abbreviation: "MS" + }, + { + name: "Missouri", + abbreviation: "MO" + }, + { + name: "Montana", + abbreviation: "MT" + }, + { + name: "Nebraska", + abbreviation: "NE" + }, + { + name: "Nevada", + abbreviation: "NV" + }, + { + name: "New Hampshire", + abbreviation: "NH" + }, + { + name: "New Jersey", + abbreviation: "NJ" + }, + { + name: "New Mexico", + abbreviation: "NM" + }, + { + name: "New York", + abbreviation: "NY" + }, + { + name: "North Carolina", + abbreviation: "NC" + }, + { + name: "North Dakota", + abbreviation: "ND" + }, + { + name: "Ohio", + abbreviation: "OH" + }, + { + name: "Oklahoma", + abbreviation: "OK" + }, + { + name: "Oregon", + abbreviation: "OR" + }, + { + name: "Pennsylvania", + abbreviation: "PA" + }, + { + name: "Rhode Island", + abbreviation: "RI" + }, + { + name: "South Carolina", + abbreviation: "SC" + }, + { + name: "South Dakota", + abbreviation: "SD" + }, + { + name: "Tennessee", + abbreviation: "TN" + }, + { + name: "Texas", + abbreviation: "TX" + }, + { + name: "Utah", + abbreviation: "UT" + }, + { + name: "Vermont", + abbreviation: "VT" + }, + { + name: "Virginia", + abbreviation: "VA" + }, + { + name: "Washington", + abbreviation: "WA" + }, + { + name: "West Virginia", + abbreviation: "WV" + }, + { + name: "Wisconsin", + abbreviation: "WI" + }, + { + name: "Wyoming", + abbreviation: "WY" + } + ]); + }, + + down: function(queryInterface, Sequelize) { + return queryInterface.bulkDelete("States", null, {}, model.States); + } +}; diff --git a/views/products/index.handlebars b/views/products/index.handlebars new file mode 100644 index 0000000..e69de29 From 2f26eea1892154349d7e214de63f8d2fff035e73 Mon Sep 17 00:00:00 2001 From: Eric Glover Date: Wed, 9 Aug 2017 16:18:08 -0500 Subject: [PATCH 12/17] rendering products --- app.js | 4 ++-- config/sequelize.json | 4 ++-- routers/products.js | 9 +++++--- views/layouts/application.handlebars | 24 ++++++++++++++++++++ views/partials/navbar.handlebars | 22 ++++++++++++++++++ views/products/index.handlebars | 34 ++++++++++++++++++++++++++++ 6 files changed, 90 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 359fd37..17bbc1c 100644 --- a/app.js +++ b/app.js @@ -41,8 +41,8 @@ app.use((req, res, next) => { app.get("/", (req, res) => { res.redirect("/products"); }); -var productsRouter = require("routers/products"); -app.use("/products"); +var productsRouter = require("./routers/products"); +app.use("/products", productsRouter); var expressHandlebars = require("express-handlebars"); var hbs = expressHandlebars.create({ diff --git a/config/sequelize.json b/config/sequelize.json index c4d482a..ec5107b 100644 --- a/config/sequelize.json +++ b/config/sequelize.json @@ -1,13 +1,13 @@ { "development": { - "username": "IanDavid", + "username": "ericglover", "password": null, "database": "mimirs_market_development", "host": "127.0.0.1", "dialect": "postgres" }, "test": { - "username": "IanDavid", + "username": "ericglover", "password": null, "database": "mimirs_market_test", "host": "127.0.0.1", diff --git a/routers/products.js b/routers/products.js index 58e2187..cbb65bc 100644 --- a/routers/products.js +++ b/routers/products.js @@ -1,9 +1,12 @@ var express = require("express"); var router = express.Router(); +const { Product } = require("../models/sequelize"); -Router.get("/", () => { - //get products --> then - res.render("products/index"); +router.get("/", (req, res) => { + Product.findAll({}).then(products => { + console.log(`Products = ${products}`); + res.render("products/index", { products: products[0] }); + }); }); module.exports = router; diff --git a/views/layouts/application.handlebars b/views/layouts/application.handlebars index e69de29..73094be 100644 --- a/views/layouts/application.handlebars +++ b/views/layouts/application.handlebars @@ -0,0 +1,24 @@ + + + + + + + Mimir's Market + + + + + + + + + + {{#unless hideNav }} + {{>navbar}} + {{/unless }} +
+ {{{ body }}} +
+ + diff --git a/views/partials/navbar.handlebars b/views/partials/navbar.handlebars index e69de29..e7f90ae 100644 --- a/views/partials/navbar.handlebars +++ b/views/partials/navbar.handlebars @@ -0,0 +1,22 @@ + diff --git a/views/products/index.handlebars b/views/products/index.handlebars index e69de29..db7be74 100644 --- a/views/products/index.handlebars +++ b/views/products/index.handlebars @@ -0,0 +1,34 @@ +
+

Vikings

+
+
+
+

Search

+
+
+ {{ products }} +
+
+
+
+

Select a user to view their profile

+
+
+ +
+
+
+
+ +
+
+ +
+
From 4e2f6d4b7b42e3727fc62231acd6e71202761bcf Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Wed, 9 Aug 2017 18:08:32 -0400 Subject: [PATCH 13/17] doing show page --- routers/products.js | 15 ++++++- seeds/sequelize/20170809163150-products.js | 2 +- views/layouts/application.handlebars | 14 +------ views/partials/head.handlebars | 13 ++++++ views/partials/navbar.handlebars | 5 +++ views/products/index.handlebars | 49 ++++++++++------------ views/products/show.handlebars | 22 ++++++++++ 7 files changed, 77 insertions(+), 43 deletions(-) create mode 100644 views/products/show.handlebars diff --git a/routers/products.js b/routers/products.js index cbb65bc..4fb6881 100644 --- a/routers/products.js +++ b/routers/products.js @@ -4,8 +4,19 @@ const { Product } = require("../models/sequelize"); router.get("/", (req, res) => { Product.findAll({}).then(products => { - console.log(`Products = ${products}`); - res.render("products/index", { products: products[0] }); + res.render("products/index", { products }); + }); +}); + +router.get("/show/:productId", (req, res) => { + Product.findById(req.params.productId).then(product => { + Product.findAll({ + where: { categoryId: product.categoryId, id: { $ne: product.id } }, + limit: 6 + }).then(relatedProducts => { + console.log(relatedProducts); + res.render("products/show", { product, relatedProducts }); + }); }); }); diff --git a/seeds/sequelize/20170809163150-products.js b/seeds/sequelize/20170809163150-products.js index b086743..24d596e 100644 --- a/seeds/sequelize/20170809163150-products.js +++ b/seeds/sequelize/20170809163150-products.js @@ -8,7 +8,7 @@ module.exports = { up: function(queryInterface, Sequelize) { let seeds = []; for (var i = 0; i < 50; i++) { - let name = `${faker.random.catch_phrase_descriptor()} ${faker.random.bs_adjective()} ${faker.random.bs_noun()}`; + let name = `${faker.random.catch_phrase_descriptor()} ${faker.random.catch_phrase_descriptor()} ${faker.random.bs_noun()}`; let p = { name: name, description: faker.Lorem.sentence(), diff --git a/views/layouts/application.handlebars b/views/layouts/application.handlebars index 73094be..b8d4c9e 100644 --- a/views/layouts/application.handlebars +++ b/views/layouts/application.handlebars @@ -1,18 +1,6 @@ - - - - - Mimir's Market - - - - - - - - + {{>head}} {{#unless hideNav }} {{>navbar}} diff --git a/views/partials/head.handlebars b/views/partials/head.handlebars index e69de29..66d6fda 100644 --- a/views/partials/head.handlebars +++ b/views/partials/head.handlebars @@ -0,0 +1,13 @@ + + + + + Mimir's Market + + + + + + + + diff --git a/views/partials/navbar.handlebars b/views/partials/navbar.handlebars index e7f90ae..edc17ff 100644 --- a/views/partials/navbar.handlebars +++ b/views/partials/navbar.handlebars @@ -9,6 +9,11 @@ diff --git a/views/products/index.handlebars b/views/products/index.handlebars index db7be74..aec1dfa 100644 --- a/views/products/index.handlebars +++ b/views/products/index.handlebars @@ -1,34 +1,29 @@ -
-

Vikings

+ -
-
-

Search

-
-
- {{ products }} -
-
-
-
-

Select a user to view their profile

-
-
- + + +
-
- -
-
- +
+ {{#each products as |prod|}} +
+ +

${{prod.price}}

+

{{prod.name}}

+
{{prod.description}}
+ +
+ {{/each}}
+
diff --git a/views/products/show.handlebars b/views/products/show.handlebars new file mode 100644 index 0000000..ef67d4b --- /dev/null +++ b/views/products/show.handlebars @@ -0,0 +1,22 @@ +
+ +
+
+

${{product.price}}

+

{{product.name}}

+
{{product.description}}
+ +
+ +

Related Products

+
+ {{#each relatedProducts as |prod|}} +
+ +

${{prod.price}}

+

{{prod.name}}

+
{{prod.description}}
+ +
+ {{/each}} +
From 43aabf7b4eea7be4e163eaa2e5db6db7a97965c9 Mon Sep 17 00:00:00 2001 From: Eric Glover Date: Wed, 9 Aug 2017 17:32:30 -0500 Subject: [PATCH 14/17] searching --- routers/products.js | 15 +++++++++++++++ views/products/index.handlebars | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/routers/products.js b/routers/products.js index 4fb6881..1fe8870 100644 --- a/routers/products.js +++ b/routers/products.js @@ -2,12 +2,14 @@ var express = require("express"); var router = express.Router(); const { Product } = require("../models/sequelize"); +//index Route router.get("/", (req, res) => { Product.findAll({}).then(products => { res.render("products/index", { products }); }); }); +//show Route router.get("/show/:productId", (req, res) => { Product.findById(req.params.productId).then(product => { Product.findAll({ @@ -20,4 +22,17 @@ router.get("/show/:productId", (req, res) => { }); }); +///search +router.post("/search", (req, res) => { + let r = `${req.body.search}`; + Product.findAll({ + where: { + name: { $regexp: r } + } + }).then(products => { + console.log(`products = ${products}`); + res.render("products/index", { products }); + }); +}); + module.exports = router; diff --git a/views/products/index.handlebars b/views/products/index.handlebars index aec1dfa..7a7c343 100644 --- a/views/products/index.handlebars +++ b/views/products/index.handlebars @@ -4,6 +4,12 @@
+
+
+ + +
+
+ Search:
-
+
- + + + + + +
+
From 4cf3ad00c66d572f48cdb127004a6f74071c735c Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Fri, 11 Aug 2017 18:15:14 -0400 Subject: [PATCH 16/17] checkout process --- README.md | 2 +- app.js | 95 ++++---- lib/checkifincart.js | 9 + lib/middleware.js | 56 +++++ .../20170809155314-create-product.js | 3 + .../20170809162921-create-product.js | 3 + models/mongoose/index.js | 12 + models/mongoose/order.js | 31 +++ models/mongoose/orderitem.js | 22 ++ models/sequelize/product.js | 1 + package-lock.json | 88 ++++--- package.json | 1 + public/javascripts/index.js | 96 ++++++++ public/stylesheets/style.css | 9 + repl.js | 8 - routers/cart.js | 68 ++++++ routers/checkout.js | 76 ++++++ routers/products.js | 110 ++++++--- schema.txt | 8 +- seeds/mongoose/index.js | 76 ++++++ seeds/sequelize/20170809163150-products.js | 22 +- seeds/sequelize/20170809200347-categories.js | 4 +- views/cart/index.handlebars | 49 ++++ views/checkout/form.handlebars | 222 ++++++++++++++++++ views/partials/head.handlebars | 3 +- views/partials/navbar.handlebars | 46 +++- views/products/index.handlebars | 107 +++++++-- views/products/show.handlebars | 16 +- 28 files changed, 1090 insertions(+), 153 deletions(-) create mode 100644 lib/checkifincart.js create mode 100644 lib/middleware.js create mode 100644 models/mongoose/order.js create mode 100644 models/mongoose/orderitem.js create mode 100644 public/javascripts/index.js create mode 100644 public/stylesheets/style.css create mode 100644 routers/cart.js create mode 100644 routers/checkout.js create mode 100644 seeds/mongoose/index.js create mode 100644 views/cart/index.handlebars create mode 100644 views/checkout/form.handlebars diff --git a/README.md b/README.md index b4718ab..ff645fb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # project_mimirs_market A Viking eCommerce store for Thunder Gods that like to buy "Antique Wooden Pizzas" -Name: Ian Halverson and Eric Glover +Name: Ian Halverson diff --git a/app.js b/app.js index 17bbc1c..40ab096 100644 --- a/app.js +++ b/app.js @@ -1,68 +1,79 @@ -var express = require("express"); -var app = express(); +//Express app +const express = require("express"); +const app = express(); -var bodyParser = require("body-parser"); +//Modules +const cookieParser = require("cookie-parser"); +const bodyParser = require("body-parser"); +const cookieSession = require("cookie-session"); +const methodOverride = require("method-override"); +const getPostSupport = require("express-method-override-get-post-support"); +const morgan = require("morgan"); +const morganToolkit = require("morgan-toolkit")(morgan); +const expressHandlebars = require("express-handlebars"); +const hbs = expressHandlebars.create({ + partialsDir: "views/partials", + defaultLayout: "application" +}); + +//Custom middleware modules +const mdw = require("./lib/middleware"); + +//Database models +const { Product } = require("./models/sequelize"); + +//Routers +const productsRouter = require("./routers/products"); +const cartRouter = require("./routers/cart"); +const checkoutRouter = require("./routers/checkout"); + +//View engine +app.engine("handlebars", hbs.engine); +app.set("view engine", "handlebars"); + +//Middleware from modules +app.use(cookieParser()); app.use(bodyParser.urlencoded({ extended: true })); -var cookieSession = require("cookie-session"); +app.use(express.static(`${__dirname}/public`)); +app.use(morgan("tiny")); +app.use(morganToolkit()); app.use( cookieSession({ name: "session", - keys: ["asdf1234567890qwer"] + keys: ["asdfqwerfdsarewq"] }) ); - -const methodOverride = require("method-override"); -const getPostSupport = require("express-method-override-get-post-support"); app.use( methodOverride( getPostSupport.callback, getPostSupport.options // { methods: ['POST', 'GET'] } ) ); -app.use((req, res, next) => { - req.session.backUrl = req.header("Referer") || "/"; - next(); -}); -app.use(express.static(`${__dirname}/public`)); -var morgan = require("morgan"); -var morganToolkit = require("morgan-toolkit")(morgan); -app.use(morgan("tiny")); -app.use(morganToolkit()); - -const mongoose = require("mongoose"); -app.use((req, res, next) => { - if (mongoose.connection.readyState) { - next(); - } else { - require("./mongo")().then(() => next()); - } -}); +//Initial redirect app.get("/", (req, res) => { - res.redirect("/products"); + return res.redirect("/products"); }); -var productsRouter = require("./routers/products"); -app.use("/products", productsRouter); -var expressHandlebars = require("express-handlebars"); -var hbs = expressHandlebars.create({ - partialsDir: "views/partials", - defaultLayout: "application" -}); - -app.engine("handlebars", hbs.engine); -app.set("view engine", "handlebars"); +//Middleware from files +app.use(mdw.setBackUrl); +app.use(mdw.mongooseReady); +app.use(mdw.retainSortField); +app.use(mdw.cartFiller); -var port = process.env.PORT || process.argv[2] || 3000; -var host = "localhost"; +//Routes +app.use("/products", productsRouter); +app.use("/cart", cartRouter); +app.use("/checkout", checkoutRouter); -var args; +//Set up and start server +const port = process.env.PORT || process.argv[2] || 3000; +const host = "localhost"; +let args; process.env.NODE_ENV === "production" ? (args = [port]) : (args = [port, host]); - args.push(() => { console.log(`Listening: http://${host}:${port}`); }); - app.listen.apply(app, args); module.exports = app; diff --git a/lib/checkifincart.js b/lib/checkifincart.js new file mode 100644 index 0000000..6af293a --- /dev/null +++ b/lib/checkifincart.js @@ -0,0 +1,9 @@ +module.exports = function checkIfInCart(req, res, products) { + let cart = req.session.cart.map(i => i.id); + products.forEach((p, i) => { + if (cart.includes(p.id.toString())) { + products[i].inCart = true; + } + }); + return products; +}; diff --git a/lib/middleware.js b/lib/middleware.js new file mode 100644 index 0000000..d504380 --- /dev/null +++ b/lib/middleware.js @@ -0,0 +1,56 @@ +const mongoose = require("mongoose"); +const { Product, Category } = require("../models/sequelize"); + +const mdw = { + //set redirect to "/" unless referer + setBackUrl: (req, res, next) => { + req.session.backUrl = req.header("Referer") || "/"; + next(); + }, + + //check mongoose connection, reconnect if needed + mongooseReady: (req, res, next) => { + if (mongoose.connection.readyState) { + next(); + } else { + require("../mongo")().then(() => next()); + } + }, + + //retain sort option input field (negated on some routes) + retainSortField: (req, res, next) => { + res.cookie("selectedSortOption", "id-ASC"); + next(); + }, + + // hoist cart if needed, find items, + // make available to view engine, hoist inCart object + cartFiller: (req, res, next) => { + let total = 0; + req.session.cart = req.session.cart || []; + let cart = req.session.cart.map(i => i.id); + Product.findAll({ + where: { id: { $in: cart } }, + include: [{ all: true, nested: true }] + }) + .then(r => { + r.forEach((p, pix) => { + req.session.cart.forEach((i, cix) => { + if (p.id * 1 === i.id * 1) { + p.quantity = i.quantity; + total += i.quantity * p.price; + } + }); + }); + return r; + }) + .then(r => { + res.locals.items = r; + res.locals.total = total; + res.locals.inCart = true; + next(); + }); + } +}; + +module.exports = mdw; diff --git a/migrations/sequelize/20170809155314-create-product.js b/migrations/sequelize/20170809155314-create-product.js index 2a9e124..2bfb1c9 100644 --- a/migrations/sequelize/20170809155314-create-product.js +++ b/migrations/sequelize/20170809155314-create-product.js @@ -14,6 +14,9 @@ module.exports = { description: { type: Sequelize.CHAR }, + imageUrl: { + type: Sequelize.CHAR + }, price: { type: Sequelize.INTEGER }, diff --git a/migrations/sequelize/20170809162921-create-product.js b/migrations/sequelize/20170809162921-create-product.js index 2a9e124..2bfb1c9 100644 --- a/migrations/sequelize/20170809162921-create-product.js +++ b/migrations/sequelize/20170809162921-create-product.js @@ -14,6 +14,9 @@ module.exports = { description: { type: Sequelize.CHAR }, + imageUrl: { + type: Sequelize.CHAR + }, price: { type: Sequelize.INTEGER }, diff --git a/models/mongoose/index.js b/models/mongoose/index.js index e69de29..a10d7f4 100644 --- a/models/mongoose/index.js +++ b/models/mongoose/index.js @@ -0,0 +1,12 @@ +const mongoose = require("mongoose"); +const bluebird = require("bluebird"); + +mongoose.Promise = bluebird; + +const models = {}; + +// Load models and attach to models here +models.Order = require("./order"); +models.OrderItem = require("./orderitem"); + +module.exports = models; diff --git a/models/mongoose/order.js b/models/mongoose/order.js new file mode 100644 index 0000000..3d86cdd --- /dev/null +++ b/models/mongoose/order.js @@ -0,0 +1,31 @@ +const mongoose = require("mongoose"); +var Schema = mongoose.Schema; + +var OrderSchema = new Schema( + { + firstName: String, + lastName: String, + description: String, + total: Number, + email: String, + streetAddress: String, + city: String, + state: String, + checkoutDate: Schema.Types.Date, + StripeToke: String, + cardType: String, + items: [ + { + type: Schema.Types.ObjectId, + ref: "OrderItem" + } + ] + }, + { + timestamps: true + } +); + +var Order = mongoose.model("Order", OrderSchema); + +module.exports = Order; diff --git a/models/mongoose/orderitem.js b/models/mongoose/orderitem.js new file mode 100644 index 0000000..9f4d7b1 --- /dev/null +++ b/models/mongoose/orderitem.js @@ -0,0 +1,22 @@ +const mongoose = require("mongoose"); +var Schema = mongoose.Schema; + +var OrderItemSchema = new Schema( + [ + { + name: String, + price: Number, + sku: Number, + description: String, + category: String, + quantity: Number + } + ], + { + timestamps: true + } +); + +var OrderItem = mongoose.model("OrderItem", OrderItemSchema); + +module.exports = OrderItem; diff --git a/models/sequelize/product.js b/models/sequelize/product.js index 449ecf1..c652828 100644 --- a/models/sequelize/product.js +++ b/models/sequelize/product.js @@ -5,6 +5,7 @@ module.exports = function(sequelize, DataTypes) { { name: DataTypes.CHAR, description: DataTypes.CHAR, + imageUrl: DataTypes.CHAR, price: DataTypes.INTEGER, sku: DataTypes.INTEGER, categoryId: DataTypes.INTEGER diff --git a/package-lock.json b/package-lock.json index af5c74c..5618051 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@types/node": { "version": "6.0.85", "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.85.tgz", - "integrity": "sha512-6qLZpfQFO/g5Ns2e7RsW6brk0Q6Xzwiw7kVVU/XiQNOiJXSojhX76GP457PBYIsNMH2WfcGgcnZB4awFDHrwpA==" + "integrity": "sha1-7AK/5UphBE8r5E8Ts4nGoOjuBa4=" }, "abbrev": { "version": "1.1.0", @@ -51,7 +51,7 @@ "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "integrity": "sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g=", "requires": { "color-convert": "1.9.0" } @@ -82,7 +82,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=" }, "array-differ": { "version": "1.0.0", @@ -124,6 +124,23 @@ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, + "asyncawait": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/asyncawait/-/asyncawait-1.0.6.tgz", + "integrity": "sha1-5EbPVOUWpBbXQju+Nb8LTitzi2c=", + "requires": { + "bluebird": "3.5.0", + "fibers": "1.0.15", + "lodash": "3.10.1" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" + } + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -224,7 +241,7 @@ "chalk": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "integrity": "sha1-rFvs8U+iG5nGySynp9fP1bF+dD4=", "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", @@ -375,7 +392,7 @@ "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + "integrity": "sha1-FXFS/R56bI2YpbcVzzdt+SgARWM=" }, "concat-map": { "version": "0.0.1", @@ -418,7 +435,7 @@ "cookie-session": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-1.3.0.tgz", - "integrity": "sha512-ql3gtHDd0yn3fX3Kjtm1aS8wkpwr3qbx8MhQMYuPFu5ENQTNukSFCIxiX6mPtw2AKWYer8BMWdXk2V3Sbnft0g==", + "integrity": "sha1-/4iulH/P4OzmEw6WGL83JL5nMfI=", "requires": { "cookies": "0.7.0", "debug": "2.6.8", @@ -788,7 +805,7 @@ "qs": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", - "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==" + "integrity": "sha1-jQSVTTZN7z78VbWgeT4eLIsebkk=" } } }, @@ -807,12 +824,12 @@ "express-method-override-get-post-support": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/express-method-override-get-post-support/-/express-method-override-get-post-support-0.0.7.tgz", - "integrity": "sha512-aHO/iYL9GV4FoRZACHkhOYfHXVljwu5LbGMOuq8++6K2JpG6437oZt64w1k3Ff6oPq1/0AtsGYnZwyivKUi67A==" + "integrity": "sha1-Dec3RwS7OvvV6mMsSlARYiTTBIA=" }, "express-session": { "version": "1.15.5", "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.5.tgz", - "integrity": "sha512-BBVy6E/XqjB507wqe5T+7Ia2N/gtur/dT/fKmvGGKQqUrzI4dcBPGJgV4t2ciX7FoxZPhZcKTDTmb4+5nCyQOw==", + "integrity": "sha1-9JoYInJjsxb2+FRNpf7iWlQCWew=", "requires": { "cookie": "0.3.1", "cookie-signature": "1.0.6", @@ -891,6 +908,11 @@ } } }, + "fibers": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/fibers/-/fibers-1.0.15.tgz", + "integrity": "sha1-IvA5yPGLhWGQ+75N7PBWFUwerpw=" + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -911,7 +933,7 @@ "finalhandler": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.4.tgz", - "integrity": "sha512-16l/r8RgzlXKmFOhZpHBztvye+lAhC5SU7hXavnerC9UfZqZxxXl3BzL8MhffPT3kF61lj9Oav2LKEzh0ei7tg==", + "integrity": "sha1-GFdPLnxLmLiuOyMMIfIB8xvbP7c=", "requires": { "debug": "2.6.8", "encodeurl": "1.0.1", @@ -1470,7 +1492,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" + "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=" }, "http-errors": { "version": "1.6.2", @@ -1609,7 +1631,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "requires": { "isobject": "3.0.1" }, @@ -1929,7 +1951,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" @@ -2053,7 +2075,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -2113,7 +2135,7 @@ "mongoose": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.11.6.tgz", - "integrity": "sha512-TZQo1u8zd67ixiWFFoOhu3P7CB73XthLDX0GuGlFGR+49mi5L3I688GsMuayJo7bJhvCrMsG1d8BKJ2Lqdrsvg==", + "integrity": "sha1-0OvdX180/Kmw8bhuE89+Uy6Tmgk=", "requires": { "async": "2.1.4", "bson": "1.0.4", @@ -2147,7 +2169,7 @@ "mongooseeder": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/mongooseeder/-/mongooseeder-2.0.5.tgz", - "integrity": "sha512-w1+g48UdomQKOukO4Kr89MikmX06qLXs8GvPVJMng1TRRbeZCEv5ZnL0cutoLvDeFfouH+xYB+qDpnqut7beFQ==" + "integrity": "sha1-f5CRavENvKyEsmkhmIfU4vJjt/4=" }, "morgan": { "version": "1.8.2", @@ -2174,7 +2196,7 @@ "morgan-toolkit": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/morgan-toolkit/-/morgan-toolkit-1.0.2.tgz", - "integrity": "sha512-tFhfamRSNrnGlaVfY384lFyeHZl8Y4IwSt2219+6YEuVeEJKVBlAQHT/NSAF5hlHrloI0G578zRy0Hxv4Iv10Q==", + "integrity": "sha1-wTJMWvojtkhJtMEjZa9CthkxD+w=", "requires": { "chalk": "2.1.0", "cli-highlight": "1.1.4" @@ -2275,7 +2297,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", @@ -2633,7 +2655,7 @@ "postgres-interval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.1.1.tgz", - "integrity": "sha512-OkuCi9t/3CZmeQreutGgx/OVNv9MKHGIT5jH8KldQ4NLYXkvmT9nDVxEuCENlNwhlGPE374oA/xMqn05G49pHA==", + "integrity": "sha1-rNsPiXtLHG5JbZ1OCoU+HEKPBvA=", "requires": { "xtend": "4.0.1" } @@ -2656,7 +2678,7 @@ "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=", "requires": { "asap": "2.0.6" } @@ -2693,7 +2715,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", "requires": { "is-number": "3.0.0", "kind-of": "4.0.0" @@ -2825,7 +2847,7 @@ "require_optional": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", - "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", + "integrity": "sha1-TPNaQkf2TKPfjC7yCMxJSxyo/C4=", "requires": { "resolve-from": "2.0.0", "semver": "5.4.1" @@ -2844,7 +2866,7 @@ "resolve": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "integrity": "sha1-p1vgHFPaJdk0qY69DkxKcxL5KoY=", "requires": { "path-parse": "1.0.5" } @@ -2884,12 +2906,12 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" }, "send": { "version": "0.15.4", @@ -3019,7 +3041,7 @@ "os-locale": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", "requires": { "execa": "0.7.0", "lcid": "1.0.0", @@ -3056,7 +3078,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" @@ -3210,7 +3232,7 @@ "split": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "integrity": "sha1-YFvZvjA6pZ+zX5Ip++oN3snqB9k=", "requires": { "through": "2.3.8" } @@ -3228,7 +3250,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "requires": { "safe-buffer": "5.1.1" } @@ -3267,7 +3289,7 @@ "supports-color": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "integrity": "sha1-ZaS7JjHpDgJCDbpVVMN1pHVLuDY=", "requires": { "has-flag": "2.0.0" } @@ -3382,7 +3404,7 @@ "uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "integrity": "sha1-Kz1cckDo/C5Y+Komnl7knAhXvTo=", "requires": { "random-bytes": "1.0.0" } @@ -3442,7 +3464,7 @@ "uuid": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" + "integrity": "sha1-PdPT55Crwk17DToDT/q6vijrvAQ=" }, "v8flags": { "version": "2.1.1", @@ -3562,7 +3584,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", "requires": { "isexe": "2.0.0" } diff --git a/package.json b/package.json index d144fdb..0fd7438 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "homepage": "https://github.com/IDHalverson/project_mimirs_market#readme", "dependencies": { "Faker": "^0.7.2", + "asyncawait": "^1.0.6", "bluebird": "^3.5.0", "body-parser": "^1.17.2", "cookie-parser": "^1.4.3", diff --git a/public/javascripts/index.js b/public/javascripts/index.js new file mode 100644 index 0000000..e61aefc --- /dev/null +++ b/public/javascripts/index.js @@ -0,0 +1,96 @@ +$(document).ready(() => { + //Variables from cookies + const selectedSort = /selectedSortOption=(.+[SC]);*/.exec(document.cookie)[1]; + const searchValue = /searchValue=([^;]+);*/.exec(document.cookie)[1]; + // const filterOptionCategory = /filterOptionCategory=([^;]+);*/.exec( + // document.cookie + // )[1]; + // const filterOptionMinPrice = /filterOptionMinPrice=([^;]+);*/.exec( + // document.cookie + // )[1]; + // const filterOptionMaxPrice = /filterOptionMaxPrice=([^;]+);*/.exec( + // document.cookie + // )[1]; + + //Variables from page + const search = $("#search"); + const sortDisplay = $(`#${selectedSort}`).html(); + + //Page-load form setters + + //set sort option from cookie + $(`#${selectedSort}`).attr("selected", "selected"); + + //set search placeholder from cookie + search.attr("placeholder", searchValue); + + //Listeners + + //indicate the selected sort option for req.body retrieval on server + $("#sort-options").on("change", e => { + $("#sort-options option").removeAttr("selected"); + let value = $(e.target).val(); + $(`#${value}`).attr("selected", "selected"); + }); + + //update search placeholder + search.on("keyup", e => { + let value = search.val(); + value === "" ? (value = "search") : (value = value); + search.attr("placeholder", value); + + //Search parameter displays + + //sorted by: + if (sortDisplay) { + $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`); + } + + //searched for: + if (searchValue !== "search") { + $("#searchValueDisplay").html(`Search Results for: "${searchValue}"`); + } + + // let filterOptionCategory = document.cookie + // .split(" ") + // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) + // .join("") + // .split("=")[1]; + // /;$/.test(selectedSort) + // ? (selectedSort = selectedSort.split(";")[0]) + // : selectedSort; + // $(`#${selectedSort}`).attr("selected", "selected"); + // let sortDisplay = $(`#${selectedSort}`).html(); + // sortDisplay + // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) + // : selectedSort; + // + // let filterOptionMinPrice = document.cookie + // .split(" ") + // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) + // .join("") + // .split("=")[1]; + // /;$/.test(selectedSort) + // ? (selectedSort = selectedSort.split(";")[0]) + // : selectedSort; + // $(`#${selectedSort}`).attr("selected", "selected"); + // let sortDisplay = $(`#${selectedSort}`).html(); + // sortDisplay + // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) + // : selectedSort; + // + // let filterOptionMaxPrice = document.cookie + // .split(" ") + // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) + // .join("") + // .split("=")[1]; + // /;$/.test(selectedSort) + // ? (selectedSort = selectedSort.split(";")[0]) + // : selectedSort; + // $(`#${selectedSort}`).attr("selected", "selected"); + // let sortDisplay = $(`#${selectedSort}`).html(); + // sortDisplay + // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) + // : selectedSort; + }); +}); diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css new file mode 100644 index 0000000..29cc16f --- /dev/null +++ b/public/stylesheets/style.css @@ -0,0 +1,9 @@ +html * { + text-align: center; +} + +#cart-dropdown:nth-child(even) { +} + +#cart-dropdown:nth-child(odd) { +} diff --git a/repl.js b/repl.js index f2cecdc..b1de6ac 100644 --- a/repl.js +++ b/repl.js @@ -8,14 +8,6 @@ var models = { require("./mongo")().then(() => { repl.context.models = models; - // repl.context.helpers = helpers; - // - // // ---------------------------------------- - // // Helpers - // // ---------------------------------------- - // Object.keys(helpers).forEach(key => { - // repl.context[key] = helpers[key]; - // }); // ---------------------------------------- // Mongoose diff --git a/routers/cart.js b/routers/cart.js new file mode 100644 index 0000000..dd9afb1 --- /dev/null +++ b/routers/cart.js @@ -0,0 +1,68 @@ +const express = require("express"); +const router = express.Router(); +const { Product } = require("../models/sequelize"); + +//render cart page +router.get("/", (req, res) => { + return res.render("cart/index"); +}); + +//add to session cart, redirect +router.post("/add", (req, res) => { + let item = { id: req.body.itemId, quantity: 1 }; + req.session.cart.push(item); + return res.redirect("/"); +}); + +//reset session cart, redirect +router.put("/clear", (req, res) => { + req.session.cart = []; + req.method = "GET"; + return res.redirect("/cart"); +}); + +// +router.patch("/edit", (req, res) => { + let newQuantity = Number(req.body.newQuantity); + let item = req.body.newQuantityItem; + if (typeof newQuantity === "number" && newQuantity > 0) { + req.session.cart.forEach(i => { + if (i.id === item) { + i.quantity = newQuantity; + } + }); + req.method = "GET"; + return res.redirect("/cart"); + } else { + if (newQuantity === 0) { + req.session.cart.forEach((i, ix) => { + if (i.id === item) { + req.session.cart.splice(ix, 1); + } + }); + req.method = "GET"; + return res.redirect("/cart"); + } else { + let err = "Please enter a number."; + return res.render("cart/index", { err }); + } + } +}); + +//find cart item, remove item, redirect +router.delete("/delete", (req, res) => { + req.session.cart.forEach((i, ix) => { + if (i.id === req.body.delete) { + req.session.cart.splice(ix, 1); + } + }); + if (req.body.checkoutPage) { + req.method = "GET"; + return res.redirect("/checkout"); + } else { + req.method = "GET"; + return res.redirect("/cart"); + } +}); + +module.exports = router; diff --git a/routers/checkout.js b/routers/checkout.js new file mode 100644 index 0000000..31dc52a --- /dev/null +++ b/routers/checkout.js @@ -0,0 +1,76 @@ +const express = require("express"); +const router = express.Router(); +const mongoose = require("mongoose"); +const { Product } = require("../models/sequelize"); +const { Order, OrderItem } = require("../models/mongoose"); + +//render checkout form +router.get("/", (req, res) => { + res.render("checkout/form"); +}); + +//collect cart items, determine quantity and order total, +//create order, save order to database +router.post("/info", (req, res) => { + let total = 0; + let orderItems; + let cart = req.session.cart.map(el => el.id); + Product.findAll({ + where: { id: { $in: cart } }, + include: [{ all: true, nested: true }] + }) + .then(items => { + items.forEach((p, pix) => { + req.session.cart.forEach((i, cix) => { + if (p.id * 1 === i.id * 1) { + p.quantity = i.quantity; + total += i.quantity * p.price; + } + }); + }); + return items; + }) + .then(items => { + orderItems = items.map(i => { + return new OrderItem({ + name: i.name, + price: i.price, + sku: i.sku, + description: i.description, + category: i.Category.name, + quantity: i.quantity + }); + }); + return { + firstName: req.body.info.firstName, + lastName: req.body.info.lastName, + email: req.body.info.email, + description: req.body.info.description, + total: total, + streetAddress: req.body.info.address, + city: req.body.info.city, + state: req.body.info.state, + checkoutDate: new Date(), + items: orderItems + }; + }) + .then(order => { + let newOrder = new Order(order); + let promises = []; + orderItems.forEach(order => { + promises.push(order.save()); + }); + promises.push(newOrder.save()); + return Promise.all(promises); + }) + .then(() => { + req.session.infoComplete = true; + res.redirect("/checkout/payment"); + }); +}); + +router.get("/payment", (req, res) => { + res.end("time to pay!"); +}); + +module.exports = router; diff --git a/routers/products.js b/routers/products.js index 13736de..87d6933 100644 --- a/routers/products.js +++ b/routers/products.js @@ -1,48 +1,102 @@ var express = require("express"); var router = express.Router(); -const { Product } = require("../models/sequelize"); +const { Product, Category } = require("../models/sequelize"); +const checkIfInCart = require("../lib/checkifincart"); -//index Route +//get all products, render index router.get("/", (req, res) => { - Product.findAll({}).then(products => { - res.render("products/index", { products }); - }); + res.cookie("searchValue", "search"); + Product.findAll() + .then(products => { + return checkIfInCart(req, res, products); + }) + .then(products => { + return res.render("products/index", { products }); + }); }); -//show Route +//get 1 product, get related products, render product 'show' page router.get("/show/:productId", (req, res) => { - Product.findById(req.params.productId).then(product => { - Product.findAll({ - where: { categoryId: product.categoryId, id: { $ne: product.id } }, - limit: 6 - }).then(relatedProducts => { - res.render("products/show", { product, relatedProducts }); + let product; + Product.findById(req.params.productId) + .then(p => { + product = p; + return Product.findAll({ + where: { categoryId: product.categoryId, id: { $ne: product.id } }, + limit: 6 + }); + }) + .then(relatedProducts => { + return res.render("products/show", { product, relatedProducts }); }); - }); }); -///search +//retain/set "search" cookie, find search results, render index router.post("/search", (req, res) => { - let r = `${req.body.search}`; + let search = req.body.search; + res.cookie("searchValue", search); Product.findAll({ where: { - name: { $regexp: r } + name: { $regexp: search } } - }).then(products => { - res.render("products/index", { products }); - }); + }) + .then(products => { + return checkIfInCart(req, res, products); + }) + .then(products => { + return res.render("products/index", { products }); + }); }); +//retain "search" cookie, retain products on page, find and sort, render index router.post("/sort", (req, res) => { - let cascade; - let param = req.body.sortOption.slice(0, -1); - param === "date" ? (param = "createdAt") : (param = param); - /[name|price|date]A$/.test(req.body.sortOption) - ? (cascade = "ASC") - : (cascade = "DESC"); - Product.findAll({ order: [param] }).then(products => { - res.render("products/index", { products }); - }); + res.cookie("searchValue", req.cookies.searchValue || "search"); + if (req.body.sortOption) { + res.cookie("selectedSortOption", req.body.sortOption); + } + let productIds = Object.keys(req.body.shownProducts).map( + el => req.body.shownProducts[el] + ); + let param = req.body.sortOption.split("-")[0]; + let cascade = req.body.sortOption.split("-")[1]; + Product.findAll({ + where: { id: { $in: productIds } }, + order: [[param, cascade]] + }) + .then(products => { + return checkIfInCart(req, res, products); + }) + .then(products => { + return res.render("products/index", { products }); + }); +}); + +//extract filters, find products, render index +router.post("/filter", (req, res) => { + Product.findAll({ + include: [ + { + model: Category, + where: { + name: { $regexp: eq.body.filterOption.category } + } + } + ], + where: { + price: { + $between: [ + req.body.filterOption.minPrice, + req.body.filterOption.maxPrice + ] + } + } + }) + .then(products => { + return checkIfInCart(req, res, products); + }) + .then(products => { + return res.render("products/index", { products }); + }); }); module.exports = router; diff --git a/schema.txt b/schema.txt index f97aa7d..3bd782c 100644 --- a/schema.txt +++ b/schema.txt @@ -40,8 +40,10 @@ MONGODB Orders: [{ - id -- userId (Sequelize) -- name +- description +- total +- first name +- last name - email - items: [{ name, category, quantity @@ -55,5 +57,5 @@ name, category, quantity }] OrderItems: [{ -name, category, quantity +name, price, sku, description, category, quantity }, {}, {}] diff --git a/seeds/mongoose/index.js b/seeds/mongoose/index.js new file mode 100644 index 0000000..de05d44 --- /dev/null +++ b/seeds/mongoose/index.js @@ -0,0 +1,76 @@ +const faker = require("faker"); +const mongoose = require("mongoose"); +const models = require("../../models/mongoose"); +const env = process.env.NODE_ENV || "development"; +const config = require("../../config/mongo")[env]; +const mongooseeder = require("mongooseeder"); + +const { Order, OrderItem } = models; + +//seeds +const seeds = () => { + let orderItems = []; + for (i = 0; i < 1000; i++) { + let orderItem = new OrderItem({ + name: `Item-${i}`, + price: 10, + sku: 123098, + description: "a cool thing", + category: "Viking stuff", + quantity: 2 + }); + orderItems.push(orderItem); + } + + let orders = []; + for (i = 0; i < 100; i++) { + let order = new Order({ + firstName: `Viking${i}`, + lastName: "The Great", + description: "Viking gear for to pillage.", + total: 200, + email: "viking@viking.com", + address: "123 Pillagers Ln", + city: "Stockholm", + state: "VK", + checkoutDate: "Fri Sep 16 2011 19:05:17 GMT+0900 (JST)", + StripeToken: "tokie-toke", + cardType: "VikingCard", + items: [ + orderItems[i], + orderItems[i + 100], + orderItems[i + 200], + orderItems[i + 300], + orderItems[i + 400], + orderItems[i + 500], + orderItems[i + 600], + orderItems[i + 700], + orderItems[i + 800], + orderItems[i + 900] + ] + }); + orders.push(order); + } + + var promises = []; + [orderItems, orders].forEach(collection => { + collection.forEach(model => { + promises.push(model.save()); + }); + }); + + return Promise.all(promises); +}; + +const mongodbUrl = + process.env.NODE_ENV === "production" + ? process.env[config.use_env_variable] + : `mongodb://${config.host}/${config.database}`; + +mongooseeder.seed({ + mongodbUrl: mongodbUrl, + seeds: seeds, + clean: true, + models: models, + mongoose: mongoose +}); diff --git a/seeds/sequelize/20170809163150-products.js b/seeds/sequelize/20170809163150-products.js index 24d596e..4abaef0 100644 --- a/seeds/sequelize/20170809163150-products.js +++ b/seeds/sequelize/20170809163150-products.js @@ -4,6 +4,19 @@ let faker = require("Faker"); // +const images = [ + "https://vignette2.wikia.nocookie.net/elderscrolls/images/3/38/NordicBattleaxe.png/revision/latest?cb=20130309120450", + "http://vignette2.wikia.nocookie.net/elderscrolls/images/8/80/Linwes_armor.png/revision/latest?cb=20121011011901", + "https://i.pinimg.com/236x/88/fa/91/88fa9159b7ce5c8a25ed17b0e53b57a9--little-cottages-small-cottages.jpg", + "http://www.glacierwear.com/media/catalog/product/cache/1/small_image/400x/17f82f742ffe127f42dca9de82fb58b1/i/m/image002_43_1.png", + "https://ak1.ostkcdn.com/images/products/10899739/P17933376.jpg", + "https://vignette1.wikia.nocookie.net/elderscrolls/images/c/ce/Steel_Shield_SK.png/revision/latest?cb=20121027210457", + "https://wiki.guildwars.com/images/thumb/d/d9/Bottle_of_Grog.jpg/151px-Bottle_of_Grog.jpg", + "https://previews.123rf.com/images/olganikitina/olganikitina1207/olganikitina120700030/14464691-sports-competition-torch-with-flame-isolated-Vector-Stock-Vector.jpg", + "https://s-media-cache-ak0.pinimg.com/originals/bb/9d/43/bb9d43fdec1a73dc3b0fdd56ab4321d8.jpg", + "http://worldartsme.com/images/cartoon-horse-free-clipart-1.jpg" +]; + module.exports = { up: function(queryInterface, Sequelize) { let seeds = []; @@ -11,7 +24,14 @@ module.exports = { let name = `${faker.random.catch_phrase_descriptor()} ${faker.random.catch_phrase_descriptor()} ${faker.random.bs_noun()}`; let p = { name: name, - description: faker.Lorem.sentence(), + description: faker.Lorem + .sentence() + .concat( + faker.Lorem + .sentence() + .concat(faker.Lorem.sentence().concat(faker.Lorem.sentence())) + ), + imageUrl: images[i % 10], price: faker.random.number(5000), sku: Math.random() * 122221, categoryId: i % 10 + 1 diff --git a/seeds/sequelize/20170809200347-categories.js b/seeds/sequelize/20170809200347-categories.js index 5db782f..ded724f 100644 --- a/seeds/sequelize/20170809200347-categories.js +++ b/seeds/sequelize/20170809200347-categories.js @@ -5,9 +5,9 @@ let faker = require("Faker"); let categoriesName = [ "Weapons", "Armor", - "Heads", + "Thatch-Roof-Cottages", "Pelts", - "Parisols", + "Shoes", "Shields", "Grog", "Torches", diff --git a/views/cart/index.handlebars b/views/cart/index.handlebars new file mode 100644 index 0000000..f6fe536 --- /dev/null +++ b/views/cart/index.handlebars @@ -0,0 +1,49 @@ + +{{#if err}} +

{{err}}

+{{/if}} +
+
+ +
+
+ + +
+
+ +
+
+

Total: ${{total}}

+
+
+ {{#each items as |item|}} +
+ +

${{item.price}}

+

{{item.name}}

+

Quantity: {{item.quantity}}

+
+
+
+
+
+ + + +
+ +
+
+ + + +
+
+
+ {{/each}} +
+ +
diff --git a/views/checkout/form.handlebars b/views/checkout/form.handlebars new file mode 100644 index 0000000..10061c8 --- /dev/null +++ b/views/checkout/form.handlebars @@ -0,0 +1,222 @@ +
+
+
+
+
+

+ Review Your Order & Complete Checkout +

+
+ Keep Shopping for Viking Gear! +
+ Return To Cart +
+
+
+
+
+
+ +
+
+
+
+ + + {{#each items as |item|}} + + + + + + + + {{/each}} +
+ +
+ + + + +
+
+ +
+ + {{item.name}}
+
    +
  • + +
  • Description:
    {{item.description}}

  • +
  • Category: {{item.Category.name}}
  • + +
+
+ Price: ${{item.price}} +
+ + Quantity: {{item.quantity}} + +
+
+
+
+

Order Total

+

${{total}}

+
+
+
+
+
+ +
+
+ +
+ +
+
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
diff --git a/views/partials/head.handlebars b/views/partials/head.handlebars index 66d6fda..c72404f 100644 --- a/views/partials/head.handlebars +++ b/views/partials/head.handlebars @@ -6,8 +6,9 @@ + - + diff --git a/views/partials/navbar.handlebars b/views/partials/navbar.handlebars index edc17ff..d618a52 100644 --- a/views/partials/navbar.handlebars +++ b/views/partials/navbar.handlebars @@ -5,19 +5,47 @@
  • Mimir's Market(current)
  • diff --git a/views/products/index.handlebars b/views/products/index.handlebars index 29fc260..5544469 100644 --- a/views/products/index.handlebars +++ b/views/products/index.handlebars @@ -6,34 +6,107 @@
    - Search: - + Search: +
    +
    +
    +
    + Filter By: + +
    + +
    + +
    + - +
    + +
    + +
    +
    Sort By: - + + + + + + + + {{#each products as |prod|}} + + {{/each}}
    - +
    +

    +

    {{#each products as |prod|}} -
    - -

    ${{prod.price}}

    -

    {{prod.name}}

    -
    {{prod.description}}
    - -
    +
    + +

    ${{prod.price}}

    +

    {{prod.name}}

    +
    {{prod.description}}
    + {{#if prod.inCart }} +
    + + +
    + {{else}} +
    + + +
    + {{/if}} +
    {{/each}}
    diff --git a/views/products/show.handlebars b/views/products/show.handlebars index ef67d4b..6ddff1a 100644 --- a/views/products/show.handlebars +++ b/views/products/show.handlebars @@ -1,5 +1,5 @@
    - +

    ${{product.price}}

    @@ -11,12 +11,12 @@

    Related Products

    {{#each relatedProducts as |prod|}} -
    - -

    ${{prod.price}}

    -

    {{prod.name}}

    -
    {{prod.description}}
    - -
    +
    + +

    ${{prod.price}}

    +

    {{prod.name}}

    +
    {{prod.description}}
    + +
    {{/each}}
    From 30389f5fe6d4ebbbd8c35044faab1a8e712e9c80 Mon Sep 17 00:00:00 2001 From: Ian Halverson Date: Mon, 14 Aug 2017 06:56:17 -0400 Subject: [PATCH 17/17] finished orders index --- .gitignore | 1 + app.js | 9 ++ models/mongoose/orderitem.js | 18 ++-- package-lock.json | 28 +++++ package.json | 4 +- public/javascripts/index.js | 104 +++++++++--------- routers/admin.js | 23 ++++ routers/cart.js | 6 ++ routers/checkout.js | 66 ++++++++---- routers/products.js | 5 +- seeds/mongoose/index.js | 4 +- views/admin/analytics/analytics.handlebars | 120 +++++++++++++++++++++ views/admin/orders/index.handlebars | 31 ++++++ views/admin/orders/show.handlebars | 116 ++++++++++++++++++++ views/checkout/payment.handlebars | 11 ++ views/development/end.handlebars | 7 ++ views/partials/navbar.handlebars | 4 +- views/products/show.handlebars | 29 ++++- 18 files changed, 492 insertions(+), 94 deletions(-) create mode 100644 routers/admin.js create mode 100644 views/admin/analytics/analytics.handlebars create mode 100644 views/admin/orders/index.handlebars create mode 100644 views/admin/orders/show.handlebars create mode 100644 views/checkout/payment.handlebars create mode 100644 views/development/end.handlebars diff --git a/.gitignore b/.gitignore index 7043851..db727fc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules/ config/ config/sequelize.json config/mongo.json +.env diff --git a/app.js b/app.js index 40ab096..3c8d18d 100644 --- a/app.js +++ b/app.js @@ -2,6 +2,11 @@ const express = require("express"); const app = express(); +//Production environment variables +if (process.env.NODE_ENV !== "production") { + require("dotenv").config(); +} + //Modules const cookieParser = require("cookie-parser"); const bodyParser = require("body-parser"); @@ -15,6 +20,8 @@ const hbs = expressHandlebars.create({ partialsDir: "views/partials", defaultLayout: "application" }); +const { STRIPE_SK, STRIPE_PK } = process.env; +const stripe = require("stripe")(STRIPE_SK); //Custom middleware modules const mdw = require("./lib/middleware"); @@ -26,6 +33,7 @@ const { Product } = require("./models/sequelize"); const productsRouter = require("./routers/products"); const cartRouter = require("./routers/cart"); const checkoutRouter = require("./routers/checkout"); +const adminRouter = require("./routers/admin"); //View engine app.engine("handlebars", hbs.engine); @@ -65,6 +73,7 @@ app.use(mdw.cartFiller); app.use("/products", productsRouter); app.use("/cart", cartRouter); app.use("/checkout", checkoutRouter); +app.use("/admin", adminRouter); //Set up and start server const port = process.env.PORT || process.argv[2] || 3000; diff --git a/models/mongoose/orderitem.js b/models/mongoose/orderitem.js index 9f4d7b1..540cd7a 100644 --- a/models/mongoose/orderitem.js +++ b/models/mongoose/orderitem.js @@ -2,16 +2,14 @@ const mongoose = require("mongoose"); var Schema = mongoose.Schema; var OrderItemSchema = new Schema( - [ - { - name: String, - price: Number, - sku: Number, - description: String, - category: String, - quantity: Number - } - ], + { + name: String, + price: Number, + sku: Number, + description: String, + category: String, + quantity: Number + }, { timestamps: true } diff --git a/package-lock.json b/package-lock.json index 5618051..4a191bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -552,6 +552,11 @@ "fs-exists-sync": "0.1.0" } }, + "dotenv": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz", + "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=" + }, "dottie": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.0.tgz", @@ -3286,6 +3291,29 @@ "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, + "stripe": { + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/stripe/-/stripe-4.24.0.tgz", + "integrity": "sha512-oI4qt/aIWMBWXBmpRaEmbjbOvMhOn4vEUx0aOyTgbPGJEExUoU/CutmZTXQQ8o/RPAl2KEABjdyL6ad8yuvZKQ==", + "requires": { + "bluebird": "2.11.0", + "lodash.isplainobject": "4.0.6", + "object-assign": "4.1.1", + "qs": "6.0.4" + }, + "dependencies": { + "bluebird": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" + }, + "qs": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.0.4.tgz", + "integrity": "sha1-UQGdhHIMk5uCc36EVWp4Izjs6ns=" + } + } + }, "supports-color": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", diff --git a/package.json b/package.json index 0fd7438..8d65024 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "body-parser": "^1.17.2", "cookie-parser": "^1.4.3", "cookie-session": "^1.3.0", + "dotenv": "^4.0.0", "express": "^4.15.4", "express-handlebars": "^3.0.0", "express-method-override-get-post-support": "0.0.7", @@ -48,6 +49,7 @@ "pg": "^7.1.0", "pg-hstore": "^2.3.2", "sequelize": "^4.4.2", - "sequelize-cli": "^2.8.0" + "sequelize-cli": "^2.8.0", + "stripe": "^4.24.0" } } diff --git a/public/javascripts/index.js b/public/javascripts/index.js index e61aefc..91dbdce 100644 --- a/public/javascripts/index.js +++ b/public/javascripts/index.js @@ -14,7 +14,7 @@ $(document).ready(() => { //Variables from page const search = $("#search"); - const sortDisplay = $(`#${selectedSort}`).html(); + const sort = $(`#${selectedSort}`).html(); //Page-load form setters @@ -38,59 +38,59 @@ $(document).ready(() => { let value = search.val(); value === "" ? (value = "search") : (value = value); search.attr("placeholder", value); + }); - //Search parameter displays + //Search parameter displays - //sorted by: - if (sortDisplay) { - $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`); - } + //sorted by: + if (sort) { + $("#sortOptionDisplay").html(`Sorted by: ${sort}`); + } - //searched for: - if (searchValue !== "search") { - $("#searchValueDisplay").html(`Search Results for: "${searchValue}"`); - } + //searched for: + if (searchValue !== "search") { + $("#searchValueDisplay").html(`Search Results for: "${searchValue}"`); + } - // let filterOptionCategory = document.cookie - // .split(" ") - // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) - // .join("") - // .split("=")[1]; - // /;$/.test(selectedSort) - // ? (selectedSort = selectedSort.split(";")[0]) - // : selectedSort; - // $(`#${selectedSort}`).attr("selected", "selected"); - // let sortDisplay = $(`#${selectedSort}`).html(); - // sortDisplay - // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) - // : selectedSort; - // - // let filterOptionMinPrice = document.cookie - // .split(" ") - // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) - // .join("") - // .split("=")[1]; - // /;$/.test(selectedSort) - // ? (selectedSort = selectedSort.split(";")[0]) - // : selectedSort; - // $(`#${selectedSort}`).attr("selected", "selected"); - // let sortDisplay = $(`#${selectedSort}`).html(); - // sortDisplay - // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) - // : selectedSort; - // - // let filterOptionMaxPrice = document.cookie - // .split(" ") - // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) - // .join("") - // .split("=")[1]; - // /;$/.test(selectedSort) - // ? (selectedSort = selectedSort.split(";")[0]) - // : selectedSort; - // $(`#${selectedSort}`).attr("selected", "selected"); - // let sortDisplay = $(`#${selectedSort}`).html(); - // sortDisplay - // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) - // : selectedSort; - }); + // let filterOptionCategory = document.cookie + // .split(" ") + // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) + // .join("") + // .split("=")[1]; + // /;$/.test(selectedSort) + // ? (selectedSort = selectedSort.split(";")[0]) + // : selectedSort; + // $(`#${selectedSort}`).attr("selected", "selected"); + // let sortDisplay = $(`#${selectedSort}`).html(); + // sortDisplay + // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) + // : selectedSort; + // + // let filterOptionMinPrice = document.cookie + // .split(" ") + // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) + // .join("") + // .split("=")[1]; + // /;$/.test(selectedSort) + // ? (selectedSort = selectedSort.split(";")[0]) + // : selectedSort; + // $(`#${selectedSort}`).attr("selected", "selected"); + // let sortDisplay = $(`#${selectedSort}`).html(); + // sortDisplay + // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) + // : selectedSort; + // + // let filterOptionMaxPrice = document.cookie + // .split(" ") + // .filter(el => /^selectedSortOption=.+[A|D]$/.test(el)) + // .join("") + // .split("=")[1]; + // /;$/.test(selectedSort) + // ? (selectedSort = selectedSort.split(";")[0]) + // : selectedSort; + // $(`#${selectedSort}`).attr("selected", "selected"); + // let sortDisplay = $(`#${selectedSort}`).html(); + // sortDisplay + // ? $("#sortOptionDisplay").html(`Sorted by: ${sortDisplay}`) + // : selectedSort; }); diff --git a/routers/admin.js b/routers/admin.js new file mode 100644 index 0000000..3966fd7 --- /dev/null +++ b/routers/admin.js @@ -0,0 +1,23 @@ +const express = require("express"); +const router = express.Router(); +const mongoose = require("mongoose"); +const Order = mongoose.model("Order"); +const OrderItem = mongoose.model("OrderItem"); + +router.get("/orders", (req, res) => { + Order.find().then(orders => { + res.render("admin/orders/index", { orders }); + }); +}); + +router.get("/orders/show/:id", (req, res) => { + Order.findById(req.params.id).populate("items").then(order => { + res.render("admin/orders/show", { order }); + }); +}); + +router.get("/analytics", (req, res) => { + res.render("admin/analytics/analytics"); +}); + +module.exports = router; diff --git a/routers/cart.js b/routers/cart.js index dd9afb1..2c4cf2b 100644 --- a/routers/cart.js +++ b/routers/cart.js @@ -11,6 +11,12 @@ router.get("/", (req, res) => { router.post("/add", (req, res) => { let item = { id: req.body.itemId, quantity: 1 }; req.session.cart.push(item); + if (req.body.addedFromShow === "true") { + return res.redirect(`/products/show/${item.id}`); + } + if (req.body.addedFromRelated === "true") { + return res.redirect(`/products/show/${req.body.currentShowPageId}`); + } return res.redirect("/"); }); diff --git a/routers/checkout.js b/routers/checkout.js index 31dc52a..b0310c1 100644 --- a/routers/checkout.js +++ b/routers/checkout.js @@ -3,6 +3,8 @@ const router = express.Router(); const mongoose = require("mongoose"); const { Product } = require("../models/sequelize"); const { Order, OrderItem } = require("../models/mongoose"); +const { STRIPE_SK, STRIPE_PK } = process.env; +const stripe = require("stripe")(STRIPE_SK); //render checkout form router.get("/", (req, res) => { @@ -12,8 +14,30 @@ router.get("/", (req, res) => { //collect cart items, determine quantity and order total, //create order, save order to database router.post("/info", (req, res) => { + req.session.pendingInfo = { + firstName: req.body.info.firstName, + lastName: req.body.info.lastName, + email: req.body.info.email, + description: req.body.info.description, + streetAddress: req.body.info.address, + city: req.body.info.city, + state: req.body.info.state, + checkoutDate: new Date() + }; + req.session.infoComplete = true; + res.redirect("/checkout/payment"); +}); + +router.get("/payment", (req, res) => { + res.render("checkout/payment"); +}); + +router.post("/charges", (req, res) => { let total = 0; let orderItems; + let order; + let charge = req.body; + let newOrder; let cart = req.session.cart.map(el => el.id); Product.findAll({ where: { id: { $in: cart } }, @@ -41,36 +65,32 @@ router.post("/info", (req, res) => { quantity: i.quantity }); }); - return { - firstName: req.body.info.firstName, - lastName: req.body.info.lastName, - email: req.body.info.email, - description: req.body.info.description, - total: total, - streetAddress: req.body.info.address, - city: req.body.info.city, - state: req.body.info.state, - checkoutDate: new Date(), - items: orderItems - }; + order = req.session.pendingInfo; + order.items = orderItems; + order.total = total; + newOrder = new Order(order); + stripe.charges.create({ + amount: total, + currency: "usd", + description: order.description, + source: charge.stripeToken + }); }) - .then(order => { - let newOrder = new Order(order); + .then(charge => { + newOrder.cardType = req.body.stripeTokenType; + newOrder.StripeToke = req.body.stripeToken; let promises = []; - orderItems.forEach(order => { - promises.push(order.save()); + orderItems.forEach(item => { + promises.push(item.save()); }); promises.push(newOrder.save()); return Promise.all(promises); }) .then(() => { - req.session.infoComplete = true; - res.redirect("/checkout/payment"); - }); -}); - -router.get("/payment", (req, res) => { - res.end("time to pay!"); + req.session = { cart: [], backUrl: "/" }; + res.render("development/end", { orderItems, newOrder }); + }) + .catch(e => res.status(500).send(e.stack)); }); module.exports = router; diff --git a/routers/products.js b/routers/products.js index 87d6933..5378e38 100644 --- a/routers/products.js +++ b/routers/products.js @@ -20,12 +20,15 @@ router.get("/show/:productId", (req, res) => { let product; Product.findById(req.params.productId) .then(p => { - product = p; + product = checkIfInCart(req, res, [p])[0]; return Product.findAll({ where: { categoryId: product.categoryId, id: { $ne: product.id } }, limit: 6 }); }) + .then(relatedProducts => { + return checkIfInCart(req, res, relatedProducts); + }) .then(relatedProducts => { return res.render("products/show", { product, relatedProducts }); }); diff --git a/seeds/mongoose/index.js b/seeds/mongoose/index.js index de05d44..6bee63e 100644 --- a/seeds/mongoose/index.js +++ b/seeds/mongoose/index.js @@ -30,11 +30,11 @@ const seeds = () => { description: "Viking gear for to pillage.", total: 200, email: "viking@viking.com", - address: "123 Pillagers Ln", + streetAddress: "123 Pillagers Ln", city: "Stockholm", state: "VK", checkoutDate: "Fri Sep 16 2011 19:05:17 GMT+0900 (JST)", - StripeToken: "tokie-toke", + StripeToke: "tokie-toke", cardType: "VikingCard", items: [ orderItems[i], diff --git a/views/admin/analytics/analytics.handlebars b/views/admin/analytics/analytics.handlebars new file mode 100644 index 0000000..ff03f89 --- /dev/null +++ b/views/admin/analytics/analytics.handlebars @@ -0,0 +1,120 @@ +
    +
    +

    Analytics

    +
    +
    +
    +
    +

    Totals

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    Total Revenue Ever{{item.name}}
    Total Units Sold{{item.price}}
    Total Transactions{{item.sku}}
    Total Customers{{item.description}}
    Total Products{{item.category}}
    Total Categories{{item.quantity}}
    +
    +
    +

    Revenue By State

    + + + + + + + + + + + + + + {{#each states as |state|}} + + + + + {{/each}} + +
    FieldValue
    {{state.name}}
    GA{{state.name}}
    +
    +
    +

    Revenue By Product

    + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    Checkout Date{{order.checkoutDate}}
    Stripe Token{{order.StripeToke}}
    Card Type{{order.cardType}}
    +
    +
    +

    Revenue By Category

    + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    Checkout Date{{order.checkoutDate}}
    Stripe Token{{order.StripeToke}}
    Card Type{{order.cardType}}
    +
    +
    +
    +
    diff --git a/views/admin/orders/index.handlebars b/views/admin/orders/index.handlebars new file mode 100644 index 0000000..9ec6851 --- /dev/null +++ b/views/admin/orders/index.handlebars @@ -0,0 +1,31 @@ +
    +
    +

    Orders

    +
    +
    + + + + + + + + + + + + + {{#each orders as |order|}} + + + + + + + + + {{/each}} + +
    IDDescriptionCheckout DateRevenueCustomer EmailCustomer State
    {{order.id}}{{order.description}}{{order.checkoutDate}}${{order.total}}{{order.email}}{{order.state}}
    +
    +
    diff --git a/views/admin/orders/show.handlebars b/views/admin/orders/show.handlebars new file mode 100644 index 0000000..64a8cce --- /dev/null +++ b/views/admin/orders/show.handlebars @@ -0,0 +1,116 @@ +
    +
    +

    Show Order: {{order.id}}

    +
    + +
    +
    +
    +
    +
    +

    Ordered Items

    + + {{#each order.items as |item|}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    Name{{item.name}}
    Price${{item.price}}
    SKU{{item.sku}}
    Description{{item.description}}
    Category{{item.category}}
    Quantity{{item.quantity}}
    + + {{/each}} +
    +
    +

    Customer Info

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    First Name{{order.firstName}}
    Last Name{{order.lastName}}
    Email{{order.email}}
    Street Address{{order.streetAddress}}
    City{{order.city}}
    State{{order.state}}
    +
    +
    +

    Order Info

    + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    Checkout Date{{order.checkoutDate}}
    Stripe Token{{order.StripeToke}}
    Card Type{{order.cardType}}
    +
    +
    +
    +
    diff --git a/views/checkout/payment.handlebars b/views/checkout/payment.handlebars new file mode 100644 index 0000000..eb0192f --- /dev/null +++ b/views/checkout/payment.handlebars @@ -0,0 +1,11 @@ +

    Please Complete Payment

    +
    + +
    diff --git a/views/development/end.handlebars b/views/development/end.handlebars new file mode 100644 index 0000000..8062853 --- /dev/null +++ b/views/development/end.handlebars @@ -0,0 +1,7 @@ +

    Thank you for your order!

    +
    +

    Order:


    +
    {{newOrder}}
    +

    Order Items:


    + +
    {{orderItems}}
    diff --git a/views/partials/navbar.handlebars b/views/partials/navbar.handlebars index d618a52..3baa1f4 100644 --- a/views/partials/navbar.handlebars +++ b/views/partials/navbar.handlebars @@ -41,10 +41,10 @@
  • - +
  • - +
  • Logout
  • diff --git a/views/products/show.handlebars b/views/products/show.handlebars index 6ddff1a..b781247 100644 --- a/views/products/show.handlebars +++ b/views/products/show.handlebars @@ -5,18 +5,41 @@

    ${{product.price}}

    {{product.name}}

    {{product.description}}
    - + {{#if product.inCart }} +
    + + +
    + {{else}} +
    + + + +
    + {{/if}}

    Related Products

    {{#each relatedProducts as |prod|}} -
    +

    ${{prod.price}}

    {{prod.name}}

    {{prod.description}}
    - + {{#if prod.inCart }} +
    + + +
    + {{else}} +
    + + + + +
    + {{/if}}
    {{/each}}