Full Code of balderdashy/sails for AI

master fd71efbd4f13 cached
718 files
2.7 MB
752.1k tokens
79 symbols
1 requests
Download .txt
Showing preview only (2,991K chars total). Download the full file or copy to clipboard to get everything.
Repository: balderdashy/sails
Branch: master
Commit: fd71efbd4f13
Files: 718
Total size: 2.7 MB

Directory structure:
gitextract_abogsmgr/

├── .editorconfig
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE
│   └── PULL_REQUEST_TEMPLATE
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── CODE-OF-CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── MODULES.md
├── README.md
├── ROADMAP.md
├── accessible/
│   ├── generate.js
│   └── rc.js
├── appveyor.yml
├── bin/
│   ├── private/
│   │   ├── patched-commander.js
│   │   └── read-repl-history-and-start-transcribing.js
│   ├── sails-console.js
│   ├── sails-debug-console.js
│   ├── sails-debug.js
│   ├── sails-deploy.js
│   ├── sails-generate.js
│   ├── sails-inspect.js
│   ├── sails-lift.js
│   ├── sails-migrate.js
│   ├── sails-new.js
│   ├── sails-run.js
│   ├── sails-upgrade.js
│   ├── sails-www.js
│   └── sails.js
├── docs/
│   ├── PAGE_NEEDED.md
│   ├── README.md
│   ├── anatomy/
│   │   ├── .editorconfig.md
│   │   ├── .eslintignore.md
│   │   ├── .eslintrc.md
│   │   ├── .htmlhintrc.md
│   │   ├── Gruntfile.js.md
│   │   ├── README.md
│   │   ├── README.md.md
│   │   ├── anatomy.md
│   │   ├── api/
│   │   │   ├── api.md
│   │   │   ├── controllers/
│   │   │   │   ├── controllers.md
│   │   │   │   └── gitkeep.md
│   │   │   ├── helpers/
│   │   │   │   ├── .gitkeep.md
│   │   │   │   └── helpers.md
│   │   │   ├── models/
│   │   │   │   ├── .gitkeep.md
│   │   │   │   └── models.md
│   │   │   └── policies/
│   │   │       ├── .gitkeep.md
│   │   │       └── policies.md
│   │   ├── app.js.md
│   │   ├── assets/
│   │   │   ├── .eslintrc.md
│   │   │   ├── assets.md
│   │   │   ├── dependencies/
│   │   │   │   ├── dependencies.md
│   │   │   │   └── sails.io.js.md
│   │   │   ├── favicon.ico.md
│   │   │   ├── images/
│   │   │   │   ├── gitkeep.md
│   │   │   │   └── images.md
│   │   │   ├── js/
│   │   │   │   ├── gitkeep.md
│   │   │   │   └── js.md
│   │   │   ├── styles/
│   │   │   │   ├── importer.less.md
│   │   │   │   └── styles.md
│   │   │   └── templates/
│   │   │       ├── gitkeep.md
│   │   │       └── templates.md
│   │   ├── config/
│   │   │   ├── blueprints.js.md
│   │   │   ├── bootstrap.js.md
│   │   │   ├── config.md
│   │   │   ├── custom.js.md
│   │   │   ├── datastores.js.md
│   │   │   ├── env/
│   │   │   │   ├── env.md
│   │   │   │   └── production.js.md
│   │   │   ├── globals.js.md
│   │   │   ├── http.js.md
│   │   │   ├── i18n.js.md
│   │   │   ├── local.js.md
│   │   │   ├── locales/
│   │   │   │   ├── de.json.md
│   │   │   │   ├── en.json.md
│   │   │   │   ├── es.json.md
│   │   │   │   ├── fr.json.md
│   │   │   │   └── locales.md
│   │   │   ├── log.js.md
│   │   │   ├── models.js.md
│   │   │   ├── policies.js.md
│   │   │   ├── routes.js.md
│   │   │   ├── security.js.md
│   │   │   ├── session.js.md
│   │   │   ├── sockets.js.md
│   │   │   └── views.js.md
│   │   ├── gitignore.md
│   │   ├── package.json.md
│   │   ├── sailsrc.md
│   │   ├── tasks/
│   │   │   ├── config/
│   │   │   │   ├── babel.js.md
│   │   │   │   ├── clean.js.md
│   │   │   │   ├── coffee.js.md
│   │   │   │   ├── concat.js.md
│   │   │   │   ├── config.md
│   │   │   │   ├── copy.js.md
│   │   │   │   ├── cssmin.js.md
│   │   │   │   ├── hash.js.md
│   │   │   │   ├── jst.js.md
│   │   │   │   ├── less.js.md
│   │   │   │   ├── sails-linker.js.md
│   │   │   │   ├── sync.js.md
│   │   │   │   ├── uglify.js.md
│   │   │   │   └── watch.js.md
│   │   │   ├── pipeline.js.md
│   │   │   ├── register/
│   │   │   │   ├── build.js.md
│   │   │   │   ├── buildProd.js.md
│   │   │   │   ├── compileAssets.js.md
│   │   │   │   ├── default.js.md
│   │   │   │   ├── linkAssets.js.md
│   │   │   │   ├── linkAssetsBuild.js.md
│   │   │   │   ├── linkAssetsBuildProd.js.md
│   │   │   │   ├── polyfill.js.md
│   │   │   │   ├── prod.js.md
│   │   │   │   ├── register.md
│   │   │   │   └── syncAssets.js.md
│   │   │   └── tasks.md
│   │   └── views/
│   │       ├── .eslintrc.md
│   │       ├── 404.ejs.md
│   │       ├── 500.ejs.md
│   │       ├── layouts/
│   │       │   ├── layout.ejs.md
│   │       │   └── layouts.md
│   │       ├── pages/
│   │       │   ├── homepage.ejs.md
│   │       │   └── pages.md
│   │       └── views.md
│   ├── concepts/
│   │   ├── ActionsAndControllers/
│   │   │   ├── ActionsAndControllers.md
│   │   │   ├── GeneratingActions.md
│   │   │   └── RoutingToActions.md
│   │   ├── Assets/
│   │   │   ├── Assets.md
│   │   │   ├── DefaultTasks.md
│   │   │   ├── DisablingGrunt.md
│   │   │   └── TaskAutomation.md
│   │   ├── Blueprints/
│   │   │   ├── Blueprint Actions.md
│   │   │   ├── Blueprint Routes.md
│   │   │   └── Blueprints.md
│   │   ├── Configuration/
│   │   │   ├── Configuration.md
│   │   │   ├── localjsfile.md
│   │   │   └── usingsailsrcfiles.md
│   │   ├── Deployment/
│   │   │   ├── Deployment.md
│   │   │   ├── FAQ.md
│   │   │   ├── Hosting.md
│   │   │   └── Scaling.md
│   │   ├── E-commerce/
│   │   │   └── E-commerce.md
│   │   ├── File Uploads/
│   │   │   ├── File Uploads.md
│   │   │   ├── uploading-to-amazon-s3.md
│   │   │   └── uploading-to-mongo-gridfs.md
│   │   ├── Globals/
│   │   │   ├── DisablingGlobals.md
│   │   │   └── Globals.md
│   │   ├── Helpers/
│   │   │   ├── ExampleHelper.md
│   │   │   └── Helpers.md
│   │   ├── Internationalization/
│   │   │   ├── Internationalization.md
│   │   │   ├── Locales.md
│   │   │   └── TranslatingDynamicContent.md
│   │   ├── Logging/
│   │   │   ├── Custom log messages.md
│   │   │   └── Logging.md
│   │   ├── Middleware/
│   │   │   ├── ConventionalDefaults.md
│   │   │   └── Middleware.md
│   │   ├── ORM/
│   │   │   ├── Associations/
│   │   │   │   ├── Associations.md
│   │   │   │   ├── ManytoMany.md
│   │   │   │   ├── OneWayAssociation.md
│   │   │   │   ├── OnetoMany.md
│   │   │   │   ├── OnetoOne.md
│   │   │   │   ├── Reflexive.md
│   │   │   │   └── ThroughAssociations.md
│   │   │   ├── Attributes.md
│   │   │   ├── Lifecyclecallbacks.md
│   │   │   ├── Models.md
│   │   │   ├── ORM.md
│   │   │   ├── Querylanguage.md
│   │   │   ├── Records.md
│   │   │   ├── Validations.md
│   │   │   ├── errors.md
│   │   │   ├── model-settings.md
│   │   │   └── standalone-usage.md
│   │   ├── Policies/
│   │   │   ├── Permissions.md
│   │   │   └── Policies.md
│   │   ├── Programmatic Usage/
│   │   │   ├── Programmatic Usage.md
│   │   │   └── Tips and Tricks.md
│   │   ├── README.md
│   │   ├── Realtime/
│   │   │   ├── Multi-server environments.md
│   │   │   ├── On the client.md
│   │   │   ├── On the server.md
│   │   │   └── Realtime.md
│   │   ├── Routes/
│   │   │   ├── RouteTargetSyntax.md
│   │   │   └── Routes.md
│   │   ├── Security/
│   │   │   ├── CORS.md
│   │   │   ├── CSRF.md
│   │   │   ├── Clickjacking.md
│   │   │   ├── ContentSecurityPolicy.md
│   │   │   ├── DDOS.md
│   │   │   ├── P3P.md
│   │   │   ├── Security.md
│   │   │   ├── SocketHijacking.md
│   │   │   ├── StrictTransportSecurity.md
│   │   │   └── XSS.md
│   │   ├── Services/
│   │   │   └── Services.md
│   │   ├── Sessions/
│   │   │   └── sessions.md
│   │   ├── Testing/
│   │   │   └── Testing.md
│   │   ├── Views/
│   │   │   ├── Layouts.md
│   │   │   ├── Locals.md
│   │   │   ├── Partials.md
│   │   │   ├── ViewEngines.md
│   │   │   └── Views.md
│   │   ├── concepts.md
│   │   ├── extending-sails/
│   │   │   ├── Adapters/
│   │   │   │   ├── Adapters.md
│   │   │   │   ├── adapterList.md
│   │   │   │   └── customAdapters.md
│   │   │   ├── Custom Responses/
│   │   │   │   ├── AddingCustomResponse.md
│   │   │   │   └── Custom Responses.md
│   │   │   ├── Generators/
│   │   │   │   ├── Generators.md
│   │   │   │   ├── customGenerators.md
│   │   │   │   └── generatorList.md
│   │   │   ├── Hooks/
│   │   │   │   ├── Hooks.md
│   │   │   │   ├── available-hooks.md
│   │   │   │   ├── events.md
│   │   │   │   ├── hookspec/
│   │   │   │   │   ├── configure.md
│   │   │   │   │   ├── defaults.md
│   │   │   │   │   ├── hookspec.md
│   │   │   │   │   ├── initialize.md
│   │   │   │   │   ├── register-actions.md
│   │   │   │   │   └── routes.md
│   │   │   │   ├── installablehooks.md
│   │   │   │   ├── projecthooks.md
│   │   │   │   └── usinghooks.md
│   │   │   └── extending-sails.md
│   │   └── shell-scripts/
│   │       └── shell-scripts.md
│   ├── contributing/
│   │   ├── adapter-specification.md
│   │   ├── code-of-conduct.md
│   │   ├── code-submission-guidelines/
│   │   │   ├── best-practices.md
│   │   │   ├── code-submission-guidelines.md
│   │   │   ├── sending-pull-requests.md
│   │   │   └── writing-tests.md
│   │   ├── contributing-to-the-documentation.md
│   │   ├── contributors-pledge.md
│   │   ├── core-maintainers.md
│   │   ├── intro-to-custom-adapters.md
│   │   ├── issue-contributions.md
│   │   ├── preface.md
│   │   ├── proposing-features/
│   │   │   ├── proposing-features.md
│   │   │   └── submitting-a-proposal.md
│   │   └── stability-index.md
│   ├── faq/
│   │   ├── README.md
│   │   └── faq.md
│   ├── irc/
│   │   └── irc.md
│   ├── reference/
│   │   ├── README.md
│   │   ├── application/
│   │   │   ├── advanced-usage/
│   │   │   │   ├── advanced-usage.md
│   │   │   │   ├── lifecycle.md
│   │   │   │   ├── sails.LOOKS_LIKE_ASSET_RX.md
│   │   │   │   ├── sails.getActions.md
│   │   │   │   ├── sails.getBaseUrl.md
│   │   │   │   ├── sails.getRouteFor.md
│   │   │   │   ├── sails.lift.md
│   │   │   │   ├── sails.load.md
│   │   │   │   ├── sails.lower.md
│   │   │   │   ├── sails.registerAction.md
│   │   │   │   ├── sails.registerActionMiddleware.md
│   │   │   │   ├── sails.reloadActions.md
│   │   │   │   ├── sails.renderView.md
│   │   │   │   └── sails.request.md
│   │   │   ├── application.md
│   │   │   ├── sails.config.custom.md
│   │   │   ├── sails.getDatastore.md
│   │   │   ├── sails.getUrlFor.md
│   │   │   └── sails.log.md
│   │   ├── blueprint-api/
│   │   │   ├── Add.md
│   │   │   ├── Create.md
│   │   │   ├── Destroy.md
│   │   │   ├── Find.md
│   │   │   ├── FindOne.md
│   │   │   ├── Populate.md
│   │   │   ├── Remove.md
│   │   │   ├── Replace.md
│   │   │   ├── Update.md
│   │   │   └── blueprint-api.md
│   │   ├── cli/
│   │   │   ├── cli.md
│   │   │   ├── sailsconsole.md
│   │   │   ├── sailsdebug.md
│   │   │   ├── sailsgenerate.md
│   │   │   ├── sailsinspect.md
│   │   │   ├── sailslift.md
│   │   │   ├── sailsnew.md
│   │   │   └── sailsversion.md
│   │   ├── reference.md
│   │   ├── req/
│   │   │   ├── req._startTime.md
│   │   │   ├── req.accepts.md
│   │   │   ├── req.acceptsCharsets.md
│   │   │   ├── req.acceptsLanguages.md
│   │   │   ├── req.allParams.md
│   │   │   ├── req.body.md
│   │   │   ├── req.cookies.md
│   │   │   ├── req.file.md
│   │   │   ├── req.fresh.md
│   │   │   ├── req.get.md
│   │   │   ├── req.headers.md
│   │   │   ├── req.host.md
│   │   │   ├── req.hostname.md
│   │   │   ├── req.ip.md
│   │   │   ├── req.ips.md
│   │   │   ├── req.is.md
│   │   │   ├── req.isSocket.md
│   │   │   ├── req.md
│   │   │   ├── req.method.md
│   │   │   ├── req.options/
│   │   │   │   └── req.options.md
│   │   │   ├── req.originalUrl.md
│   │   │   ├── req.param.md
│   │   │   ├── req.params.md
│   │   │   ├── req.path.md
│   │   │   ├── req.protocol.md
│   │   │   ├── req.query.md
│   │   │   ├── req.secure.md
│   │   │   ├── req.setLocale.md
│   │   │   ├── req.setTimeout.md
│   │   │   ├── req.signedCookies.md
│   │   │   ├── req.socket.md
│   │   │   ├── req.subdomains.md
│   │   │   ├── req.url.md
│   │   │   ├── req.wantsJSON.md
│   │   │   └── req.xhr.md
│   │   ├── res/
│   │   │   ├── res.attachment.md
│   │   │   ├── res.badRequest.md
│   │   │   ├── res.clearCookie.md
│   │   │   ├── res.cookie.md
│   │   │   ├── res.forbidden.md
│   │   │   ├── res.get.md
│   │   │   ├── res.json.md
│   │   │   ├── res.jsonp.md
│   │   │   ├── res.location.md
│   │   │   ├── res.md
│   │   │   ├── res.negotiate.md
│   │   │   ├── res.notFound.md
│   │   │   ├── res.ok.md
│   │   │   ├── res.redirect.md
│   │   │   ├── res.send.md
│   │   │   ├── res.serverError.md
│   │   │   ├── res.set.md
│   │   │   ├── res.status.md
│   │   │   ├── res.type.md
│   │   │   └── res.view.md
│   │   ├── sails.config/
│   │   │   ├── miscellaneous.md
│   │   │   ├── sails.config.blueprints.md
│   │   │   ├── sails.config.bootstrap.md
│   │   │   ├── sails.config.connections.md
│   │   │   ├── sails.config.custom.md
│   │   │   ├── sails.config.globals.md
│   │   │   ├── sails.config.http.md
│   │   │   ├── sails.config.i18n.md
│   │   │   ├── sails.config.log.md
│   │   │   ├── sails.config.md
│   │   │   ├── sails.config.models.md
│   │   │   ├── sails.config.policies.md
│   │   │   ├── sails.config.routes.md
│   │   │   ├── sails.config.security.md
│   │   │   ├── sails.config.session.md
│   │   │   ├── sails.config.sockets.md
│   │   │   └── sails.config.views.md
│   │   ├── waterline/
│   │   │   ├── datastores/
│   │   │   │   ├── datastores.md
│   │   │   │   ├── driver.md
│   │   │   │   ├── leaseConnection.md
│   │   │   │   ├── manager.md
│   │   │   │   ├── sendNativeQuery.md
│   │   │   │   └── transaction.md
│   │   │   ├── models/
│   │   │   │   ├── addToCollection.md
│   │   │   │   ├── archive.md
│   │   │   │   ├── archiveOne.md
│   │   │   │   ├── avg.md
│   │   │   │   ├── count.md
│   │   │   │   ├── create.md
│   │   │   │   ├── createEach.md
│   │   │   │   ├── destroy.md
│   │   │   │   ├── destroyOne.md
│   │   │   │   ├── find.md
│   │   │   │   ├── findOne.md
│   │   │   │   ├── findOrCreate.md
│   │   │   │   ├── getDatastore.md
│   │   │   │   ├── models.md
│   │   │   │   ├── native.md
│   │   │   │   ├── query.md
│   │   │   │   ├── removeFromCollection.md
│   │   │   │   ├── replaceCollection.md
│   │   │   │   ├── stream.md
│   │   │   │   ├── sum.md
│   │   │   │   ├── update.md
│   │   │   │   ├── updateOne.md
│   │   │   │   └── validate.md
│   │   │   ├── queries/
│   │   │   │   ├── catch.md
│   │   │   │   ├── decrypt.md
│   │   │   │   ├── exec.md
│   │   │   │   ├── fetch.md
│   │   │   │   ├── intercept.md
│   │   │   │   ├── limit.md
│   │   │   │   ├── meta.md
│   │   │   │   ├── populate.md
│   │   │   │   ├── queries.md
│   │   │   │   ├── skip.md
│   │   │   │   ├── sort.md
│   │   │   │   ├── then.md
│   │   │   │   ├── toPromise.md
│   │   │   │   ├── tolerate.md
│   │   │   │   ├── usingConnection.md
│   │   │   │   └── where.md
│   │   │   ├── records/
│   │   │   │   ├── records.md
│   │   │   │   └── toJSON.md
│   │   │   └── waterline.md
│   │   └── websockets/
│   │       ├── resourceful-pubsub/
│   │       │   ├── get-room-name.md
│   │       │   ├── publish.md
│   │       │   ├── resourceful-pubsub.md
│   │       │   ├── subscribe.md
│   │       │   └── unsubscribe.md
│   │       ├── sails.io.js/
│   │       │   ├── SailsSocket/
│   │       │   │   ├── SailsSocket.md
│   │       │   │   ├── methods.md
│   │       │   │   └── properties.md
│   │       │   ├── io.sails.md
│   │       │   ├── io.socket.md
│   │       │   ├── io.socket.off.md
│   │       │   ├── io.socket.on.md
│   │       │   ├── sails.io.js.md
│   │       │   ├── socket.delete.md
│   │       │   ├── socket.get.md
│   │       │   ├── socket.patch.md
│   │       │   ├── socket.post.md
│   │       │   ├── socket.put.md
│   │       │   └── socket.request.md
│   │       ├── sails.sockets/
│   │       │   ├── sails.sockets.addRoomMembersToRooms.md
│   │       │   ├── sails.sockets.blast.md
│   │       │   ├── sails.sockets.broadcast.md
│   │       │   ├── sails.sockets.getid.md
│   │       │   ├── sails.sockets.id.md
│   │       │   ├── sails.sockets.join.md
│   │       │   ├── sails.sockets.leave.md
│   │       │   ├── sails.sockets.leaveAll.md
│   │       │   ├── sails.sockets.md
│   │       │   └── sails.sockets.removeRoomMembersFromRoom.md
│   │       └── websockets.md
│   ├── security/
│   │   ├── README.md
│   │   └── SAILS-SECURITY-POLICY.md
│   ├── tutorials/
│   │   ├── coffeeScript.md
│   │   ├── full-stack-javascript.md
│   │   ├── low-level-mysql-access.md
│   │   ├── mongo.md
│   │   ├── tutorials.md
│   │   └── typeScript.md
│   ├── upgrading/
│   │   ├── To0.10.md
│   │   ├── To0.11.md
│   │   ├── To0.12.md
│   │   ├── To1.0.md
│   │   └── upgrading.md
│   └── version-notes/
│       ├── 0.10.x/
│       │   ├── 0.10.x.md
│       │   ├── Changelog0.10.0-rc9.md
│       │   └── Changelog0.10x.md
│       ├── 0.11.x/
│       │   ├── 0.11.x.md
│       │   └── MigrationGuide0.11.md
│       ├── 0.12.x/
│       │   ├── 0.12.x.md
│       │   └── migration-guide-0.12.md
│       ├── 0.8.x/
│       │   ├── 0.8.x.md
│       │   ├── Changelog0.8.7x.md
│       │   ├── Changelog0.8.8x.md
│       │   ├── Changelog0.8.9.md
│       │   └── ChangelogPre-0.8.77.md
│       ├── 0.9.x/
│       │   ├── 0.9.x.md
│       │   ├── Changelog0.9.0.md
│       │   ├── Changelog0.9.16.md
│       │   ├── Changelog0.9.4.md
│       │   └── Changelog0.9.7.md
│       └── 1.0.x/
│           └── migration-guide-1.0.md
├── errors/
│   ├── README.md
│   ├── fatal.js
│   ├── index.js
│   └── warn.js
├── lib/
│   ├── EVENTS.md
│   ├── README.md
│   ├── app/
│   │   ├── README.md
│   │   ├── Sails.js
│   │   ├── configuration/
│   │   │   ├── default-hooks.js
│   │   │   ├── index.js
│   │   │   ├── load.js
│   │   │   └── rc.js
│   │   ├── get-actions.js
│   │   ├── get-route-for.js
│   │   ├── get-url-for.js
│   │   ├── index.js
│   │   ├── lift.js
│   │   ├── load.js
│   │   ├── lower.js
│   │   ├── private/
│   │   │   ├── after.js
│   │   │   ├── bootstrap.js
│   │   │   ├── checkGruntConfig.js
│   │   │   ├── controller/
│   │   │   │   ├── README.md
│   │   │   │   ├── help-register-action.js
│   │   │   │   └── load-action-modules.js
│   │   │   ├── exposeGlobals.js
│   │   │   ├── initialize.js
│   │   │   ├── inspect.js
│   │   │   ├── isLocalSailsValid.js
│   │   │   ├── isSailsAppSync.js
│   │   │   ├── loadHooks.js
│   │   │   ├── toJSON.js
│   │   │   └── toString.js
│   │   ├── register-action-middleware.js
│   │   ├── register-action.js
│   │   ├── reload-actions.js
│   │   └── request.js
│   ├── hooks/
│   │   ├── README.md
│   │   ├── blueprints/
│   │   │   ├── README.md
│   │   │   ├── actionUtil.js
│   │   │   ├── actions/
│   │   │   │   ├── add.js
│   │   │   │   ├── create.js
│   │   │   │   ├── destroy.js
│   │   │   │   ├── find.js
│   │   │   │   ├── findOne.js
│   │   │   │   ├── populate.js
│   │   │   │   ├── remove.js
│   │   │   │   ├── replace.js
│   │   │   │   └── update.js
│   │   │   ├── formatUsageError.js
│   │   │   ├── index.js
│   │   │   ├── onRoute.js
│   │   │   └── parse-blueprint-options.js
│   │   ├── helpers/
│   │   │   ├── index.js
│   │   │   └── private/
│   │   │       ├── iterate-helpers.js
│   │   │       └── load-helpers.js
│   │   ├── http/
│   │   │   ├── README.md
│   │   │   ├── get-configured-http-middleware-fns.js
│   │   │   ├── index.js
│   │   │   ├── initialize.js
│   │   │   ├── start.js
│   │   │   └── view.js
│   │   ├── i18n/
│   │   │   └── index.js
│   │   ├── index.js
│   │   ├── logger/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── ship.js
│   │   ├── moduleloader/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── policies/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── pubsub/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── request/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   ├── locals.js
│   │   │   ├── metadata.js
│   │   │   ├── param.js
│   │   │   ├── params.all.js
│   │   │   ├── qualifiers.js
│   │   │   └── validate.js
│   │   ├── responses/
│   │   │   ├── README.md
│   │   │   ├── defaults/
│   │   │   │   ├── badRequest.js
│   │   │   │   ├── forbidden.js
│   │   │   │   ├── negotiate.js
│   │   │   │   ├── notFound.js
│   │   │   │   ├── ok.js
│   │   │   │   └── serverError.js
│   │   │   ├── index.js
│   │   │   └── onRoute.js
│   │   ├── security/
│   │   │   ├── README.md
│   │   │   ├── cors/
│   │   │   │   ├── index.js
│   │   │   │   ├── set-headers.js
│   │   │   │   └── set-preflight-config.js
│   │   │   ├── csrf/
│   │   │   │   ├── grant-csrf-token.js
│   │   │   │   └── index.js
│   │   │   └── index.js
│   │   ├── services/
│   │   │   └── index.js
│   │   ├── session/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── userconfig/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── userhooks/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   └── views/
│   │       ├── configure.js
│   │       ├── default-view-rendering-fn.js
│   │       ├── escape-html-entities-deep.js
│   │       ├── get-implicit-defaults.js
│   │       ├── html-scriptify.js
│   │       ├── index.js
│   │       ├── onRoute.js
│   │       ├── render.js
│   │       ├── res.view.js
│   │       ├── stat-views.js
│   │       └── unescape-html-entities-deep-lite.min.string.js
│   ├── index.js
│   ├── router/
│   │   ├── README.md
│   │   ├── bind.js
│   │   ├── bindDefaultHandlers.js
│   │   ├── index.js
│   │   ├── mock-req.js
│   │   ├── mock-res.js
│   │   ├── req.js
│   │   └── res.js
│   └── util/
│       ├── check-origin-url.js
│       ├── deep-extend.js
│       ├── detect-verb.js
│       └── rc.js
├── package.json
└── test/
    ├── .eslintrc
    ├── README.md
    ├── benchmarks/
    │   ├── README.md
    │   ├── helpers/
    │   │   └── benchmarx.js
    │   ├── sails.load.test.js
    │   └── sails.request.generic.test.js
    ├── fixtures/
    │   ├── constants.js
    │   ├── customHooks.js
    │   └── middleware.js
    ├── helpers/
    │   ├── RouteFactory.helper.js
    │   ├── router.js
    │   ├── sails.js
    │   ├── test-spawning-sails-child-process-in-cwd.js
    │   └── test-spawning-sails-lift-child-process-in-cwd.js
    ├── hooks/
    │   ├── blueprints/
    │   │   └── initialize.test.js
    │   ├── http/
    │   │   └── initialize.test.js
    │   ├── pubsub/
    │   │   └── initialize.test.js
    │   ├── request/
    │   │   ├── initialize.test.js
    │   │   ├── req.metadata.test.js
    │   │   └── req.options.sticky.test.js
    │   └── views/
    │       ├── ejs/
    │       │   └── index.i18n.ejs
    │       ├── intialize.test.js
    │       ├── locales/
    │       │   ├── en.json
    │       │   ├── es.json
    │       │   └── eu.json
    │       ├── res.render.i18n.js
    │       ├── res.view.test.js
    │       └── skipAssets.test.js
    ├── init.js
    ├── integration/
    │   ├── README.md
    │   ├── cert/
    │   │   ├── sailstest-cert.pem
    │   │   └── sailstest-key.pem
    │   ├── fixtures/
    │   │   ├── hooks/
    │   │   │   └── installable/
    │   │   │       ├── add-policy/
    │   │   │       │   ├── index.js
    │   │   │       │   └── package.json
    │   │   │       ├── async/
    │   │   │       │   └── index.js.txt
    │   │   │       └── shout/
    │   │   │           ├── index.js
    │   │   │           └── package.json
    │   │   ├── sampleapp/
    │   │   │   ├── api/
    │   │   │   │   ├── controllers/
    │   │   │   │   │   ├── EmptyController.js
    │   │   │   │   │   ├── PetController.js
    │   │   │   │   │   ├── QuizController.js
    │   │   │   │   │   ├── TestController.js
    │   │   │   │   │   ├── UserController.js
    │   │   │   │   │   ├── UserProfileController.js
    │   │   │   │   │   └── ViewTestController.js
    │   │   │   │   ├── models/
    │   │   │   │   │   ├── Empty.js
    │   │   │   │   │   ├── Pet.js
    │   │   │   │   │   ├── Quiz.js
    │   │   │   │   │   ├── Test.js
    │   │   │   │   │   ├── User.js
    │   │   │   │   │   └── UserProfile.js
    │   │   │   │   ├── policies/
    │   │   │   │   │   ├── error_policy.js
    │   │   │   │   │   └── fake_auth.js
    │   │   │   │   └── services/
    │   │   │   │       └── TestService.js
    │   │   │   ├── config/
    │   │   │   │   └── local.js
    │   │   │   └── views/
    │   │   │       ├── app/
    │   │   │       │   ├── index.ejs
    │   │   │       │   └── user/
    │   │   │       │       └── homepage.ejs
    │   │   │       ├── pages/
    │   │   │       │   └── homepage.ejs
    │   │   │       └── viewtest/
    │   │   │           ├── create.ejs
    │   │   │           ├── csrf.ejs
    │   │   │           ├── index.ejs
    │   │   │           └── viewOptions.ejs
    │   │   └── users.js
    │   ├── generate.test.js
    │   ├── globals.test.js
    │   ├── helpers/
    │   │   ├── appHelper.js
    │   │   ├── httpHelper.js
    │   │   └── socketHelper.js
    │   ├── hook.3rdparty.test.js
    │   ├── hook.blueprints.action.routes.test.js
    │   ├── hook.blueprints.blacklist.test.js
    │   ├── hook.blueprints.index.routes.test.js
    │   ├── hook.blueprints.restful.routes.test.js
    │   ├── hook.blueprints.shortcut.routes.test.js
    │   ├── hook.cors.test.js
    │   ├── hook.csrf.test.js
    │   ├── hook.helpers.test.js
    │   ├── hook.i18n.test.js
    │   ├── hook.policies.test.js
    │   ├── hook.pubsub.modelEvents.noSubscribers.test.js
    │   ├── hook.pubsub.modelEvents.subscribers.test.js
    │   ├── hook.sockets.interpreter.test.js
    │   ├── hook.userconfig.test.js
    │   ├── hook.views.test.js
    │   ├── hooks.user.test.js
    │   ├── lift.https.test.js
    │   ├── lift.lower.test.js
    │   ├── lift.test.js
    │   ├── middleware.404.test.js
    │   ├── middleware.500.test.js
    │   ├── middleware.compression.test.js
    │   ├── middleware.cookieParser.test.js
    │   ├── middleware.favicon.test.js
    │   ├── middleware.handleBodyParserError.test.js
    │   ├── middleware.sails.test.js
    │   ├── middleware.session.redis.test.js
    │   ├── middleware.session.test.js
    │   ├── middleware.startRequestTimer.test.js
    │   ├── middleware.static.test.js
    │   ├── new.test.js
    │   ├── router.params.test.js
    │   ├── router.specifiedRoutes.test.js
    │   ├── router.viewRendering.test.js
    │   └── www.test.js
    ├── mocha.opts
    └── unit/
        ├── App.prototype.load.test.js
        ├── README.md
        ├── app.getRouteFor.test.js
        ├── app.getUrlFor.test.js
        ├── app.initializeHooks.test.js
        ├── app.lower.test.js
        ├── app.registerAction.test.js
        ├── app.reloadActions.test.js
        ├── bootstrap.test.js
        ├── controller.test.js
        ├── req.errors.test.js
        ├── req.session.test.js
        ├── req.test.js
        ├── res.test.js
        ├── router.bind.test.js
        ├── router.ordering.test.js
        ├── router.test.js
        ├── router.unbind.test.js
        └── virtual-request-interpreter.test.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
#   ╔═╗╔╦╗╦╔╦╗╔═╗╦═╗┌─┐┌─┐┌┐┌┌─┐┬┌─┐
#   ║╣  ║║║ ║ ║ ║╠╦╝│  │ ││││├┤ ││ ┬
#  o╚═╝═╩╝╩ ╩ ╚═╝╩╚═└─┘└─┘┘└┘└  ┴└─┘
#
# This file (`.editorconfig`) exists to help maintain consistent formatting
# throughout this package, the Sails framework, and the Node-Machine project.
#
# To review what each of these options mean, see:
# http://editorconfig.org/
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true


================================================
FILE: .eslintrc
================================================
{
  //   ╔═╗╔═╗╦  ╦╔╗╔╔╦╗┬─┐┌─┐
  //   ║╣ ╚═╗║  ║║║║ ║ ├┬┘│
  //  o╚═╝╚═╝╩═╝╩╝╚╝ ╩ ┴└─└─┘
  // A set of basic conventions (similar to .jshintrc) for use within any
  // arbitrary JavaScript / Node.js package -- inside or outside Sails.js.
  // For the master copy of this file, see the `.eslintrc` template file in
  // the `sails-generate` package (https://www.npmjs.com/package/sails-generate.)
  // Designed for ESLint v4.
  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  // For more information about any of the rules below, check out the relevant
  // reference page on eslint.org.  For example, to get details on "no-sequences",
  // you would visit `http://eslint.org/docs/rules/no-sequences`.  If you're unsure
  // or could use some advice, come by https://sailsjs.com/support.
  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  "env": {
    "node": true
  },

  "parserOptions": {
    "ecmaVersion": 8
  },

  "globals": {
    "Promise": true,
    "Symbol": true,
    // ^^Available since Node v4
  },

  "rules": {
    "callback-return":              ["error", ["done", "proceed", "next", "onwards", "callback", "cb"]],
    "camelcase":                    ["warn", {"properties": "always"}],
    "comma-style":                  ["warn", "last"],
    "curly":                        ["error"],
    "eqeqeq":                       ["error", "always"],
    "eol-last":                     ["warn"],
    "handle-callback-err":          ["error"],
    "indent":                       ["warn", 2, {
      "SwitchCase": 1,
      "MemberExpression": "off",
      "FunctionDeclaration": {"body":1, "parameters": "off"},
      "FunctionExpression": {"body":1, "parameters": "off"},
      "CallExpression": {"arguments":"off"},
      "ArrayExpression": 1,
      "ObjectExpression": 1,
      "ignoredNodes": ["ConditionalExpression"]
    }],
    "linebreak-style":              ["error", "unix"],
    "no-dupe-keys":                 ["error"],
    "no-duplicate-case":            ["error"],
    "no-extra-semi":                ["warn"],
    "no-labels":                    ["error"],
    "no-mixed-spaces-and-tabs":     ["error", "smart-tabs"],
    "no-redeclare":                 ["warn"],
    "no-return-assign":             ["error", "always"],
    "no-sequences":                 ["error"],
    "no-trailing-spaces":           ["warn"],
    "no-undef":                     ["error"],
    "no-unexpected-multiline":      ["warn"],
    "no-unreachable":               ["warn"],
    "no-unused-vars":               ["warn", {"caughtErrors":"all", "caughtErrorsIgnorePattern": "^unused($|[A-Z].*$)", "argsIgnorePattern": "^unused($|[A-Z].*$)", "varsIgnorePattern": "^unused($|[A-Z].*$)" }],
    "no-use-before-define":         ["error", {"functions":false}],
    "one-var":                      ["warn", "never"],
    "quotes":                       ["warn", "single", {"avoidEscape":false, "allowTemplateLiterals":true}],
    "semi":                         ["error", "always"],
    "semi-spacing":                 ["warn", {"before":false, "after":true}],
    "semi-style":                   ["warn", "last"]
  }

}


================================================
FILE: .github/ISSUE_TEMPLATE
================================================
**Node version**: 
**Sails version** _(sails)_: 
**ORM hook version** _(sails-hook-orm)_: 
**Sockets hook version** _(sails-hook-sockets)_: 
**Organics hook version** _(sails-hook-organics)_: 
**Grunt hook version** _(sails-hook-grunt)_: 
**Uploads hook version** _(sails-hook-uploads)_: 
**DB adapter & version** _(e.g. sails-mysql@5.55.5)_: 
**Skipper adapter & version** _(e.g. skipper-s3@5.55.5)_: 
<hr/>


================================================
FILE: .github/PULL_REQUEST_TEMPLATE
================================================



================================================
FILE: .gitignore
================================================
#   ┌─┐┬┌┬┐╦╔═╗╔╗╔╔═╗╦═╗╔═╗
#   │ ┬│ │ ║║ ╦║║║║ ║╠╦╝║╣
#  o└─┘┴ ┴ ╩╚═╝╝╚╝╚═╝╩╚═╚═╝
#
# This file (`.gitignore`) exists to signify to `git` that certain files
# and/or directories should be ignored for the purposes of version control.
#
# This is primarily useful for excluding temporary files of all sorts; stuff
# generated by IDEs, build scripts, automated tests, package managers, or even
# end-users (e.g. file uploads). `.gitignore` files like this also do a nice job
# at keeping sensitive credentials and personal data out of version control systems.
#

############################
# sails / node.js / npm
############################
node_modules
.tmp
npm-debug.log
package-lock.json
package-lock.*
.waterline
.node_history

############################
# editor & OS files
############################
*.swo
*.swp
*.swn
*.swm
*.seed
*.log
*.out
*.pid
lib-cov
.DS_STORE
*#
*\#
.\#*
*~
.idea
.netbeans
nbproject

############################
# misc
############################
dump.rdb


================================================
FILE: .npmignore
================================================
.git
./.gitignore
./.jshintrc
./.editorconfig
./.travis.yml
./appveyor.yml
./example
./examples
./test
./tests
./sails-docs
./.github

node_modules
npm-debug.log
.node_history
*.swo
*.swp
*.swn
*.swm
*.seed
*.log
*.out
*.pid
lib-cov
.DS_STORE
*#
*\#
.\#*
*~
.idea
.netbeans
nbproject
.tmp
dump.rdb


================================================
FILE: .travis.yml
================================================
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#   ╔╦╗╦═╗╔═╗╦  ╦╦╔═╗ ┬ ┬┌┬┐┬                           #
#    ║ ╠╦╝╠═╣╚╗╔╝║╚═╗ └┬┘││││                           #
#  o ╩ ╩╚═╩ ╩ ╚╝ ╩╚═╝o ┴ ┴ ┴┴─┘                         #
#                                                       #
# This file configures Travis CI.                       #
# (i.e. how we run the tests... mainly)                 #
#                                                       #
# https://docs.travis-ci.com/user/customizing-the-build #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # #

language: node_js

node_js:
  - "12"
  - "14"
  - "16"

branches:
  only:
    - master

notifications:
  email:
    - ci@sailsjs.com

env:
  TEST_REDIS_SESSION=true

before_script: sudo redis-server /etc/redis/redis.conf --daemonize yes --port 6380 --requirepass 'secret'


================================================
FILE: CHANGELOG.md
================================================
# Sails Changelog

## 1.2.0

- Added `sails migrate` for quickly running auto-migrations by hand
- The output of `sails inspect` no longer includes controller information
- When loading user hooks, if `sails.config.loadHooks` is specified, skip hooks whose names aren't explicitly included
- Increased time to display warning message in `config/bootstrap.js` from 5 seconds to 30 seconds
- Switched to using `updateOne` in the "update" blueprint
- Blueprint queries no longer include `fetch: true` by default, to avoid warnings from `updateOne`
- Update error mesage in default `serverError` response to use flaverr
- In `lib/router/res.js`, instead of always setting 'content-type' to 'application/json', only set it if `res.get('content-type')` is falsy
- Update flaverr dependency
- Update i18n-2 dependency to resolve deprecation warning
- Update rc dependency to address potential vulnerabilities
- Update machinepack-process dependency to address potential vulnerabilities
- Update machinepack-redis dependency to address potential vulnerabilities

## 1.1.0

> As always, we owe a debt of gratitude to our contributors-- we mentioned you below next to the features/enhancements/fixes you contributed to.  (Apologies to anyone we missed, there was a lot in this release!  Let us know and we'll add you to the list.)
>
> We especially want to thank those contributors who helped out with the documentation:
> - [Rachael Shaw](https://github.com/rachaelshaw)
> - [Mike McNeil](https://github.com/mikermcneil)
> - Ali Norouzi
> - [Ronny Medina](https://github.com/ronnymedinave)
> - [Alex Schwarz](https://github.com/alexschwarz89)
> - [Xavier Spriet](https://github.com/loginx)
> - [Ian Harris](https://github.com/harrisi)
> - [Vladyslav Piskunov](https://github.com/vpiskunov)
> - [Michael Frederick](https://github.com/mdfrederick)
> - [Mark Strelecky](https://github.com/streleck)
> - [Freddy](https://github.com/mdfrederick)
> - [pavan](https://github.com/pavanmehta91)
> - [Scott Reed](https://github.com/AdJesumPerMariam)
> - [Mario Colque](https://github.com/colkito)
> - [Okoli Lemuel](https://github.com/okolilemuel)
> - [ultimate-tester](https://github.com/ultimate-tester)
> - [@snidell](https://github.com/snidell)
> - [Pika](https://github.com/ThatNerdyPikachu)
> - [AYEDOUN Fiacre](https://github.com/afidosstar)
> - [Tim Wisniewski](https://github.com/timwis)
> - [Tom Saleeba](https://github.com/tomsaleeba)
> - [s-slavchev](https://github.com/s-slavchev)
> - [Daniel Harvey](https://github.com/danielsharvey)
> - [Julien Le Coupanec](https://github.com/LeCoupa)
> - [floriancummings](https://github.com/floriancummings)
> - [Bernardo Gomes](https://github.com/Bernardoow)
> - [Eli Peters](https://github.com/elipeters)
> - [Dennis Cheung](https://github.com/oaksofmamre)
> - [Minh Tri Nguyen](https://github.com/kevinvn1709)
>
> Finally, big thanks to [Dennis Cheung](https://github.com/oaksofmamre) who did the painstaking work of compiling this changelog!
>
>   ~[mike](https://twitter.com/mikermcneil)


#### Framework:
- **New model methods: `.updateOne()`, `.destroyOne()`, and `.archiveOne()`**
- **`exits` argument may now be excluded from your `fn` function in all helpers, actions2 definitions, and shell scripts.**
- **Cleaner usage for `.stream()`,  `.transaction()`, and `.leaseConnection()`.  Functions provided as procedural parameters (i.e. `during` and iteratees) no longer expect a callback to be invoked, as long as you omit their 2nd callabck argument from the function signature.**
- **The bootstrap function (`config/bootstrap.js`) and the `initialize` function of hooks no longer expect a callback to be invoked, as long as the callback argument is excluded from the function signature.**
- **New chainable methods available on helper invocations: `.timeout()` and `.retry()`.**
- Use vuejs VueRouter (and a virtual page example) by default, and make vuejs <router-view> more apparent
- Update helper, action, and hook generators, plus a few other updates to boilerplate output from generators.
- Update boilerplate bootstrap and hook initialize functions.
- Disable 'async' dependency when generated the expanded starter app, to avoid confusion.  (Can always still be installed, it just won't be bundled by default anymore, and auto-globalization is also, of course, disabled.)
- Include FontAwesome 4 files, and update instructions for removal if desired
- Update check for production/staging in vuejs to assume we're in production if no SAILS_LOCALS are present
- Provide documentation tip on how to configure Mongo as default datastore w/ link to tutorial
- Take advantage of next-gen whelk.
- Improve Windows compatibility (for 'sails generate page', sails generate action, etc)
- Exclude 'async' dep by default in all new apps
- Update boilerplate to take advantage of optional 'exits' argument in helpers, actions, and shell scripts.
- Use updated bootstrap for web app template
- Implement Google fonts/typekit/google tag manager/google analytics
- Include (hard-code) Bowser inline now
- Improve <ajax-form> to also include 'is' rule
- Redirect away ALL unrecognized base subdomains (not just webhooks and click), but only do it in staging/production.
- Fix "sails g page" with nested folders on Windows
- Add FileList and FormData to reserved list to protect them from mangling.  (Should be fine anyway, but this protects against potential issues from changing uglify versions.)
- Take advantage of patch in Parasails 0.7.7
- Leverage .updateOne()
- Add 5 second timeout for all four of those calls, to protect user experience from any 3rd party API call issues.  (For context, this is rare, but it happens.  I've noticed Stripe go all 500 on a customer app twice in the last 6 months: once for about 28 minutes earlier this summer, and once last month for a split second.  I've never seen it hang, but this is such a common thing with other 3rd party apis better to be safe than sorry.  An error message after a reasonable wait time is a far better user experience than having to wait 2 whole minutes for the TCP timeout.  And this way, any error handling logic to unroll stuff etc that gets added here will still be able to run.)
- Integrate Cloud SDK into Parasails
- Use top-level implementationSniffingTactic and pass through to whelk and MaA
- Force homogeneous sniffing tactic for helpers+actions.
- Force minimum SVRs (re implementationType: 'classical').
- Finish up support for smarter .bootstrap and .initialize. (Continued from 21bc1f1ab88dfa1064f2e312a4b1135b92763d2a)
- Add faux callbacks for easier debugging
- Add `create` method to datastore fixture, and test "no validation errors" case. [(Scott Gress)](https://github.com/sgress454)
- Fix test descriptions for `update` [(Scott Gress)](https://github.com/sgress454)
- Add test cases for validations on primary key [(Scott Gress)](https://github.com/sgress454)
- Hoist flag for determining whether to apply validation rules, and use it for both PKs and generic attributes. [(Scott Gress)](https://github.com/sgress454)
- Add implementation-sniffing to .stream()
- Setup updateOne() method
- Set up destroyOne() and archiveOne(), and use an omen in the 'found too many' error in findOne() to improve the stack trace.
- Implement implementation sniffing in .transaction() and .leaseConnection().
- Enable ORM to accept attributes named 'length'. Replace `_.each()` with `_.forIn()` to enable ORM to accept attributes named 'length'. [(Daniel Harvey)](https://github.com/danielsharvey)
- Add an isError check when handling errors thrown from validation rules to prevent potential issues in extreme edge cases (where something weird gets thrown)
- Clean up tests for greater clarity and usefulness
- Finish restructuring things to match latest conventions in parley, etc.  Leave standalone/ alias for backwards-compatibility
- Update docs about other adapter methods
- Improve error messaging to assist in debugging
- Add E_TOO_MANY_FILES error code.
- Add Cloud.on() and Cloud.off(), improve error msgs, and remove idempotency guarantee
- Add typeof check to ensure reasonable behavior even with strange input.
- Enhance built-in catchall error msg for Cloud.on()
- Refactor UMD approach to make it easier to see what's going on at a glance.
- Add experimental support for FileList instances (multi-file upload via Cloud SDK).
- Improve performance of +500K ops/sec by collapsing IIFE
- Setup for being able to use AsyncFunctions with .intercept() and .tolerate().
- Add new method: getInvocationinfo() -- a public API for accessing private info such as _timeout. Add .interruptions to getInvocationInfo().
- Introduce working impl of .retry()
- Clone (shallow) metadata on the way in during .retry(), just to avoid any potential edge cases with a fn attaching additional properties and that actually mattering for subsequent invocations with the same arguments.
- Take advantage of new getInvocationInfo() method in parley related to .retry()
- Implement partial support for blended tolerate/intercept with retry (Note: works only for completely parallel error conditions).
- Optimize AsyncFunction function constructor check.
- Allow implementationSniffingTactic to be customized.
- Add failsafe to ensure app lifts inside of Mocha tests. Related to https://github.com/balderdashy/sails/issues/4395 and https://github.com/balderdashy/captains-log/pull/22
- Also in new Sails apps: Force min 3.10.3 of lodash in new projects
- Also in new Sails apps: Update eslintrc templates to tolerate unused args and vars that begin with 'unused' (or are just named 'unused')
- Also in new Sails apps: Add 'custom' validation rule.
- Also in new Sails apps: Replace autofocus with focus-first, and ensure this feature is opt-in for <ajax-form> and <modal>. Also add typeof check for bowser.
- Also in new Sails apps: Tolerate required: false, etc in <ajax-form>
- Also in new Sails apps: Improve error msg in weird edge case
- Also in new Sails apps: Allow completely numeric passwords by default when using 'isHalfwayDecentPassword' validation rule for <ajax-form>
- Also in new Sails apps: Update email templates
- Also in new Sails apps: Add a couple opinionated-yet-reasonable global styles to the 'bootstrap-overrides' file
- Also in new Sails apps: Bump appveyor+travis files to always include Node 10
- Also in new Sails apps: Standardize redis url format to be consistent with site documentation for db (numerical database names only). [Scott Reed](https://github.com/AdJesumPerMariam)
- Also in new Sails apps: Ignore files generated by 'npm link' in recent NPM releases
- Also in new Sails apps: Add note about conditional requiredness and validation rules.
- Also in new Sails apps: Add autocomplete attributes to form fields where applicable
- Also in new Sails apps: Disable lesshint rule for border-boxing everything in bootstrap-overrides
- Also in new Sails apps: Fix mismatched tags in email templates
- Also in new Sails apps: Fix that silly checkbox alignment on login/signup templates
- Also in new Sails apps: Fix camelCasing issue in intermediate subdirectories for newly created view actions.
- Also in new Sails apps: Fix fullName validation on edit profile page [(S.Slavchev)](https://github.com/s-slavchev)
- Also in new Sails apps: Don't include inputs in generated shell script.
- Also in new Sails apps: Make 'semi' and 'curly' lint violations burn yellow instead of burning red
- Also in new Sails apps: Tweak generated comment about 'no lodash'
- Also in new Sails apps: Add note about the function signature of 'leave'
- Also in new Sails apps: Simplify readme links
- Also in new Sails apps: Tweak inline docs for <ajax-form>
- Also in new Sails apps: Bring in self-updating timestamp component for web app template
- Also in new Sails apps: Update model examples
- Also in new Sails apps: Use kebab-cased status to avoid database-dependent behavior in edge cases (b/c case sensitivity)
- Also in new Sails apps: Rename var and kebab-case desired effect strings for consistency
- Also in new Sails apps: Use _.extend for consistency
- Also in new Sails apps: Include moment in eslintrc-override
- Also in new Sails apps: Tweak <js-timestamp>, and then include a demo in the welcome page.
- Also in new Sails apps: Normalize indentation in "send template email" helper
- Also in new Sails apps: Make sure the HTML email contents are actually being logged properly
- Also in new Sails apps: Change method names on welcome page for consistency, and also use `this.modal`, since there can only be one modal on the page at a time anyway
- Also in new Sails apps: Rearrange virtual page example
- Also in new Sails apps: Bring in unsupported browser overlay
- Also in new Sails apps: Change href so it makes more sense
- Also in new Sails apps: Expand comment re virtual pages.
- Also in new Sails apps: Expand comments in js-timestamp a bit.
- Also in new Sails apps: Rearrange note about filtering argins now that handleSubmitting exists.
- Also in new Sails apps: Don't specify testMode when calling out to Mailgun, to avoid confusion.
- Also in new Sails apps: Never indicate that the email was logged instead of sent if it wasn't.
- Also in new Sails apps: Add retries w/ exponentional back-off for idempotent / low-risk 3rd party API calls.
- Also in new Sails apps: Add 'ensureAck' flag to sendTemplateEmail(), and change behavior to background the sending by default.
- Also in new Sails apps: Simplify rebuild-cloud-sdk script a bit.
- Also in new Sails apps: Use for instead of _.each()
- Also in new Sails apps: Fix typo introduced in 22df26e832aeef817a6e3c01561041eda83830cd
- Also in new Sails apps: Tweak verbiage in boilerplate FAQ for clarity. (action not controller)
- Also in new Sails apps: Normalize capitalization in generated footer
- Also in new Sails apps: Include a placeholder logo image for the branding in the masthead
- Also in new Sails apps: On homepage for web app template, add more space between "feature" sections on small screens
- Also in new Sails apps: Use consistent link styles all across the web app template, and also add some special blockquote styles
- Also in new Sails apps: Verbiage tweaks / capitalization normalizaish
- Also in new Sails apps: 'No matter how legal it is, capitalization should never look this ugly.'  -mike, amateur lawyer
- Also in new Sails apps: Add FAQ item with info about placeholders, and give the questions some more breathing room
- Also in new Sails apps: Cleanup and friendlify boilerplate legal documents
- Also in new Sails apps: Provide better example config
- Also in new Sails apps: Tweak constant name to match
- Also in new Sails apps: Fix inconsistent constants
- Also in new Sails apps: Avoid find/replace conflicts with constants. Also, add the link we mention in the FAQ.
- Also in new Sails apps: Correct the boilerplate language
- Also in new Sails apps: Add clarifications to boilerplate stylesheet
- Also in new Sails apps: Remove custom `a:not(.btn)` styles from homepage, because those are set elsewhere now
- Parasails: Tweak varname for clarity.
- Parasails: Rename private method for clarity.
- Parasails: Leave better error sniffability, but rip out attempt to actually use it from 173685357364baaf9e2e2b3c16307c3fa7ec5d44
- Parasails: An additional layer to Cloud.on() and Cloud.off()  (intermediate commit to track concept of wildcard key -- ends up being too confusing for custom error handling, but might be worth revisiting as a kind of lifecycle callback in the future)
- Parasails: Rename "*" catchall handler to "error" and finish implementation
- Parasails: Rename to Cloud.listen() and Cloud.ignore(), add aliases, and improve error msgs.
- Parasails: Intermediate commit: Tracks how we'd approach making .listen() idempotent-- but actually this probably isn't the right granularity to do that (save that for parasails proper on a per-Vue-component basis)
- Parasails: Change .listen() and .ignore() back to .on() and .off(), and remove idempotency guarantee (that'll need to live at the component/Vue instance level in parasails proper -- see also https://github.com/mikermcneil/parasails/commit/36f87501cd174104e6b75a18b7c16d83ec74
edaa and https://github.com/mikermcneil/parasails/commit/b54258a9f244fabbbd3c89e35c7be5095c5d8dfa)
- Parasails: Add back conveniences for multiple bindings.
- Parasails: 'error' => '*'
- Parasails: Add uncaught error handler
- Parasails: Bring in most recent updates
- Parasails: Remove double-binding
- Parasails: Update parasails.js [(Mark Strelecky)](https://github.com/streleck)
- Parasails: Throw error when upload request is no good because it contains structured data as text parameter values.
- Parasails: Add tip about uglify
- Parasails: Follow-up to 4941181912646ec27132afb82c2be32bb3cf6203 to make $.ajax() transport work with FileList instances (on browsers where this is supported).
- Parasails: Fix hard-coded version number in parasails.js file.
- Parasails: Allow sparser shorthand for setting up virtual pages, while also implementing more error-checking and edge-case handling for various configurations of virtualPages, virtualPagesRegExp, and html5HistoryMode.
- Parasails: Improve 'did you mean?' intelligence and add two FUTURE nice-to-haves.
- Force sails-generate@1.15.19
- Fix linting and global var issues for globals tests [(Scott Gress)](https://github.com/sgress454)
- Fix paths to Lodash for globals tests [(Scott Gress)](https://github.com/sgress454)
- Fix lint and global var issues in www test [(Scott Gress)](https://github.com/sgress454)
- Use `tmp` in www tests to attempt to fix Appveyor issues [(Scott Gress)](https://github.com/sgress454)
- Address https://github.com/balderdashy/sails/commit/8168dffb8052c0a2df3de923a18c60dd27875915#diff-78ca47cd74fd541e85ff2100564371ddR656
- Use `tmp` in remaining www test to try and address random Appveyor failures [(Scott Gress)](https://github.com/sgress454)
- Use more accurate verb in secure cookie info msg
- Contextualize the 'yes secure cookies, no trustProxy' debug mesage.
- Clarify message and change it to be verbose
- Closes #4392 (by removing coffee-script, checksum, and istanbul devDependencies)
- Ignore 'npm link' collateral
- Stub implementation opts for helpers re upcoming opt-ins
- Add note about implementationSniffingTactic
- Implicitly set implementationSniffingTactic
- Add bookends about 'customize' for whelk and machine-as-action
- Don't use explicit implementationSniffingTactic yet.
- Bump machine runner SVR and remove unnecessary code
- Note optimization
- Setup for smarter .bootstrap and .initialize
- Correctly apply implementationSniffingTactic for helpers
- Default value for implementationSniffingTactic
- Add note in 'sails run'
- Expand explanations in changelog.
- For compatibility, tolerate action identities that contain '$'.
- Change variable name to prevent confusion with built-in 'module'.
- Follow-up to a22598eb26f108768be91a31f4baa8fc92a9c5c7 which covers the rest of the cases
- Change var name for clarity (same idea as in 2eaaf968daae8f00ebc0007210baa32b5d50f7f0)
- Log warnings if special actions-only props are in use in helper defs.
- Update changelog to reflect what's happening w/ the responses hook
- Bump skipper dep
- Clarify optional-ness of bootstrap callback in comment.
- Update error messages for bootstrap/initialize to reflect new reality.
- 2nd follow up to 97082b8e067a490531758f6bcbc471e08874c209 to allow for "$" in route bindings
- Use prerelease of sails-generate
- Fix sails-generate SVR
- Pin merge-dictionaries
- Fix test now that async is no longer included as a dep. in newly generated sails apps (thanks to await and sails.helpers.flow via organics)
- Fix expectations of test to match correct child process output (follow up to c694f2d2b1db4b9f397c52f540b19d7d4a4125f4)
- Fix one more test related to c694f2d2b1db4b9f397c52f540b19d7d4a4125f4
- Waterline: [PATCH] Fix typo and swap unit test description misplaced in fix #1554 to issue #4360 [(Luis Lobo Borobia)](https://github.com/luislobo)
- Waterline: Add link to drawing demonstrating how Waterline works underneath the hood
- Waterline: Stub out the spots where implementationSniffingTactic needs to apply
- Waterline: Improve error msg when attempting to use a too-generic WHERE clause with updateOne/destroyOne/archiveOne
- Waterline: Don't use skipEncryption for archiveOne() and destroyOne() -- doesn't make sense.
- sails-hook-orm: Add missing comma and link to lifecycle hooks in docs [(Tom Saleeba)](https://github.com/tomsaleeba)
- sails-hook-orm: Update error message about adapter compatibility
- sails-hook-orm: Stub out the spots where implementationSniffingTactic needs to apply
- waterline-utils: Update boilerplate
- waterline-utils: Resolve lint issues
- waterline-utils: Ignore fun new files generated by 'npm link'
- waterline-utils: Add normalize-datastore-config from sails-mongo (needs more love)
- waterline-utils: Set 'protocol' property automatically.
- waterline-utils: Expose .normalizeDatastoreConfig()
- waterline-utils: Change .protocol -> protocolPrefix  (and get rid of trailing colon)
- waterline-utils: Add missing change from prev. commit, and also set .protocolPrefix when appropriate, even if no url was specified.
- waterline-utils: Grab dictionary of models (w/ backwards compatibility)
- waterline-utils: Fix backwards conditional
- anchor: Fix build status urls
- anchor: Bump validator version re https://snyk.io/test/npm/anchor?severity=high&severity=medium&severity=low#npm:validator:20160218 (without applying any of the necessary changes yet, if there are any). Also upgrade to latest eslintrc file, etc, and bump eslint dep.
- anchor: Fix out of date test label
- anchor: Tweak checkConfig error msgs for isBefore+isAfter
- anchor: Clean up checkConfig for isBefore and isAfter, and clarify another comment.
- anchor: Reroll isBefore and isAfter the dumb, explicit way.
- anchor: Added a few more tests.
- anchor: Add validator upgrade
- sails-hook-sockets: Fix typo in function being checked when preparing driver in case of unexpected failure [(Luis Lobo Borobia)](https://github.com/luislobo)
- sails-hook-sockets: Modify deprecation message to recommend install Sails owned socket.io-redis, to match up documentation https://sailsjs.com/documentation/concepts/deployment/scaling [(Luis Lobo Borobia)](https://github.com/luislobo)
- skipper: Update boilerplate.
- skipper: Add eslint dev dep
- skipper: Set up lint script and add docs for quota-related error codes in README
- skipper: Some lint fixes plus remove stringfile and 2 unnecessary deps.
- skipper: sailshq/lodash
- skipper: Improve linter
- skipper: Consolidate roadmap w/ sails core
- skipper: Consolidate contributor info
- skipper: Remove old logger in favor of consistently using 'debug'
- skipper: Documentation
- skipper: Conslidate into lib/ (part 1)
- skipper: Move index.js to lib/skipper.js
- skipper: Remove standalone/ alias
- skipper: Latest SVR for skipper-adapter-tests
- Backport https://github.com/lodash/lodash/commit/d8e069cc3410082e44eb18fcf8e7f3d08ebe1d4a
- Flaverr: Fix bad error message
- Parley: Shorten error message and pull out exec countdown secs into a constant.
- Parley: Tweak verbiage in warning msg one more time for further clarity.
- Parley: Implement .timeout() and initial pass at .retry().
- Parley: Set up more of .retry(), and add relevant TODO about what needs to happen now
- Parley: Avoid 1MM ops/sec perf. loss by using .slice() alternative
- Parley: 200k ops/sec to general-case performance  (and take care of annoying arguments keyword usage)
- Parley: Implement IIFE but prepare for about-face since it takes away 1MM ops/sec
- Parley: Regain 1MM ops/sec by moving IIFE out
- Parley: Cleanup, deduplication, and docs
- Parley: +350K ops/sec
- Parley: Change where bindUserlandAfterExecLC lives, for consistency
- Parley: Rearrange for clarity, and update comments
- Parley: Boilerplate update
- Parley: Setup first pass at async function support for userland afterExec LCs
- Parley: Remove usage assertion now that AsyncFunctions are supported
- Parley: Added _hasStartedButNotFinishedAfterExecLC
- Parley: Eliminate todos now that "one tick" flag takes afterexec LCs into account
- Parley: Rough .retry() impl
- Parley: Rip out retry from parley (realized it needs to live a level higher up in the stack)
- Parley: Remove two now-unused reserved keys from blacklist
- Parley: Update examples
- Parley: Add 'thenable' option for backwards-compatibility for older node releases (specifically important for .tolerate())
- Parley: Fix backwards conditional
- Parley: Revert "3.6.0"
- Parley: Prevent throwing when no afterExec LC handler is specified
- Parley: Don't throw a special error when handler provided to .tolerate() throws -- instead just allow it through unscathed.
- Machine (runner for actions2, helpers, & shell scripts): Upgrade eslint
- Machine: Obey new 'instructionTimeout' meta key
- Machine: Reverse 8af993b01c1480aca45d7e7e2952cfd8d288a293 because all metadata isn't known at build time.  (This will need more shuffling to accomplish)
- Machine: Update boilerplate and bump min parley version.
- Machine: Finish "Too many retries" error, and make note of situation with [Circular]
- Machine: Disable old tests, remove now-irrelevant future note
- Machine: More cleanup, after verifying it works w/ defaultArgins and defaultMeta.
- Machine: Add note explaining why we don't pass in a build-time omen (or any omen) to .retry()'s extra .build() call.
- Machine: Respect original invocation timeout
- Machine: Remove strict idempotency check.
- Machine: Eliminate support for variadic usage (because it's potentially confusing/imprecise -- negotation rules and retry series can BOTH be arrays)
- Machine: Fix an oversight/edge case: an error message would have itself thrown an error.
- Machine: Fix typo in .retry().
- Machine: Setup for implementationSniffingTacticgls
- Machine: Catch attempt to use AsyncFunction in sync:true method at build time instead of waiting until exec-time.
- Machine: Cursory setup of exits arg detection
- Machine: Don't freak out about new customization option
- Machine: Validate implementationSniffingTactic
- Machine: Eliminate old comments, and one trivial optimization
- Machine: Tweak comments and add clarification
- Machine: Handle implementationType: 'classical' for 'exits'-less functions.
- Machine: Skip 'await' tests for Node versions that dont support it.
- Machine: Avoid returning from .catch()  (this is not tied to any known issue, just cleanup)
- Machine: Fix to properly simulate chaining: promise = promise.catch()
- Machine: Swap around 71eb66400f73a52baf0a78a38c1b8d44061737ac so that .then() gets handled first.  Otherwise, you get either an unhandled promise rejection OR a called-it-twice warning.
- whelk (shell scripts): Add note about customizations
- whelk (shell scripts): Add support for new `customize` option
- whelk (shell scripts): Ensure at least machine@15.2.2
- Defined a req.path for socket requests.
- Ensured req.path is good and stringy.

#### Documentation:
- Add documentation for new model methods in Sails 1.1.0.
- Sails 1.1.0 updates for .transaction() and .leaseConnection() -- also some follow up from b126f7b66a1c46be0208c2a81235e0584cc50225 for .stream()
- Update examples for .stream() in advance of sails 1.1.0
- Update Blueprint API docs for clarity
- Update Platzi course links
- Update adapterList.md [(Ronny Medina)](https://github.com/ronnymedinave)
- Update policies.md [(Alex Schwarz)](https://github.com/alexschwarz89)
- Update waterline.md
- Update dependencies.md
- Normalize capittalization
- Update upgrading.md
- Update routes.md
- Add link and clarify a bit further
- Update res.status.md
- Updated link [(Simon)](https://github.com/svict4)
- Fix event documentation for `lower` [(Xavier Spriet)](https://github.com/loginx)
- Add note to upgrading guide re: i18n (see https://gitter.im/balderdashy/sails?at=5ac46d9cc574b1aa3e6533f6)
- Fix commented-out code block
- Fix getLocale link
- Update locales.md
- Update req.setLocale.md
- Fix broken links in old 0.12 upgrading guide
- Fix RESTful route examples for `add` and `remove`
- Update content for req.acceptsLanguages()
- Update content for req.acceptsCharsets(), and rename both files
- Clean up req.accepts() reference page.
- Update upgrading guide
- Update logging.md
- Fixed typo in routing actions description [(Scott Reed)](https://github.com/AdJesumPerMariam)
- Fix action name in docs [(Ian Harris)](https://github.com/harrisi)
- Update views.md
- Fixed broken links to req.wantsJSON & req.allParams() [(Vladyslav Piskunov)](https://github.com/vpiskunov)
- Update Lifecyclecallbacks.md
- Update cors.md link from cors.js to security.js [(Michael Frederick)](https://github.com/mdfrederick)
- Update cors.md - Adjusting links and updating examples [(Michael Frederick)](https://github.com/mdfrederick)
- Remove link to guide that doesn't exist anymore (fixes #1000)
- Update faq.md
- Fix some links, and create a page in tutorials linking to the course/demo app
- Create req.hostname [(Mark Strelecky)](https://github.com/streleck)
- Update req.host.md and change to deprecated [(Mark Strelecky)](https://github.com/streleck)
- Update req.isSocket.md [(Mark Strelecky)](https://github.com/streleck)
- Update req.wantsJSON.md [(Mark Strelecky)](https://github.com/streleck)
- Update req.hostname
- Fix docmeta tag
- Update req.isSocket.md
- Update req.wantsJSON.md
- Update res.send.md [(Mark Strelecky)](https://github.com/streleck)
- Add res headers to examples
- Add fragments to cors links. Update another link to use /documentation [(Freddy)](https://github.com/mdfrederick)
- Update low-level-mysql-access.md
- Update mongo.md
- Update cors.md since there's no config/cors.js in 1.0 and the settings are in config/security.js [(pavan)](https://github.com/pavanmehta91)
- Fix broken link [(Scott Reed)](https://github.com/AdJesumPerMariam)
- Add the ) and } forgotten, to close the queries in the right way. [(Mario Colque)](https://github.com/colkito)
- Add hooks + a few tweaks
- Update hooks.md
- Update services.md
- Update sendNativeQuery.md
- Update findOrCreate.md
- Clarify sentence, and add link
- Add file extension
- Update req.host.md
- Update ExampleHelper.md [(Okoli Lemuel)](https://github.com/okolilemuel)
- Update standalone-usage.md to 1.0 [(ultimate-tester)](https://github.com/ultimate-tester)
- Correct syntax typo for log messages [(Alex Schwarz)](https://github.com/alexschwarz89)
- Update Validations.md [(Okoli Lemuel)](https://github.com/okolilemuel)
- Take first pass at e-commerce page
- Remove irrelevant example
- Add note re: customToJSON does not support async functions [(Scott)](https://github.com/snidell)
- Add sails-hook-organics to the Hooks page [(Pika)](https://github.com/ThatNerdyPikachu)
- Fix missing comma [(Scott Reed)](https://github.com/AdJesumPerMariam)
- Waterline initialize function must be async [(Scott Reed)](https://github.com/AdJesumPerMariam)
- Update sails.sockets.md [(AYEDOUN Fiacre)](https://github.com/afidosstar)
- Fix custom model methods example [(Tim Wisniewski)](https://github.com/timwis)
- Add quotes to key in headers example re: dictionary keys [(Tom Saleeba)](https://github.com/tomsaleeba)
- Fix typo in ActionsAndControllers.md [(s-slavchev)](https://github.com/s-slavchev)
- Fix typo in URL link [(Daniel Harvey)](https://github.com/danielsharvey)
- Update GeneratingActions.md to fix typo manging => managing [(Julien Le Coupanec)](https://github.com/LeCoupa)
- Update extending-sails.md to remove remove broken link [(Julien Le Coupanec)](https://github.com/LeCoupa)
- Update Testing.md to add dd Semaphore [(Julien Le Coupanec)](https://github.com/LeCoupa)
- Update To1.0.md [(floriancummings)](https://github.com/floriancummings)
- Add information about optional param. [(Bernardo Gomes)](https://github.com/Bernardoow)
- Update sort.md to fix code example typo [(Eli Peters)](https://github.com/elipeters)
- Update standalone-usage.md
- Add back and correct link
- Update Models.md
- Update To1.0.md
- Edit Sails versioning for consistency (v1.0 and JavaScript) [(Dennis Cheung)](https://github.com/oaksofmamre)
- Update globals.md to fix broken link for Services and Models [(Minh Tri Nguyen)](https://github.com/kevinvn1709)
- Update res.redirect.md [(Julien Le Coupanec)](https://github.com/LeCoupa)
- Update res.status.md [(Julien Le Coupanec)](https://github.com/LeCoupa)
- Add link to info about negotiating errrors
- Update errors.md
- Simplify examples.
- Fix typo in .update() usage example.
- Update sails.config.bootstrap.md
- Update decrypt.md
- Update attributes.md

#### Organics:
- Improve security
- Add note for future about new exit from .saveBillingInfo()
- Update package.json [(Pika)](https://github.com/ThatNerdyPikachu)
- Use `encodeURIComponent` instead of `encoreURI` for `url-friendly` style.
- Replace all special characters and skip encoding entirely. [(Scott Gress)](https://github.com/sgress454)
- Swap open with opn to remove critical error on audit ([Peter Barrett)](https://github.com/Peter-Barrett)
- Pin opn version number and move back to json5 [(Peter Barrett)](https://github.com/Peter-Barrett)
- Remove unused dep

#### Adapters:
- Check `exits` against raw instead of built machine as it seems as though the built machine doesn’t expose the exits  [(Yuki von Kanel)](https://github.com/Rua-Yuki)
- Update debug to fix ReDoS vulnerability [(Alec Fenichel)](https://github.com/fenichelar)
- Remove auto setting JSON to LONGTEXT [(Betanu701)](https://github.com/Betanu701)
- sails-disk: Update eslint
- sails-disk: Don't test node 0.10 and 0.12 because eslint doesn't even run on them anymore
- MySQL: Pin debug version [(Alec Fenichel)](https://github.com/fenichelar)
- MySQL: machine@15 adjustment
- MySQL: Follow up to d41eb10e1804ccc884cf6e290fd5a340f8f12c0b
- MySQL: Test on Node 10
- MySQL: eslint for tests
- MySQL: Use the right port
- MySQL: Get rid of ajv keywords dev install warning and clean up machine SVR
- MySQL: Update skipped test
- MySQL: Rename test files for easier quick-switching and add back linting for tests
- MySQL: Move the files (still need to update require paths-- see next commit)
- MySQL: Fix require paths (follow up to d9db8cda4fcd9ffb37b738402d855991991c892b)
- MySQL: Update travis.yml and remove Dockerfile
- MySQL: Normalize the license stuff
- MySQL: Fix those badge things
- PostgreSQL: Correctly raises error when you have bad model attributes [(Tony Buser)](https://github.com/tbuser)
- PostgreSQL: Allow for other auto increment scenarios other than numeric [(Andrew Greenstreet)](https://github.com/gstreetmedia)
- PostgreSQL: Single quotes (eslint) and a couple of other minor adjustments to comments and varnames
- PostgreSQL: Improve linter
- PostgreSQL: Change it's => its
- PostgreSQL: Fix failing test (https://travis-ci.org/balderdashy/sails-postgresql/jobs/368925613).  This is because https://github.com/balderdashy/sails-postgresql/pull/278 actually breaks normal usage (because logical types are not made accessible to the adapter in the per-table DDL spec passed into the define() adapter method- instead, another approach must be used)
- PostgreSQL: Update node versions tested to include all LTS releases
- PostgreSQL: Improve error message
- PostgreSQL: Adjust tests to stop using 'integer' columnType for auto-incrementing pk
- PostgreSQL: Close https://github.com/balderdashy/sails-postgresql/pull/279
- PostgreSQL: Include additional number type property to model. This will cause the registerDatastore method to throw an error due to autoMigrations being undefined for anotherGood property on the model. [(Andrew Salib)](https://github.com/andezzat)
- PostgreSQL: Check that property autoMigrations exists before checking its child property columnType resolving undefined errors [(Andrew Salib)](https://github.com/andezzat)
- MongoDB: Upgrade 'machine' dependency to ^15.0.0 [(Yuki von Kanel)](https://github.com/Rua-Yuki)
- MongoDB: Use `.switch(...)` where needed [(Yuki von Kanel)](https://github.com/Rua-Yuki)
- MongoDB: Allow tests to run on PRs (hopefully) - see https://docs.travis-ci.com/user/environment-variables/
- MongoDB: Bump devdep SVRs

#### Tools:
- sails-hook-dev: Recommend simple solution to setting up staging environment in readme.md

#### Raw diffs:

##### Framework:
- https://github.com/balderdashy/sails-generate/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/waterline/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-hook-orm/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/waterline-utils/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/waterline-schema/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/anchor/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-hook-sockets/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails.io.js/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/socket.io-redis/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/skipper/compare/master@%7B2018-03-29%7D...master
- https://github.com/rachaelshaw/sails-hook-uploads/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/sails-hook-grunt/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/lodash/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/connect-redis/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/flaverr/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/parley/compare/master@%7B2018-03-29%7D...master
- https://github.com/node-machine/machine/compare/master@%7B2018-03-29%7D...master
- https://github.com/node-machine/rttc/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/whelk/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/whelk/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/captains-log/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/reportback/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/include-all/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/machinepack-redis/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/sort-route-addresses/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-stringfile/compare/master@%7B2018-03-29%7D...master

##### Documentation:
- https://github.com/balderdashy/sails-docs/compare/master@%7B2018-03-29%7D...master

##### Organics:
- https://github.com/mikermcneil/parasails/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/sails-hook-organics/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/machinepack-http/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/machinepack-strings/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/machinepack-fs/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/machinepack-process/compare/master@%7B2018-03-29%7D...master

##### Adapters:
- https://github.com/balderdashy/sails-disk/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-mysql/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/machinepack-mysql/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/waterline-sql-builder/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-postgresql/compare/master@%7B2018-03-29%7D...master
- https://github.com/sailshq/machinepack-postgresql/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-mongo/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-redis/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/skipper-disk/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/skipper-s3/compare/master@%7B2018-03-29%7D...master

##### Tools:
- https://github.com/mikermcneil/sails-hook-apianalytics/compare/master@%7B2018-03-29%7D...master
- https://github.com/balderdashy/sails-hook-dev/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/eslint/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/htmlhint/compare/master@%7B2018-03-29%7D...master
- https://github.com/mikermcneil/lesshint/compare/master@%7B2018-03-29%7D...master



## 1.0.0

Sails v1.0 comes with a host of new features and improvements as well as some breaking changes to previous versions.  Please see the [migration guide](http://sailsjs.com/upgrading) if you're upgrading from a previous version of Sails!

* [ENHANCEMENT] Introduce Actions 2 -- ability to declare actions as [Machines](http://node-machine.org) in individual files.  See the [Actions and controllers](http://sailsjs.com/documentation/concepts/actions-and-controllers) and [Action target syntax](http://sailsjs.com/documentation/concepts/routes/custom-routes#?action-target-syntax) docs for more info.
* [ENHANCEMENT] Introduce Helpers -- the successor to services.  See the [Helpers](http://sailsjs.com/documentation/concepts/helpers) docs for more info.
* [BUGFIX] Improve path resolution in moduleloader for Windows [f13bb77](https://github.com/balderdashy/sails/commit/f13bb77eb49b9b61aa225c43cc2aacaadd4f07be)
* [BUGFIX] Fix output for virtual requests that have non 2xx/3xx status codes and no body [525c7c5](https://github.com/balderdashy/sails/commit/525c7c503347ef586ebf26730af77e2aa8626060)
* [REMOVAL] Remove support for (undocumented) "action/model" route syntax for binding routes to blueprint actions
* [BUGFIX] Fix issue causing Sails to sometimes crash when using Redis sessions if it receives a request after the Redis server has unexpectedly disconnected [3f29dce](https://github.com/balderdashy/sails/commit/3f29dce22b5a36403108d8d1aab7a903aa4488a5)
* [ENHANCEMENT] Add `sails.getActions()` method to return a dictionary of registered Sails actions [5598179](https://github.com/balderdashy/sails/commit/55981792ea52febfa5c343bbae4517c6a38f20c9)
* [ENHANCEMENT] Add `sails.registerAction()` method to programmatically register a Sails action [dd9af88](https://github.com/balderdashy/sails/commit/dd9af88b114db696dde2fbeee79a1dc745f2d748)
* [ENHANCEMENT] Add `exposeLocalsToBrowser` local in all views
* [ENHANCEMENT] Add `sails.registerActionMiddleware()` to programmatically register middleware to be applied to one or more actions [2c281d5](https://github.com/balderdashy/sails/commit/2c281d51301e684f00c91da5cc9d8fa37814094c)
* [ENHANCEMENT] Allow explicitly defined actions in Sails config via `sails.config.controllers.moduleDefinitions` [3b264fa](https://github.com/balderdashy/sails/commit/3b264facc2e0a72bd2aa5366271c588c903e6f5c), [4ad23dd](https://github.com/balderdashy/sails/commit/4ad23dd353ff1d7e607c0a75377a0ba6d9dd2f3d)
* [BUGFIX] Default `req.options.populate` to the value of `sails.config.blueprints.populate [d8f4df8](https://github.com/balderdashy/sails/commit/d8f4df8e19cfb7eaefa00bbcbbc6cab870483194)
* [ENHANCEMENT] Add `sails.reloadActions()` method to reload actions from disk / config while an app is running [df2ee46](https://github.com/balderdashy/sails/commit/df2ee4657774a092fb0bd25b3013448c9f155700)
* [ENHANCEMENT] Allow loaded modules (actions, controllers, policies, models, etc.) to have _any_ file extension besides `.md` and `.txt` (which are ignored).  Direct support for anything besides plain Javascript has been removed; variants like CoffeeScript and TypeScript can be used by registering them in the `app.js` file.  See the [Using CoffeeScript tutorial](http://sailsjs.com/documentation/tutorials/using-coffee-script) for an example.
* [REMOVAL] Remove support for custom blueprints.  These can easily be replaced by regular actions.  See the [migration guide](http://sailsjs.com/upgrading#custom-blueprints) for more info. [0fd4362](https://github.com/balderdashy/sails/commit/0fd4362795ee338ea5b18c3ee42dbdae4b08fd43)
* [REMOVAL] Remove support for blueprint route target syntax [0fd4362](https://github.com/balderdashy/sails/commit/0fd4362795ee338ea5b18c3ee42dbdae4b08fd43)
* [REMOVAL] Remove deprecated `dontFlattenConfig` option [56c9b5b](https://github.com/balderdashy/sails/commit/56c9b5bc4b4f876778653a3995981516bb0767a7)
* [ENHANCEMENT] Humanize config vars that are loaded from the environment [7eb6af6](https://github.com/balderdashy/sails/commit/7eb6af659b67eb856719c8c0d08c7e7043c9e3e8)
* [REMOVAL] Remove most Resourceful PubSub methods, leaving just `.subscribe()`, `.unsubscribe()` and `.publish()`. [c981c6e](https://github.com/balderdashy/sails/commit/c981c6edf8573fea0d3a13451d51292ba9038b3b)
* [ENHANCEMENT] Expose Sails generator for programmatic use [e008a6b](https://github.com/balderdashy/sails/commit/e008a6b7e76cf0c272ec556f0ab48b67499269f5)
* [UPGRADE] Upgrade to Express 4.14.0.  Thanks to [josebaseba](https://github.com/josebaseba) for his help in the transition to Express 4!
* [ENHANCEMENT] Improved CORS support.  See the [migration guide](http://sailsjs.com/upgrading#security) and [CORS docs](http://sailsjs.com/documentation/concepts/security/cors) for more info.
* [REMOVAL] Removed `req.validate()` functionality.  Use Actions 2 instead, which automatically validate parameters. [68fa8ff](https://github.com/balderdashy/sails/commit/68fa8ff0327530973237dfd602b3155e0386cad5)
* [ENHANCEMENT] Updated syntax for policies.  See the [migration guide](http://sailsjs.com/upgrading#policies) and the [policies documentation](http://sailsjs.com/documentation/concepts/policies) for more details. [66d2b2d](https://github.com/balderdashy/sails/commit/66d2b2d8d9d7f23b35cad7693eab79a58e888d77)
* [ENHANCEMENT] Automatically sort routes to avoid wildcards swallowing static routes.  See the [sort-route-addresses](https://github.com/treelinehq/sort-route-addresses) module for more info on route sorting.
* [ENHANCEMENT] Combine CORS and CSRF hooks into new "Security" hook.  See the [migration guide](http://sailsjs.com/upgrading#security) for more details.
* [ENHANCEMENT] Update CSRF configuration and replace `/csrfToken` route with an action that can be bound to any route.  See the [migration guide](http://sailsjs.com/upgrading#security) and [CSRF docs](http://sailsjs.com/documentation/concepts/security/csrf) for more info. [7328c05](https://github.com/balderdashy/sails/commit/7328c0527de4d6ae7bfd48f0c6959ff90c7e3d30)
* [REMOVAL] `res.created()` will no longer be included by default. [7988866](https://github.com/balderdashy/sails/commit/7988866f68f3cb9926d750265acf1fa9e1cb25c6)
* [BUGFIX] Ignore default installed hooks when searching `node_modules` for hooks.  [#3855](https://github.com/balderdashy/sails/issues/3855).
* [SECURITY] Don't serve CSRF token via websockets [50b0684](https://github.com/balderdashy/sails/commit/50b06845a0075f4a45f5e2b5d66c05ea3ed62c4b)
* [INTERNAL] Bring EJS layout code into Sails rather than relying on the unmaintained `ejs-locals` package [d3ba9bd](https://github.com/balderdashy/sails/commit/d3ba9bdd3c7301b6ac438d2b4591c74c40e2b06c)
* [REMOVAL] Remove handlebars dependency and support for layouts in view engines other than EJS. See the [migration guide](http://sailsjs.com/upgrading#layouts) for more details. [ae7e656](https://github.com/balderdashy/sails/commit/ae7e656cf815480d135a8d124db6c3269bad1b92), [9f1f2fb](https://github.com/balderdashy/sails/commit/9f1f2fb91b69a8f6a6e29e9a171a981e7a109f51)
* [ENHANCEMENT] Don't set NODE_ENV based on Sails environment, except in special circumstances. See the [migration guide](http://sailsjs.com/upgrading#node-env) for more details. [cf20d07](https://github.com/balderdashy/sails/commit/cf20d070700230f73b158bd37fb7109739f16519), [abbf1f7](https://github.com/balderdashy/sails/commit/abbf1f724f4b45176d9c8cd46db1a94bef7c37f9)
* [ENHANCEMENT] Make session hook `routesDisabled` use Sails route address syntax (including regular expression syntax) [aba8f2f](https://github.com/balderdashy/sails/commit/aba8f2fe9856e43168b423d813e17f1b3067746a)
* [BUGFIX] Supply `res.locals._csrf` to _all_ routes when CSRF protection is enabled.  Fixes [#3865](https://github.com/balderdashy/sails/issues/3865)
* [REMOVAL] Remove Consolidate dependency -- view template engines are now configurable via the `sails.config.views.getRenderFn` setting.  See the [migration guide](http://sailsjs.com/upgrading#views) for more details. [6316452](https://github.com/balderdashy/sails/commit/63164527b2e0b7c268488539aa3a0e011ff332f9)
* [REMOVAL] Remove deprecated RPS "firehose" [86b88](https://github.com/balderdashy/sails/commit/86b8884f15b647ebc963cadff8502f2449ce04a2)
* [REMOVAL] Remove deprecated 0.9.x socket support [6464d8f](https://github.com/balderdashy/sails/commit/6464d8f89bd74aaaed380cee15143e6ad0aad614)
* [BUGFIX] Update and standardize precedence of route param, query and body in `req.param()` and `req.allParams()` [820d1eb](https://github.com/balderdashy/sails/commit/820d1eb53e12774cd644f516d5952c8da8f02da8)
* [REMOVAL] Remove JSONP support from blueprints.  CORS is fairly ubiquitous now. [effd6c3](https://github.com/balderdashy/sails/commit/effd6c315f2ef9fe55cf5dafdf65b59b8c5cbe1e)
* [REMOVAL] Remove deprecated `sails.getBaseUrl` method. [d0fe4ff](https://github.com/balderdashy/sails/commit/d0fe4ff169ae9e01a799d4fd32da45700daba21e)
* [INTERNAL] Remove `sails-util` [1fee468](https://github.com/balderdashy/sails/commit/1fee468bacf98b847d2455d3c40f92bae8b33233)
* [INTERNAL] Remove grunt, sockets and ORM hooks [48750d7](https://github.com/balderdashy/sails/commit/48750d7010218bcb224623c532474430063dbdb3), [07c59ce](https://github.com/balderdashy/sails/commit/07c59ceaccf3e5a7258962b01f9eaae03fd888d9)
* [REMOVAL] Remove deprecated `req.params.all()` method [9c6b217](https://github.com/balderdashy/sails/commit/9c6b21773b07ab816fea28f67d3e614e5eb2210b)
* [BUGFIX] Correctly load custom adapters (stored in either `FooAdapter.js` files or in subfolders) [#3884](https://github.com/balderdashy/sails/issues/3884)
* [INTERNAL] Add benchmarks [6b4ba32](https://github.com/balderdashy/sails/commit/6b4ba32d1d5219976be81fe7a5bf57a38635d681)
* [ENHANCEMENT] Requests for assets will skip running session middleware by default [3c5ddf7](https://github.com/balderdashy/sails/commit/3c5ddf719e78acbe66d0896b9d0d013d9e02279b)
* [ENHANCEMENT] Support `routesDisabled` for sessions in virtual requests [a00cf78](https://github.com/balderdashy/sails/commit/a00cf78895836f3ab982fab00c52fdcb668c4eef)
* [INTERNAL] Standardize log level for warnings to always use "debug" except for warning related to security.
* [ENHANCEMENT] Add 404, 500 and `startRequestTimer` to middleware order automatically (and remove them from default sails.config.http.middleware.order) [a22e4e7](https://github.com/balderdashy/sails/commit/a22e4e730f42e9868f604bc62eaf9dcc4d2abd6b), [f788e39](https://github.com/balderdashy/sails/commit/f788e3956cf2daf521dbe36fdb8d64a2a8dbb5c8)
* [REMOVAL] Remove the `handleBodyParserError` middleware from the stack, use the `onBodyParserError` option in Skipper instead.  [f788e39](https://github.com/balderdashy/sails/commit/f788e3956cf2daf521dbe36fdb8d64a2a8dbb5c8)
* [BUGFIX] Take locale into account in views.render() [#3833](https://github.com/balderdashy/sails/issues/3833)
* [ENHANCEMENT] Allow session adapter to be required directly [039d245](https://github.com/balderdashy/sails/commit/039d24580f55c4e03f187de87339f88dd31afbc6)
* [REMOVAL] Remove support for Express 3 session adapters [628a55b](https://github.com/balderdashy/sails/commit/628a55b687ed95adc7b6f7667023ddb96bd939fd)
* [INTERNAL] Switch from i18n to i18n-2. See the [migration guide](http://sailsjs.com/upgrading#i18n) for more details. [4a90de2](https://github.com/balderdashy/sails/commit/4a90de293883545fb0418851826fa84c5331dad9)
* [BUGFIX] Fail to lift Sails if `connect-redis` can't initialize. [#3590](https://github.com/balderdashy/sails/issues/3590)
* [REMOVAL] Remove `method-override` from default middleware list. [575c4a3](https://github.com/balderdashy/sails/commit/575c4a37613992af92a3e40338fe5b470ec2531b)
* [BUGFIX] Use _.clone() instead of _.cloneDeep() for config overrides, to preserve things like Redis clients passed into config. [1b970b6](https://github.com/balderdashy/sails/commit/1b970b6c445659a731967550ec6132c582613bea)
* [ENHANCEMENT] Update `sails.config.globals` functionality.  See the [migration guide](http://sailsjs.com/upgrading#globals) for more details. [44c6d9b](https://github.com/balderdashy/sails/commit/44c6d9b41e1b1ffd38150788085890c8c2cbe286)
* [ENHANCEMENT] Add `sails.config.session.onDisconnect` and `sails.config.session.onReconnect` functions [1e55c63](https://github.com/balderdashy/sails/commit/1e55c639b617e13199db7ee4c3a17f62db87b8ea)
* [ENHANCEMENT] Add `sails.config.sockets.adapterOptions.onDisconnect` and `sails.config.sockets.adapterOptions.onReconnect` functions [3a25971](https://github.com/balderdashy/sails-hook-sockets/commit/3a2597155eefa086bba54b70b1f3274aaa97a1f5)
* [DEPRECATION] Deprecate `.jsonx()` [cdcc3c0](https://github.com/balderdashy/sails/commit/cdcc3c09ad864329474ae50b5888571cd6dc2654)
* [INTERNAL] Update default responses [510504e](https://github.com/balderdashy/sails/commit/510504e210047a2ae8aced98a3a17ced5b499140)
* [REMOVAL] Remove update-via-POST blueprint route [5c3814d](https://github.com/balderdashy/sails/commit/5c3814d0162535d8f5b9e907ed9a25aa263c2eff)
* [INTERNAL] Disconnect Redis session client when Sails is lowering [80fb71b](https://github.com/balderdashy/sails/commit/80fb71b45fa7dab94f4c6054b6d365a9319150f7)
* [UPGRADE] Upgrade EJS dependency to v2.5.3 [6bfad70](https://github.com/balderdashy/sails/commit/6bfad700445038533486affb1637b52b73ed2eac)
* [REMOVAL] Removed deprecated `connect-flash` middleware [c5c4900](https://github.com/balderdashy/sails/commit/c5c49007f9d55ed74b3ca3062b465c470a15e82b)
* [REMOVAL] Removed 16 unused dependencies (see full list [here](https://gist.github.com/sgress454/4a4930fec3520b24bdf0df552f70a45c))



> Also see the [Waterline changelog](https://github.com/balderdashy/waterline/blob/a7cad817e831af5367be2d2c89c021d12a674b86/CHANGELOG.md#edge).



## 0.12.11

* [BUGFIX] fix typo in error message (see https://github.com/balderdashy/sails/pull/3902)  Thanks [Johnny](https://github.com/Hiro-Nakamura) and [@appdevdesigns](https://github.com/appdevdesigns)!
* [BUGFIX] backport fix for `_.isFunction()` from Lodash 4 (see https://github.com/lodash/lodash/issues/2768 and https://github.com/balderdashy/sails/issues/3863)  Thanks [@adnan-kamili](https://github.com/adnan-kamili) and [@jdalton](https://github.com/jdalton)!
* [INTERNAL] rebase changelog updates from master [223567c](https://github.com/balderdashy/sails/commit/223567cf986dd62317d958cb29a6683a4cf1e140)


## 0.12.10

* [BUGFIX] Fix issue where incorrect file size was computed for incoming (multi-)file uploads on skipper-disk and skipper-s3 [#3847](https://github.com/balderdashy/sails/issues/3847)  (thanks [@crobinson42](https://github.com/crobinson42), [@NAlexandrov](https://github.com/NAlexandrov) and [@vbogdanov](https://github.com/vbogdanov)!)  See also https://github.com/balderdashy/skipper/issues/109.
* [BUGFIX] Internationalization fix ([#3833](https://github.com/balderdashy/sails/issues/3833) fixes [#3889](https://github.com/balderdashy/sails/pull/3889) (thanks [@josebaseba](https://github.com/Josebaseba)!)
* [INTERNAL] Added automated request latency benchmarks -- primarily in advance of 1.0 for the purpose of comparison (thanks [@sgress454](http://github.com/sgress454)!)
* [BUGFIX] Fixed issue with defined-in-app adapters being improperly loaded [#3884](https://github.com/balderdashy/sails/issues/3884) (thanks [@richdunajewski](https://github.com/richdunajewski)!)

## 0.12.9

* [INTERNAL] Fix deprecation warning from express-session [3872](https://github.com/balderdashy/sails/issues/3872)  (thanks [@Boycce](https://github.com/Boycce) and [@dougwilson](https://github.com/dougwilson)!)

## 0.12.8

* [BUGFIX] Fix issue with multiple config files that have the same filename [3850](https://github.com/balderdashy/sails/issues/3850)
* [ENHANCEMENT] Add criteria validation for the `find` and `findOne` blueprint actions. [ab9c2c3...c6e8ad0](https://github.com/balderdashy/sails/compare/ab9c2c3431a5298e8fd140e5c1e2ed2c7260526c...c6e8ad0940e1034222b958b97e8f28287fae32b6)
* [INTERNAL] Fix Gitter link in README so it displays properly on NPM [284c660](https://github.com/balderdashy/sails/commit/284c66008632d906524b2238447a0b79715855e7)

## 0.12.7

* [BUGFIX] Fix issue with multiple config files that have the same filename [3846](https://github.com/balderdashy/sails/issues/3846)
* [ENHANCEMENT] Warn about overly permissive CORS settings when lifting in production [ca43e05](https://github.com/balderdashy/sails/commit/ca43e0507af79f15361789a3489013b01c8e1825)

## 0.12.6

* [BUGFIX] Revert inadvertent breaking change to CORS config in 0.12.5, see [f80252f](https://github.com/balderdashy/sails/commit/f80252f66edc0bf00cf6ed317d9a3e68b4e8d948) for details)

## 0.12.5

* [INTERNAL] Upgrade version of `include-all` to ^1.0.0 [f6e8d32](https://github.com/balderdashy/sails/commit/f6e8d3243d7d695983a3816e6cf7c43ca4237948)
* [ENHANCEMENT] Add experimental `sails console --dontLift` option [029fe06](https://github.com/balderdashy/sails/commit/029fe0683ea4f01a962b91381b948136f5c18f63)
* [UPGRADE] Dependencies in captains-log
* [UPGRADE] Moduleloader now uses include-all@1, and sails-build-dictionary is deprecated (all of its methods were folded into include-all)
* [BUGFIX] In moduleloader: Improve path resolution on windows
* [BUGFIX] Fix property name for ('status' => 'statusCode') in virtual request header


## 0.12.4

* [INTERNAL] Upgrade Mocha to 3.0.0 to remove more of the deprecation notices when installing dependencies (see [mocha:#2200](https://github.com/mochajs/mocha/issues/2200))
* [INTERNAL] Simplify config-merging code in captains-log.  This also gets rid of more deprecation notices during install (see [captains-log:49f433eff348c05115a2caf292b4da0db9499887](https://github.com/balderdashy/captains-log/commit/49f433eff348c05115a2caf292b4da0db9499887))
* [BUGFIX] Fix long-standing, low-priority (but super annoying) issue with logged dictionaries/arrays getting extra quote marks (due to a pecularity in the usage of util.format()) [d67e9c8e6775](https://github.com/balderdashy/captains-log/commit/d67e9c8e67759e8dda3a2d664c3607e9127d209c)
* [ENHANCEMENT] Add `sails.config.session.routesDisabled` config option to specify routes that should not use session middleware [c712acf](https://github.com/balderdashy/sails/commit/c712acf29de257d438b422b2c47e67a4d5126ddc)
* [ENHANCEMENT] Use `res.forbidden()` when denying access to a route via a policy.  Thanks [@wulfsolter](https://github.com/wulfsolter)!  [3764](https://github.com/balderdashy/sails/pull/3764)
* [ENHANCEMENT] Allow use of Express style path and RegExp in `sails.config.csrf.routesDisabled`.  Thanks [@bolasblack](https://github.com/bolasblack)!
* [BUGFIX] Fix for query / body params called `length` [3738](https://github.com/balderdashy/sails/issues/3738)
* [BUGFIX] Fix view rendering when i18n hook is disabled.  Thanks [@mordred](https://github.com/Mordred)! [3741](https://github.com/balderdashy/sails/pull/3741)
* [BUGFIX] Allow `sails.renderView` to work with globals turned off [3753](https://github.com/balderdashy/sails/issues/3753)
[d3f634c](https://github.com/balderdashy/sails/commit/d3f634c9ac0c5e2172710fe27ab3f61f8303d840)
* [BUGFIX] Fix typo which could cause crashing when attempting to serialize non-json-compatible output in the response to a socket request.
* [UPGRADE] Update all Grunt dependencies [5f6be05](https://github.com/balderdashy/sails/commit/5f6be059823aeb235ef3b4cf53a8d40a341c5873)
* [UPGRADE] Update "connect" dependency to 3.4.1 [1d3c9e6](https://github.com/balderdashy/sails/commit/1d3c9e6459253261e0f763d133c559641bcbfa33)
* [UPGRADE] Update "compression" dependency to version 1.6.2
* [UPGRADE] Upgraded version of Consolidate to `0.14.1` [a70623c](https://github.com/balderdashy/sails/commit/a70623ce2809d497b3581268354f06904d862268)
* [UPGRADE] Upgraded version of grunt-contrib-watch to `1.0.0` [3678](https://github.com/balderdashy/sails/issues/3678)
* [INTERNAL] Use standalone CSRF package instead of using the one (formerly) bundled with Connect.  Sails should be using all standalone middleware now. [1d3c9e6](https://github.com/balderdashy/sails/commit/1d3c9e6459253261e0f763d133c559641bcbfa33)
[98861ef](https://github.com/balderdashy/sails/commit/98861ef12ddca0ff6d57cf7ea6d4bb9f8bca9656)
* [INTERNAL] Add some assertions to ensure custom hooks don't use reserved properties [2e76dac](https://github.com/balderdashy/sails/commit/2e76dac2f961a1f20c591fb0a5d7ea6556d2ab70)
* [INTERNAL] Update code that virtual response uses to read buffer to work with all Node versions [a5ab134](https://github.com/balderdashy/sails/commit/a5ab134c4bafa40db6b2b2133145f8a5462e4abc)
* [INTERNAL] Remove un-maintained "wrench" module from tests; use "fs-extra" instead.  Thanks [@Ignigena](https://github.com/Ignigena)! [4f90f78](https://github.com/balderdashy/sails/commit/4f90f78fbfb1b2edf088c5e57d5e4cab56e3cf47)

## 0.12.3

* [BUGFIX] Allow `skipAssets` and `skipRegex` to be used with direct/static view route target syntax [3682](https://github.com/balderdashy/sails/issues/3682).  Thanks [@dottodot](https://github.com/dottodot), [@nikhilbedi](https://github.com/nikhilbedi), and [@AlexanderKozhevin](https://github.com/AlexanderKozhevin)!
* [BUGFIX] Automatically route to `index/` in deeply nested views when using direct/static view route target syntax
* [BUGFIX] Add assertion about views which contain extra dots (`.`) in their paths when using direct/static view route target syntax
* [INTERNAL] Use `chalk` instead of `colors` for console output. Thanks [@markelog](https://github.com/markelog)! [3680](https://github.com/balderdashy/sails/pull/3680)

## 0.12.2

* [ENHANCEMENT] Allow use of `fn` in expanded route targets [e1790b7](https://github.com/balderdashy/sails/commit/e1790b70b35cd7dc50743a63bb169585f8a927f2)
* [BUGFIX] Add blacklist to "update" blueprint action so that it can be used with primary keys that are not "id" [3625](https://github.com/balderdashy/sails/issues/3625)
* [ENHANCEMENT] Allow hooks to be turned off by setting their environment var to the string "false" [3618](https://github.com/balderdashy/sails/issues/3618)
* [BUGFIX] Allow view target syntax for routes to specify deeply-nested views [3604](https://github.com/balderdashy/sails/issues/3604)
* [BUGFIX] Allow custom bodyParser middleware config [3592](https://github.com/balderdashy/sails/issues/3592)
* [BUGFIX] When lifting with unknown validation rule, exit gracefully instead of throwing.
* [BUGFIX] Update validation rules from anchor [3649](https://github.com/balderdashy/sails/issues/3649)
* [BUGFIX] Respond with an error if attempting to use `req.file()` from a virtual request (i.e. when Skipper is not available).  And don't pass in `res` when building the mock request, since it is not available yet. [3656](https://github.com/balderdashy/sails/issues/3656)
* [BUGFIX] Fix incorrect handling of errors in responses hook.  Thanks [@tapuzzo-fsi](https://github.com/tapuzzo-fsi)! [3645](https://github.com/balderdashy/sails/pull/3645)
* [BUGFIX] Fix error from `routeCorsConfig` sometimes being undefined [3662](https://github.com/balderdashy/sails/issues/3662)
* [INTERNAL] Replace `ready` event with an async `handleLift` lifecycle callback in order to simplify the behavior of `sails lift` and ensure the timing of the "done" callback is correct when using it programmatically.
* [INTERNAL] Massive overhaul of tests.  See [b033f2d thru e85810a](https://github.com/balderdashy/sails/compare/71aa56db59129da58825b22f32030234a4f5ae2c...b033f2d9af4953fd65c3e1bbb44ed4df15da1f68).
* [INTERNAL] Extrapolate ORM hook into sails-hook-orm.
* [INTERNAL] Force asynchronicity in the optional third argument of `res.view()`/`res.render()` to pave the way for better, request-agnostic view rendering methods.  This prevents double-calling of the callback if userland code throws an error.  Thanks [@lennym](https://github.com/lennym)! [cd413e15435947aa855e27aab16d9cd9e65ad493](https://github.com/balderdashy/sails/commit/cd413e15435947aa855e27aab16d9cd9e65ad493)
* [ENHANCEMENT] Update version of i18n to `0.8.1` [3631](https://github.com/balderdashy/sails/pull/3631).
* [ENHANCEMENT] Improve auto-migrate prompt, and skip the prompt and log an info message instead if `sails.config.models.migrate` is being automatically set to production anyways.  [sails-hook-orm/commit/3161c34edbe0aa07055f8665493734dda1688c2a](https://github.com/balderdashy/sails-hook-orm/commit/3161c34edbe0aa07055f8665493734dda1688c2a)
* [ENHANCEMENT] Add production check in case sails-disk is being used, and experimental `sails.config.orm.skipProductionWarnings` flag for preventing the warning. [sails-hook-orm/commit/9a0d46e135dadf00bc4576341624a31e50b12838](https://github.com/balderdashy/sails-hook-orm/commit/9a0d46e135dadf00bc4576341624a31e50b12838)
* [INTERNAL] Don't clone target function in expanded route syntax [6cfb2de](https://github.com/balderdashy/sails/commit/6cfb2de17ccafd789d4af001934b286bc189d1a4)
* [BUGFIX] Replace naughty code in implicit default res.forbidden() response; relevant when api/responses/ is deleted. See #3667 for more info. Thanks [@Biktop](https://github.com/biktop)!  [4767585994c45e7a7040402a057f0e41660d3419](https://github.com/balderdashy/sails/commit/4767585994c45e7a7040402a057f0e41660d34)19
* [INCONSISTENCY] Fix embarassing old link that was being shown when you `console.log` the `sails` app instance.  Thanks [@wulfsolter](https://github.com/wulfsolter) [52d45688fcfb6c4437348115f3e9c91595a8d379](https://github.com/balderdashy/sails/commit/52d45688fcfb6c4437348115f3e9c91595a8d379)!
* [INTERNAL] Get rid of a whimsical little `--require` in mocha.opts that must have gotten lost.  Don't ask us how it ended up there. Thanks [@markelog](https://github.com/markelog)! [06837a53b48352de7c46a1be84e87e28a084ffe2](https://github.com/balderdashy/sails/commit/06837a53b48352de7c46a1be84e87e28a084ffe2)
* [INTERNAL] Remove needless require from mocha opts. Thanks [@markelog](https://github.com/markelog)! [3681](https://github.com/balderdashy/sails/pull/3681)


## 0.12.1

* [INTERNAL] Expose private `loadAndRegisterControllers` method for now, since certain apps are relying on it [0ba7829](https://github.com/balderdashy/sails/commit/0ba78296047874debd33ce62588e97c371b7138c)
* [BUGFIX] Updated default HTTP cache config property to match what's documented [750d434](https://github.com/balderdashy/sails/commit/750d434a5592b422686ef0217ecab6cc2abcce7a)
* [BUGFIX] Check for `sails.io` before checking for `sails.io.httpServer` when lowering [92c4b19](https://github.com/balderdashy/sails/commit/92c4b1907073336b879c7c6abf57d5d34b3fca46)
* [ENHANCEMENT] Keep cookie middleware even if session middleware is deactivated [d21ae2d](https://github.com/balderdashy/sails/commit/d21ae2d8cf16df1169187392c9f522f99d556a85)
* [BUGFIX] Reset process.env.NODE_ENV after Sails lowers to whatever it was originally (to make it non-sticky when lifting/lowering multiple apps) [f9db888](https://github.com/balderdashy/sails/commit/f9db888a4fd39d43138bad4b279ad86046c27482)
* [BUGFIX] Use correct extension config for Handlebars [3559](https://github.com/balderdashy/sails/issues/3559)
* [BUGFIX] Update usage of `sails.sockets.id()` in pubsub hook to `sails.sockets.getId()` to avoid deprecation warning [3552](https://github.com/balderdashy/sails/issues/3552)
* [INTERNAL] Replace usage of Express middleware (e.g. `require('express').favicon`) with equivalent standalone packages (e.g. `require('serve-favicon')`)
* [BUGFIX] Allow passing in non-model instances to `publishCreate` [3558](https://github.com/balderdashy/sails/issues/3558)

## 0.12.0

* [UPGRADE] Bump Waterline dependency to `0.11.0` and Sails-Disk to `0.10.9`
* [ENHANCEMENT] More core hooks are now fully documented ([controllers](https://github.com/balderdashy/sails/tree/master/lib/hooks/controllers)|[grunt](https://github.com/balderdashy/sails/tree/master/lib/hooks/grunt)|[logger](https://github.com/balderdashy/sails/tree/master/lib/hooks/logger)|[cors](https://github.com/balderdashy/sails/tree/master/lib/hooks/cors)|[responses](https://github.com/balderdashy/sails/tree/master/lib/hooks/responses)|[orm](https://github.com/balderdashy/sails/tree/master/lib/hooks/orm))
* [ENHANCEMENT] Improve `sails --help` output (note that this removes support for common misspellings) [#3539](https://github.com/balderdashy/sails/issues/3539)
* [ENHANCEMENT] Detect EMFILE warnings from grunt-contrib-watch and treat them as fatal (this is the too many open files / `ulimit -n 1024` thing)  [#3523](https://github.com/balderdashy/sails/issues/3523)
* [BUGFIX] Downgrade default grunt-contrib-watch dependency installed in new Sails apps to use v0.5.3 [#3526](https://github.com/balderdashy/sails/issues/3526)
* [BUGFIX] Use locally-installed Sails (when available) with `sails console` instead of always using global [093ec01](https://github.com/balderdashy/sails/commit/093ec01754f1caa54333e97cfb9a095f1697a2f1)
* [UPGRADE] Update `express-handlebars` to `3.0.0` [1760604](https://github.com/balderdashy/sails/commit/1760604b5a78eacc2d5a1facd4db2de3ea930972)
* [BUGFIX] Don't attempt to run CSRF protection methods if session is not available
* [BUGFIX] Properly remove process listeners on sails.lower() to avoid EventEmitter leaks when lifting/lowering multiple apps (e.g. in tests) [#2693](https://github.com/balderdashy/sails/issues/2693)
* [UPGRADE] Updated versions of Lodash (v3.10.1) and Async (v1.5.0) used in Sails (and globalized in Sails apps by default)
* [ENHANCEMENT] Support for newer versions of connect-redis session adapter (and other session adapters using express-session)
* [ENHANCEMENT] Set the useGlobal config option for REPL while using sails console, allows autoreload hook to reflect changes on global models and services
* [ENHANCEMENT] Support JSON sorting syntax in blueprints [#2449](https://github.com/balderdashy/sails/issues/2449)
* [ENHANCEMENT] Support namespaced modules as hooks [#3022](https://github.com/balderdashy/sails/issues/3022), [#3514](https://github.com/balderdashy/sails/pull/3514)
* [ENHANCEMENT] Allow installable hooks to override their default names [#3168](https://github.com/balderdashy/sails/pull/3168)
* [BUGFIX] Fixed issues with subscribing sockets to new model instances in a clustered environment [#2990](https://github.com/balderdashy/sails/issues/2990), [#3008](https://github.com/balderdashy/sails/issues/3008)
* [UPGRADE] Update `consolidate` to `^0.12.1`
* [BUGFIX] Don't allow changing a model's primary key via blueprints
* [ENHANCEMENT] Added sails.config.keepResponseErrors option to keep response errors in production mode [#2853](https://github.com/balderdashy/sails/pull/2853)
* [ENHANCEMENT] Added Livescript support [#2662](https://github.com/balderdashy/sails/pull/2662), [#2599](https://github.com/balderdashy/sails/pull/2599)
* [ENHANCEMENT] Added IcedCoffeeScript support (brrr) [#2599](https://github.com/balderdashy/sails/pull/2599)
* [BUGFIX] Fix req.param() to work correctly with falsy params [#2756](https://github.com/balderdashy/sails/pull/2756)
* [ENHANCEMENT] Support "exposeHeaders" option in CSRF config [#2712](https://github.com/balderdashy/sails/pull/2712)
* [BUGFIX] Honor all route options when using policy target syntax (https://github.com/balderdashy/sails/issues/2609#issuecomment-77527609)
* [ENHANCEMENT] New `sails deploy` CLI command.  See https://github.com/mikermcneil/sails-deploy-azure for an example deployment strategy.
* [ENHANCEMENT] Support CSRF hook route configuration [#2366](https://github.com/balderdashy/sails/issues/2366)
* [BUGFIX] Fix [RangeError: Maximum call stack size exceeded] error in PubSub hook
* [ENHANCEMENT] Support layout for Ractive template engine
* [ENHANCEMENT] Body parser error logs no longer outputted in production, unless `sails.config.keepResponseErrors` is set [#3347](https://github.com/balderdashy/sails/pull/3347)
* [BUGFIX] Pluralize option works correctly for all routes [#3223](https://github.com/balderdashy/sails/pull/3223)
* [BUGFIX] Blueprint create now works when POSTing arrays [#3228](https://github.com/balderdashy/sails/pull/3228)
* [UPGRADE] Updated `sails-hook-sockets` to `^0.13.0`, which uses an updated socket.io-client module and has some bugfixes
* [BUGFIX] Default responses now work correctly when views hook is disabled [#2770](https://github.com/balderdashy/sails/pull/2770)
* [BUGFIX] Restored troubleshooting messages in console when Sails server fails to lift
* [BUGFIX] app-wide locals (sails.config.views.locals) are combined using a shallow merge (`_.extend()` instead of `_.merge()`) [#3500](https://github.com/balderdashy/sails/issues/3500)
* [ENHANCEMENT] Added `sails.getRouteFor()` and `sails.getUrlFor()`, utility methods for reverse routing  [#3402](https://github.com/balderdashy/sails/issues/3402#issuecomment-167137610)
* [BUGFIX] Improve interoperability of virtual requests to provide a more consistent API to Socket.io and `sails.request()` (e.g. for tests)  [121f3feb8702d44420e86707ef05e3282461d136](https://github.com/balderdashy/sails/commit/121f3feb8702d44420e86707ef05e3282461d136)
* [INTERNAL] Use shallow merge in services hook when loading modules (37eceee9b0ff0a20a285ac2889f4a5e96f3f5b30)
* [INTERNAL] Don't expose sails.services until `loadModules` is called in the services hook (37eceee9b0ff0a20a285ac2889f4a5e96f3f5b30)

## 0.11.5

* [BUGFIX] Allow disabling of installed hooks [#3550](https://github.com/balderdashy/sails/pull/3550)
* [ENHANCEMENT] Support namespaced modules as hooks (hotfix from [#3022](https://github.com/balderdashy/sails/issues/3022), [#3514](https://github.com/balderdashy/sails/pull/3514))
* [ENHANCEMENT] Allow installable hooks to override their default names (hotfix from [#3168](https://github.com/balderdashy/sails/pull/3168))

## 0.11.4

* [SECURITY] Updated several dependencies due to security vulnerabilities (https://github.com/balderdashy/sails/issues/3464#issuecomment-169255559)

## 0.11.3

* [BUGFIX] Fix [RangeError: Maximum call stack size exceeded] error in PubSub hook (https://github.com/balderdashy/sails/issues/2636)
* [ENHANCEMENT] Allow custom route options in policy target syntax (https://github.com/balderdashy/sails/commit/0990fc10709520a9f6c55923b991708d5eaf8aa0)
* [ENHANCEMENT] Support CSRF hook route configuration [#2366](https://github.com/balderdashy/sails/issues/2366)
* [ENHANCEMENT] Added "exposeHeaders" option in CORS configuration (https://github.com/balderdashy/sails/pull/2712)

## 0.11.2

* [BUGFIX] Fixes to allow proper installation / execution in environments using Node 4 and/or NPM 3.

## 0.11.1

* Shhhh nothing to see here (version skipped)

## 0.11.0

* [ENHANCEMENT] Allow hooks to be installed in node_modules and dynamic changing of hook name
* [ENHANCEMENT] Pull out the `sockets` hook to its own repository
* [ENHANCEMENT] Allow hooks to have individual timeouts, and a global `sails.config.hookTimeout`
* [ENHANCEMENT] Pull out `sails.io`.js to its own generator
* [UPGRADE] Update `sails.io.js` for the latest version of the sockets hook
* [UPGRADE] Upgrade from Socket.IO 0.9.17 to 1.2.1
* [FEATURE] Add `restPrefix` setting in addition to `prefix` setting for blueprints for finer control
* [ENHANCEMENT] Support partials and layout with Handlebars for the `backend` generator
* [BUGFIX] Blueprint creation returns 201 status code instead of 200
* [BUGFIX] `ractive.toHTML()` replaces `ractive.renderHTML()` for Ractive template engine
* [BUGFIX] Fix arguments for publishAdd, publishRemove and publishUpdate
* [ENHANCEMENT] Enable views hook for all methods
* [BUGFIX] Resolve depreciation warnings
* [BUGFIX] Fix dependency for npm 2.0.0
* [BUGFIX] Fix Grunt launching when it's a peer dep
* [ENHANCEMENT] Upgrade express and skipper because of security vulnerabilities
* [BUGFIX] Fix Sails crashes if Redis goes down [#2277](https://github.com/balderdashy/sails/pull/2277)
* [BUGFIX] Fix crash when using sessionless requests over WebSockets [#2107](https://github.com/balderdashy/sails/pull/2107)
* [ENHANCEMENT] Checking npm-version on install
* [ENHANCEMENT] Updated "skipAssets" regex to ignore query string


## 0.10.5

* [ENHANCEMENT] Updated `waterline` to `~0.10.9`
* [ENHANCEMENT] Added new `routesDisabled` option for CSRF [#2121](https://github.com/balderdashy/sails/pull/2121)
* [ENHANCEMENT] Refactoring and cleanup.
* [ENHANCEMENT] Switched from `express3-handlebars` to `express-handlebars`
* [BUGFIX] Add missing require for async module [#2101](https://github.com/balderdashy/sails/pull/2101)

## 0.10.4 and earlier?

See https://github.com/balderdashy/sails/commits/eea3b43b4e79d6b9f1b03b318a3ccab80704f22a.


================================================
FILE: CODE-OF-CONDUCT.md
================================================
> The Code of Conduct now lives in the 'Contributing' section of the documentation: [http://sailsjs.com/documentation/contributing/code-of-conduct](http://sailsjs.com/documentation/contributing/code-of-conduct)


================================================
FILE: CONTRIBUTING.md
================================================
> The Contribution guide now lives in the 'Contributing' section of the documentation: [sailsjs.com/documentation/contributing](http://sailsjs.com/documentation/contributing)


================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)
--

Copyright © 2012-present, Mike McNeil

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: MODULES.md
================================================
# Modules

Sails is a large project, with many modular components.  Each module is located in its own repository, and in most cases is tested individually.

Below, you'll find an overview of the modules maintained by the core team and community members.


## Sails core

The modules comprising the Sails framework, as well as the other plugins maintained by our core team, are spread across a number of different code repositories.  Some modules can be used outside of the context of Sails, while others are not intended for external use.

#### Framework and ORM

> For more information on the available releases of the Sails framework as a whole, check out the [contribution guide](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md).

| Package          |  Latest Stable Release   |  Build Status (edge)                  |
|------------------|--------------------------|---------------------------------------|
| <a href="http://github.com/balderdashy/sails" target="_blank" title="Github repo for Sails core"><img src="http://sailsjs.com/images/logos/sails-logo_ltBg_dkBlue.png" width=60 alt="Sails.js logo (small)"/></a>     | [![NPM version](https://badge.fury.io/js/sails.png)](http://badge.fury.io/js/sails) | [![Build Status](https://travis-ci.org/balderdashy/sails.png?branch=master)](https://travis-ci.org/balderdashy/sails)
| <a href="http://github.com/balderdashy/waterline" target="_blank" title="Github repo for Waterline ORM"><img src="https://camo.githubusercontent.com/fda800f7fab38baffcf951761d8c1e97f3af6533/687474703a2f2f692e696d6775722e636f6d2f33587168364d7a2e706e67" width=100 alt="Waterline logo (small)"/></a> | [![NPM version](https://badge.fury.io/js/waterline.png)](http://badge.fury.io/js/waterline) | [![Build Status](https://travis-ci.org/balderdashy/waterline.png?branch=master)](https://travis-ci.org/balderdashy/waterline)



#### Core hooks

As of Sails v1, some hooks are no longer included in Sails core.  Instead, they're published as standalone packages:

| Hook           | Package                                                             |  Latest Stable Release                                                                                             | Build Status (edge)                                                                                                                              | Purpose                                                  |
|:---------------|---------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------|
| `orm`          | [sails-hook-orm](https://npmjs.com/package/sails-hook-orm)          | [![NPM version](https://badge.fury.io/js/sails-hook-orm.png)](http://badge.fury.io/js/sails-hook-orm)         | [![Build Status](https://travis-ci.org/balderdashy/sails-hook-orm.png?branch=master)](https://travis-ci.org/balderdashy/sails-hook-orm)          | Implements support for Waterline ORM in Sails.  |
| `sockets`      | [sails-hook-sockets](https://npmjs.com/package/sails-hook-sockets)  | [![NPM version](https://badge.fury.io/js/sails-hook-sockets.png)](http://badge.fury.io/js/sails-hook-sockets) | [![Build Status](https://travis-ci.org/balderdashy/sails-hook-sockets.png?branch=master)](https://travis-ci.org/balderdashy/sails-hook-sockets)  | Implements Socket.io support in Sails.  |

> These are not _all_ the core hooks in Sails.  There are other core hooks built in to the `sails` package itself (see [`lib/hooks/`](https://github.com/balderdashy/sails/tree/master/lib/hooks)).  These other, _built-in hooks_ can still be disabled or overridden using the same configuration.


#### Bundled hooks

Certain additional hooks are bundled as dependencies of a new Sails app, especially when using the "Web app" template:


| Hook           | Package                                                             |  Latest Stable Release                                                                                             | Build Status (edge)                                                                                                                              | Purpose                                                  |
|:---------------|---------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------|
| `grunt`        | [sails-hook-grunt](https://npmjs.com/package/sails-hook-grunt)      | [![NPM version](https://badge.fury.io/js/sails-hook-grunt.png)](http://badge.fury.io/js/sails-hook-grunt)     | [![Build Status](https://travis-ci.org/balderdashy/sails-hook-grunt.png?branch=master)](https://travis-ci.org/balderdashy/sails-hook-grunt)      | Governs the built-in asset pipeline in Sails.  |
| `organics`     | [sails-hook-organics](https://npmjs.com/package/sails-hook-organics)                | [![NPM version](https://badge.fury.io/js/sails-hook-organics.png)](http://badge.fury.io/js/sails-hook-organics) | [![Build Status](https://travis-ci.org/sailshq/sails-hook-organics.png?branch=master)](https://travis-ci.org/sailshq/sails-hook-organics)             | Evolving library of well-tested, well-documented, and officially supported modules for the most common everyday tasks in apps (e.g. password hashing, emails, billing, etc.)
| `apianalytics` | [sails-hook-apianalytics](https://npmjs.com/package/sails-hook-apianalytics)                | [![NPM version](https://badge.fury.io/js/sails-hook-apianalytics.png)](http://badge.fury.io/js/sails-hook-apianalytics) | [![Build Status](https://travis-ci.org/sailshq/sails-hook-apianalytics.png?branch=master)](https://travis-ci.org/sailshq/sails-hook-apianalytics)             | A Sails hook for logging detailed request metadata and monitoring your API.
| `dev` | [sails-hook-dev](https://npmjs.com/package/sails-hook-dev)                | [![NPM version](https://badge.fury.io/js/sails-hook-dev.png)](http://badge.fury.io/js/sails-hook-dev) | [![Build Status](https://travis-ci.org/sailshq/sails-hook-dev.png?branch=master)](https://travis-ci.org/sailshq/sails-hook-dev)             | A Sails hook that provides diagnostic / debugging information and levers during development.



#### Core socket client SDKs

| Platform     | Package             |  Latest Stable Release           | Build Status (edge)          |
|--------------|---------------------|----------------------------------|------------------------------|
| Browser      | [sails.io.js-dist](https://npmjs.com/package/sails.io.js-dist)  | [![NPM version](https://badge.fury.io/js/sails.io.js-dist.png)](http://badge.fury.io/js/sails.io.js-dist) | [![Build Status](https://travis-ci.org/balderdashy/sails.io.js.png?branch=master)](https://travis-ci.org/balderdashy/sails.io.js)  |
| Node.js      | [sails.io.js](https://npmjs.com/package/sails.io.js)  | [![NPM version](https://badge.fury.io/js/sails.io.js.png)](http://badge.fury.io/js/sails.io.js) | [![Build Status](https://travis-ci.org/balderdashy/sails.io.js.png?branch=master)](https://travis-ci.org/balderdashy/sails.io.js)  |


#### Other browser libraries

The "Web App" template in Sails comes with a lightweight client-side JavaScript wrapper for Vue.js called `parasails`:

[![NPM version](https://badge.fury.io/js/parasails.png)](https://npmjs.com/package/parasails)


#### Core database adapters

| Package                                                          |  Latest Stable Release                                                                                       | Build Status (edge)                                                                                                                           | Platform                                                          |
|:-----------------------------------------------------------------| -------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------|
| [sails-disk](https://npmjs.com/package/sails-disk)               | [![NPM version](https://badge.fury.io/js/sails-disk.png)](http://badge.fury.io/js/sails-disk)                | [![Build Status](https://travis-ci.org/balderdashy/sails-disk.png?branch=master)](https://travis-ci.org/balderdashy/sails-disk)               | Local disk (`.tmp/`)                                              |
| [sails-mysql](https://npmjs.com/package/sails-mysql)             | [![NPM version](https://badge.fury.io/js/sails-mysql.png)](http://badge.fury.io/js/sails-mysql)              | [![Build Status](https://travis-ci.org/balderdashy/sails-mysql.png?branch=master)](https://travis-ci.org/balderdashy/sails-mysql)             | [MySQL](http://dev.mysql.com/)                                    |
| [sails-postgresql](https://npmjs.com/package/sails-postgresql)   | [![NPM version](https://badge.fury.io/js/sails-postgresql.png)](http://badge.fury.io/js/sails-postgresql)    | [![Build Status](https://travis-ci.org/balderdashy/sails-postgresql.png?branch=master)](https://travis-ci.org/balderdashy/sails-postgresql)   | [PostgreSQL](https://www.postgresql.org/)                         |
| [sails-mongo](https://npmjs.com/package/sails-mongo)             | [![NPM version](https://badge.fury.io/js/sails-mongo.png)](http://badge.fury.io/js/sails-mongo)              | [![Build Status](https://travis-ci.org/balderdashy/sails-mongo.png?branch=master)](https://travis-ci.org/balderdashy/sails-mongo)             | [MongoDB](https://www.mongodb.com/)                               |
| [sails-redis](https://npmjs.com/package/sails-redis)             | [![NPM version](https://badge.fury.io/js/sails-redis.png)](http://badge.fury.io/js/sails-redis)              | [![Build Status](https://travis-ci.org/balderdashy/sails-redis.png?branch=master)](https://travis-ci.org/balderdashy/sails-redis)             | [Redis](http://redis.io)                                          |


#### Core filesystem adapters

| Package                                                          |  Latest Stable Release                                                                                       | Build Status (edge)                                                                                                                           | Platform                                                          |
|:-----------------------------------------------------------------| -------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------|
| [skipper-disk](https://npmjs.com/package/skipper-disk)           | [![NPM version](https://badge.fury.io/js/skipper-disk.png)](http://badge.fury.io/js/skipper-disk)            | [![Build Status](https://travis-ci.org/balderdashy/skipper-disk.png?branch=master)](https://travis-ci.org/balderdashy/skipper-disk)           | Local disk (`.tmp/uploads/`)                                      |
| [skipper-s3](https://npmjs.com/package/skipper-s3)           | [![NPM version](https://badge.fury.io/js/skipper-s3.png)](http://badge.fury.io/js/skipper-s3)            | [![Build Status](https://travis-ci.org/balderdashy/skipper-s3.png?branch=master)](https://travis-ci.org/balderdashy/skipper-s3)           | [Amazon S3 (AWS)](https://aws.amazon.com/s3)                                      |



#### Core generators

_As of Sails v1.0, core generators are now bundled in [sails-generate](https://github.com/balderdashy/sails-generate).  All generators can still be overridden the same way.  For examples, see below._



#### Core framework utilities

| Package                                                               | Latest Stable Release   | Build Status (edge)         |
|-----------------------------------------------------------------------|--------------------------|----------------------------|
| [**skipper**](http://npmjs.com/package/skipper)                       | [![NPM version](https://badge.fury.io/js/skipper.png)](http://badge.fury.io/js/skipper)                           | [![Build Status](https://travis-ci.org/balderdashy/skipper.png?branch=master)](https://travis-ci.org/balderdashy/skipper) |
| [**machine**](http://npmjs.com/package/machine)                       | [![NPM version](https://badge.fury.io/js/machine.png)](http://badge.fury.io/js/machine)                           | [![Build Status](https://travis-ci.org/node-machine/machine.png?branch=master)](https://travis-ci.org/node-machine/machine) |
| [**machine-as-action**](http://npmjs.com/package/machine-as-action)   | [![NPM version](https://badge.fury.io/js/machine-as-action.png)](http://badge.fury.io/js/machine-as-action)       | [![Build Status](https://travis-ci.org/sailshq/machine-as-action.png?branch=master)](https://travis-ci.org/treelinehq/machine-as-action) |
| [**whelk**](http://npmjs.com/package/whelk)   | [![NPM version](https://badge.fury.io/js/whelk.png)](http://badge.fury.io/js/whelk)       | [![Build Status](https://travis-ci.org/sailshq/whelk.png?branch=master)](https://travis-ci.org/treelinehq/whelk) |
| [**captains-log**](http://npmjs.com/package/captains-log)             | [![NPM version](https://badge.fury.io/js/captains-log.png)](http://badge.fury.io/js/captains-log)                 | [![Build Status](https://travis-ci.org/balderdashy/captains-log.png?branch=master)](https://travis-ci.org/balderdashy/captains-log) |
| [**anchor**](http://npmjs.com/package/anchor)                         | [![NPM version](https://badge.fury.io/js/anchor.png)](http://badge.fury.io/js/anchor)                             | [![Build Status](https://travis-ci.org/sailsjs/anchor.png?branch=master)](https://travis-ci.org/sailsjs/anchor) |
| [**sails-generate**](http://npmjs.com/package/sails-generate)         | [![NPM version](https://badge.fury.io/js/sails-generate.png)](http://badge.fury.io/js/sails-generate)             | [![Build Status](https://travis-ci.org/balderdashy/sails-generate.png?branch=master)](https://travis-ci.org/balderdashy/sails-generate) |
| [**waterline-schema**](http://npmjs.com/package/waterline-schema)     | [![NPM version](https://badge.fury.io/js/waterline-schema.png)](http://badge.fury.io/js/waterline-schema)         | [![Build Status](https://travis-ci.org/balderdashy/waterline-schema.svg?branch=master)](https://travis-ci.org/balderdashy/waterline-schema) |
| [**waterline-utils**](http://npmjs.com/package/waterline-utils)       | [![NPM version](https://badge.fury.io/js/waterline-utils.png)](http://badge.fury.io/js/waterline-utils)           | [![Build Status](https://travis-ci.org/sailshq/waterline-utils.svg?branch=master)](https://travis-ci.org/balderdashy/waterline-utils)
| [**include-all**](http://npmjs.com/package/include-all)               | [![NPM version](https://badge.fury.io/js/include-all.png)](http://badge.fury.io/js/include-all)                   | [![Build Status](https://travis-ci.org/balderdashy/include-all.png?branch=master)](https://travis-ci.org/balderdashy/include-all) |
| [**reportback**](http://npmjs.com/package/reportback)                 | [![NPM version](https://badge.fury.io/js/reportback.png)](http://badge.fury.io/js/reportback)                     | _n/a_
| [**switchback**](http://npmjs.com/package/switchback)                 | [![NPM version](https://badge.fury.io/js/switchback.png)](http://badge.fury.io/js/switchback)                     | [![Build Status](https://travis-ci.org/node-machine/switchback.png?branch=master)](https://travis-ci.org/node-machine/switchback) |
| [**rttc**](http://npmjs.com/package/rttc)                             | [![NPM version](https://badge.fury.io/js/rttc.png)](http://badge.fury.io/js/rttc)                                 | [![Build Status](https://travis-ci.org/node-machine/rttc.png?branch=master)](https://travis-ci.org/node-machine/rttc) |
| [**@sailshq/lodash**](http://npmjs.com/package/@sailshq/lodash)       | [![npm version](https://badge.fury.io/js/%40sailshq%2Flodash.svg)](https://badge.fury.io/js/%40sailshq%2Flodash)                        | _n/a_


#### Forks

- [@sailshq/lodash](https://npmjs.com/package/@sailshq/lodash) · _(A fork of Lodash 3.10.x that fixes security issues.  Ongoing maintenance provided by the Sails core team.)_
- [@sailshq/connect-redis](https://npmjs.com/package/@sailshq/connect-redis)
- [@sailshq/socket.io-redis](https://npmjs.com/package/@sailshq/socket.io-redis)
- [@sailshq/eslint](https://npmjs.com/package/@sailshq/eslint)
- [@sailshq/htmlhint](https://npmjs.com/package/@sailshq/htmlhint)
- [@sailshq/lesshint](https://npmjs.com/package/@sailshq/lesshint)


## Official documentation

The official documentation for the Sails framework is written in Markdown, and is automatically compiled for the [Sails website](http://sailsjs.com).

| Repo       | Purpose                           |
|------------|:----------------------------------|
| [sails-docs](https://github.com/balderdashy/sails-docs)  | Raw content for reference, conceptual, anatomical, and other documentation on the Sails website (in Markdown).
| [www.sailsjs.com](https://sailsjs.com) | The Sails app that powers [sailsjs.com](http://sailsjs.com).  HTML content is automatically compiled from [`sails-docs`](https://github.com/balderdashy/sails-docs).
| [doc-templater](https://github.com/uncletammy/doc-templater) | The module we use to pre-process, compile, and format Markdown documentation files into the HTML markup and tree menus at [`sailsjs.com/documentation`](http://sailsjs.com/documentation).


_All known translation projects for the Sails documentation are listed in the README [**sails-docs**](https://github.com/balderdashy/sails-docs)._







## Community projects

In addition to the official code repositories that are supported by the Sails.js core team, there are countless other plugins created by members of the Sails.js community.


#### Hooks

There are at least 200 community hooks for Sails.js [available on NPM](https://www.npmjs.com/search?q=sails+hook).

> [Learn about custom hooks in Sails](http://sailsjs.com/documentation/concepts/extending-sails/hooks).


#### Asset pipeline

Need to customize your build?  Want automatically-generated spritesheets?  Source maps?  Sails.js uses Grunt for its asset pipeline, which means it supports any Grunt plugin. out of the box.  There are thousands of Grunt plugins [available on NPM](http://gruntjs.com/plugins).

> [Learn how to customize your app's asset pipeline](http://sailsjs.com/documentation/concepts/assets).



#### Generators

Don't like Grunt?  Want to use WebPack or Gulp instead?  Prefer your generated backend files to be written in CoffeeScript?  There are at least 100 community generators for Sails.js [available on NPM](https://www.npmjs.com/search?q=sails%20generate).

> [Learn how to use community generators, and how to build your own](http://sailsjs.com/documentation/concepts/extending-sails/generators).

<!-- Looking for the list that used to be here?  See https://github.com/balderdashy/sails-docs/blob/323477613b6b9ab0cfd7dfb38e53cdff6f46f5d8/concepts/extending-sails/Generators/generatorList.md -->


#### Database adapters

Is your database not supported by one of the core adapters?  Good news!  There are many different community database adapters for Sails.js and Waterline [available on NPM](https://www.npmjs.com/search?q=sails+adapter).

> [Learn how to install and configure community adapters](http://sailsjs.com/documentation/concepts/extending-sails/adapters).



#### Filesystem adapters

Need to upload files to a cloud file store like S3, GridFS, or Azure Cloud Files?  Check out the community filesystem adapters for Sails.js and Skipper [available on NPM](https://www.npmjs.com/search?q=skipper+adapter).

> [Learn how to wire up one or more custom filesystem adapters for your application](https://github.com/balderdashy/skipper#use-cases).



#### 3rd party integrations

Need to process payments with Stripe?  Fetch video metadata from YouTube?  Process user email data via Google APIs?  Choose from hundreds of community machinepacks for Sails.js/Node [available on NPM](http://node-machine.org/machinepacks).

> [Learn how to install and use machinepacks in your controller actions and helpers.](http://node-machine.org/)


#### Database drivers

Want to work with your database at a low level?  Need to get extra performance out of your database queries?  Dynamic database connections?

> [Learn about Waterline drivers](https://github.com/node-machine/driver-interface).


#### View engines

Is EJS bumming you out?  Prefer to use a different templating language like pug (/jade), handlebars, or dust?  Sails.js supports almost any Consolidate/Express-compatible view engine-- meaning you can use just about any imaginable markup language for your Sails.js views.  Check out the community view engines for Sails.js and Express [available on NPM](http://sailsjs.com/documentation/concepts/views/view-engines).

> [Learn how to set up a custom view engine for your app](http://sailsjs.com/documentation/reference/configuration/sails-config-views).


#### Session stores

The recommended production session store for Sails.js is Redis... but we realize that, for some apps, that isn't an option.  Fortunately, Sails.js supports almost any Connect/Express-compatible session store-- meaning you can store your sessions almost anywhere, whether that's Mongo, on the local filesystem, or even in a relational database.  Check out the community session stores for Sails.js, Express, and Connect [available on NPM](https://www.npmjs.com/search?q=connect%20session-).

> [Learn how to install and configure a custom session store in your Sails app](http://sailsjs.com/documentation/reference/configuration/sails-config-session#?production-config).



#### Community socket client SDKs & examples

Need to connect to Sails from a native iPhone or Android app?

| Platform     | Repo       |  Build Status (edge)             |
|--------------|------------|----------------------------------|
| iOS          | [sails.ios](https://github.com/ChrisChares/sails.ios)  | [![CI Status](http://img.shields.io/travis/ChrisChares/sails.ios.svg?style=flat)](https://travis-ci.org/ChrisChares/sails.ios) |
| Objective C  | [sails.io.objective-c](https://github.com/fishrod-interactive/sails-io.objective-c) | _N/A_ |
| Android      | [Sails Messenger](https://github.com/TheFinestArtist/Sails-Messenger)  | _N/A_  |
| React Native | [React Native example](https://github.com/mikermcneil/chatkin/tree/master/mobileapp)  | _N/A_  |
| Cordova      | [Phonegap tips](https://stackoverflow.com/questions/33378104/how-to-implement-sailsjs-phonegap-cordova-application)  | _N/A_  |


#### Misc. projects

| Package                                                                             | Latest Stable Release           | Purpose
|-------------------------------------------------------------------------------------|---------------------------------|:------------|
| [sails-migrations](https://github.com/BlueHotDog/sails-migrations)                  | [![NPM version](https://badge.fury.io/js/sails-migrations.png)](http://badge.fury.io/js/sails-migrations) | Manual migration tool for Sails, built on Knex.
| [sails-mysql-transactions](https://github.com/postmanlabs/sails-mysql-transactions) | [![NPM version](https://badge.fury.io/js/sails-mysql-transactions.png)](http://badge.fury.io/js/sails-mysql-transactions) | Augmented database adapter for mySQL with transaction and replication support.
| [sails-inverse-model](https://www.npmjs.com/package/sails-inverse-model) | Generate Sails/Waterline model definitions from a pre-existing database.



## FAQ

#### What happened to the core generators?

For easier maintainence, they were pulled into [`sails-generate`](https://github.com/balderdashy/sails-generate).

#### What release of XYZ should I install?

You can read about naming conventions for plugins and core modules [here](https://gist.github.com/mikermcneil/baa3eed1030e67f1b0670fb05a2b1f53).  Covers NPM dist tags, git tags, and version strings, as well as recommendations for hotfix branches.


================================================
FILE: README.md
================================================
# [![Sails.js](http://balderdashy.github.io/sails/images/logo.png "Sails.js")](http://sailsjs.com)

### [Website](https://sailsjs.com/)  &nbsp; [Get Started](https://sailsjs.com/get-started) &nbsp;  [Docs](http://sailsjs.com/documentation)  &nbsp; [News](http://twitter.com/sailsjs) &nbsp; [Submit Issue](http://sailsjs.com/bugs)

[![NPM version](https://badge.fury.io/js/sails.svg)](http://badge.fury.io/js/sails) &nbsp; [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/balderdashy/sails)  &nbsp; [![Twitter Follow](https://img.shields.io/twitter/follow/sailsjs.svg?style=social&maxAge=3600)](https://twitter.com/sailsjs)

Sails.js is a [web framework](http://sailsjs.com/whats-that) that makes it easy to build custom, enterprise-grade Node.js apps. It is designed to resemble the MVC architecture from frameworks like Ruby on Rails, but with support for the more modern, data-oriented style of web app & API development. It's especially good for building realtime features like chat.

Since version 1.0, Sails supports `await` out of the box.  This replaces nested callbacks (and the commensurate error handling) with simple, familiar usage:

```javascript
var orgs = await Organization.find();
```


## Installation &nbsp;
**With [node](http://nodejs.org) [installed](http://nodejs.org/en/download):**
```sh
# Get the latest stable release of Sails
$ npm install sails -g
```

> ##### Upgrading from an earlier version of Sails?
> Upgrade guides for all major releases since 2013 are available on the Sails website under [**Upgrading**](http://sailsjs.com/upgrading).


## Your First Sails Project

**Create a new app:**
```sh
# Create the app
sails new my-app
```

**Lift sails:**
```sh
# cd into the new folder
cd my-app

# fire up the server
sails lift
```

[![Screenshot from the original Sails video](http://i.imgur.com/Ii88jlhl.png)](https://sailsjs.com/get-started)

For the most up-to-date introduction to Sails, [get started here](https://sailsjs.com/get-started).

## Compatibility

Sails is built on [Node.js](http://nodejs.org/), [Express](http://expressjs.com/), and [Socket.io](http://socket.io/).

Sails [actions](http://sailsjs.com/documentation/concepts/actions-and-controllers) are compatible with Connect middleware, so in most cases, you can paste code into Sails from an existing Express project and everything will work-- plus you'll be able to use WebSockets to talk to your API, and vice versa.

The ORM, [Waterline](https://github.com/balderdashy/waterline), has a well-defined adapter system for supporting all kinds of datastores.  Officially supported databases include [MySQL](https://npmjs.com/package/sails-mysql), [PostgreSQL](https://npmjs.com/package/sails-postgresql), [MongoDB](https://npmjs.com/package/sails-mongo), [Redis](https://npmjs.com/package/sails-redis), and [local disk / memory](https://npmjs.com/package/sails-disk).
Community adapters exist for [CouchDB](https://github.com/search?q=sails+couch&nwo=codeswarm%2Fsails-couchdb-orm&search_target=global&ref=cmdform), [neDB](https://github.com/adityamukho/sails-nedb), [SQLite](https://github.com/AndrewJo/sails-sqlite3/tree/0.10), [Oracle](https://github.com/search?utf8=%E2%9C%93&q=%22sails+oracle%22+OR+%22waterline+oracle%22&type=Repositories&ref=searchresults), [MSSQL](https://github.com/misterGF/sails-mssqlserver), [DB2](https://github.com/search?q=sails+db2&type=Repositories&ref=searchresults), [ElasticSearch](https://github.com/search?q=%28elasticsearch+AND+sails%29+OR+%28elasticsearch+AND+waterline%29+&type=Repositories&ref=searchresults), [Riak](https://github.com/search?q=sails+riak&type=Repositories&ref=searchresults),
[neo4j](https://www.npmjs.org/package/sails-neo4j), [OrientDB](https://github.com/appscot/sails-orientdb),
[Amazon RDS](https://github.com/TakenPilot/sails-rds), [DynamoDB](https://github.com/TakenPilot/sails-dynamodb), [Azure Tables](https://github.com/azuqua/sails-azuretables), [RethinkDB](https://github.com/gutenye/sails-rethinkdb) and [Solr](https://github.com/sajov/sails-solr); for various 3rd-party REST APIs like Quickbooks, Yelp, and Twitter, including a configurable generic [REST API adapter](https://github.com/zohararad/sails-rest); plus some [eclectic projects](https://www.youtube.com/watch?v=OmcQZD_LIAE).

<!-- Core adapter logos -->
<a target="_blank" href="http://www.mysql.com">
  <img width="75" src="http://www.mysql.com/common/logos/powered-by-mysql-125x64.png" alt="Powered by MySQL" title="sails-mysql: MySQL adapter for Sails"/>
</a>&nbsp; &nbsp; &nbsp; &nbsp;
<a target="_blank" href="http://www.postgresql.org/"><img width="50" title="PostgreSQL" src="http://i.imgur.com/OSlDDKv.png"/></a>&nbsp; &nbsp; &nbsp; &nbsp;
<a target="_blank" href="http://www.mongodb.org/"><img width="100" title="MongoDB" src="http://i.imgur.com/bC2j13z.png"/></a>&nbsp; &nbsp; &nbsp; &nbsp;
<a target="_blank" href="http://redis.io/"><img width="75" title="Redis" src="http://i.imgur.com/dozv0ub.jpg"/></a>&nbsp; &nbsp; &nbsp; &nbsp;
<!-- /core adapter logos -->

> For the latest core adapters and notable community adapters, see [Available Adapters](http://sailsjs.com/documentation/concepts/extending-sails/adapters/available-adapters).

## Tutorial Course
- [Sailscasts](https://sailscasts.com/), taught by [Kelvin Omereshone](https://twitter.com/Dominus_Kelvin) _(English)_
- [Full-Stack JavaScript with Sails.js and Vue.js](https://platzi.com/cursos/javascript-pro/), taught by [Mike McNeil](https://twitter.com/mikermcneil) _(in English, with optional Spanish subtitles)_


## Books
- [Sails.js in Action](https://www.manning.com/books/sails-js-in-action) by Mike McNeil and Irl Nathan (Manning Publications).
- [Sails.js Essentials](https://www.packtpub.com/web-development/sailsjs-essentials) by Shaikh Shahid (Packt)
- [Pro Express.js: Part 3](http://link.springer.com/chapter/10.1007%2F978-1-4842-0037-7_18) by Azat Mardan (Apress).

## Support
Need help or have a question?
- [Frequently Asked Questions (FAQ)](http://sailsjs.com/faq)
- [Tutorials](http://sailsjs.com/faq#?what-are-some-good-community-tutorials)
- [Community support](http://sailsjs.com/support)
- [Professional/Enterprise options](http://sailsjs.com/faq#?are-there-professional-support-options)


## Issue submission
Please read the [submission guidelines](http://sailsjs.com/documentation/contributing/issue-contributions) and [code of conduct](http://sailsjs.com/documentation/contributing/code-of-conduct) before opening a new issue.  Click [here](https://github.com/balderdashy/sails/search?q=&type=Issues) to search/post issues in this repository.

## Contribute
There are many different ways you can contribute to Sails:
- answering questions on [StackOverflow](http://stackoverflow.com/questions/tagged/sails.js), [Gitter](https://gitter.im/balderdashy/sails), [Facebook](https://www.facebook.com/sailsjs), or [Twitter](https://twitter.com/search?f=tweets&vertical=default&q=%40sailsjs%20OR%20%23sailsjs%20OR%20sails.js%20OR%20sailsjs&src=typd)
- improving the [documentation](https://github.com/balderdashy/sails-docs#contributing-to-the-docs)
- translating the [documentation](https://github.com/balderdashy/sails-docs/issues/580) to your native language
- writing [tests](https://github.com/balderdashy/sails/blob/master/test/README.md)
- writing a [tutorial](https://github.com/sails101/contribute-to-sails101), giving a [talk](https://speakerdeck.com/mikermcneil), or supporting [your local Sails meetup](https://www.meetup.com/find/?allMeetups=false&keywords=node.js&radius=Infinity&sort=default)
- troubleshooting [reported issues](http://sailsjs.com/bugs)
- and [submitting patches](http://sailsjs.com/documentation/contributing/code-submission-guidelines).

_Please carefully read our [contribution guide](http://sailsjs.com/documentation/contributing) and check the [build status](http://sailsjs.com/architecture) for the relevant branch before submitting a pull request with code changes._


## Links
- [Website](http://sailsjs.com/)
- [Documentation](http://sailsjs.com/documentation)
- [Ask a question](http://sailsjs.com/support)
- [Tutorial](https://platzi.com/cursos/javascript-pro/)
- [Roadmap](https://trello.com/b/s9zEnyG7/sails-v1)
- [Twitter (@sailsjs)](https://twitter.com/sailsjs)
- [Facebook](https://www.facebook.com/sailsjs)

## Team
Sails is actively maintained with the help of many amazing [contributors](https://github.com/balderdashy/sails/graphs/contributors).  Our core team consists of:

[![Mike McNeil](https://www.gravatar.com/avatar/4b02a9d5780bdd282151f7f9b8a4d8de?s=144&d=identicon&rating=g)](https://twitter.com/mikermcneil) |  [![Kelvin Omereshone](https://avatars.githubusercontent.com/u/24433274?s=144&v=3)](https://twitter.com/dominus_kelvin) |  [![Eric Shaw](https://avatars2.githubusercontent.com/u/7445991?s=144&v=3)](https://github.com/eashaw)
|:---:|:---:|:---:|
[Mike McNeil](http://github.com/mikermcneil) | [Kelvin Omereshone](https://github.com/DominusKelvin) | [Eric Shaw](https://github.com/eashaw)


[Our company](https://sailsjs.com/about) designs/builds Node.js websites and apps for startups and enterprise customers. After building a few applications and taking them into production, we realized that the Node.js development landscape was very much still the Wild West. Over time, after trying lots of different methodologies, we decided to crystallize all of our best practices into this framework.  Six years later, Sails is now one of the most widely-used web application frameworks in the world. I hope it saves you some time! :)

## License

[MIT License](https://opensource.org/licenses/MIT)  Copyright © 2012-present, Mike McNeil

> Sails is built around so many great open-source technologies that it would never have crossed our minds to keep it proprietary.  We owe huge gratitude and props to Ryan Dahl ([@ry](https://github.com/ry)), TJ Holowaychuk ([@tj](https://github.com/tj)), Doug Wilson ([@dougwilson](https://github.com/dougwilson)) and Guillermo Rauch ([@rauchg](https://github.com/rauchg)) for the work they've done, as well as the stewards of all the other open-source modules we use.  Sails could never have been developed without your tremendous contributions to the JavaScript community.

![A squid peering inside a book, halation and cosmic Sails.js knowledge emanating from the pages of the substantial tome](https://sailsjs.com/images/get_started_hero.png)


================================================
FILE: ROADMAP.md
================================================
# Sails Roadmap

As of November 2017, the Sails project roadmap is now managed [on Trello](https://trello.com/b/s9zEnyG7) to allow for simpler feedback and collaboration.

The "Bugs/Priority" and "Frontlog" columns on Trello consist of relatively hashed-out proposals for useful features or patches which would be excellent places to contribute code to the Sails framework. We would exuberantly accept a pull request implementing any of the Trello cards in these columns, so long as that pull request was accompanied with reasonable tests that prove it, all code changes adhere to the style guide laid out in the `.eslintrc` file, and it doesn't cause breaking changes to any other core functionality.

> Community proposals can still be made as pull requests against this file-- but instead of managing status updates here, once approved, they are now managed on the [Trello board](https://trello.com/b/s9zEnyG7).  See "Pending Proposals" below for more on that.


> ##### What's up with Sails v1.0?
>
> For the latest news on Sails v1.0 and beyond, and to check out specific changes and new features, see https://trello.com/b/s9zEnyG7.  (Please feel free to contribute by leaving comments on cards!  It helps the core team to verify that the new release is working as expected.)
>
> You can find more information about installing v1.0 here: http://sailsjs.com/documentation/upgrading/to-v-1-0



## Pending Proposals

The table below consists of pending proposals for useful features which are not currently in the official roadmap on Trello.  To submit a proposal, send a pull request adding a row to this column.  Please see the Sails [contribution guide](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md) to get started.

> - If you would like to see a new feature or an enhancement to an existing feature in Sails, please review the [Sails contribution guide](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md). When you are ready, submit a pull request adding a new row to the bottom of this table.
> - Check [the official Sails roadmap on Trello](https://trello.com/b/s9zEnyG7) to make sure there isn't already something similar feature already planned, in discussion, or under active development.
> - In your pull request, please include a detailed proposal with a short summary of your use case, the reason why you cannot implement the feature as a hook, adapter, or generator, and a well-reasoned explanation of how you think that feature could be implemented.  Your proposal should include changes or additions to usage, expected return values, and any errors or exit conditions.
> - Once your pull request has been created, add an additional commit which links to it from your new row in the table below.
> - If there is sufficient interest in the proposal from other contributors, a core team member will close your PR and add a new card for the proposal to the appropriate column [on Trello](https://trello.com/b/s9zEnyG7).


Feature                                          | Proposal                                                                              | Summary
 :---------------------------------------------- | :------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------
 Allow select/omit clauses when populating a singular association | https://trello.com/c/yM9WPxzr/107-waterline-fs2q-tolerate-a-subcriteria-being-provided-to-populate-for-a-singular-associations-but-only-if-it-exclusively-contains | Don't throw an error if these clauses are included in a `populate` for a singular association (but still error if actual "where" criteria are used)
 Generate `test/` folder in new Sails apps       | [#2499](https://github.com/balderdashy/sails/pull/2499#issuecomment-171556544)        | Generate a generic setup for mocha tests in all new Sails apps.  Originally suggested by [@jedd-ahyoung](https://github.com/jedd-ahyoung).



<!--

TODO: Double check that all items from here are covered in Trello:


## 1.1.0 and beyond

+ **Blueprint API: Support transactions, when possible.**
  + See "FUTURE" comments throughout the code for the blueprints hook in this repo.
+ **Sessions: Expand `express-session`/Connect session store interface**
  + Expose a method in session stores which can be used to do an initial, asynchronous ping in order to check configuration.
  + Worst case, we should also be able to use [`.get()`](https://github.com/expressjs/session/blob/2667028d39b3655a45eb1f9579d7f66f26a6937f/README.md#storegetsid-callback) with a nonsense session id to do this-- the errors just won't be as nice, or as easy to negotiate.
  + The best middle-of-the-road solution is probably to get a couple of standardized error codes in the spec for `.get()`
    + Most likely, that's stuff like `ECONNREFUSED`
    + But would be a lot better if we could swing more specific error codes-- e.g. `E_BAD_SESSION_STORE_CONFIG` and `E_COULD_NOT_CONNECT_TO_SESSION_STORE`-- since that would eliminate the possibility of false positives due to throwing / `cb(err)`-ing.


## 2.0.0 and beyond

+ **Custom responses: Deprecate res.ok() in favor of res.success(); as well as some other breaking changes to custom responses.**
  + See first half of https://github.com/balderdashy/sails/commit/518bae84f01d17eac84c96977e5ed0c3b6a98083#commitcomment-20917978 for details.
+ **Blueprint API: Make the behavior of certain error conditions in blueprint actions customizable via `sails.config.blueprints.handle*`**
  + See second half of https://github.com/balderdashy/sails/commit/518bae84f01d17eac84c96977e5ed0c3b6a98083#commitcomment-20917978 for details.
+ **Federate sails-hook-blueprints**
  + In the process, pull the implementation of the three public RPS methods into sails-hook-sockets (and take the rest of the private methods out and drop them into the blueprints hook)
+ **Federate sails-hook-session**
  + Remember: This will involve a few delicate tweaks to the boilerplate config generated by `sails new foo --without=session`
+ **Federate sails-hook-i18n**
  + ~~(Will need to publish the backwards-compatible i18n hook as a separate package at that point)~~
+ **Switch to Lodash view engine by default?**
  + This is really just to normalize the confusing backwardsness of `<%=` vs. `<%-` in EJS/Lodash/Underscore
  + Would need to figure out partials/layouts though

-->


<!--

TODO: go through these lingering pending proposals:

Atomic `update`                                 | See [this issue](https://github.com/balderdashy/sails-mysql/issues/253) for details.  Originally suggested by [@leedm777](https://github.com/leedm777).
Log key configuration info on lift              | For example, if `config/local.js` is present, log a message explaining that it will be used.  See also https://github.com/dominictarr/rc/issues/23#issuecomment-33875197. Originally suggested by [@mikermcneil](https://github.com/mikermcneil).
Lock + unlock app in dev env                    | Capability for a hook to "lock" and/or "unlock" the app (in a development env only).  When "locked" all requests are intercepted by an endpoint which responds with either a page or JSON payload communicating a custom message.  e.g. so the grunt hook can let us know as it syncs.  e.g. `sails.emit('lock')`. Originally suggested by [@mikermcneil](https://github.com/mikermcneil).
Hook dependency/load order mgmt                 | Rebase the hook dependency+optional depenency system.  A detailed spec was originally proposed by @ragulka, but since then, custom hooks have complicated the equation.
~~Standalone router~~                               | ~~replace express dependency in `lib/router` with standalone router- either routification or @dougwilson's new project.  See https://github.com/balderdashy/sails/pull/2351#issuecomment-71855236 for more information.~~
Standalone view renderer                        | Use @fishrock123's standalone views module (enables views over sockets).  See https://github.com/balderdashy/sails/pull/2351#issuecomment-71855236 for more information.
Standalone static middleware                    | use static middleware directly in `lib/router` (enables static files over sockets)  See https://github.com/balderdashy/sails/pull/2351#issuecomment-71855236 for more information.
Break out core hooks into separate modules      | Makes Sails more composable, and removes most of its dependencies in core. Also allows for easier sharing of responsibility w/ the community, controls issue flow.  Started with github.com/balderdashy/sails-hook-sockets
~~Allow disabling session mw for static assets~~    | ~~Allow session handling to be turned off for static assets. In certain situations, a request for a static asset concurrent to a request to a controller action can have undesirable consequences; specifically, a race condition can occur wherein the static asset response ends up overwriting changes that were made to the session in the controller action.  Luckily, this is a very rare issue, and only occurs when there are race conditions from two different simultaneous requests sent from the same browser with the same cookies.  If you encounter this issue today, first think about whether you actually need/want to do things this way.  If you absolutely need this functionality, a workaround is to change the order of middleware or override the `session` middleware implementation in `config/http.js`.  However, for the long-term, we need a better solution.  It would be good to improve the default behavior of our dependency, `express-session` so that it uses a smarter heuristics.  For more information, see the implementation of session persistence in [express-session](https://github.com/expressjs/session/blob/master/index.js#L207).  However, the single cleanest solution to the general case of this issue would be the ability to turn off session handling features for all static assets (or on a per-route basis).  This is easier said than done.  If you'd like to have this feature, and have the cycles/chops to implement it, please tweet @sgress454 or @mikermcneil and we can dive in and work out a plan.  Summary of what we could merge:  We could remove the default session middleware from our http middleware configuration, and instead add it as a manual step in the virtual router that runs before the route action is triggered.  Good news it that we're actually already doing this in order to support sessions [in the virtual router](https://github.com/balderdashy/sails/blob/master/lib/router/index.js#L101) (e.g. for use w/ socket.io).  So the actual implementation isn't a lot of work-- just needs some new automated tests written, as well as a lot of manual testing (including w/ redis sessions).  We also need to update our HTTP docs to explain that requests for static assets no longer create a session by default, and that default HTTP session support is no longer configured via Express's middleware chain (handled by the virtual router instead.)  Finally we'd also need to document how to enable sessions for assets (i.e. attaching the express-session middleware in `config/http.js`, but doing so directly _before_ the static middleware runs so that other routes don't try to retrieve/save the session twice).  [@sgress454](https://github.com/sgress454)~~
Manual migrations in Sails CLI                  | For production environments it would be nice to have a save/secure command that creates the db automatically for you; e.g. a `sails migrate` or `sails create-db` command.  See [sails-migrations](https://github.com/BlueHotDog/sails-migrations) and [sails-db-migrate](https://github.com/building5/sails-db-migrate) for inspiration.  We should begin by contributing and using one or both of these modules in production in order to refine them further into a full fledged proposal (the Sails core team is using sails-migrations currently).  Originally suggested by [@globegitter](https://github.com/Globegitter).
Wildcard action policies                        | Instead of only having one global action policy `'*'` it would be nice if we could define policies for a specific action in all controllers: `'*/destroy': ['isOwner']` or something similar.  Originally suggested by [@ProLoser](https://github.com/ProLoser).
SPDY/HTTP2 protocol support                     | See https://github.com/balderdashy/sails/issues/80 for background.


-->



================================================
FILE: accessible/generate.js
================================================
/**
 * Module dependencies
 */

var sailsgen = require('sails-generate');

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TODO: Remove this at next opportunity to simplify maintenance.
// (Check docs, but I don't think it's documented, and it's not being used
// anywhere anymore.  Now that NPM is faster than it used to be, there's no
// reason to work towards separating the core generators from the main
// framework's NPM package anymore.  So this doesn't really need to exist,
// unless there are a lot of really good use cases for why generators need to be
// easily expoed for programmatic usage.  If you have such a use case, let us
// know at https://sailsjs.com/bugs)
//
// But note that this is a breaking change.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


/**
 * require('sails/accessible/generate')
 *
 * Generate files or folders.
 *
 * > This is an exposed version of sails-generate for programmatic use.
 * > (available on `require('sails').Sails.generate()`)
 *
 * @param {Dictionary} scope
 * @param {Function|Dictionary} cbOrHandlers
 */
module.exports = function generate (){

  return sailsgen.apply(this, Array.prototype.slice.call(arguments));

};



================================================
FILE: accessible/rc.js
================================================
/**
 * Module dependencies
 */

var rc = require('../lib/app/configuration/rc');


/**
 * require('sails/accessible/rc')
 *
 * A direct reference to Sails' built-in `rc` dependency.
 *
 * > This should not be modified.
 * > It's job is to eliminate the need for an extra `rc` dep. in userland
 * > just to load cmdline config in app.js.
 *
 * @type {Ref}
 */
module.exports = rc;


================================================
FILE: appveyor.yml
================================================
# # # # # # # # # # # # # # # # # # # # # # # # # #
#  ╔═╗╔═╗╔═╗╦  ╦╔═╗╦ ╦╔═╗╦═╗ ┬ ┬┌┬┐┬              #
#  ╠═╣╠═╝╠═╝╚╗╔╝║╣ ╚╦╝║ ║╠╦╝ └┬┘││││              #
#  ╩ ╩╩  ╩   ╚╝ ╚═╝ ╩ ╚═╝╩╚═o ┴ ┴ ┴┴─┘            #
#                                                 #
# This file configures Appveyor CI.               #
# (i.e. how we run the tests on Windows)          #
#                                                 #
# https://www.appveyor.com/docs/lang/nodejs-iojs/ #
# # # # # # # # # # # # # # # # # # # # # # # # # #


# Test against these versions of Node.js.
environment:
  matrix:
    - nodejs_version: "12"
    - nodejs_version: "14"
    - nodejs_version: "16"

# Install scripts. (runs after repo cloning)
install:
  # Get the latest stable version of Node.js
  # (Not sure what this is for, it's just in Appveyor's example.)
  - ps: Install-Product node $env:nodejs_version
  # Install declared dependencies
  - npm install


# Post-install test scripts.
test_script:
  # Output Node and NPM version info.
  # (Presumably just in case Appveyor decides to try any funny business?
  #  But seriously, always good to audit this kind of stuff for debugging.)
  - node --version
  - npm --version
  # Run the actual tests (but note that we skip linting.)
  - npm run custom-tests


# Don't actually build.
# (Not sure what this is for, it's just in Appveyor's example.
#  I'm not sure what we're not building... but I'm OK with not
#  building it.  I guess.)
build: off


================================================
FILE: bin/private/patched-commander.js
================================================
/**
 * Module dependencies
 */

var _ = require('@sailshq/lodash');
var program = require('commander');


//
//
// Monkey-patch commander
//
//

// Override the `usage` method to always strip out the `*` command,
// which we added so that `sails someunknowncommand` will output
// the Sails help message instead of nothing.
var usage = program.Command.prototype.usage;
program.Command.prototype.usage = program.usage = function( /* str */ ) {
  program.commands = _.reject(program.commands, {
    _name: '*'
  });
  return usage.apply(this, Array.prototype.slice.call(arguments));
};

// Force commander to display version information.
program.Command.prototype.versionInformation = program.versionInformation = function() {
  program.emit('version');
};

module.exports = program;


================================================
FILE: bin/private/read-repl-history-and-start-transcribing.js
================================================
/**
 * Module dependencies
 */

var fs = require('fs');


/**
 * readReplHistoryAndBeginTranscribing()
 *
 * Load from a REPL history file, then bind notifier functions to
 * track history-making events as changes occur in the future.
 *
 * > Originally based on https://github.com/tmpvar/repl.history
 *
 * @param {Ref} repl
 *        An already-started REPL instance.
 *
 * @param {String} file
 *        The absolute path to the `.node_history` file to use.
 */

module.exports = function readReplHistoryAndBeginTranscribing(repl, file) {

  // Check that the REPL history file exists.
  var historyFileExists = fs.existsSync(file);
  if (historyFileExists) {

    // If so, then read it, and set the initial REPL history.
    repl.history = fs.readFileSync(file, 'utf-8').split('\n').reverse();
    repl.history.shift();
    repl.historyIndex = -1;

  }//>-

  // Attempt to open the history file.
  var fd = fs.openSync(file, 'a');

  // Track whether we've logged a warning about writing the REPL history yet.
  // (Just to avoid making everybody tear their hair out.)
  var alreadyLoggedWarningAboutREPLHistory;

  // Bind alistener that will fire each time a newline is entered on the REPL.
  repl.addListener('line', function (code) {

    // Update the REPL history file accordingly.
    if (code && code !== '.history') {
      var buffer = Buffer.from(code + '\n');
      // Send all arguments to fs.write to support Node v0.10.x.
      fs.write(fd, buffer, 0, buffer.length, null, function (err /*, written */){
        if (!err) {
          // If everything worked, then there's nothing to worry about.  We're done.
          return;
        }

        // Otherwise, log a warning about the REPL history.
        // (Unless the spinlock has already been spun.)
        if (alreadyLoggedWarningAboutREPLHistory) { return; }
        alreadyLoggedWarningAboutREPLHistory = true;
        console.warn('WARNING: Could not write REPL history.  Details: '+err.stack);

      });// _∏_
    }
    else {
      repl.historyIndex++;
      repl.history.pop();
    }

  });//</every time repl emits a "line" event>

  // Bind a one-time-use listener that will fire when the process exits.
  process.once('exit', function () {

    // Close the history file.
    fs.closeSync(fd);

  });//</when process emits "exit">

};


================================================
FILE: bin/sails-console.js
================================================
/**
 * Module dependencies
 */

var nodepath = require('path');
var REPL = require('repl');
var stream = require('stream');
var _ = require('@sailshq/lodash');
var chalk = require('chalk');
var CaptainsLog = require('captains-log');

var rconf = require('../lib/app/configuration/rc')();
var Sails = require('../lib/app');
var SharedErrorHelpers = require('../errors');
var readReplHistoryAndStartTranscribing = require('./private/read-repl-history-and-start-transcribing');



/**
 * `sails console`
 *
 * Enter the interactive console (aka REPL) for the app
 * in our working directory.  This is just like the default
 * Node REPL except that it starts with the Sails app in the
 * current directory lifted, and with console history enabled
 * (i.e. so you can press up arrow to browse and potentially
 *  replay commands from past runs)
 *
 * @stability 3
 * @see http://sailsjs.com/documentation/reference/command-line-interface/sails-console
 * ------------------------------------------------------------------------
 * This lifts the Sails app in the current working directory, then uses
 * the core `repl` package to spin up an interactive console.
 *
 * Note that, if `--dontLift` was set, then `sails.load()` will be used
 * instead. (By default, the `sails console` cmd runs `sails.lift()`.)
 * ------------------------------------------------------------------------
 */

module.exports = function() {

  // Get a temporary logger just for use in `sails console`.
  // > This is so that logging levels are configurable, even when a
  // > Sails app hasn't been loaded yet.
  var cliLogger = CaptainsLog(rconf.log);

  // Now grab our dictionary of configuration overrides to pass in
  // momentarily when we lift (or load) our Sails app.  This is the
  // dictionary of configuration settings built from `.sailsrc` file(s),
  // command-line options, and environment variables.
  // (No need to clone, since, even through we're modifying it below,
  //  it's not being used anywhere else.)
  var configOverrides = rconf;

  // Then tweak this configuration to make sure we always disable
  // the ASCII ship.  It just doesn't look good in the REPL.
  if (!_.isObject(configOverrides.log)) {
    configOverrides.log = {};
  }
  configOverrides.log.noShip = true;

  // Determine whether to use the local or global Sails install.
  var sailsApp = (function _determineAppropriateSailsAppInstance(){

    // Use the app's locally-installed Sails dependency (in `node_modules/sails`),
    // assuming it's extant and valid.
    // > Note that we always assume the current working directory to be the
    // > root directory of the app.
    var appPath = process.cwd();
    var localSailsPath = nodepath.resolve(appPath, 'node_modules/sails');
    if (Sails.isLocalSailsValid(localSailsPath, appPath)) {
      cliLogger.verbose('Using locally-installed Sails.');
      cliLogger.silly('(which is located at `'+localSailsPath+'`)');
      return require(localSailsPath);
    }// --•

    // Otherwise, since no workable locally-installed Sails exists,
    // run the app using the currently running version of Sails.
    // > This is probably always the global install.
    cliLogger.info('No local Sails install detected; using globally-installed Sails.');

    return Sails();

  })();

  console.log();
  if (configOverrides.dontLift) {
    cliLogger.info(chalk.blue('Loading app in interactive mode...'));
    cliLogger.info(chalk.gray('Sails is not listening for requests (since `dontLift` was enabled).'));
    cliLogger.info(chalk.gray('You still have access to your models, helpers, and `sails`.'));
  }
  else {
    cliLogger.info(chalk.blue('Starting app in interactive mode...'));
  }
  console.log();

  // Lift (or load) Sails
  (function _loadOrLift(proceed){

    // If `--dontLift` was set, then use `.load()` instead.
    if (configOverrides.dontLift) {
      sailsApp.load(configOverrides, proceed);
    }
    // Otherwise, go with the default behavior (`.lift()`)
    else {
      sailsApp.lift(configOverrides, proceed);
    }

  })(function afterwards(err){// ~∞%°
    if (err) {
      return SharedErrorHelpers.fatal.failedToLoadSails(err);
    }

    // Get the current global _ value, if any.
    var underscore = global._;

    cliLogger.info('Welcome to the Sails console.');
    cliLogger.info(chalk.grey('( to exit, type ' + '<CTRL>+<C>' + ' )'));
    console.log();

    // Define a custom output stream that will replace global._ after every command.
    // This works around the issue where the Node REPL uses the underscore to hold
    // the result of the last command.
    var outputStream = (function() {
      // Create a new writable stream.
      var writableStream = new stream.Writable();
      // Add the `_write` method to it (can't do this in the constructor b/c that's not supported in older Node versions).
      writableStream._write = function(chunk, encoding, callback) {
        // Ignore the output generated the first time the global _ is set in Node 6+.
        if (chunk.toString('utf8').indexOf('Expression assignment to _ now disabled.') !== -1) {
          return callback();
        }
        // Set the global underscore again (for Node < 6).
        // See code after `REPL.start` for more info.
        if (typeof underscore !== 'undefined') {
          global._ = underscore;
        }
        // Forward the chunk on to stdout.
        process.stdout.write(chunk, encoding, callback);
      };
      // Return the new writable stream.
      return writableStream;
    })();

    // Start a REPL.
    var repl = REPL.start({
      // Set the REPL prompt.
      prompt: 'sails> ',
      // Allow the REPL to use the same global space as the Sails app, giving it access
      // to things like globalized models.
      useGlobal: true,
      // Specify the custom output stream we created above.
      output: outputStream,
      // When an output stream is specified, an input stream must be specified as well
      // or else the REPL crashes.
      input: process.stdin,
      // Set `terminal` to true to allow arrow keys to work correctly,
      // even when we're using a custom output stream.  Otherwise pressing
      // the up arrow just outputs ^[[A instead of accessing history.
      terminal: true,
      preview: false,
      // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      // FUTURE: Potentially use custom `eval` as stopgap for `await` support in Node <v9
      // https://nodejs.org/api/repl.html#repl_repl_start_options
      // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    });

    // Replace the global _ value, if any.  This will deactivate the underscore behavior
    // in the Node REPL for Node 6+, which conflicts with the global _ in Sails apps.
    // Note that in Node 6+ this typically causes the REPL to output "Expression assignment to _ now disabled.",
    // which unfortunately gets put right next to the `sails>` prompt, making for a very confusing
    // introduction to the Sails console.  In the custom output stream we defined above, we filter out
    // that message.
    if (typeof underscore !== 'undefined') {
      global._ = underscore;
    }

    // Now attempt to read the existing REPL history file, if there is one.
    var pathToReplHistoryFile = nodepath.join(sailsApp.config.paths.tmp, '.node_history');
    try {

      // Read the REPL history file, and bind notifier functions that will listen
      // for history-making events, and keep track of them for future generations.
      readReplHistoryAndStartTranscribing(repl, pathToReplHistoryFile);

    }
    catch (e) {

      cliLogger.verbose('Encountered an error attempting to access/interpret a `.node_history` file at `'+pathToReplHistoryFile+'`.');
      cliLogger.verbose('(This session of `sails console` will still work, it just won\'t support REPL history.)');
      cliLogger.verbose('Error details:\n',e);

    }//>-

    // Bind a one-time-use handler that will run when the REPL instance emits its "exit" event.
    repl.once('exit', function(err) {

      // If an error occurred, log it, then terminate the process with an exit code of 1.
      if (err) {
        cliLogger.error(err);
        return process.exit(1);
      }// --•

      // Otherwise, everything is cool.
      // Call the core 'lower' function and terminate the process with an exit code of 0.
      sailsApp.lower(function () {
        return process.exit(0);
      });

    });//</when 'exit' event it emitted by repl instance>

  });//</after lifting or loading Sails app>

};


================================================
FILE: bin/sails-debug-console.js
================================================
#!/usr/bin/env node


/**
 * Module dependencies
 */

var path = require('path');
var Womb = require('child_process');
var CaptainsLog = require('captains-log');
var chalk = require('chalk');
var Sails = require('../lib/app');


/**
 * `sails debug-console`
 *
 * Attach the Node debugger and enter the interactive console
 * (aka REPL) for the app in our working directory by calling
 * `sails-console.js`. You can then use the console to invoke
 * methods and Node inspector, or your favorite IDE, to debug
 * your app as it runs.
 *
 * @stability 2
 * @see http://sailsjs.org/documentation/reference/command-line-interface/sails-debug-console
 */
module.exports = function(cmd) {

  var extraArgs = cmd.parent.rawArgs.slice(3);

  var log = CaptainsLog();

  // Use the app's local Sails in `node_modules` if one exists
  // But first make sure it'll work...
  var appPath = process.cwd();
  var pathToSails = path.resolve(appPath, '/node_modules/sails');
  if (!Sails.isLocalSailsValid(pathToSails, appPath)) {
    // otherwise, use the currently-running instance of Sails
    pathToSails = path.resolve(__dirname, './sails.js');
  }

  console.log();
  log.info('Running console in debug mode...');

  log.info(chalk.grey('( to exit, type ' + '<CTRL>+<C>' + ' )'));
  console.log();

  // Spin up child process for the Sails console
  Womb.spawn('node', ['--debug', pathToSails, 'console'].concat(extraArgs), {
    stdio: 'inherit'
  });

};


================================================
FILE: bin/sails-debug.js
================================================
/**
 * Module dependencies
 */

var path = require('path');
var Womb = require('child_process');
var CaptainsLog = require('captains-log');
var chalk = require('chalk');
var Sails = require('../lib/app');


/**
 * `sails debug`
 *
 * Attach the Node debugger and lift a Sails app.
 * You can then use Node inspector to debug your app as it runs.
 *
 * @stability 2
 * @see http://sailsjs.com/documentation/reference/command-line-interface/sails-debug
 */
module.exports = function(cmd) {

  var extraArgs = cmd.parent.rawArgs.slice(3);

  var log = CaptainsLog();

  // Use the app's local Sails in `node_modules` if one exists
  // But first make sure it'll work...
  var appPath = process.cwd();
  var pathToSails = path.resolve(appPath, '/node_modules/sails');
  if (!Sails.isLocalSailsValid(pathToSails, appPath)) {
    // otherwise, use the currently-running instance of Sails
    pathToSails = path.resolve(__dirname, './sails.js');
  }

  console.log();
  log.info('Running app in debug mode...');

  log.info(chalk.grey('( to exit, type ' + '<CTRL>+<C>' + ' )'));
  console.log();

  // Spin up child process for Sails
  Womb.spawn('node', ['--debug', pathToSails, 'lift'].concat(extraArgs), {
    stdio: 'inherit'
  });

};


================================================
FILE: bin/sails-deploy.js
================================================
/**
 * Module dependencies
 */

var path = require('path');
var rconf = require('../lib/app/configuration/rc')();

/**
 * `sails deploy`
 *
 * Deploy the Sails app in the current directory to a hosting provider.
 *
 * @stability 1
 */

module.exports = function() {

  var commands = rconf.commands;
  var deploy = commands && commands.deploy;
  var modulePath = deploy && deploy.module;
  var module;

  // If no module path was specified, bail out
  if (!modulePath) {
    console.error('No module specified for the `deploy` command.');
    console.error('To use `sails deploy`, set a `commands.deploy.module` setting in your .sailsrc file');
    return;
  }

  // Attempt to require the specified module from the project node_modules folder
  try {
    module = require(path.resolve(process.cwd(), 'node_modules', modulePath));
  } catch (unusedErr) { // FUTURE: provide access to error details instead of swallowing
    // If the module couldn't be required, bail out
    console.error('Could not require module at path: ' + modulePath + '.  Please check the path and try again.');
    return;
  }//•

  try {
    // Attempt to run the deploy command
    module({config: rconf}, function(err) {
      // If there were any issues, log them to the console.
      if (err) {
        console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
        console.error('Deployment failed!  Details below:');
        console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
        console.error(err);
      }
    });
  }
  // Chances are we won't catch any errors internal to the deploy command here;
  // this would probably be an error at the top level of the deploy script.
  catch(e) {
    console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
    console.error('Could not run deploy!  Details below:');
    console.error('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
    console.error(e);
  }


};


================================================
FILE: bin/sails-generate.js
================================================
/**
 * Module dependencies
 */

var util = require('util');
var path = require('path');
var assert = require('assert');
var _ = require('@sailshq/lodash');
var CaptainsLog = require('captains-log');
var sailsGen = require('sails-generate');
var package = require('../package.json');
var rconf = require('../lib/app/configuration/rc')();


/**
 * `sails generate`
 *
 * Generate one or more file(s) in our working directory.
 * This runs an appropriate generator.
 *
 * @see http://sailsjs.com/docs/reference/command-line-interface/sails-generate
 */

module.exports = function () {

  // Build initial scope for our call to sails-generate.
  var scope = {
    rootPath: process.cwd(),
    sailsRoot: path.resolve(__dirname, '..'),
    modules: {},
    sailsPackageJSON: package,
  };

  // Mix-in rc config
  // (note that we mix in everything namespaced under `generators` at the top level-
  //  but also that anything at the top level takes precedence)
  _.merge(scope, rconf.generators);
  _.merge(scope, rconf);


  // Get a temporary logger just for use in `sails generate`.
  // > This is so that logging levels are configurable, even when a
  // > Sails app hasn't been loaded yet.
  var log = CaptainsLog(rconf.log);


  // Pass down the original serial args from the CLI.
  // > Note that (A) first, we remove the last arg from commander using `_.initial`,
  // > and then (B) second, we remove ANOTHER arg -- the one representing the
  // > generator type -- in favor of just setting `scope.generatorType`.
  var cliArguments = _.initial(arguments);
  scope.generatorType = cliArguments.shift();
  scope.args = cliArguments;


  // If no generator type was defined, then log the expected usage.
  if (!scope.generatorType) {
    console.log('Usage: sails generate [something]');
    return;
  }
  assert(arguments.length === (scope.args.length + 2), new Error('Consistency violation: Should have trimmed exactly two args.'));

  // Call out to `sails-generate`.
  return sailsGen(scope, {

    // Handle unexpected errors.
    error: function (err) {

      log.error(err);
      return process.exit(1);

    },//</on error :: sailsGen()>

    // Attend to invalid usage.
    invalid: function (err) {

      // If this is an Error, don't bother logging the stack, just log the `.message`.
      // (This is purely for readability.)
      if (_.isError(err)) {
        log.error(err.message);
      }
      else {
        log.error(err);
      }

      return process.exit(1);

    },//</on invalid :: sailsGen()>

    // Enjoy success.
    success: function (){

      // Infer the `outputPath` if necessary/possible.
      if (!scope.outputPath && scope.filename && scope.destDir) {
        scope.outputPath = scope.destDir + scope.filename;
      }

      // Humanize the output path
      var humanizedPath;
      if (scope.outputPath) {
        humanizedPath = ' at ' + scope.outputPath;
      }
      else if (scope.destDir) {
        humanizedPath = ' in ' + scope.destDir;
      }
      else {
        humanizedPath = '';
      }

      // Humanize the module identity
      var humanizedId;
      if (scope.id) {
        humanizedId = util.format(' ("%s")',scope.id);
      }
      else {
        humanizedId = '';
      }

      // If this isn't the "new" generator, and we're not explicitly
      // asked not to, output a final success message.
      if (scope.generatorType !== 'new' && !scope.suppressFinalLog) {

        log.info(util.format(
          'Created a new %s%s%s!',
          scope.generatorType, humanizedId, humanizedPath
        ));

      }

    }//</on success :: sailsGen()>

  });//</sailsGen()>

};


================================================
FILE: bin/sails-inspect.js
================================================
/**
 * Module dependencies
 */

var path = require('path');
var Womb = require('child_process');
var CaptainsLog = require('captains-log');
var chalk = require('chalk');
var Sails = require('../lib/app');


/**
 * `sails inspect`
 *
 * Attach the Node inspector and lift a Sails app.
 * You can then use Node inspector to debug your app as it runs.
 *
 */
module.exports = function(cmd) {

  var extraArgs = cmd.parent.rawArgs.slice(3);

  var log = CaptainsLog();

  // Use the app's local Sails in `node_modules` if one exists
  // But first make sure it'll work...
  var appPath = process.cwd();
  var pathToSails = path.resolve(appPath, '/node_modules/sails');
  if (!Sails.isLocalSailsValid(pathToSails, appPath)) {
    // otherwise, use the currently-running instance of Sails
    pathToSails = path.resolve(__dirname, './sails.js');
  }

  console.log();
  log.info('Running app in inspect mode...');
  if (process.version[1] >= 8) {
    log.info('In Google Chrome, go to chrome://inspect for interactive debugging.');
    log.info('For other options, see the link below.');
  }

  log.info(chalk.grey('( to exit, type ' + '<CTRL>+<C>' + ' )'));
  console.log();

  // Spin up child process for Sails
  Womb.spawn('node', ['--inspect', pathToSails, 'lift'].concat(extraArgs), {
    stdio: 'inherit'
  });

};


================================================
FILE: bin/sails-lift.js
================================================
/**
 * Module dependencies
 */

var nodepath = require('path');
var _ = require('@sailshq/lodash');
var chalk = require('chalk');
var captains = require('captains-log');

var rconf = require('../lib/app/configuration/rc')();
var Sails = require('../lib/app');
var SharedErrorHelpers = require('../errors');



/**
 * `sails lift`
 *
 * Fire up the Sails app in our working directory, using the
 * appropriate version of Sails.
 *
 * > This uses the locally-installed Sails, if available.
 * > Otherwise, it uses the currently-running Sails (which,
 * > 99.9% of the time, is the globally-installed version.)
 *
 * @stability 3
 * @see http://sailsjs.com/documentation/reference/command-line-interface/sails-lift
 */

module.exports = function() {

  // Get a temporary logger just for use in `sails lift`.
  // > This is so that logging levels are configurable, even when a
  // > Sails app hasn't been loaded yet.
  var cliLogger = captains(rconf.log);

  console.log();
  cliLogger.info(chalk.grey('Starting app...'));
  console.log();

  // Now grab our dictionary of configuration overrides to pass in
  // momentarily when we lift (or load) our Sails app.  This is the
  // dictionary of configuration settings built from `.sailsrc` file(s),
  // command-line options, and environment variables.
  // (No need to clone, since it's not being used anywhere else)
  var configOverrides = rconf;

  // Determine whether to use the local or global Sails install.
  var sailsApp = (function _determineAppropriateSailsAppInstance(){

    // Use the app's locally-installed Sails dependency (in `node_modules/sails`),
    // assuming it's extant and valid.
    // > Note that we always assume the current working directory to be the
    // > root directory of the app.
    var appPath = process.cwd();
    var localSailsPath = nodepath.resolve(appPath, 'node_modules/sails');
    if (Sails.isLocalSailsValid(localSailsPath, appPath)) {
      cliLogger.verbose('Using locally-installed Sails.');
      cliLogger.silly('(which is located at `'+localSailsPath+'`)');
      return require(localSailsPath);
    }// --•

    // Otherwise, since no workable locally-installed Sails exists,
    // run the app using the currently running version of Sails.
    // > This is probably always the global install.
    cliLogger.info('No local Sails install detected; using globally-installed Sails.');

    return Sails();

  })();

  // Lift (or load) Sails
  (function _loadOrLift(proceed){

    // If `--dontLift` was set, then use `.load()` instead.
    if (!_.isUndefined(configOverrides.dontLift)) {
      sailsApp.load(configOverrides, proceed);
    }
    // Otherwise, go with the default behavior (`.lift()`)
    else {
      sailsApp.lift(configOverrides, proceed);
    }

  })(function afterwards(err){// ~∞%°
    if (err) {
      return SharedErrorHelpers.fatal.failedToLoadSails(err);
    }// --•

    // If we made it here, the app is all lifted and ready to go.
    // The server will lower when the process is terminated-- either by a signal,
    // or via an uncaught fatal error.

  });//</after lifting or loading Sails app>

};


================================================
FILE: bin/sails-migrate.js
================================================
/**
 * Module dependencies
 */

var nodepath = require('path');
var _ = require('@sailshq/lodash');
var captains = require('captains-log');
var rconf = require('../lib/app/configuration/rc')();
var Sails = require('../lib/app');
var SharedErrorHelpers = require('../errors');



/**
 * `sails migrate`
 *
 * Load (but don't lift) the Sails app in our working directory, using the
 * appropriate version of Sails, and skipping the Grunt hook.  Then run the
 * app's bootstrap function, and simply exit.
 *
 * (Useful for quickly running auto-migrations by hand.)
 *
 * > This uses the locally-installed Sails, if available.
 * > Otherwise, it uses the currently-running Sails (which,
 * > 99.9% of the time, is the globally-installed version.)
 *
 * Example usage:
 * ```
 * # Run "alter" auto-migrations to attempt to adjust all data
 * # (but possibly delete it)
 * sails migrate
 *
 * # Run "drop" auto-migrations to wipe all data
 * sails migrate --drop
 * ```
 *
 * @stability EXPERIMENTAL
 * @see http://sailsjs.com/documentation/reference/command-line-interface/sails-migrate
 */

module.exports = function() {

  // Get a temporary logger just for use in this file.
  // > This is so that logging levels are configurable, even when a
  // > Sails app hasn't been loaded yet.
  var cliLogger = captains(rconf.log);

  cliLogger.warn('`sails migrate` is currently experimental.');

  // Now grab our dictionary of configuration overrides to pass in
  // momentarily when we lift (or load) our Sails app.  This is the
  // dictionary of configuration settings built from `.sailsrc` file(s),
  // command-line options, and environment variables.
  // (No need to clone, since it's not being used anywhere else)
  var configOverrides = rconf;

  // Determine whether to use the local or global Sails install.
  var sailsApp = (function _determineAppropriateSailsAppInstance(){

    // Use the app's locally-installed Sails dependency (in `node_modules/sails`),
    // assuming it's extant and valid.
    // > Note that we always assume the current working directory to be the
    // > root directory of the app.
    var appPath = process.cwd();
    var localSailsPath = nodepath.resolve(appPath, 'node_modules/sails');
    if (Sails.isLocalSailsValid(localSailsPath, appPath)) {
      cliLogger.verbose('Using locally-installed Sails.');
      cliLogger.silly('(which is located at `'+localSailsPath+'`)');
      return require(localSailsPath);
    }// --•

    // Otherwise, since no workable locally-installed Sails exists,
    // run the app using the currently running version of Sails.
    // > This is probably always the global install.
    cliLogger.info('No local Sails install detected; using globally-installed Sails.');

    return Sails();

  })();//†


  // Skip the grunt hook.
  // (Note that we can't really use `sails.config.loadHooks` because we don't
  // know what kinds of stuff you might be relying on in your bootstrap function.)
  //
  // > FUTURE: if no orm hook actually installed, then fail with an error
  // > explaining you can't really run auto-migrations without that.
  configOverrides = _.extend(_.clone(configOverrides), {
    hooks: _.extend(configOverrides.hooks||{}, {
      grunt: false
    }),
  });

  // Load the Sails app
  sailsApp.load(configOverrides, function(err) {
    if (err) {
      return SharedErrorHelpers.fatal.failedToLoadSails(err);
    }// --•

    // Run the app bootstrap
    sailsApp.runBootstrap(function afterBootstrap(err) {
      if (err) {
        sailsApp.log.error('Bootstrap function encountered an error during `sails migrate`: (see below)');
        sailsApp.log.error(err);
        return;
      }// --•

      // Tear down the Sails app
      sailsApp.lower();

    });//_∏_. </after running bootstrap>

  });//_∏_  </after loading Sails app>

};


================================================
FILE: bin/sails-new.js
================================================
/**
 * Module dependencies
 */

var nodepath = require('path');
var _ = require('@sailshq/lodash');
var sailsgen = require('sails-generate');
var CaptainsLog = require('captains-log');
var package = require('../package.json');
var rconf = require('../lib/app/configuration/rc')();


/**
 * `sails new`
 *
 * Generate a new Sails app.
 *
 * ```
 * # In the current directory:
 * sails new
 * ```
 *
 * ```
 * # As a new directory or within an existing directory:
 * sails new foo
 * ```
 *
 * @stability 3
 * @see http://sailsjs.com/documentation/reference/command-line-interface/sails-new
 * ------------------------------------------------------------------------
 * This command builds `scope` for the generator by scooping up any available
 * configuration using `rc` (merging config from env vars, CLI opts, and
 * relevant `.sailsrc` files).  Then it runs the `sails-generate-new`
 * generator (https://github.com/balderdashy/sails-generate-new).
 */

module.exports = function () {

  // Build initial scope
  var scope = {
    rootPath: process.cwd(),
    modules: {},
    sailsRoot: nodepath.resolve(__dirname, '..'),
    sailsPackageJSON: package,
    viewEngine: rconf.viewEngine
  };

  // Support --template option for backwards-compat.
  if (!scope.viewEngine && rconf.template) {
    scope.viewEngine = rconf.template;
  }

  // Mix-in rconf
  _.merge(scope, rconf.generators);

  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  // FUTURE: Verify that we can just do a top-level merge here,
  // and then reference `scope.generators.modules` as needed
  // (would be simpler- but would be a breaking change, though
  // unlikely to affect most people.  The same issue exists in
  // other places where we read rconf and then call out to
  // sails-generate)
  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  _.merge(scope, rconf);

  // Get a temporary logger just for use in `sails new`.
  // > This is so that logging levels are configurable, even when a
  // > Sails app hasn't been loaded yet.
  var log = CaptainsLog(rconf.log);

  // Pass the original CLI arguments down to the generator
  // (but first, remove commander's extra argument)
  var cliArguments = Array.prototype.slice.call(arguments);
  cliArguments.pop();
  scope.args = cliArguments;

  scope.generatorType = 'new';

  return sailsgen(scope, {
    // Handle unexpected errors.
    error: function (err) {

      log.error(err);
      return process.exit(1);

    },//</on error :: sailsGen()>

    // Attend to invalid usage.
    invalid: function (err) {

      // If this is an Error, don't bother logging the stack, just log the `.message`.
      // (This is purely for readability.)
      if (_.isError(err)) {
        log.error(err.message);
      }
      else {
        log.error(err);
      }

      return process.exit(1);

    },//</on invalid :: sailsGen()>
    success: function() {
      // Good to go.
    }
  });
};


================================================
FILE: bin/sails-run.js
================================================
/**
 * Module dependencies
 */

var path = require('path');
var fs = require('fs');
var _ = require('@sailshq/lodash');
var chalk = require('chalk');
var COMMON_JS_FILE_EXTENSIONS = require('common-js-file-extensions');
var flaverr = require('flaverr');
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Note that `whelk`, `machinepack-process`, and `../lib/app` are
// conditionally required below, only in the cases where they are actually used.
// (That way you don't have to wait for them to load if you're not using them.)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


/**
 * Module constants
 */

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Supported file extensions for imperative code files such as hooks:
//  • 'js' (.js)
//  • 'ts' (.ts)
//  • 'es6' (.es6)
//  • ...etc.
//
// > For full list, see:
// > https://github.com/luislobo/common-js-file-extensions/blob/210fd15d89690c7aaa35dba35478cb91c693dfa8/README.md#code-file-extensions
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var BASIC_SUPPORTED_FILE_EXTENSIONS = COMMON_JS_FILE_EXTENSIONS.code;


/**
 * `sails run`
 *
 * Run a script for the Sails app in the current working directory.
 *
 * This matches either a JavaScript file in the `scripts/` directory, or one of the command-line scripts
 * declared within the `scripts: {}` dictionary in the package.json file.
 *
 * @see https://sailsjs.com/documentation/reference/command-line-interface/sails-run
 */

module.exports = function(scriptName) {

  // If there is only one argument, it means there is actually no scriptName at all.
  // (A detail of how commander works.)
  if (arguments.length === 1) {
    scriptName = undefined;
  }

  // Sanitize the script name, for comfort.
  if (!scriptName) {
    console.error('Which one?  (To run a script, provide its name.)');
    console.error('For example:');
    console.error('    sails run rebuild-cloud-sdk');
    console.error();
    console.error('^ runs `scripts/rebuild-cloud-sdk.js`.');
    console.error();
    console.error('(For more help, visit '+chalk.underline('https://sailsjs.com/support')+'.)');
    return process.exit(1);
  }

  // Remove `scripts/` prefix if it exists (allows users to do sails run scripts/foo, so they can use tab autocomplete).
  scriptName = _.trim(scriptName);
  scriptName = scriptName.replace(/^scripts\//, '');

  // Unless the script name is under a "scope" (as in `@sailshq/some-package`), don't allow slashes in the name.
  if (scriptName.match(/\//) && scriptName[0] !== '@') {
    // FUTURE: Do allow this so scripts can be nested in subdirectories  (doesn't work for package.json scripts obviously)
    console.error('Cannot run `'+scriptName+'`.  Script name should never contain any slashes.');
    return process.exit(1);
  }//-•

  // Examine the script name and determine if it has a file extension included.
  // If so, we'll rip it out of the script name, but keep a reference to it.
  // Otherwise, we'll always assume that we're looking for a normal `.js` file.
  var X_BASIC_SUPPORTED_FILE_EXTENSION = new RegExp('^([^.]+)\\.(' + BASIC_SUPPORTED_FILE_EXTENSIONS.join('|') + ')$');
  var matchedFileExtension = scriptName.match(X_BASIC_SUPPORTED_FILE_EXTENSION);
  var fileExtension;
  if (matchedFileExtension) {
    fileExtension = matchedFileExtension[2];
    scriptName = scriptName.replace(X_BASIC_SUPPORTED_FILE_EXTENSION, '$1');
  }
  else {
    fileExtension = 'js';
  }


  // First, we need to determine the appropriate script to run.
  // (either a terminal command or a specially-formatted Node.js/Sails.js module)

  // We begin by figuring out whether this is a script from the package.json
  // or a definition in the `scripts/` folder.
  var pjCommandToRun;

  // Check the package.json file.
  try {
    var pathToLocalPj = path.resolve(process.cwd(), 'package.json');
    var packageJson;
    try {
      packageJson = require(pathToLocalPj);
    } catch (e) {
      switch (e.code) {
        case 'MODULE_NOT_FOUND': throw flaverr('E_NO_PACKAGE_JSON', new Error('No package.json file.  Are you sure you\'re in the root directory of a Node.js/Sails.js app?'));
        default: throw e;
      }
    }

    if (!_.isUndefined(packageJson.scripts) && (!_.isObject(packageJson.scripts) || _.isArray(packageJson.scripts))) {
      throw flaverr('E_MALFORMED_PACKAGE_JSON', new Error('This package.json file has an invalid `scripts` property -- should be a dictionary (plain JS object).'));
    }

    pjCommandToRun = packageJson.scripts[scriptName];

  } catch (e) {
    switch (e.code) {
      case 'E_NO_PACKAGE_JSON':
      case 'E_MALFORMED_PACKAGE_JSON':
        console.error('--');
        console.error(chalk.red(e.message));
        return process.exit(1);

      default:
        console.error('--');
        console.error(chalk.bold('Oops, something unexpected happened:'));
        console.error(chalk.red(e.stack));
        console.error('--');
        console.error('Please read the error message above and troubleshoot accordingly.');
        console.error('(You can report suspected bugs at '+chalk.underline('http://sailsjs.com/bugs')+'.)');
        return process.exit(1);
    }
  }


  // Now check both the `scripts/` directory and node_modules to see if a matching script exists.
  var relativePathToAppScript = 'scripts/'+scriptName+'.'+fileExtension;
  var relativePathToInstalledScript = (function(){
    // Handle scripts organized under org subdirectories in node_modules.
    var installedScriptName = scriptName;
    var org = '';
    if (scriptName[0] === '@') {
      org = scriptName.split('/')[0] + '/';
      installedScriptName = scriptName.split('/')[1];
    }
    installedScriptName = installedScriptName.replace(/^sails-run-/,'');
    return 'node_modules/' + org + 'sails-run-'+installedScriptName;
  })();

  var installedScriptExists = fs.existsSync(path.resolve(relativePathToInstalledScript));
  var appScriptExists = fs.existsSync(path.resolve(relativePathToAppScript));
  var doesScriptFileExist = appScriptExists || installedScriptExists;

  // Ensure that this script is not defined in BOTH places.
  if (pjCommandToRun && doesScriptFileExist) {
    console.error('Cannot run `'+scriptName+'` because it is too ambiguous.');
    console.error('A script should only be defined once, but that script is defined in both the package.json file');
    console.error('AND as a file in the `scripts/` directory.');
    return process.exit(1);
  }

  // Ensure that this script exists one place or the other.
  if (!pjCommandToRun && !doesScriptFileExist) {
    console.error('Unknown script: `'+scriptName+'`');
    console.error('No matching script is defined at `'+relativePathToAppScript+'`.');
    console.error('(And there is no matching NPM script in the package.json file.)');
    return process.exit(1);
  }


  // If this is a Node.js/Sails.js script (machine def), then require the script file
  // to get the module definition, then run it using MaS.
  if (!pjCommandToRun) {
    try {
      var pathToScriptDef = path.resolve(process.cwd(), appScriptExists ? relativePathToAppScript : relativePathToInstalledScript);
      var scriptDef;
      try {
        scriptDef = require(pathToScriptDef);
      } catch (e) {
        switch (e.code) {
          case 'MODULE_NOT_FOUND': throw flaverr('E_FAILED_TO_REQUIRE_SCRIPT_DEF', new Error('Encountered an error while loading the script definition.  Are you sure this is a well-formed Node.js/Sails.js script definition?  Error details:\n'+e.stack));
          default: throw e;
        }
      }

      // Make sure the script is at least basically valid.
      // (MaS will check it more later -- this is just preliminary -- and also to make sure that it's not `{}`,
      // the special indicator that the script definition didn't export _ANYTHING_ at all.)
      if (!_.isObject(scriptDef) || _.isArray(scriptDef) || _.isEqual(scriptDef, {})) {
        console.error('');
        console.error('');
        console.error('Invalid script: `'+scriptName+'`');
        console.error('');
        console.error('A well-formed Node.js/Sails.js script should export a script definition.');
        console.error('In other words, it should be defined more or less like this:');
        console.error('');
        console.error('    ```````````````````````````````````````````````````````````');
        console.error('    module.exports = {');
        console.error('      description: \'Do a thing given some stuff.\',');
        console.error('      inputs: {');
        console.error('        someStuff: { type: \'string\', required: true }');
        console.error('      },');
        console.error('      fn: async function (inputs, exits) {');
        console.error('        // ...');
        console.error('        sails.log(\'Hello world!\');');
        console.error('        return exits.success();');
        console.error('      }');
        console.error('    };');
        console.error('    ```````````````````````````````````````````````````````````');
        console.error('');
        console.error(' [?] Visit https://sailsjs.com/support for assistance.');
        console.error('');
        return process.exit(1);
      }

      // Modify the script definition to add `sails: require('sails')` and `habitat: 'sails'`
      // (unless it explicitly disables this behavior with `sails: false` or by explicitly
      // declaring some other habitat)
      var isLifecycleMgmtExplicitlyDisabled = (
        scriptDef.sails === false ||
        (scriptDef.habitat !== undefined && scriptDef.habitat !== 'sails')
      );
      if (!isLifecycleMgmtExplicitlyDisabled) {
        // (Only require the rest of the Sails framework if it's needed.)
        var Sails = require('../lib/app');
        scriptDef.habitat = 'sails';
        scriptDef.sails = Sails();
      }

      // (Only require whelk if it's needed.)
      var whelk = require('whelk');

      // console.log('process.argv ->', require('util').inspect(process.argv,{depth:null}));
      // console.log('arguments ->', require('util').inspect(arguments,{depth:null}));
      // console.log('scriptName ->', scriptName);
      // console.log('Array.prototype.slice.call(arguments, 1, -1) ->', Array.prototype.slice.call(arguments, 1, -1));

      // Pass in override for runtime array of serial command-line arguments
      // (we rely on commander having parsed them for us so that we don't include `sails`, `run`, `node`, etc)
      scriptDef.rawSerialCommandLineArgs = Array.prototype.slice.call(arguments, 1, -1);

      // Now actually run the script.
      whelk(scriptDef);

    } catch (err) {
      console.error(err);
      return process.exit(1);
    }
  }
  // Otherwise, this is an NPM script of some kind, from the package.json file.
  else {


    // So execute the command like you would on the terminal.

    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // FUTURE: Consider pulling this boilerplate setup code into spawnChildProcess() machine
    // as a way of leveraging a subshell to remove the need to pass in CLI args directly.
    // Maybe as an option at least.
    //
    // > Also, we should also consider adding a notifier function to optionally provide
    // > special instructions of what to do when the current (parent) process receives a SIGINT.
    // > (Otherwise, by default, the SIGINT behavior implemented below could be used instead.)
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    //
    // -AND/OR-
    //
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // FUTURE: Consider exposing an optional `onData` input to the more basic `executeCommand()`
    // machine.  That way, you can just pass in a notifier function that handles the child's
    // writes to its stdout and stderr streams without having to dig into all of these
    // annoying complexities.  Also, it'd then be possible to add another input: a flag that
    // allows you to choose whether or not to store output and pass it to the callback
    // (e.g. `bufferOutput`).
    //
    // > Finally, we should also consider adding the same SIGINT notifier function mentioned above.
    //
    // Here's an example of how we might put it all together:
    // ```
    // Process.executeCommand({
    //   command: pjCommandToRun,
    //   bufferOutput: false,
    //   killOnParentSigint: false,
    //   onData: function (data, stdStreamName){
    //     process[stdStreamName].write(data);
    //   }
    // }).exec(function (err) {
    //   if (err) {
    //     console.error('Error occurred running `'+ pjCommandToRun+ '`');
    //     console.error('Please resolve any issues and try `sails run '+scriptName+'` again.');
    //     console.error('Details:');
    //     console.error(err);
    //     return process.exit(1);
    //   }//-•
    //
    //   return process.exit(0);
    // });//< Process.executeCommand().exec() > _∏_
    // ```
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    // (Only require machinepack-process if it's needed.)
    var Process = require('machinepack-process');

    // Determine an appropriate name for our shell.
    // > This is mainly just so we don't have to try and do any fancy parsing of the command,
    // > allowing for more platform-specific customization.  (Mirroring the NPM CLI here)
    var shProcName;
    var shFlag;
    if (process.platform === 'win32') {
      shProcName = process.env.comspec || 'cmd';
      shFlag = '/d /s /c';
    }
    else {
      shProcName = 'sh';
      shFlag = '-c';
    }

    var childProcess = Process.spawnChildProcess({
      command: shProcName,
      cliArgs: [ shFlag, pjCommandToRun ]
    }).now();

    // Pipe output from the child process to the current (parent) process.
    childProcess.stdout.pipe(process.stdout);
    childProcess.stderr.pipe(process.stderr);

    // Set up CTRL+C listener on the parent process that will force-kill this child process.
    // (Note that we define the event listener as a named function so we can unbind it below.)
    var onSigTerm = function (){
      Process.killChildProcess({ childProcess: childProcess, force: true }).exec(function (_forceKillErr){
        if (_forceKillErr) {
          console.error('There was a problem terminating this script:\n'+_forceKillErr.stack+'\nHere are some details which might be helpful:\n' + _forceKillErr.stack);
        }
      });
    };
    process.once('SIGTERM', onSigTerm);


    var spinlocked;
    (function (proceed){

      childProcess.on('error', function (err) { return proceed(err); });
      childProcess.stderr.on('error', function (err) { return proceed(err); });
      childProcess.stdout.on('error', function (err) { return proceed(err); });
      childProcess.on('close', function (code, signal) {
        // log.silly('lifecycle', logid(pkg, stage), 'Returned: code:', code, ' signal:', signal)
        // If a signal was received, terminate the current parent process (i.e. `sails run`).
        if (signal) {
          // Note that, in this case, `proceed()` is never called.
          // (But it doesn't actually matter, because we'll have killed the process.)
          return process.kill(process.pid, signal);
        }

        // Otherwise if we got a non-zero exit code, then consider this an error.
        if (code !== 0) {
          return proceed(new Error('Exit status '+code));
        }

        // Otherwise, consider it a success.
        return proceed();
      });

    })(function(err){
      if (err) {

        if (spinlocked) {
          console.error(err);
          return;
        }
        spinlocked = true;

        console.error('- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ');
        console.error('Error occurred running `'+ pjCommandToRun+ '`');
        console.error('Please resolve any issues and try `sails run '+scriptName+'` again.');
        console.error('Details:');
        console.error(err);

        process.removeListener('SIGTERM', onSigTerm);
        return process.exit(1);
      }//-•

      return process.exit(0);

    });//_∏_  (†)

  }//</ else >

};



================================================
FILE: bin/sails-upgrade.js
================================================
/**
 * Module dependencies
 */

var path = require('path');
var chalk = require('chalk');
var _ = require('@sailshq/lodash');
var sailsgen = require('sails-generate');
var flaverr = require('flaverr');
var semver = require('semver');
var rconf = require('../lib/app/configuration/rc')();


/**
 * `sails upgrade`
 *
 * Upgrade a pre v1.0.x app to Sails v1.0.x.
 *
 * ```
 * # In the root directory of your Sails app:
 * sails upgrade
 * ```
 */

module.exports = function () {

  if (!rconf.reportOnly) {

    console.log(chalk.gray('Checking compatibility for Sails v1.0 upgrade...'));

    try {
      var packageJson;
      try {
        var pathToLocalPackageJson = path.resolve(process.cwd(), 'package.json');
        packageJson = require(pathToLocalPackageJson);
      } catch (e) {
        switch (e.code) {
          case 'MODULE_NOT_FOUND': throw flaverr('E_NO_PACKAGE_JSON', new Error('No package.json file.  Are you sure you\'re in the root directory of a Sails app?'));
          default: throw e;
        }
      }

      if (_.isUndefined(packageJson.dependencies)) {
        throw flaverr('E_NO_SAILS_DEP', new Error('This package.json file does not declare any dependencies.  Are you sure you\'re in the root directory of a Sails app?'));
      }

      if (!_.isObject(packageJson.dependencies) || _.isArray(packageJson.dependencies)) {
        throw flaverr('E_NO_SAILS_DEP', new Error('This package.json file has an invalid `dependencies` property -- should be a dictionary (plain JS object).'));
      }

      var sailsDepSVR = packageJson.dependencies.sails;
      if (!sailsDepSVR) {
        throw flaverr('E_NO_SAILS_DEP', new Error('This package.json file does not declare `sails` as a dependency.  Are you sure you\'re in the root directory of a Sails app?'));
      }

      if (!semver.ltr('0.9.9999', sailsDepSVR)) {
        throw flaverr('E_SAILS_DEP_DEFINITELY_TOO_OLD', new Error('this app depends on sails@'+sailsDepSVR+'.'));
      }

      if (!semver.ltr('0.11.9999', sailsDepSVR)) {
        throw flaverr('E_SAILS_DEP_MIGHT_BE_TOO_OLD', new Error('this app depends on sails@'+sailsDepSVR+'.'));
      }

      // if (semver.ltr('0.12.9999', sailsDepSVR)) {
      //   throw flaverr('E_SAILS_DEP_IS_ALREADY_V1', new Error('this app already depends on sails@'+sailsDepSVR+'...'));
      // }

      console.log();
      console.log('----------------------------------------------------');
      console.log('This utility will kickstart the process of migrating');
      console.log('this Sails v0.12.x app to Sails v1.');
      console.log('----------------------------------------------------');
      console.log();

    } catch (e) {
      switch (e.code) {
        case 'E_SAILS_DEP_IS_ALREADY_V1':
          console.log();
          console.log('----------------------------------------------------');
          console.log('This utility is designed to kickstart the process of');
          console.log('migrating a '+chalk.bold('v0.12.x')+' app to Sails v1.');
          console.log();
          console.log(chalk.yellow.bold('But '+e.message));
          console.log(chalk.reset('Maybe you already started upgrading it?'));
          console.log(chalk.reset('If so, then please press CTRL+C to cancel now, or'));
          console.log(chalk.reset('otherwise feel free to proceed with care-- this'));
          console.log(chalk.reset('upgrade tool may still work partially as-is.'));
          console.log(chalk.gray('For more help, visit '+chalk.underline('http://sailsjs.com/support')+'.'));
          console.log('----------------------------------------------------');
          console.log();
          break;

        case 'E_SAILS_DEP_MIGHT_BE_TOO_OLD':
          console.log();
          console.log('----------------------------------------------------');
          console.log('This utility is designed to kickstart the process of');
          console.log('migrating a '+chalk.bold('v0.12.x')+' app to Sails v1.');
          console.log();
          console.log(chalk.yellow.bold('But '+e.message));
          console.log(chalk.reset('This upgrade tool may partially work as-is, but we recommend'));
          console.log(chalk.reset('using the appropriate guide(s) to upgrade to Sails v0.12 first.'));
          console.log(chalk.reset('See '+chalk.underline('http://sailsjs.com/upgrading')+' for details.'));
          console.log(chalk.gray('(Press CTRL+C to cancel -- or proceed at your own risk!)'));
          console.log('----------------------------------------------------');
          console.log();
          break;

        case 'E_SAILS_DEP_DEFINITELY_TOO_OLD':
          console.log('--');
          console.log(chalk.red.bold('Well, '+e.message));
          console.log(chalk.reset('It looks to be built for a version of Sails that is probably too'));
          console.log(chalk.reset('old to work with this upgrade tool as-is.  We recommend using'));
          console.log(chalk.reset('the appropriate guide(s) to upgrade to Sails v0.12 first.'));
          console.log(chalk.gray('For more assistance, visit '+chalk.underline('http://sailsjs.com/support')+' or, if'));
          console.log(chalk.gray('you\'re using Sails Flagship, '+chalk.underline('https://flagship.sailsjs.com')+'.'));
          return process.exit(1);

        case 'E_NO_PACKAGE_JSON':
        case 'E_NO_SAILS_DEP':
          console.log('--');
          console.log(chalk.red(e.message));
          return process.exit(1);

        default:
          console.log('--');
          console.log(chalk.bold('Oops, something unexpected happened:'));
          console.log(chalk.red(e.stack));
          console.log('--');
          console.log('Please read the error message above and troubleshoot accordingly.');
          console.log('(You can report suspected bugs at '+chalk.underline('http://sailsjs.com/bugs')+'.)');
          return process.exit(1);
      }
    }

  }


  // Attempt to require the upgrade tool.
  var generator;
  try {
    var requirePath = path.resolve(process.cwd(), 'node_modules/@sailshq/upgrade');
    generator = require(requirePath);
  } catch (e) {

    if (e.code === 'MODULE_NOT_FOUND') {
      console.log(chalk.blue.bold('Could not find the `@sailshq/upgrade` package in your local app folder.'));
      console.log('Please run `npm install @sailshq/upgrade` and try again.');
      console.log(chalk.gray('(Or just use the Sails v1.0.x upgrade guide on sailsjs.com.)'));
      console.log();
      return process.exit(1);
    }//-•

    // Some other unexpected error from within this package:
    console.log(chalk.bold('Oops, something unexpected happened:'));
    console.log(chalk.red(e.stack));
    console.log('--');
    console.log('Please report this bug at '+chalk.underline('https://flagship.sailsjs.com')+'.');
    process.exit(1);

  }//</catch>


  // Build initial scope
  var scope = {
    rootPath: process.cwd(),
    sailsRoot: path.resolve(__dirname, '..'),
    generatorType: 'upgrade',
    modules: { upgrade: generator },
  };

  // Mix-in rconf
  _.merge(scope, rconf.generators);

  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  // FUTURE: Verify that we can just do a top-level merge here,
  // and then reference `scope.generators.modules` as needed
  // (would be simpler- but would be a breaking change, though
  // unlikely to affect most people.  The same issue exists in
  // other places where we read rconf and then call out to
  // sails-generate)
  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  _.merge(scope, rconf);

  // Pass the original CLI arguments down to the generator
  // (but first, remove commander's extra argument)
  var cliArguments = Array.prototype.slice.call(arguments);
  cliArguments.pop();
  scope.args = cliArguments;

  return sailsgen(scope, {
    // Handle unexpected errors.
    error: function (err) {
      console.log(chalk.bold('Oops, something unexpected happened:'));
      console.log(chalk.red(err.stack));
      console.log('--');
      console.log('Please report this bug at '+chalk.underline('https://flagship.sailsjs.com')+'.');
      return process.exit(1);

    },//</on error :: sailsGen()>

    // Attend to invalid usage.
    invalid: function (err) {

      // If this is an Error, don't bother logging the other details, just log the `.message`.
      // (This is purely for readability.)
      if (_.isError(err)) {
        console.log(err.message);
      }
      else {
        console.log(err);
      }

      console.log('--');
      console.log('For assistance, visit '+chalk.underline('https://flagship.sailsjs.com')+'.');
      return process.exit(1);

    },//</on invalid :: sailsGen()>
    success: function() {
      // Good to go.
    }
  });
};


================================================
FILE: bin/sails-www.js
================================================
/**
 * Module dependencies
 */

var path = require('path');
var _ = require('@sailshq/lodash');
var CaptainsLog = require('captains-log');
var Process = require('machinepack-process');
var chalk = require('chalk');
var flaverr = require('flaverr');
var rconf = require('../lib/app/configuration/rc')();


/**
 * `sails www`
 *
 * Run the `build` or `buildProd` Grunt task (depending on whether this is the production environment)
 * for the Sails app in the current working directory.
 *
 * @see http://sailsjs.com/documentation/reference/command-line-interface/sails-www
 */

module.exports = function() {

  // Check compatibility
  try {
    var pathToLocalPackageJson = path.resolve(process.cwd(), 'package.json');
    var packageJson;
    try {
      packageJson = require(pathToLocalPackageJson);
    } catch (e) {
      switch (e.code) {
        case 'MODULE_NOT_FOUND': throw flaverr('E_NO_PACKAGE_JSON', new Error('No package.json file.  Are you sure you\'re in the root directory of a Sails app?'));
        default: throw e;
      }
    }

    if (_.isUndefined(packageJson.dependencies)) {
      throw flaverr('E_NO_SAILS_DEP', new Error('This package.json file does not declare any dependencies.  Are you sure you\'re in the root directory of a Sails app?'));
    }

    if (!_.isObject(packageJson.dependencies) || _.isArray(packageJson.dependencies)) {
      throw flaverr('E_NO_SAILS_DEP', new Error('This package.json file has an invalid `dependencies` property -- should be a dictionary (plain JS object).'));
    }

    var sailsDepSVR = packageJson.dependencies.sails;
    if (!sailsDepSVR) {
      throw flaverr('E_NO_SAILS_DEP', new Error('This package.json file does not declare `sails` as a dependency.\nAre you sure you\'re in the root directory of a Sails app?'));
    }

    var shGruntDepSVR = packageJson.dependencies['sails-hook-grunt'] || packageJson.devDependencies['sails-hook-grunt'];
    if (!shGruntDepSVR) {
      throw flaverr('E_NO_SH_GRUNT_DEP', new Error('This app\'s package.json file does not declare `sails-hook-grunt` in "dependencies" or "devDependencies".\nAre you sure this is a Sails v1.0 app that is using Grunt?'));
    }

  } catch (e) {
    switch (e.code) {
      case 'E_NO_PACKAGE_JSON':
      case 'E_NO_SAILS_DEP':
        console.log('--');
        console.log(chalk.red(e.message));
        return process.exit(1);
      case 'E_NO_SH_GRUNT_DEP':
        console.log('--');
        console.log(chalk.red(e.message));
        console.log(chalk.gray('(Maybe try running `npm install sails-hook-grunt --save`?)'));
        return process.exit(1);

      default:
        console.log('--');
        console.log(chalk.bold('Oops, something unexpected happened:'));
        console.log(chalk.red(e.stack));
        console.log('--');
        console.log('Please read the error message above and troubleshoot accordingly.');
        console.log('(You can report suspected bugs at '+chalk.underline('http://sailsjs.com/bugs')+'.)');
        return process.exit(1);
    }
  }



  var log = CaptainsLog(rconf.log);

  // The destination path.
  var wwwPath = path.resolve(process.cwd(), 'www');

  // Determine the appropriate Grunt task to run based on `process.env.NODE_ENV`, `rconf.prod`, and `rconf.environment`.
  var overrideGruntTask;
  if (rconf.prod || rconf.environment === 'production' || process.env.NODE_ENV === 'production') {
    overrideGruntTask = 'buildProd';
  }
  else {
    overrideGruntTask = 'build';
  }
  log.info('Compiling assets into standalone directory with `grunt ' + overrideGruntTask + '`...');

  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  // Execute a command like you would on the ter
Download .txt
gitextract_abogsmgr/

├── .editorconfig
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE
│   └── PULL_REQUEST_TEMPLATE
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── CODE-OF-CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── MODULES.md
├── README.md
├── ROADMAP.md
├── accessible/
│   ├── generate.js
│   └── rc.js
├── appveyor.yml
├── bin/
│   ├── private/
│   │   ├── patched-commander.js
│   │   └── read-repl-history-and-start-transcribing.js
│   ├── sails-console.js
│   ├── sails-debug-console.js
│   ├── sails-debug.js
│   ├── sails-deploy.js
│   ├── sails-generate.js
│   ├── sails-inspect.js
│   ├── sails-lift.js
│   ├── sails-migrate.js
│   ├── sails-new.js
│   ├── sails-run.js
│   ├── sails-upgrade.js
│   ├── sails-www.js
│   └── sails.js
├── docs/
│   ├── PAGE_NEEDED.md
│   ├── README.md
│   ├── anatomy/
│   │   ├── .editorconfig.md
│   │   ├── .eslintignore.md
│   │   ├── .eslintrc.md
│   │   ├── .htmlhintrc.md
│   │   ├── Gruntfile.js.md
│   │   ├── README.md
│   │   ├── README.md.md
│   │   ├── anatomy.md
│   │   ├── api/
│   │   │   ├── api.md
│   │   │   ├── controllers/
│   │   │   │   ├── controllers.md
│   │   │   │   └── gitkeep.md
│   │   │   ├── helpers/
│   │   │   │   ├── .gitkeep.md
│   │   │   │   └── helpers.md
│   │   │   ├── models/
│   │   │   │   ├── .gitkeep.md
│   │   │   │   └── models.md
│   │   │   └── policies/
│   │   │       ├── .gitkeep.md
│   │   │       └── policies.md
│   │   ├── app.js.md
│   │   ├── assets/
│   │   │   ├── .eslintrc.md
│   │   │   ├── assets.md
│   │   │   ├── dependencies/
│   │   │   │   ├── dependencies.md
│   │   │   │   └── sails.io.js.md
│   │   │   ├── favicon.ico.md
│   │   │   ├── images/
│   │   │   │   ├── gitkeep.md
│   │   │   │   └── images.md
│   │   │   ├── js/
│   │   │   │   ├── gitkeep.md
│   │   │   │   └── js.md
│   │   │   ├── styles/
│   │   │   │   ├── importer.less.md
│   │   │   │   └── styles.md
│   │   │   └── templates/
│   │   │       ├── gitkeep.md
│   │   │       └── templates.md
│   │   ├── config/
│   │   │   ├── blueprints.js.md
│   │   │   ├── bootstrap.js.md
│   │   │   ├── config.md
│   │   │   ├── custom.js.md
│   │   │   ├── datastores.js.md
│   │   │   ├── env/
│   │   │   │   ├── env.md
│   │   │   │   └── production.js.md
│   │   │   ├── globals.js.md
│   │   │   ├── http.js.md
│   │   │   ├── i18n.js.md
│   │   │   ├── local.js.md
│   │   │   ├── locales/
│   │   │   │   ├── de.json.md
│   │   │   │   ├── en.json.md
│   │   │   │   ├── es.json.md
│   │   │   │   ├── fr.json.md
│   │   │   │   └── locales.md
│   │   │   ├── log.js.md
│   │   │   ├── models.js.md
│   │   │   ├── policies.js.md
│   │   │   ├── routes.js.md
│   │   │   ├── security.js.md
│   │   │   ├── session.js.md
│   │   │   ├── sockets.js.md
│   │   │   └── views.js.md
│   │   ├── gitignore.md
│   │   ├── package.json.md
│   │   ├── sailsrc.md
│   │   ├── tasks/
│   │   │   ├── config/
│   │   │   │   ├── babel.js.md
│   │   │   │   ├── clean.js.md
│   │   │   │   ├── coffee.js.md
│   │   │   │   ├── concat.js.md
│   │   │   │   ├── config.md
│   │   │   │   ├── copy.js.md
│   │   │   │   ├── cssmin.js.md
│   │   │   │   ├── hash.js.md
│   │   │   │   ├── jst.js.md
│   │   │   │   ├── less.js.md
│   │   │   │   ├── sails-linker.js.md
│   │   │   │   ├── sync.js.md
│   │   │   │   ├── uglify.js.md
│   │   │   │   └── watch.js.md
│   │   │   ├── pipeline.js.md
│   │   │   ├── register/
│   │   │   │   ├── build.js.md
│   │   │   │   ├── buildProd.js.md
│   │   │   │   ├── compileAssets.js.md
│   │   │   │   ├── default.js.md
│   │   │   │   ├── linkAssets.js.md
│   │   │   │   ├── linkAssetsBuild.js.md
│   │   │   │   ├── linkAssetsBuildProd.js.md
│   │   │   │   ├── polyfill.js.md
│   │   │   │   ├── prod.js.md
│   │   │   │   ├── register.md
│   │   │   │   └── syncAssets.js.md
│   │   │   └── tasks.md
│   │   └── views/
│   │       ├── .eslintrc.md
│   │       ├── 404.ejs.md
│   │       ├── 500.ejs.md
│   │       ├── layouts/
│   │       │   ├── layout.ejs.md
│   │       │   └── layouts.md
│   │       ├── pages/
│   │       │   ├── homepage.ejs.md
│   │       │   └── pages.md
│   │       └── views.md
│   ├── concepts/
│   │   ├── ActionsAndControllers/
│   │   │   ├── ActionsAndControllers.md
│   │   │   ├── GeneratingActions.md
│   │   │   └── RoutingToActions.md
│   │   ├── Assets/
│   │   │   ├── Assets.md
│   │   │   ├── DefaultTasks.md
│   │   │   ├── DisablingGrunt.md
│   │   │   └── TaskAutomation.md
│   │   ├── Blueprints/
│   │   │   ├── Blueprint Actions.md
│   │   │   ├── Blueprint Routes.md
│   │   │   └── Blueprints.md
│   │   ├── Configuration/
│   │   │   ├── Configuration.md
│   │   │   ├── localjsfile.md
│   │   │   └── usingsailsrcfiles.md
│   │   ├── Deployment/
│   │   │   ├── Deployment.md
│   │   │   ├── FAQ.md
│   │   │   ├── Hosting.md
│   │   │   └── Scaling.md
│   │   ├── E-commerce/
│   │   │   └── E-commerce.md
│   │   ├── File Uploads/
│   │   │   ├── File Uploads.md
│   │   │   ├── uploading-to-amazon-s3.md
│   │   │   └── uploading-to-mongo-gridfs.md
│   │   ├── Globals/
│   │   │   ├── DisablingGlobals.md
│   │   │   └── Globals.md
│   │   ├── Helpers/
│   │   │   ├── ExampleHelper.md
│   │   │   └── Helpers.md
│   │   ├── Internationalization/
│   │   │   ├── Internationalization.md
│   │   │   ├── Locales.md
│   │   │   └── TranslatingDynamicContent.md
│   │   ├── Logging/
│   │   │   ├── Custom log messages.md
│   │   │   └── Logging.md
│   │   ├── Middleware/
│   │   │   ├── ConventionalDefaults.md
│   │   │   └── Middleware.md
│   │   ├── ORM/
│   │   │   ├── Associations/
│   │   │   │   ├── Associations.md
│   │   │   │   ├── ManytoMany.md
│   │   │   │   ├── OneWayAssociation.md
│   │   │   │   ├── OnetoMany.md
│   │   │   │   ├── OnetoOne.md
│   │   │   │   ├── Reflexive.md
│   │   │   │   └── ThroughAssociations.md
│   │   │   ├── Attributes.md
│   │   │   ├── Lifecyclecallbacks.md
│   │   │   ├── Models.md
│   │   │   ├── ORM.md
│   │   │   ├── Querylanguage.md
│   │   │   ├── Records.md
│   │   │   ├── Validations.md
│   │   │   ├── errors.md
│   │   │   ├── model-settings.md
│   │   │   └── standalone-usage.md
│   │   ├── Policies/
│   │   │   ├── Permissions.md
│   │   │   └── Policies.md
│   │   ├── Programmatic Usage/
│   │   │   ├── Programmatic Usage.md
│   │   │   └── Tips and Tricks.md
│   │   ├── README.md
│   │   ├── Realtime/
│   │   │   ├── Multi-server environments.md
│   │   │   ├── On the client.md
│   │   │   ├── On the server.md
│   │   │   └── Realtime.md
│   │   ├── Routes/
│   │   │   ├── RouteTargetSyntax.md
│   │   │   └── Routes.md
│   │   ├── Security/
│   │   │   ├── CORS.md
│   │   │   ├── CSRF.md
│   │   │   ├── Clickjacking.md
│   │   │   ├── ContentSecurityPolicy.md
│   │   │   ├── DDOS.md
│   │   │   ├── P3P.md
│   │   │   ├── Security.md
│   │   │   ├── SocketHijacking.md
│   │   │   ├── StrictTransportSecurity.md
│   │   │   └── XSS.md
│   │   ├── Services/
│   │   │   └── Services.md
│   │   ├── Sessions/
│   │   │   └── sessions.md
│   │   ├── Testing/
│   │   │   └── Testing.md
│   │   ├── Views/
│   │   │   ├── Layouts.md
│   │   │   ├── Locals.md
│   │   │   ├── Partials.md
│   │   │   ├── ViewEngines.md
│   │   │   └── Views.md
│   │   ├── concepts.md
│   │   ├── extending-sails/
│   │   │   ├── Adapters/
│   │   │   │   ├── Adapters.md
│   │   │   │   ├── adapterList.md
│   │   │   │   └── customAdapters.md
│   │   │   ├── Custom Responses/
│   │   │   │   ├── AddingCustomResponse.md
│   │   │   │   └── Custom Responses.md
│   │   │   ├── Generators/
│   │   │   │   ├── Generators.md
│   │   │   │   ├── customGenerators.md
│   │   │   │   └── generatorList.md
│   │   │   ├── Hooks/
│   │   │   │   ├── Hooks.md
│   │   │   │   ├── available-hooks.md
│   │   │   │   ├── events.md
│   │   │   │   ├── hookspec/
│   │   │   │   │   ├── configure.md
│   │   │   │   │   ├── defaults.md
│   │   │   │   │   ├── hookspec.md
│   │   │   │   │   ├── initialize.md
│   │   │   │   │   ├── register-actions.md
│   │   │   │   │   └── routes.md
│   │   │   │   ├── installablehooks.md
│   │   │   │   ├── projecthooks.md
│   │   │   │   └── usinghooks.md
│   │   │   └── extending-sails.md
│   │   └── shell-scripts/
│   │       └── shell-scripts.md
│   ├── contributing/
│   │   ├── adapter-specification.md
│   │   ├── code-of-conduct.md
│   │   ├── code-submission-guidelines/
│   │   │   ├── best-practices.md
│   │   │   ├── code-submission-guidelines.md
│   │   │   ├── sending-pull-requests.md
│   │   │   └── writing-tests.md
│   │   ├── contributing-to-the-documentation.md
│   │   ├── contributors-pledge.md
│   │   ├── core-maintainers.md
│   │   ├── intro-to-custom-adapters.md
│   │   ├── issue-contributions.md
│   │   ├── preface.md
│   │   ├── proposing-features/
│   │   │   ├── proposing-features.md
│   │   │   └── submitting-a-proposal.md
│   │   └── stability-index.md
│   ├── faq/
│   │   ├── README.md
│   │   └── faq.md
│   ├── irc/
│   │   └── irc.md
│   ├── reference/
│   │   ├── README.md
│   │   ├── application/
│   │   │   ├── advanced-usage/
│   │   │   │   ├── advanced-usage.md
│   │   │   │   ├── lifecycle.md
│   │   │   │   ├── sails.LOOKS_LIKE_ASSET_RX.md
│   │   │   │   ├── sails.getActions.md
│   │   │   │   ├── sails.getBaseUrl.md
│   │   │   │   ├── sails.getRouteFor.md
│   │   │   │   ├── sails.lift.md
│   │   │   │   ├── sails.load.md
│   │   │   │   ├── sails.lower.md
│   │   │   │   ├── sails.registerAction.md
│   │   │   │   ├── sails.registerActionMiddleware.md
│   │   │   │   ├── sails.reloadActions.md
│   │   │   │   ├── sails.renderView.md
│   │   │   │   └── sails.request.md
│   │   │   ├── application.md
│   │   │   ├── sails.config.custom.md
│   │   │   ├── sails.getDatastore.md
│   │   │   ├── sails.getUrlFor.md
│   │   │   └── sails.log.md
│   │   ├── blueprint-api/
│   │   │   ├── Add.md
│   │   │   ├── Create.md
│   │   │   ├── Destroy.md
│   │   │   ├── Find.md
│   │   │   ├── FindOne.md
│   │   │   ├── Populate.md
│   │   │   ├── Remove.md
│   │   │   ├── Replace.md
│   │   │   ├── Update.md
│   │   │   └── blueprint-api.md
│   │   ├── cli/
│   │   │   ├── cli.md
│   │   │   ├── sailsconsole.md
│   │   │   ├── sailsdebug.md
│   │   │   ├── sailsgenerate.md
│   │   │   ├── sailsinspect.md
│   │   │   ├── sailslift.md
│   │   │   ├── sailsnew.md
│   │   │   └── sailsversion.md
│   │   ├── reference.md
│   │   ├── req/
│   │   │   ├── req._startTime.md
│   │   │   ├── req.accepts.md
│   │   │   ├── req.acceptsCharsets.md
│   │   │   ├── req.acceptsLanguages.md
│   │   │   ├── req.allParams.md
│   │   │   ├── req.body.md
│   │   │   ├── req.cookies.md
│   │   │   ├── req.file.md
│   │   │   ├── req.fresh.md
│   │   │   ├── req.get.md
│   │   │   ├── req.headers.md
│   │   │   ├── req.host.md
│   │   │   ├── req.hostname.md
│   │   │   ├── req.ip.md
│   │   │   ├── req.ips.md
│   │   │   ├── req.is.md
│   │   │   ├── req.isSocket.md
│   │   │   ├── req.md
│   │   │   ├── req.method.md
│   │   │   ├── req.options/
│   │   │   │   └── req.options.md
│   │   │   ├── req.originalUrl.md
│   │   │   ├── req.param.md
│   │   │   ├── req.params.md
│   │   │   ├── req.path.md
│   │   │   ├── req.protocol.md
│   │   │   ├── req.query.md
│   │   │   ├── req.secure.md
│   │   │   ├── req.setLocale.md
│   │   │   ├── req.setTimeout.md
│   │   │   ├── req.signedCookies.md
│   │   │   ├── req.socket.md
│   │   │   ├── req.subdomains.md
│   │   │   ├── req.url.md
│   │   │   ├── req.wantsJSON.md
│   │   │   └── req.xhr.md
│   │   ├── res/
│   │   │   ├── res.attachment.md
│   │   │   ├── res.badRequest.md
│   │   │   ├── res.clearCookie.md
│   │   │   ├── res.cookie.md
│   │   │   ├── res.forbidden.md
│   │   │   ├── res.get.md
│   │   │   ├── res.json.md
│   │   │   ├── res.jsonp.md
│   │   │   ├── res.location.md
│   │   │   ├── res.md
│   │   │   ├── res.negotiate.md
│   │   │   ├── res.notFound.md
│   │   │   ├── res.ok.md
│   │   │   ├── res.redirect.md
│   │   │   ├── res.send.md
│   │   │   ├── res.serverError.md
│   │   │   ├── res.set.md
│   │   │   ├── res.status.md
│   │   │   ├── res.type.md
│   │   │   └── res.view.md
│   │   ├── sails.config/
│   │   │   ├── miscellaneous.md
│   │   │   ├── sails.config.blueprints.md
│   │   │   ├── sails.config.bootstrap.md
│   │   │   ├── sails.config.connections.md
│   │   │   ├── sails.config.custom.md
│   │   │   ├── sails.config.globals.md
│   │   │   ├── sails.config.http.md
│   │   │   ├── sails.config.i18n.md
│   │   │   ├── sails.config.log.md
│   │   │   ├── sails.config.md
│   │   │   ├── sails.config.models.md
│   │   │   ├── sails.config.policies.md
│   │   │   ├── sails.config.routes.md
│   │   │   ├── sails.config.security.md
│   │   │   ├── sails.config.session.md
│   │   │   ├── sails.config.sockets.md
│   │   │   └── sails.config.views.md
│   │   ├── waterline/
│   │   │   ├── datastores/
│   │   │   │   ├── datastores.md
│   │   │   │   ├── driver.md
│   │   │   │   ├── leaseConnection.md
│   │   │   │   ├── manager.md
│   │   │   │   ├── sendNativeQuery.md
│   │   │   │   └── transaction.md
│   │   │   ├── models/
│   │   │   │   ├── addToCollection.md
│   │   │   │   ├── archive.md
│   │   │   │   ├── archiveOne.md
│   │   │   │   ├── avg.md
│   │   │   │   ├── count.md
│   │   │   │   ├── create.md
│   │   │   │   ├── createEach.md
│   │   │   │   ├── destroy.md
│   │   │   │   ├── destroyOne.md
│   │   │   │   ├── find.md
│   │   │   │   ├── findOne.md
│   │   │   │   ├── findOrCreate.md
│   │   │   │   ├── getDatastore.md
│   │   │   │   ├── models.md
│   │   │   │   ├── native.md
│   │   │   │   ├── query.md
│   │   │   │   ├── removeFromCollection.md
│   │   │   │   ├── replaceCollection.md
│   │   │   │   ├── stream.md
│   │   │   │   ├── sum.md
│   │   │   │   ├── update.md
│   │   │   │   ├── updateOne.md
│   │   │   │   └── validate.md
│   │   │   ├── queries/
│   │   │   │   ├── catch.md
│   │   │   │   ├── decrypt.md
│   │   │   │   ├── exec.md
│   │   │   │   ├── fetch.md
│   │   │   │   ├── intercept.md
│   │   │   │   ├── limit.md
│   │   │   │   ├── meta.md
│   │   │   │   ├── populate.md
│   │   │   │   ├── queries.md
│   │   │   │   ├── skip.md
│   │   │   │   ├── sort.md
│   │   │   │   ├── then.md
│   │   │   │   ├── toPromise.md
│   │   │   │   ├── tolerate.md
│   │   │   │   ├── usingConnection.md
│   │   │   │   └── where.md
│   │   │   ├── records/
│   │   │   │   ├── records.md
│   │   │   │   └── toJSON.md
│   │   │   └── waterline.md
│   │   └── websockets/
│   │       ├── resourceful-pubsub/
│   │       │   ├── get-room-name.md
│   │       │   ├── publish.md
│   │       │   ├── resourceful-pubsub.md
│   │       │   ├── subscribe.md
│   │       │   └── unsubscribe.md
│   │       ├── sails.io.js/
│   │       │   ├── SailsSocket/
│   │       │   │   ├── SailsSocket.md
│   │       │   │   ├── methods.md
│   │       │   │   └── properties.md
│   │       │   ├── io.sails.md
│   │       │   ├── io.socket.md
│   │       │   ├── io.socket.off.md
│   │       │   ├── io.socket.on.md
│   │       │   ├── sails.io.js.md
│   │       │   ├── socket.delete.md
│   │       │   ├── socket.get.md
│   │       │   ├── socket.patch.md
│   │       │   ├── socket.post.md
│   │       │   ├── socket.put.md
│   │       │   └── socket.request.md
│   │       ├── sails.sockets/
│   │       │   ├── sails.sockets.addRoomMembersToRooms.md
│   │       │   ├── sails.sockets.blast.md
│   │       │   ├── sails.sockets.broadcast.md
│   │       │   ├── sails.sockets.getid.md
│   │       │   ├── sails.sockets.id.md
│   │       │   ├── sails.sockets.join.md
│   │       │   ├── sails.sockets.leave.md
│   │       │   ├── sails.sockets.leaveAll.md
│   │       │   ├── sails.sockets.md
│   │       │   └── sails.sockets.removeRoomMembersFromRoom.md
│   │       └── websockets.md
│   ├── security/
│   │   ├── README.md
│   │   └── SAILS-SECURITY-POLICY.md
│   ├── tutorials/
│   │   ├── coffeeScript.md
│   │   ├── full-stack-javascript.md
│   │   ├── low-level-mysql-access.md
│   │   ├── mongo.md
│   │   ├── tutorials.md
│   │   └── typeScript.md
│   ├── upgrading/
│   │   ├── To0.10.md
│   │   ├── To0.11.md
│   │   ├── To0.12.md
│   │   ├── To1.0.md
│   │   └── upgrading.md
│   └── version-notes/
│       ├── 0.10.x/
│       │   ├── 0.10.x.md
│       │   ├── Changelog0.10.0-rc9.md
│       │   └── Changelog0.10x.md
│       ├── 0.11.x/
│       │   ├── 0.11.x.md
│       │   └── MigrationGuide0.11.md
│       ├── 0.12.x/
│       │   ├── 0.12.x.md
│       │   └── migration-guide-0.12.md
│       ├── 0.8.x/
│       │   ├── 0.8.x.md
│       │   ├── Changelog0.8.7x.md
│       │   ├── Changelog0.8.8x.md
│       │   ├── Changelog0.8.9.md
│       │   └── ChangelogPre-0.8.77.md
│       ├── 0.9.x/
│       │   ├── 0.9.x.md
│       │   ├── Changelog0.9.0.md
│       │   ├── Changelog0.9.16.md
│       │   ├── Changelog0.9.4.md
│       │   └── Changelog0.9.7.md
│       └── 1.0.x/
│           └── migration-guide-1.0.md
├── errors/
│   ├── README.md
│   ├── fatal.js
│   ├── index.js
│   └── warn.js
├── lib/
│   ├── EVENTS.md
│   ├── README.md
│   ├── app/
│   │   ├── README.md
│   │   ├── Sails.js
│   │   ├── configuration/
│   │   │   ├── default-hooks.js
│   │   │   ├── index.js
│   │   │   ├── load.js
│   │   │   └── rc.js
│   │   ├── get-actions.js
│   │   ├── get-route-for.js
│   │   ├── get-url-for.js
│   │   ├── index.js
│   │   ├── lift.js
│   │   ├── load.js
│   │   ├── lower.js
│   │   ├── private/
│   │   │   ├── after.js
│   │   │   ├── bootstrap.js
│   │   │   ├── checkGruntConfig.js
│   │   │   ├── controller/
│   │   │   │   ├── README.md
│   │   │   │   ├── help-register-action.js
│   │   │   │   └── load-action-modules.js
│   │   │   ├── exposeGlobals.js
│   │   │   ├── initialize.js
│   │   │   ├── inspect.js
│   │   │   ├── isLocalSailsValid.js
│   │   │   ├── isSailsAppSync.js
│   │   │   ├── loadHooks.js
│   │   │   ├── toJSON.js
│   │   │   └── toString.js
│   │   ├── register-action-middleware.js
│   │   ├── register-action.js
│   │   ├── reload-actions.js
│   │   └── request.js
│   ├── hooks/
│   │   ├── README.md
│   │   ├── blueprints/
│   │   │   ├── README.md
│   │   │   ├── actionUtil.js
│   │   │   ├── actions/
│   │   │   │   ├── add.js
│   │   │   │   ├── create.js
│   │   │   │   ├── destroy.js
│   │   │   │   ├── find.js
│   │   │   │   ├── findOne.js
│   │   │   │   ├── populate.js
│   │   │   │   ├── remove.js
│   │   │   │   ├── replace.js
│   │   │   │   └── update.js
│   │   │   ├── formatUsageError.js
│   │   │   ├── index.js
│   │   │   ├── onRoute.js
│   │   │   └── parse-blueprint-options.js
│   │   ├── helpers/
│   │   │   ├── index.js
│   │   │   └── private/
│   │   │       ├── iterate-helpers.js
│   │   │       └── load-helpers.js
│   │   ├── http/
│   │   │   ├── README.md
│   │   │   ├── get-configured-http-middleware-fns.js
│   │   │   ├── index.js
│   │   │   ├── initialize.js
│   │   │   ├── start.js
│   │   │   └── view.js
│   │   ├── i18n/
│   │   │   └── index.js
│   │   ├── index.js
│   │   ├── logger/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── ship.js
│   │   ├── moduleloader/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── policies/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── pubsub/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── request/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   ├── locals.js
│   │   │   ├── metadata.js
│   │   │   ├── param.js
│   │   │   ├── params.all.js
│   │   │   ├── qualifiers.js
│   │   │   └── validate.js
│   │   ├── responses/
│   │   │   ├── README.md
│   │   │   ├── defaults/
│   │   │   │   ├── badRequest.js
│   │   │   │   ├── forbidden.js
│   │   │   │   ├── negotiate.js
│   │   │   │   ├── notFound.js
│   │   │   │   ├── ok.js
│   │   │   │   └── serverError.js
│   │   │   ├── index.js
│   │   │   └── onRoute.js
│   │   ├── security/
│   │   │   ├── README.md
│   │   │   ├── cors/
│   │   │   │   ├── index.js
│   │   │   │   ├── set-headers.js
│   │   │   │   └── set-preflight-config.js
│   │   │   ├── csrf/
│   │   │   │   ├── grant-csrf-token.js
│   │   │   │   └── index.js
│   │   │   └── index.js
│   │   ├── services/
│   │   │   └── index.js
│   │   ├── session/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── userconfig/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   ├── userhooks/
│   │   │   ├── README.md
│   │   │   └── index.js
│   │   └── views/
│   │       ├── configure.js
│   │       ├── default-view-rendering-fn.js
│   │       ├── escape-html-entities-deep.js
│   │       ├── get-implicit-defaults.js
│   │       ├── html-scriptify.js
│   │       ├── index.js
│   │       ├── onRoute.js
│   │       ├── render.js
│   │       ├── res.view.js
│   │       ├── stat-views.js
│   │       └── unescape-html-entities-deep-lite.min.string.js
│   ├── index.js
│   ├── router/
│   │   ├── README.md
│   │   ├── bind.js
│   │   ├── bindDefaultHandlers.js
│   │   ├── index.js
│   │   ├── mock-req.js
│   │   ├── mock-res.js
│   │   ├── req.js
│   │   └── res.js
│   └── util/
│       ├── check-origin-url.js
│       ├── deep-extend.js
│       ├── detect-verb.js
│       └── rc.js
├── package.json
└── test/
    ├── .eslintrc
    ├── README.md
    ├── benchmarks/
    │   ├── README.md
    │   ├── helpers/
    │   │   └── benchmarx.js
    │   ├── sails.load.test.js
    │   └── sails.request.generic.test.js
    ├── fixtures/
    │   ├── constants.js
    │   ├── customHooks.js
    │   └── middleware.js
    ├── helpers/
    │   ├── RouteFactory.helper.js
    │   ├── router.js
    │   ├── sails.js
    │   ├── test-spawning-sails-child-process-in-cwd.js
    │   └── test-spawning-sails-lift-child-process-in-cwd.js
    ├── hooks/
    │   ├── blueprints/
    │   │   └── initialize.test.js
    │   ├── http/
    │   │   └── initialize.test.js
    │   ├── pubsub/
    │   │   └── initialize.test.js
    │   ├── request/
    │   │   ├── initialize.test.js
    │   │   ├── req.metadata.test.js
    │   │   └── req.options.sticky.test.js
    │   └── views/
    │       ├── ejs/
    │       │   └── index.i18n.ejs
    │       ├── intialize.test.js
    │       ├── locales/
    │       │   ├── en.json
    │       │   ├── es.json
    │       │   └── eu.json
    │       ├── res.render.i18n.js
    │       ├── res.view.test.js
    │       └── skipAssets.test.js
    ├── init.js
    ├── integration/
    │   ├── README.md
    │   ├── cert/
    │   │   ├── sailstest-cert.pem
    │   │   └── sailstest-key.pem
    │   ├── fixtures/
    │   │   ├── hooks/
    │   │   │   └── installable/
    │   │   │       ├── add-policy/
    │   │   │       │   ├── index.js
    │   │   │       │   └── package.json
    │   │   │       ├── async/
    │   │   │       │   └── index.js.txt
    │   │   │       └── shout/
    │   │   │           ├── index.js
    │   │   │           └── package.json
    │   │   ├── sampleapp/
    │   │   │   ├── api/
    │   │   │   │   ├── controllers/
    │   │   │   │   │   ├── EmptyController.js
    │   │   │   │   │   ├── PetController.js
    │   │   │   │   │   ├── QuizController.js
    │   │   │   │   │   ├── TestController.js
    │   │   │   │   │   ├── UserController.js
    │   │   │   │   │   ├── UserProfileController.js
    │   │   │   │   │   └── ViewTestController.js
    │   │   │   │   ├── models/
    │   │   │   │   │   ├── Empty.js
    │   │   │   │   │   ├── Pet.js
    │   │   │   │   │   ├── Quiz.js
    │   │   │   │   │   ├── Test.js
    │   │   │   │   │   ├── User.js
    │   │   │   │   │   └── UserProfile.js
    │   │   │   │   ├── policies/
    │   │   │   │   │   ├── error_policy.js
    │   │   │   │   │   └── fake_auth.js
    │   │   │   │   └── services/
    │   │   │   │       └── TestService.js
    │   │   │   ├── config/
    │   │   │   │   └── local.js
    │   │   │   └── views/
    │   │   │       ├── app/
    │   │   │       │   ├── index.ejs
    │   │   │       │   └── user/
    │   │   │       │       └── homepage.ejs
    │   │   │       ├── pages/
    │   │   │       │   └── homepage.ejs
    │   │   │       └── viewtest/
    │   │   │           ├── create.ejs
    │   │   │           ├── csrf.ejs
    │   │   │           ├── index.ejs
    │   │   │           └── viewOptions.ejs
    │   │   └── users.js
    │   ├── generate.test.js
    │   ├── globals.test.js
    │   ├── helpers/
    │   │   ├── appHelper.js
    │   │   ├── httpHelper.js
    │   │   └── socketHelper.js
    │   ├── hook.3rdparty.test.js
    │   ├── hook.blueprints.action.routes.test.js
    │   ├── hook.blueprints.blacklist.test.js
    │   ├── hook.blueprints.index.routes.test.js
    │   ├── hook.blueprints.restful.routes.test.js
    │   ├── hook.blueprints.shortcut.routes.test.js
    │   ├── hook.cors.test.js
    │   ├── hook.csrf.test.js
    │   ├── hook.helpers.test.js
    │   ├── hook.i18n.test.js
    │   ├── hook.policies.test.js
    │   ├── hook.pubsub.modelEvents.noSubscribers.test.js
    │   ├── hook.pubsub.modelEvents.subscribers.test.js
    │   ├── hook.sockets.interpreter.test.js
    │   ├── hook.userconfig.test.js
    │   ├── hook.views.test.js
    │   ├── hooks.user.test.js
    │   ├── lift.https.test.js
    │   ├── lift.lower.test.js
    │   ├── lift.test.js
    │   ├── middleware.404.test.js
    │   ├── middleware.500.test.js
    │   ├── middleware.compression.test.js
    │   ├── middleware.cookieParser.test.js
    │   ├── middleware.favicon.test.js
    │   ├── middleware.handleBodyParserError.test.js
    │   ├── middleware.sails.test.js
    │   ├── middleware.session.redis.test.js
    │   ├── middleware.session.test.js
    │   ├── middleware.startRequestTimer.test.js
    │   ├── middleware.static.test.js
    │   ├── new.test.js
    │   ├── router.params.test.js
    │   ├── router.specifiedRoutes.test.js
    │   ├── router.viewRendering.test.js
    │   └── www.test.js
    ├── mocha.opts
    └── unit/
        ├── App.prototype.load.test.js
        ├── README.md
        ├── app.getRouteFor.test.js
        ├── app.getUrlFor.test.js
        ├── app.initializeHooks.test.js
        ├── app.lower.test.js
        ├── app.registerAction.test.js
        ├── app.reloadActions.test.js
        ├── bootstrap.test.js
        ├── controller.test.js
        ├── req.errors.test.js
        ├── req.session.test.js
        ├── req.test.js
        ├── res.test.js
        ├── router.bind.test.js
        ├── router.ordering.test.js
        ├── router.test.js
        ├── router.unbind.test.js
        └── virtual-request-interpreter.test.js
Download .txt
SYMBOL INDEX (79 symbols across 34 files)

FILE: errors/fatal.js
  function _terminateProcess (line 181) | function _terminateProcess(code /*, opts */) {

FILE: lib/app/Sails.js
  function Sails (line 21) | function Sails() {

FILE: lib/app/configuration/index.js
  function Configuration (line 18) | function Configuration() {

FILE: lib/app/index.js
  function SailsFactory (line 16) | function SailsFactory() {

FILE: lib/app/load.js
  function helpLoadHooks (line 170) | function helpLoadHooks(results, cb) {
  function loadHookDefinitions (line 202) | function loadHookDefinitions(hooks, cb) {
  function verifyEnvironment (line 231) | function verifyEnvironment() {
  function ready__ (line 258) | function ready__(cb) {

FILE: lib/app/lower.js
  function onClose (line 103) | function onClose() {

FILE: lib/app/private/loadHooks.js
  function prepareHook (line 58) | function prepareHook(id) {
  function applyDefaults (line 140) | function applyDefaults(hook) {
  function loadHook (line 165) | function loadHook(id, cb) {

FILE: lib/app/request.js
  function MockClientResponse (line 164) | function MockClientResponse() {

FILE: lib/hooks/blueprints/index.js
  function _bindShortcutRoute (line 335) | function _bindShortcutRoute(template, blueprintActionName) {
  function _bindAssocRoute (line 343) | function _bindAssocRoute(template, blueprintActionName, alias) {
  function _bindRestRoute (line 423) | function _bindRestRoute(template, blueprintActionName) {
  function _bindAssocRoute (line 431) | function _bindAssocRoute(template, blueprintActionName, alias) {

FILE: lib/hooks/http/start.js
  function failedToStart (line 47) | function failedToStart(err) {

FILE: lib/hooks/http/view.js
  function SailsView (line 38) | function SailsView (name, options) {

FILE: lib/hooks/index.js
  function _normalize (line 232) | function _normalize(def) {

FILE: lib/hooks/moduleloader/index.js
  function bindToSails (line 618) | function bindToSails(cb) {

FILE: lib/hooks/pubsub/index.js
  function getPubsubMethods (line 176) | function getPubsubMethods () {

FILE: lib/hooks/request/qualifiers.js
  function bindReqDeprecationNotice (line 55) | function bindReqDeprecationNotice(req, key) {
  function bindResDeprecationNotice (line 77) | function bindResDeprecationNotice(res, key) {

FILE: lib/hooks/responses/index.js
  function _mixinJsonxMethod (line 166) | function _mixinJsonxMethod(req, res) {

FILE: lib/hooks/security/cors/set-headers.js
  function isString (line 32) | function isString(s) {
  function isOriginAllowed (line 36) | function isOriginAllowed(origin, allowedOrigin) {
  function configureOrigin (line 53) | function configureOrigin(options, req) {
  function configureMethods (line 88) | function configureMethods(options) {
  function configureCredentials (line 99) | function configureCredentials(options) {
  function configureAllowedHeaders (line 109) | function configureAllowedHeaders(options, req) {
  function configureExposedHeaders (line 125) | function configureExposedHeaders(options) {
  function configureMaxAge (line 141) | function configureMaxAge(options) {
  function applyHeaders (line 152) | function applyHeaders(headers, res) {
  function cors (line 167) | function cors(options, req, res, next) {
  function middlewareWrapper (line 205) | function middlewareWrapper(o) {

FILE: lib/hooks/views/default-view-rendering-fn.js
  function resolveObjectName (line 136) | function resolveObjectName(view){
  function lookup (line 172) | function lookup(root, partial, options){
  function partial (line 247) | function partial(view, options){
  function layout (line 390) | function layout(view){
  function Block (line 394) | function Block() {
  function block (line 425) | function block(name, html) {
  function script (line 440) | function script(path, type) {
  function stylesheet (line 448) | function stylesheet(path, media) {

FILE: lib/hooks/views/unescape-html-entities-deep-lite.min.string.js
  function unescapeHtmlEntitiesDeepLite (line 67) | function unescapeHtmlEntitiesDeepLite(data){

FILE: lib/router/bind.js
  function bind (line 32) | function bind( /* path, target, verb, options */ ) {
  function bindRedirect (line 110) | function bindRedirect(path, redirectTo, verb, options) {
  function bindAction (line 125) | function bindAction(path, target, verb, options) {
  function bindArray (line 269) | function bindArray(path, target, verb, options) {
  function bindFunction (line 290) | function bindFunction(path, fn, verb, options) {
  function sanitize (line 555) | function sanitize(path, target, verb, options) {

FILE: lib/router/index.js
  function Router (line 37) | function Router(options) {
  function qsParser (line 507) | function qsParser(req,res,next) {
  function bodyParser (line 518) | function bodyParser (req, res, next) {
  function parseCookies (line 570) | function parseCookies (req, res, next){
  function loadSession (line 592) | function loadSession (req, res, next){

FILE: lib/router/mock-req.js
  function MockIncomingMessage (line 35) | function MockIncomingMessage(options) {

FILE: lib/router/mock-res.js
  function MockServerResponse (line 36) | function MockServerResponse(finish) {

FILE: lib/router/res.js
  function onlyAllowOneResponse (line 421) | function onlyAllowOneResponse (res) {
  function MockClientResponse (line 431) | function MockClientResponse() {

FILE: lib/util/deep-extend.js
  function isSpecificValue (line 44) | function isSpecificValue(val) {
  function cloneSpecificValue (line 52) | function cloneSpecificValue(val) {
  function deepCloneArray (line 71) | function deepCloneArray(arr) {
  function safeGetProperty (line 89) | function safeGetProperty(object, property) {

FILE: lib/util/rc.js
  function find (line 135) | function find(start, rel) {
  function addConfigFile (line 168) | function addConfigFile (file) {

FILE: test/benchmarks/sails.load.test.js
  function benchmark (line 158) | function benchmark(description, fn) {
  function setupBenchmarks (line 200) | function setupBenchmarks() {
  function reportBenchmarks (line 210) | function reportBenchmarks() {
  function _getTestCleanupCallback (line 269) | function _getTestCleanupCallback(app, cb) {

FILE: test/helpers/RouteFactory.helper.js
  function RouteFactory (line 12) | function RouteFactory(prefix) {

FILE: test/helpers/sails.js
  function _cleanOptions (line 33) | function _cleanOptions (options) {
  function _with (line 156) | function _with (description, sailsOpts, msThreshold) {

FILE: test/integration/fixtures/hooks/installable/add-policy/index.js
  function forbiddenPolicy (line 13) | function forbiddenPolicy(req, res, next) {

FILE: test/integration/generate.test.js
  function capitalize (line 11) | function capitalize(string) {

FILE: test/integration/globals.test.js
  function setupAppFiles (line 672) | function setupAppFiles() {

FILE: test/integration/hook.cors.test.js
  function makeRequest (line 969) | function makeRequest(options, responseHolder, sailsApp) {
  function expectHeaders (line 979) | function expectHeaders(responseHolder, headers) {

FILE: test/integration/hook.pubsub.modelEvents.subscribers.test.js
  function expectNotifications (line 884) | function expectNotifications(notifications, done) {
Condensed preview — 718 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,983K chars).
[
  {
    "path": ".editorconfig",
    "chars": 493,
    "preview": "#   ╔═╗╔╦╗╦╔╦╗╔═╗╦═╗┌─┐┌─┐┌┐┌┌─┐┬┌─┐\n#   ║╣  ║║║ ║ ║ ║╠╦╝│  │ ││││├┤ ││ ┬\n#  o╚═╝═╩╝╩ ╩ ╚═╝╩╚═└─┘└─┘┘└┘└  ┴└─┘\n#\n# This "
  },
  {
    "path": ".eslintrc",
    "chars": 3192,
    "preview": "{\n  //   ╔═╗╔═╗╦  ╦╔╗╔╔╦╗┬─┐┌─┐\n  //   ║╣ ╚═╗║  ║║║║ ║ ├┬┘│\n  //  o╚═╝╚═╝╩═╝╩╝╚╝ ╩ ┴└─└─┘\n  // A set of basic convention"
  },
  {
    "path": ".github/ISSUE_TEMPLATE",
    "chars": 409,
    "preview": "**Node version**: \n**Sails version** _(sails)_: \n**ORM hook version** _(sails-hook-orm)_: \n**Sockets hook version** _(sa"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": ".gitignore",
    "chars": 995,
    "preview": "#   ┌─┐┬┌┬┐╦╔═╗╔╗╔╔═╗╦═╗╔═╗\n#   │ ┬│ │ ║║ ╦║║║║ ║╠╦╝║╣\n#  o└─┘┴ ┴ ╩╚═╝╝╚╝╚═╝╩╚═╚═╝\n#\n# This file (`.gitignore`) exists t"
  },
  {
    "path": ".npmignore",
    "chars": 298,
    "preview": ".git\n./.gitignore\n./.jshintrc\n./.editorconfig\n./.travis.yml\n./appveyor.yml\n./example\n./examples\n./test\n./tests\n./sails-d"
  },
  {
    "path": ".travis.yml",
    "chars": 854,
    "preview": " # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n#   ╔╦╗╦═╗╔═╗╦  ╦╦╔═╗ ┬ ┬┌┬┐┬                           #\n#  "
  },
  {
    "path": "CHANGELOG.md",
    "chars": 77343,
    "preview": "# Sails Changelog\n\n## 1.2.0\n\n- Added `sails migrate` for quickly running auto-migrations by hand\n- The output of `sails "
  },
  {
    "path": "CODE-OF-CONDUCT.md",
    "chars": 211,
    "preview": "> The Code of Conduct now lives in the 'Contributing' section of the documentation: [http://sailsjs.com/documentation/co"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 175,
    "preview": "> The Contribution guide now lives in the 'Contributing' section of the documentation: [sailsjs.com/documentation/contri"
  },
  {
    "path": "LICENSE.md",
    "chars": 1088,
    "preview": "The MIT License (MIT)\n--\n\nCopyright © 2012-present, Mike McNeil\n\nPermission is hereby granted, free of charge, to any pe"
  },
  {
    "path": "MODULES.md",
    "chars": 25001,
    "preview": "# Modules\n\nSails is a large project, with many modular components.  Each module is located in its own repository, and in"
  },
  {
    "path": "README.md",
    "chars": 10404,
    "preview": "# [![Sails.js](http://balderdashy.github.io/sails/images/logo.png \"Sails.js\")](http://sailsjs.com)\n\n### [Website](https:"
  },
  {
    "path": "ROADMAP.md",
    "chars": 12483,
    "preview": "# Sails Roadmap\n\nAs of November 2017, the Sails project roadmap is now managed [on Trello](https://trello.com/b/s9zEnyG7"
  },
  {
    "path": "accessible/generate.js",
    "chars": 1249,
    "preview": "/**\n * Module dependencies\n */\n\nvar sailsgen = require('sails-generate');\n\n// - - - - - - - - - - - - - - - - - - - - - "
  },
  {
    "path": "accessible/rc.js",
    "chars": 380,
    "preview": "/**\n * Module dependencies\n */\n\nvar rc = require('../lib/app/configuration/rc');\n\n\n/**\n * require('sails/accessible/rc')"
  },
  {
    "path": "appveyor.yml",
    "chars": 1474,
    "preview": "# # # # # # # # # # # # # # # # # # # # # # # # # #\n#  ╔═╗╔═╗╔═╗╦  ╦╔═╗╦ ╦╔═╗╦═╗ ┬ ┬┌┬┐┬              #\n#  ╠═╣╠═╝╠═╝╚╗╔╝"
  },
  {
    "path": "bin/private/patched-commander.js",
    "chars": 782,
    "preview": "/**\n * Module dependencies\n */\n\nvar _ = require('@sailshq/lodash');\nvar program = require('commander');\n\n\n//\n//\n// Monke"
  },
  {
    "path": "bin/private/read-repl-history-and-start-transcribing.js",
    "chars": 2322,
    "preview": "/**\n * Module dependencies\n */\n\nvar fs = require('fs');\n\n\n/**\n * readReplHistoryAndBeginTranscribing()\n *\n * Load from a"
  },
  {
    "path": "bin/sails-console.js",
    "chars": 8625,
    "preview": "/**\n * Module dependencies\n */\n\nvar nodepath = require('path');\nvar REPL = require('repl');\nvar stream = require('stream"
  },
  {
    "path": "bin/sails-debug-console.js",
    "chars": 1447,
    "preview": "#!/usr/bin/env node\n\n\n/**\n * Module dependencies\n */\n\nvar path = require('path');\nvar Womb = require('child_process');\nv"
  },
  {
    "path": "bin/sails-debug.js",
    "chars": 1233,
    "preview": "/**\n * Module dependencies\n */\n\nvar path = require('path');\nvar Womb = require('child_process');\nvar CaptainsLog = requi"
  },
  {
    "path": "bin/sails-deploy.js",
    "chars": 1885,
    "preview": "/**\n * Module dependencies\n */\n\nvar path = require('path');\nvar rconf = require('../lib/app/configuration/rc')();\n\n/**\n "
  },
  {
    "path": "bin/sails-generate.js",
    "chars": 3645,
    "preview": "/**\n * Module dependencies\n */\n\nvar util = require('util');\nvar path = require('path');\nvar assert = require('assert');\n"
  },
  {
    "path": "bin/sails-inspect.js",
    "chars": 1316,
    "preview": "/**\n * Module dependencies\n */\n\nvar path = require('path');\nvar Womb = require('child_process');\nvar CaptainsLog = requi"
  },
  {
    "path": "bin/sails-lift.js",
    "chars": 3132,
    "preview": "/**\n * Module dependencies\n */\n\nvar nodepath = require('path');\nvar _ = require('@sailshq/lodash');\nvar chalk = require("
  },
  {
    "path": "bin/sails-migrate.js",
    "chars": 3824,
    "preview": "/**\n * Module dependencies\n */\n\nvar nodepath = require('path');\nvar _ = require('@sailshq/lodash');\nvar captains = requi"
  },
  {
    "path": "bin/sails-new.js",
    "chars": 2959,
    "preview": "/**\n * Module dependencies\n */\n\nvar nodepath = require('path');\nvar _ = require('@sailshq/lodash');\nvar sailsgen = requi"
  },
  {
    "path": "bin/sails-run.js",
    "chars": 16424,
    "preview": "/**\n * Module dependencies\n */\n\nvar path = require('path');\nvar fs = require('fs');\nvar _ = require('@sailshq/lodash');\n"
  },
  {
    "path": "bin/sails-upgrade.js",
    "chars": 8764,
    "preview": "/**\n * Module dependencies\n */\n\nvar path = require('path');\nvar chalk = require('chalk');\nvar _ = require('@sailshq/loda"
  },
  {
    "path": "bin/sails-www.js",
    "chars": 4410,
    "preview": "/**\n * Module dependencies\n */\n\nvar path = require('path');\nvar _ = require('@sailshq/lodash');\nvar CaptainsLog = requir"
  },
  {
    "path": "bin/sails.js",
    "chars": 4960,
    "preview": "#!/usr/bin/env node\n\n\n/**\n * Module dependencies\n */\n\nvar _ = require('@sailshq/lodash');\nvar program = require('./priva"
  },
  {
    "path": "docs/PAGE_NEEDED.md",
    "chars": 628,
    "preview": "# Page Needed\n\nIf you&rsquo;re seeing this page, it means you've clicked on a link to a Sails doc that has yet to be wri"
  },
  {
    "path": "docs/README.md",
    "chars": 5467,
    "preview": "![Squiddy reads the docs](https://sailsjs.com/images/squidford_swimming.png)\n\n# Sails.js Documentation\n\nThe official doc"
  },
  {
    "path": "docs/anatomy/.editorconfig.md",
    "chars": 239,
    "preview": "# .editorconfig\n\nThis file exists to help maintain consistent formatting throughout the files in your Sails app.\n\nFor mo"
  },
  {
    "path": "docs/anatomy/.eslintignore.md",
    "chars": 215,
    "preview": "# .eslintignore\n\nThis file exists to signify to [ESLint](https://eslint.org/) that certain files and/or directories shou"
  },
  {
    "path": "docs/anatomy/.eslintrc.md",
    "chars": 254,
    "preview": "# .eslintrc\n\nThis file defines a set of basic code conventions designed to encourage quality and consistency across your"
  },
  {
    "path": "docs/anatomy/.htmlhintrc.md",
    "chars": 208,
    "preview": "# .htmlhintrc\n\nThis file defines the rules for your app's [HTMLHint](http://htmlhint.com/), to encourage quality and con"
  },
  {
    "path": "docs/anatomy/Gruntfile.js.md",
    "chars": 910,
    "preview": "# Gruntfile.js\n\n\nSails uses [Grunt](http://gruntjs.com) for asset management. This file contains the entry point for the"
  },
  {
    "path": "docs/anatomy/README.md",
    "chars": 573,
    "preview": "# docs/anatomy\n\nThis section contains the \"Anatomy\" documentation which is eventually available at https://sailsjs.com/d"
  },
  {
    "path": "docs/anatomy/README.md.md",
    "chars": 127,
    "preview": "# README.md\n\nThis is a generic README that you can edit to describe your app.\n\n\n<docmeta name=\"displayName\" value=\"READM"
  },
  {
    "path": "docs/anatomy/anatomy.md",
    "chars": 312,
    "preview": "# Anatomy of a Sails app\n\nAn interactive guide to the structure of the Sails app generated by default with `sails new`.\n"
  },
  {
    "path": "docs/anatomy/api/api.md",
    "chars": 1999,
    "preview": "# api/\n\nThis folder contains the vast majority of your app's back-end logic.  It is home to the 'M' and 'C' in <a href=\""
  },
  {
    "path": "docs/anatomy/api/controllers/controllers.md",
    "chars": 774,
    "preview": "# api/controllers/\n\nThis is the directory that holds your controllers.  In Sails, controllers are JavaScript files that "
  },
  {
    "path": "docs/anatomy/api/controllers/gitkeep.md",
    "chars": 312,
    "preview": "# api/controllers/.gitkeep\n\nIgnore this file.  It only exists because `git` refuses to push empty directories to a remot"
  },
  {
    "path": "docs/anatomy/api/helpers/.gitkeep.md",
    "chars": 308,
    "preview": "# api/helpers/.gitkeep\n\nIgnore this file.  It only exists because `git` refuses to push empty directories to a remote se"
  },
  {
    "path": "docs/anatomy/api/helpers/helpers.md",
    "chars": 523,
    "preview": "# api/helpers/\n\nThis is the directory that holds your helpers.  In Sails, helpers are shared functions that can be calle"
  },
  {
    "path": "docs/anatomy/api/models/.gitkeep.md",
    "chars": 308,
    "preview": "# api/models/.gitkeep\n\nIgnore this file.  It only exists because `git` refuses to push empty directories to a remote ser"
  },
  {
    "path": "docs/anatomy/api/models/models.md",
    "chars": 483,
    "preview": "# api/models/\n\nThis is the directory that holds your models.  In Sails, models are the structures that contain data for "
  },
  {
    "path": "docs/anatomy/api/policies/.gitkeep.md",
    "chars": 310,
    "preview": "# api/policies/.gitkeep\n\nIgnore this file.  It only exists because `git` refuses to push empty directories to a remote s"
  },
  {
    "path": "docs/anatomy/api/policies/policies.md",
    "chars": 602,
    "preview": "# api/policies/\n\nThis is the folder you will store your &ldquo;policy&rdquo; files in.  A policy file is a JavaScript fi"
  },
  {
    "path": "docs/anatomy/app.js.md",
    "chars": 1084,
    "preview": "# app.js\n\nThis file is the conventional entry point for a _production_ Sails/Node.js app.\n\nWhen developing on your local"
  },
  {
    "path": "docs/anatomy/assets/.eslintrc.md",
    "chars": 418,
    "preview": "# assets/.eslintrc\n\nThis file is for [ESLint](https://eslint.org/) configuration overrides for  the `assets/` directory."
  },
  {
    "path": "docs/anatomy/assets/assets.md",
    "chars": 334,
    "preview": "# assets/\n\nThis is your assets folder.  It houses all of the static files that your app will need to host.  Feel free to"
  },
  {
    "path": "docs/anatomy/assets/dependencies/dependencies.md",
    "chars": 807,
    "preview": "# assets/dependencies/\n\nAs a rule of thumb, if it's code written by you or someone on your team, it _does not belong in "
  },
  {
    "path": "docs/anatomy/assets/dependencies/sails.io.js.md",
    "chars": 614,
    "preview": "# assets/dependencies/sails.io.js\n\n\nThis file adds a few custom methods to socket.io which provide the \"built-in\" websoc"
  },
  {
    "path": "docs/anatomy/assets/favicon.ico.md",
    "chars": 153,
    "preview": "# assets/favicon.ico\n\nThis file is the [Favicon](http://en.wikipedia.org/wiki/Favicon) for your app.\n\n\n<docmeta name=\"di"
  },
  {
    "path": "docs/anatomy/assets/images/gitkeep.md",
    "chars": 311,
    "preview": "# assets/images/.gitkeep\n\n\nIgnore this file.  It only exists because `git` refuses to push empty directories to a remote"
  },
  {
    "path": "docs/anatomy/assets/images/images.md",
    "chars": 267,
    "preview": "# assets/images/\n\nThis is where you should put image files that need to be statically hosted by your app.\n\nUpon lifting "
  },
  {
    "path": "docs/anatomy/assets/js/gitkeep.md",
    "chars": 306,
    "preview": "# assets/js/.gitkeep\n\nIgnore this file.  It only exists because `git` refuses to push empty directories to a remote serv"
  },
  {
    "path": "docs/anatomy/assets/js/js.md",
    "chars": 233,
    "preview": "# assets/js/\n\nThis is where you put client-side JavaScript files that you want to be statically hosted by your app.  Sai"
  },
  {
    "path": "docs/anatomy/assets/styles/importer.less.md",
    "chars": 650,
    "preview": "# assets/styles/importer.less\n\nBy default, new Sails projects are configured to compile this file from LESS to CSS.  Unl"
  },
  {
    "path": "docs/anatomy/assets/styles/styles.md",
    "chars": 171,
    "preview": "# assets/styles/\n\nThis is where you will put all of the .css files that you would like to be statically hosted by your a"
  },
  {
    "path": "docs/anatomy/assets/templates/gitkeep.md",
    "chars": 313,
    "preview": "# assets/templates/.gitkeep\n\nIgnore this file.  It only exists because `git` refuses to push empty directories to a remo"
  },
  {
    "path": "docs/anatomy/assets/templates/templates.md",
    "chars": 1765,
    "preview": "# assets/templates/\n\nClient-side HTML templates are important prerequisites for certain types of modern, rich client app"
  },
  {
    "path": "docs/anatomy/config/blueprints.js.md",
    "chars": 626,
    "preview": "# config/blueprints.js\n\nThis file is for the configuration of blueprint routes and actions.\n\nFor an overview of blueprin"
  },
  {
    "path": "docs/anatomy/config/bootstrap.js.md",
    "chars": 409,
    "preview": "# config/bootstrap.js\n\nThis is a server-side JavaScript file that is executed by Sails just before your app is lifted.\n\n"
  },
  {
    "path": "docs/anatomy/config/config.md",
    "chars": 157,
    "preview": "# config/\n\nThis folder contains various files that will allow you to customize and configure your Sails app.\n\n\n\n<docmeta"
  },
  {
    "path": "docs/anatomy/config/custom.js.md",
    "chars": 623,
    "preview": "# config/custom\n\nThis is your custom configuration file. It is useful for one-off settings specific to your application-"
  },
  {
    "path": "docs/anatomy/config/datastores.js.md",
    "chars": 522,
    "preview": "# config/datastores\n\nA set of datastore configurations which tell Sails where to fetch or save data when you execute bui"
  },
  {
    "path": "docs/anatomy/config/env/env.md",
    "chars": 463,
    "preview": "# config/env/\n\nThis folder contains various environment-specific settings such as API keys or remote database passwords."
  },
  {
    "path": "docs/anatomy/config/env/production.js.md",
    "chars": 227,
    "preview": "# config/env/production.js\n\nThis file will be loaded when Sails is running in `production` mode. If using the CLI comman"
  },
  {
    "path": "docs/anatomy/config/globals.js.md",
    "chars": 293,
    "preview": "# config/globals.js\n\nConfiguration for the global variables Sails exposes to its Node process.\n\n### Usage\n\nSee [`sails.c"
  },
  {
    "path": "docs/anatomy/config/http.js.md",
    "chars": 323,
    "preview": "# config/http.js\n\nThis file is for configuring the underlying HTTP server in Sails, as well as any HTTP middleware your "
  },
  {
    "path": "docs/anatomy/config/i18n.js.md",
    "chars": 275,
    "preview": "# config/i18n.js\n\nThis file contains your Sails app's internationalization settings.\n\n### Usage\n\nSee [`sails.config.i18n"
  },
  {
    "path": "docs/anatomy/config/local.js.md",
    "chars": 640,
    "preview": "# config/local.js\n\nThis file is used to specify configuration settings for use while developing the app on your personal"
  },
  {
    "path": "docs/anatomy/config/locales/de.json.md",
    "chars": 129,
    "preview": "# config/locales/de.json\n\nThis file is where German locale information is stored.\n\n<docmeta name=\"displayName\" value=\"de"
  },
  {
    "path": "docs/anatomy/config/locales/en.json.md",
    "chars": 127,
    "preview": "# config/locales/en.json\n\nThis file is where English locale settings are stored.\n\n<docmeta name=\"displayName\" value=\"en."
  },
  {
    "path": "docs/anatomy/config/locales/es.json.md",
    "chars": 127,
    "preview": "# config/locales/es.json\n\nThis file is where Spanish locale settings are stored.\n\n<docmeta name=\"displayName\" value=\"es."
  },
  {
    "path": "docs/anatomy/config/locales/fr.json.md",
    "chars": 126,
    "preview": "# config/locales/fr.json\n\nThis file is where French locale settings are stored.\n\n<docmeta name=\"displayName\" value=\"fr.j"
  },
  {
    "path": "docs/anatomy/config/locales/locales.md",
    "chars": 337,
    "preview": "# config/locales\n\nThis folder contains the information that is used by your app in supporting visiting client's differen"
  },
  {
    "path": "docs/anatomy/config/log.js.md",
    "chars": 466,
    "preview": "# config/log.js\n\nThis file contains the logger configuration for your Sails app.\n\nConfigure the log level for your app, "
  },
  {
    "path": "docs/anatomy/config/models.js.md",
    "chars": 320,
    "preview": "# config/models.js\n\nUnless you override them, the properties contained in this file will be included in each of your mod"
  },
  {
    "path": "docs/anatomy/config/policies.js.md",
    "chars": 650,
    "preview": "# config/policies.js\n\nThis file contains the default policies for your app.\n\nPolicies are simply Express middleware func"
  },
  {
    "path": "docs/anatomy/config/routes.js.md",
    "chars": 1164,
    "preview": "# config/routes.js\n\nThis file contains custom routes.  Sails uses these routes to determine what to do each time it rece"
  },
  {
    "path": "docs/anatomy/config/security.js.md",
    "chars": 924,
    "preview": "# config/security.js\n\nThis file is the conventional home of your Sails app's global security settings.  For a complete r"
  },
  {
    "path": "docs/anatomy/config/session.js.md",
    "chars": 1045,
    "preview": "# config/session.js\n\nThis file contains information that tells Sails where to store your sessions.\n\nSails session integr"
  },
  {
    "path": "docs/anatomy/config/sockets.js.md",
    "chars": 816,
    "preview": "# config/sockets.js\n\nThis is a configuration file that allows you to customize the way your app talks to clients over So"
  },
  {
    "path": "docs/anatomy/config/views.js.md",
    "chars": 567,
    "preview": "# config/views.js\n\nThis file is where Sails looks to find out which templating engine to use when rendering server side "
  },
  {
    "path": "docs/anatomy/gitignore.md",
    "chars": 726,
    "preview": "# .gitignore\n\nThis file is only relevant if you are using git.\n\nIt informs `git` of any files that you don't want `pushe"
  },
  {
    "path": "docs/anatomy/package.json.md",
    "chars": 362,
    "preview": "# package.json\n\nThis is a standard configuration file for [npm](https://npmjs.org/doc/json.html). Among other things, th"
  },
  {
    "path": "docs/anatomy/sailsrc.md",
    "chars": 386,
    "preview": "# .sailsrc\n\nThis file is useful for setting configuration that you want to generate programmatically.  You can also use "
  },
  {
    "path": "docs/anatomy/tasks/config/babel.js.md",
    "chars": 716,
    "preview": "# tasks/config/babel.js\n\nThis file configures a Grunt task called \"babel\".\n\nThis task is used to <a href=\"https://en.wik"
  },
  {
    "path": "docs/anatomy/tasks/config/clean.js.md",
    "chars": 548,
    "preview": "# tasks/config/clean.js\n\nThis file configures a Grunt task called \"clean\".\n\nThis task is used when preparing for a new p"
  },
  {
    "path": "docs/anatomy/tasks/config/coffee.js.md",
    "chars": 1201,
    "preview": "# tasks/config/coffee.js\n\nThis file configures a Grunt task called \"coffee\".\n\nBy default, this compiles CoffeeScript fil"
  },
  {
    "path": "docs/anatomy/tasks/config/concat.js.md",
    "chars": 648,
    "preview": "# tasks/config/concat.js\n\nThis file configures a Grunt task called \"concat\".\n\nIt concatenates the contents of multiple J"
  },
  {
    "path": "docs/anatomy/tasks/config/config.md",
    "chars": 357,
    "preview": "# tasks/config/\n\nThis folder contains the default Grunt task configuration used by the main entry points in [`tasks/regi"
  },
  {
    "path": "docs/anatomy/tasks/config/copy.js.md",
    "chars": 758,
    "preview": "# tasks/config/copy.js\n\nThis file configures a Grunt task called \"copy\".\n\nCopy files and/or folders from your `assets/` "
  },
  {
    "path": "docs/anatomy/tasks/config/cssmin.js.md",
    "chars": 576,
    "preview": "# tasks/config/cssmin.js\n\nThis file configures a Grunt task called \"cssmin\".\n\nIt minifies the intermediate, concatenated"
  },
  {
    "path": "docs/anatomy/tasks/config/hash.js.md",
    "chars": 461,
    "preview": "# tasks/config/hash.js\n\n\nThis file configures a Grunt task called \"hash\".\n\nThis task implements cache-busting for minifi"
  },
  {
    "path": "docs/anatomy/tasks/config/jst.js.md",
    "chars": 2092,
    "preview": "# tasks/config/jst.js\n\n\nThis file configures a Grunt task called \"jst\".\n\nIt precompiles HTML templates using Underscore/"
  },
  {
    "path": "docs/anatomy/tasks/config/less.js.md",
    "chars": 1358,
    "preview": "# tasks/config/less.js\n\n\nThis file configures a Grunt task called \"less\".\n\nIts job is to compile your LESS files into a "
  },
  {
    "path": "docs/anatomy/tasks/config/sails-linker.js.md",
    "chars": 1844,
    "preview": "# tasks/config/sails-linker.js\n\nThis file configures a Grunt task called \"sails-linker\".\n\nAutomatically inject `<script>"
  },
  {
    "path": "docs/anatomy/tasks/config/sync.js.md",
    "chars": 615,
    "preview": "# tasks/config/sync.js\n\n\nThis file configures a Grunt task called \"sync\".\n\nThis task synchronizes one directory with ano"
  },
  {
    "path": "docs/anatomy/tasks/config/uglify.js.md",
    "chars": 1043,
    "preview": "# tasks/config/uglify.js\n\nThis file configures a Grunt task called \"uglify\".\n\nIts job is to <a target=\"_blank\" href=\"htt"
  },
  {
    "path": "docs/anatomy/tasks/config/watch.js.md",
    "chars": 485,
    "preview": "# tasks/config/watch.js\n\nThis file configures a Grunt task called \"watch\".\n\nIt runs predefined tasks whenever watched fi"
  },
  {
    "path": "docs/anatomy/tasks/pipeline.js.md",
    "chars": 608,
    "preview": "# tasks/pipeline.js\n\nThe `pipeline.js` file in your Sails app determines the order in which your stylesheets,\nJavaScript"
  },
  {
    "path": "docs/anatomy/tasks/register/build.js.md",
    "chars": 572,
    "preview": "# tasks/register/build.js\n\nThis Grunt tasklist will be executed if you run `sails www` or `grunt build` in a development"
  },
  {
    "path": "docs/anatomy/tasks/register/buildProd.js.md",
    "chars": 494,
    "preview": "# tasks/register/buildProd.js\n\nThis Grunt tasklist will be executed instead of `build` if you run `sails www` in a produ"
  },
  {
    "path": "docs/anatomy/tasks/register/compileAssets.js.md",
    "chars": 248,
    "preview": "# tasks/register/compileAssets.js\n\nThis Grunt tasklist is not designed to be used directly-- rather it is a supporting m"
  },
  {
    "path": "docs/anatomy/tasks/register/default.js.md",
    "chars": 811,
    "preview": "# tasks/register/default.js\n\nThis is the default Grunt tasklist that will be executed if you\n run `grunt` in the top lev"
  },
  {
    "path": "docs/anatomy/tasks/register/linkAssets.js.md",
    "chars": 286,
    "preview": "# tasks/register/linkAssets.js\n\nThis Grunt tasklist is not designed to be used directly-- rather it is a supporting modu"
  },
  {
    "path": "docs/anatomy/tasks/register/linkAssetsBuild.js.md",
    "chars": 216,
    "preview": "# tasks/register/linkAssetsBuild.js\n\nThis Grunt tasklist is not designed to be used directly-- rather it is a supporting"
  },
  {
    "path": "docs/anatomy/tasks/register/linkAssetsBuildProd.js.md",
    "chars": 227,
    "preview": "# tasks/register/linkAssetsBuildProd.js\n\nThis Grunt tasklist is not designed to be used directly-- rather it is a suppor"
  },
  {
    "path": "docs/anatomy/tasks/register/polyfill.js.md",
    "chars": 1198,
    "preview": "# tasks/register/polyfill.js\n\nThis file configures a Grunt task called \"polyfill\".\n\nAdd a polyfill.js file to the public"
  },
  {
    "path": "docs/anatomy/tasks/register/prod.js.md",
    "chars": 233,
    "preview": "# tasks/register/prod.js\n\nThis Grunt tasklist will be executed instead of `default` when your Sails app is lifted in a p"
  },
  {
    "path": "docs/anatomy/tasks/register/register.md",
    "chars": 769,
    "preview": "# tasks/register/\n\nThis folder contains the Grunt tasks that Sails runs by default.\n\nFor more information, see [Assets >"
  },
  {
    "path": "docs/anatomy/tasks/register/syncAssets.js.md",
    "chars": 228,
    "preview": "# tasks/register/syncAssets.js\n\nThis Grunt tasklist is not designed to be used directly-- rather it is a supporting modu"
  },
  {
    "path": "docs/anatomy/tasks/tasks.md",
    "chars": 4105,
    "preview": "# tasks/\n\nThe `tasks/` directory is a suite of Grunt tasks and their configurations, bundled for your convenience.  The "
  },
  {
    "path": "docs/anatomy/views/.eslintrc.md",
    "chars": 927,
    "preview": "# views/.eslintrc\n\nThis file overrides your Sails app's top-level [ESLint](https://eslint.org/) configuration, specifica"
  },
  {
    "path": "docs/anatomy/views/404.ejs.md",
    "chars": 502,
    "preview": "# views/404.ejs\n\nThis is the default \"404: Not Found\" page. User agents that don't \"Accept\" HTML will see a JSON version"
  },
  {
    "path": "docs/anatomy/views/500.ejs.md",
    "chars": 592,
    "preview": "# views/500.ejs\n\nThis is the default \"500: Server Error\" page. User agents that don't \"Accept\" HTML will see a JSON vers"
  },
  {
    "path": "docs/anatomy/views/layouts/layout.ejs.md",
    "chars": 552,
    "preview": "# views/layouts/layout.ejs\n\nThis [Embedded JavaScript file](http://ejs.co/) acts as the default layout for all server si"
  },
  {
    "path": "docs/anatomy/views/layouts/layouts.md",
    "chars": 367,
    "preview": "# views/layouts/\n\nThis directory initially contains the default layout for your app, `layout.ejs`, but you can add any o"
  },
  {
    "path": "docs/anatomy/views/pages/homepage.ejs.md",
    "chars": 672,
    "preview": "# views/pages/homepage.ejs\n\nThis is the actual template that is rendered by default when a user visits the base URL of y"
  },
  {
    "path": "docs/anatomy/views/pages/pages.md",
    "chars": 269,
    "preview": "# views/pages/\n\nThis is the directory that holds the homepage, and any other page files you add to it.\n\nThis folder is m"
  },
  {
    "path": "docs/anatomy/views/views.md",
    "chars": 376,
    "preview": "# views/\n\nThis is the directory that holds all of your custom views.\n\nTo create a custom view, create a new directory in"
  },
  {
    "path": "docs/concepts/ActionsAndControllers/ActionsAndControllers.md",
    "chars": 12441,
    "preview": "# Actions and controllers\n\n### Overview\n\n_Actions_ are responsible for responding to *requests* from a web browser, mobi"
  },
  {
    "path": "docs/concepts/ActionsAndControllers/GeneratingActions.md",
    "chars": 1949,
    "preview": "# Generating controllers or standalone actions\n\nYou can use [`sails-generate`](https://sailsjs.com/documentation/referen"
  },
  {
    "path": "docs/concepts/ActionsAndControllers/RoutingToActions.md",
    "chars": 2132,
    "preview": "# Routing to actions\n\n### Manual routing\n\nBy default, controller actions in your Sails app will be inaccessible to users"
  },
  {
    "path": "docs/concepts/Assets/Assets.md",
    "chars": 2563,
    "preview": "# Assets\n\n### Overview\n\nAssets refer to [static files](http://en.wikipedia.org/wiki/Static_web_page) (js, css, images, e"
  },
  {
    "path": "docs/concepts/Assets/DefaultTasks.md",
    "chars": 4833,
    "preview": "# Default tasks\n\n### Overview\n\nThe asset pipeline bundled in Sails is a set of Grunt tasks configured with conventional "
  },
  {
    "path": "docs/concepts/Assets/DisablingGrunt.md",
    "chars": 1549,
    "preview": "# Disabling Grunt\n\nTo disable Grunt integration in Sails, simply delete your Gruntfile (and/or [`tasks/`](https://sailsj"
  },
  {
    "path": "docs/concepts/Assets/TaskAutomation.md",
    "chars": 9060,
    "preview": "# Task automation\n\n### Overview\n\nThe [`tasks/`](https://sailsjs.com/documentation/anatomy/tasks) directory contains a su"
  },
  {
    "path": "docs/concepts/Blueprints/Blueprint Actions.md",
    "chars": 4896,
    "preview": "# Blueprint actions\n\nBlueprint actions (not to be confused with implicit [blueprint \"action\" _routes_](https://sailsjs.c"
  },
  {
    "path": "docs/concepts/Blueprints/Blueprint Routes.md",
    "chars": 11602,
    "preview": "# Blueprint routes\n\nWhen you run `sails lift` with blueprints enabled, the framework inspects your models and configurat"
  },
  {
    "path": "docs/concepts/Blueprints/Blueprints.md",
    "chars": 1600,
    "preview": "# Blueprints\n\n### Overview\n\nLike any good web framework, Sails aims to reduce both the amount of code you write and the "
  },
  {
    "path": "docs/concepts/Configuration/Configuration.md",
    "chars": 13940,
    "preview": "# Configuration\n\n### Overview\n\nWhile Sails dutifully adheres to the philosophy of [convention-over-configuration](http:/"
  },
  {
    "path": "docs/concepts/Configuration/localjsfile.md",
    "chars": 1200,
    "preview": "# The `config/local.js` file\n\nThe config/local.js file is useful for configuring a Sails app for your local environment "
  },
  {
    "path": "docs/concepts/Configuration/usingsailsrcfiles.md",
    "chars": 1197,
    "preview": "# Using .sailsrc files\n\nIn addition to the other methods of configuring your app, you can also specify configuration for"
  },
  {
    "path": "docs/concepts/Deployment/Deployment.md",
    "chars": 11033,
    "preview": "# Deployment\n\n### Before you deploy\n\nBefore you launch any web application, you should ask yourself a few questions:\n\n+ "
  },
  {
    "path": "docs/concepts/Deployment/FAQ.md",
    "chars": 4580,
    "preview": "# FAQ\n\n\n### Can I use environment variables?\n\nYes! Like any Node app, your environment variables are available as `proce"
  },
  {
    "path": "docs/concepts/Deployment/Hosting.md",
    "chars": 9234,
    "preview": "# Hosting\n\nHere is a non-comprehensive list of Node/Sails hosting providers and a few available community tutorials.  Ke"
  },
  {
    "path": "docs/concepts/Deployment/Scaling.md",
    "chars": 6678,
    "preview": "# Scaling\n\nIf you have the immediate expectation of lots of traffic to your application (or better yet, you already have"
  },
  {
    "path": "docs/concepts/E-commerce/E-commerce.md",
    "chars": 1025,
    "preview": "# E-commerce\n\nLike any web application framework, Sails can be used for e-commerce apps. Depending on your project's spe"
  },
  {
    "path": "docs/concepts/File Uploads/File Uploads.md",
    "chars": 8860,
    "preview": "# File uploads\n\nUploading files in Sails is similar to uploading files for a vanilla Node.js or Express application. How"
  },
  {
    "path": "docs/concepts/File Uploads/uploading-to-amazon-s3.md",
    "chars": 934,
    "preview": "# Uploading to Amazon S3\n\n> Please note that your Amazon S3 bucket must be created in the 'US East (N. Virginia)' region"
  },
  {
    "path": "docs/concepts/File Uploads/uploading-to-mongo-gridfs.md",
    "chars": 770,
    "preview": "# Uploading to Mongo GridFS\n\nUploading files to MongoDB is possible thanks to Mongo's GridFS filesystem.  With Sails, yo"
  },
  {
    "path": "docs/concepts/Globals/DisablingGlobals.md",
    "chars": 1109,
    "preview": "# Disabling globals\n\nSails determines which globals to expose by looking at [`sails.config.globals`](https://sailsjs.com"
  },
  {
    "path": "docs/concepts/Globals/Globals.md",
    "chars": 1774,
    "preview": "# Globals\n### Overview\n\nFor convenience, Sails exposes a handful of global variables.  By default, your app's [models](h"
  },
  {
    "path": "docs/concepts/Helpers/ExampleHelper.md",
    "chars": 5116,
    "preview": "# An example helper\n\nA common use of helpers is to encapsulate some repeated database queries.  For example, suppose our"
  },
  {
    "path": "docs/concepts/Helpers/Helpers.md",
    "chars": 16118,
    "preview": "# Helpers\n\nAs of v1.0, all Sails apps come with built-in support for **helpers**, simple utilities that let you share No"
  },
  {
    "path": "docs/concepts/Internationalization/Internationalization.md",
    "chars": 5560,
    "preview": "# Internationalization\n\n### Overview\n\nIf your app will touch people or systems from all over the world, internationaliza"
  },
  {
    "path": "docs/concepts/Internationalization/Locales.md",
    "chars": 3244,
    "preview": "# Locales\n\n### Overview\n\nThe i18n hook reads JSON-formatted translation files from your project's \"locales\" directory (`"
  },
  {
    "path": "docs/concepts/Internationalization/TranslatingDynamicContent.md",
    "chars": 1156,
    "preview": "### Translating dynamic content\n\nIf your backend is storing interlingual data (e.g. product data is entered in multiple "
  },
  {
    "path": "docs/concepts/Logging/Custom log messages.md",
    "chars": 3920,
    "preview": "# Custom log messages\n\nIt is often useful to emit custom log messages or events from your application code; whether you "
  },
  {
    "path": "docs/concepts/Logging/Logging.md",
    "chars": 2934,
    "preview": "# Logging\n\nSails comes with a simple, built-in logger called [`captains-log`](https://github.com/balderdashy/captains-lo"
  },
  {
    "path": "docs/concepts/Middleware/ConventionalDefaults.md",
    "chars": 2554,
    "preview": "# Conventional defaults\n\nSails comes bundled with a suite of conventional HTTP middleware, ready to use.  Naturally, you"
  },
  {
    "path": "docs/concepts/Middleware/Middleware.md",
    "chars": 8537,
    "preview": "# Middleware\n\nTechnically, much of the code you&rsquo;ll write in a Sails app is _middleware_, in that runs in between t"
  },
  {
    "path": "docs/concepts/ORM/Associations/Associations.md",
    "chars": 3549,
    "preview": "# Associations\n\n### Overview\n\nIn addition to being literal types like `string` and `number`, attributes in a Sails model"
  },
  {
    "path": "docs/concepts/ORM/Associations/ManytoMany.md",
    "chars": 5923,
    "preview": "# Many-to-many\n\n**AKA \"Has and Belongs To Many\"**\n\n### Overview\n\nA many-to-many association states that one record can b"
  },
  {
    "path": "docs/concepts/ORM/Associations/OneWayAssociation.md",
    "chars": 1871,
    "preview": "# One way association\n\n**AKA \"Belongs To\"**\n\n### Overview\n\nA one way association is where a model is associated with ano"
  },
  {
    "path": "docs/concepts/ORM/Associations/OnetoMany.md",
    "chars": 2294,
    "preview": "# One-to-many\n\n**AKA \"Has Many\"**\n\n### Overview\n\nA one-to-many association states that a model can be associated with ma"
  },
  {
    "path": "docs/concepts/ORM/Associations/OnetoOne.md",
    "chars": 2436,
    "preview": "# One-to-one\n\n**AKA \"has one\"**\n\n### Overview\n\nA one-to-one association states that a model may only be associated with "
  },
  {
    "path": "docs/concepts/ORM/Associations/Reflexive.md",
    "chars": 2570,
    "preview": "# Reflexive associations\n\n### Overview\n\nIn most cases, an association will be between attributes of two different models"
  },
  {
    "path": "docs/concepts/ORM/Associations/ThroughAssociations.md",
    "chars": 1767,
    "preview": "# Through associations\n\n**AKA \"has many through\"**\n\n### Overview\n\nMany-to-many through associations behave in the same w"
  },
  {
    "path": "docs/concepts/ORM/Attributes.md",
    "chars": 12079,
    "preview": "# Attributes\n### Overview\n\nModel attributes are basic pieces of information about a model.  For example, a model called "
  },
  {
    "path": "docs/concepts/ORM/Lifecyclecallbacks.md",
    "chars": 2372,
    "preview": "# Lifecycle callbacks\n\n### Overview\n\nLifecycle callbacks are functions that are called before or after certain model met"
  },
  {
    "path": "docs/concepts/ORM/Models.md",
    "chars": 7749,
    "preview": "# Models\n\nA model represents a set of structured data, called records.  Models usually correspond to a table/collection "
  },
  {
    "path": "docs/concepts/ORM/ORM.md",
    "chars": 10498,
    "preview": "# Waterline: SQL/noSQL Data Mapper (ORM/ODM)\n\n\nSails comes installed with a powerful [ORM/ODM](http://stackoverflow.com/"
  },
  {
    "path": "docs/concepts/ORM/Querylanguage.md",
    "chars": 8531,
    "preview": "# Waterline query language\n\nThe syntax supported by Sails' model methods is called Waterline Query Language.  Waterline "
  },
  {
    "path": "docs/concepts/ORM/Records.md",
    "chars": 3803,
    "preview": "# Records\n\nA _record_ is what you get back from `.find()` or `.findOne()`.  Each record is a uniquely identifiable objec"
  },
  {
    "path": "docs/concepts/ORM/Validations.md",
    "chars": 21373,
    "preview": "# Validations\n\nSails bundles support for automatic validations of your models' attributes. Any time a record is updated,"
  },
  {
    "path": "docs/concepts/ORM/errors.md",
    "chars": 5818,
    "preview": "# Errors\n\nWhen a call to any model method or helper fails, Sails throws a [JavaScript Error instance](https://developer."
  },
  {
    "path": "docs/concepts/ORM/model-settings.md",
    "chars": 24994,
    "preview": "# Model settings\n\nIn Sails, the top-level properties of model definitions are called **model settings**.  This includes "
  },
  {
    "path": "docs/concepts/ORM/standalone-usage.md",
    "chars": 13451,
    "preview": "# Standalone Waterline usage\n\nIn addition to built-in usage with the Sails framework, Waterline can be used as a standal"
  },
  {
    "path": "docs/concepts/Policies/Permissions.md",
    "chars": 3560,
    "preview": "# Access control and permissions\n\nPolicies in Sails are designed for controlling binary (\"yes or no\") access to particul"
  },
  {
    "path": "docs/concepts/Policies/Policies.md",
    "chars": 7597,
    "preview": "# Policies\n### Overview\n\nPolicies in Sails are versatile tools for authorization and access control: they let you execut"
  },
  {
    "path": "docs/concepts/Programmatic Usage/Programmatic Usage.md",
    "chars": 7843,
    "preview": "# Using Sails programmatically\n\n### Overview\n\nUsually you will interact with Sails through its [command-line interface]("
  },
  {
    "path": "docs/concepts/Programmatic Usage/Tips and Tricks.md",
    "chars": 1270,
    "preview": "# Tips and tricks for programmatic usage\n\nWhen loading a Sails app programmatically, you will usually want to turn off h"
  },
  {
    "path": "docs/concepts/README.md",
    "chars": 645,
    "preview": "# docs/concepts\n\nThis section contains the markdown files which are compiled to HTML and eventually made available as co"
  },
  {
    "path": "docs/concepts/Realtime/Multi-server environments.md",
    "chars": 2973,
    "preview": "# Realtime communication in a multi-server (aka \"clustered\") environment\n\nWith the default configuration, Sails allows r"
  },
  {
    "path": "docs/concepts/Realtime/On the client.md",
    "chars": 3415,
    "preview": "# Realtime communication between the client and the server\n\nThe easiest way to send a realtime message from a client to "
  },
  {
    "path": "docs/concepts/Realtime/On the server.md",
    "chars": 3297,
    "preview": "# Sending realtime messages from the server to one or more clients\n\n### Overview\n\nSails exposes two APIs for communicati"
  },
  {
    "path": "docs/concepts/Realtime/Realtime.md",
    "chars": 7148,
    "preview": "# Realtime communication (aka Sockets)\n\n### Overview\n\nSails apps are capable of full-duplex, realtime communication betw"
  },
  {
    "path": "docs/concepts/Routes/RouteTargetSyntax.md",
    "chars": 17465,
    "preview": "# Custom routes\n\n### Overview\n\nSails allows you to explicitly route URLs in several different ways in your **config/rout"
  },
  {
    "path": "docs/concepts/Routes/Routes.md",
    "chars": 6495,
    "preview": "# Routes\n\n### Overview\n\nThe most basic feature of any web application is the ability to interpret a request sent to a UR"
  },
  {
    "path": "docs/concepts/Security/CORS.md",
    "chars": 4177,
    "preview": "# Cross-Origin Resource Sharing (CORS)\n\n<!--\nEvery Sails app comes ready to handle AJAX requests from a web page on the "
  },
  {
    "path": "docs/concepts/Security/CSRF.md",
    "chars": 8608,
    "preview": "# CSRF\n\nCross-site request forgery ([CSRF](https://www.owasp.org/index.php/Cross-Site_Request_Forgery)) is a type of att"
  },
  {
    "path": "docs/concepts/Security/Clickjacking.md",
    "chars": 1068,
    "preview": "# Clickjacking\n\n\n[Clickjacking](https://www.owasp.org/index.php/Clickjacking) (aka \"UI redress attacks\") happens when an"
  },
  {
    "path": "docs/concepts/Security/ContentSecurityPolicy.md",
    "chars": 3645,
    "preview": "# Content security policy\n\n[Content Security Policy (CSP)](https://www.owasp.org/index.php/Clickjacking) is a [W3C speci"
  },
  {
    "path": "docs/concepts/Security/DDOS.md",
    "chars": 2849,
    "preview": "# DDOS\n\nThe prevention of [denial of service attacks](https://www.owasp.org/index.php/Application_Denial_of_Service) is "
  },
  {
    "path": "docs/concepts/Security/P3P.md",
    "chars": 3614,
    "preview": "# P3P\n\n### Background\n\nP3P stands for the \"Platform for Privacy Preferences\" and is a browser/web standard designed to f"
  },
  {
    "path": "docs/concepts/Security/Security.md",
    "chars": 1284,
    "preview": "# Security\n\n### Overview\n\nSails and Express provide built-in, easily configurable protection against most known types of"
  },
  {
    "path": "docs/concepts/Security/SocketHijacking.md",
    "chars": 1643,
    "preview": "# Socket hijacking\n\nUnfortunately, cross-site request forgery attacks are not limited to the HTTP protocol.  WebSocket h"
  },
  {
    "path": "docs/concepts/Security/StrictTransportSecurity.md",
    "chars": 1499,
    "preview": "# HTTP Strict Transport Security\n\nStrict Transport Security (STS) is an opt-in security enhancement that forces usage of"
  },
  {
    "path": "docs/concepts/Security/XSS.md",
    "chars": 3548,
    "preview": "# XSS\n\nCross-site scripting (XSS) is a type of attack in which a malicious agent manages to inject client-side JavaScrip"
  },
  {
    "path": "docs/concepts/Services/Services.md",
    "chars": 1271,
    "preview": "# Services\n\n> _**Note**_: Although Services are still fully supported in Sails 1.0, it is recommended that you use [help"
  },
  {
    "path": "docs/concepts/Sessions/sessions.md",
    "chars": 8805,
    "preview": "# How sessions work in Sails (advanced)\n\nFor our purposes, **sessions** are defined to be a few components that together"
  },
  {
    "path": "docs/concepts/Testing/Testing.md",
    "chars": 9444,
    "preview": "# Testing your code\n\nThis section of the documentation runs through how you might go about testing your Sails applicatio"
  }
]

// ... and 518 more files (download for full content)

About this extraction

This page contains the full source code of the balderdashy/sails GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 718 files (2.7 MB), approximately 752.1k tokens, and a symbol index with 79 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!