gina 0.0.9-p91b → 0.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +46 -0
- package/{core/asset/html/static.html → Icon/r} +0 -0
- package/LICENSE +1 -1
- package/README-4Contributors.md +96 -0
- package/README.md +296 -104
- package/bin/cli +287 -0
- package/bin/cli-debug +60 -0
- package/bin/cmd +184 -0
- package/bin/gina +180 -0
- package/config/logger.json +17 -0
- package/doc/framework/cli/doc.json +9 -0
- package/doc/framework/index.md +60 -0
- package/framework/v0.1.1-alpha.2/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.2}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.2/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.2/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.2/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.2/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.2/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.2/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.2/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.2/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.2/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.2/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.2/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.2/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.2/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.2/core/router.js +664 -0
- package/framework/v0.1.1-alpha.2/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.2/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.2/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.2/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.2/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.2/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.2/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.2/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.2/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.2/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.2/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.2/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.2/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.2/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.2/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.2/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.2/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.2/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.2/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.2/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.2/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.2/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/main.js +734 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.2/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.2/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.2/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.2/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.2/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.2/package.json +14 -0
- package/package.json +35 -33
- package/resources/etc/init.d/debian/gina +117 -0
- package/resources/home/framework/env.json +34 -0
- package/resources/home/framework/locals.json +14 -0
- package/resources/home/framework/project.json +48 -0
- package/resources/home/framework/projects.json +6 -0
- package/resources/home/main.json +47 -0
- package/resources/home/settings.json +22 -0
- package/resources/home/user/extensions/logger/default/config.json +77 -0
- package/resources/home/user/extensions/logger/file/config.json +11 -0
- package/resources/img/android-chrome-192x192.png +0 -0
- package/resources/img/android-chrome-512x512.png +0 -0
- package/resources/img/apple-touch-icon.png +0 -0
- package/resources/img/favicon-16x16.png +0 -0
- package/resources/img/favicon-32x32.png +0 -0
- package/resources/img/favicon.ico +0 -0
- package/resources/package.json.template +50 -0
- package/script/lib.js +24 -0
- package/script/post_install.js +449 -157
- package/script/pre_install.js +277 -36
- package/script/prepare_version.js +425 -0
- package/utils/helper.js +438 -0
- package/utils/prototypes.js +239 -0
- package/utils/prototypes.json_clone.js +175 -0
- package/.npmignore +0 -6
- package/MIDDLEWARE +0 -1
- package/SUCCESS +0 -1
- package/VERSION +0 -1
- package/core/asset/html/nolayout.html +0 -1
- package/core/asset/js/plugin/build.dev.json +0 -28
- package/core/asset/js/plugin/build.json +0 -31
- package/core/asset/js/plugin/dist/gina.min.css +0 -1
- package/core/asset/js/plugin/dist/gina.min.css.map +0 -1
- package/core/asset/js/plugin/dist/gina.min.js +0 -13731
- package/core/asset/js/plugin/dist/gina.min.js.map +0 -42
- package/core/asset/js/plugin/dist/gina.onload.min.js +0 -3
- package/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
- package/core/asset/js/plugin/readme.md +0 -152
- package/core/asset/js/plugin/src/gina/main.js +0 -132
- package/core/asset/js/plugin/src/gina/popin/css/design.css +0 -23
- package/core/asset/js/plugin/src/gina/popin/css/main.css +0 -1112
- package/core/asset/js/plugin/src/gina/popin/css/popin.css +0 -3
- package/core/asset/js/plugin/src/gina/popin/css/popin.css.map +0 -1
- package/core/asset/js/plugin/src/gina/popin/doc/TOC.md +0 -29
- package/core/asset/js/plugin/src/gina/popin/doc/css.md +0 -162
- package/core/asset/js/plugin/src/gina/popin/doc/extend.md +0 -663
- package/core/asset/js/plugin/src/gina/popin/doc/faq.md +0 -46
- package/core/asset/js/plugin/src/gina/popin/doc/html.md +0 -227
- package/core/asset/js/plugin/src/gina/popin/doc/js.md +0 -37
- package/core/asset/js/plugin/src/gina/popin/doc/misc.md +0 -178
- package/core/asset/js/plugin/src/gina/popin/doc/usage.md +0 -130
- package/core/asset/js/plugin/src/gina/popin/main.js +0 -783
- package/core/asset/js/plugin/src/gina/popin/sass/config.sass +0 -37
- package/core/asset/js/plugin/src/gina/popin/sass/gina-design.sass +0 -622
- package/core/asset/js/plugin/src/gina/popin/sass/gina-popin.sass +0 -54
- package/core/asset/js/plugin/src/gina/popin/sass/helper.scss +0 -73
- package/core/asset/js/plugin/src/gina/toolbar/.npmignore +0 -19
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css +0 -433
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css.map +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/index.html +0 -285
- package/core/asset/js/plugin/src/gina/toolbar/index.kit +0 -120
- package/core/asset/js/plugin/src/gina/toolbar/jquery-3.1.0.min.js +0 -4
- package/core/asset/js/plugin/src/gina/toolbar/main.js +0 -693
- package/core/asset/js/plugin/src/gina/toolbar/mock.gina.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/mock.user.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/readme.md +0 -7
- package/core/asset/js/plugin/src/gina/toolbar/sass/toolbar.sass +0 -563
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/info-optim.svg +0 -13
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/logo-gina.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings-big.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.afdesign +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/test.jpg +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/toolbar.html +0 -104
- package/core/asset/js/plugin/src/gina/utils/dom.js +0 -24
- package/core/asset/js/plugin/src/gina/utils/events.js +0 -201
- package/core/asset/js/plugin/src/gina/utils/loader.js +0 -57
- package/core/asset/js/plugin/src/main.js +0 -235
- package/core/asset/js/plugin/src/vendor/jquery/1.11.1-css-event_alias.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/1.12.4.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/2.1.1-css-event_alias-sizzle.min.js +0 -4
- package/core/asset/js/plugin/src/vendor/jquery/README.md +0 -14
- package/core/asset/js/plugin/src/vendor/jquery/slim-3.1.1.min.js +0 -4
- package/core/config.js +0 -1225
- package/core/controller/controller.js +0 -1860
- package/core/gna.js +0 -908
- package/core/plugins/lib/validator/src/form-validator.js +0 -788
- package/core/plugins/lib/validator/src/main.js +0 -2056
- package/core/router.js +0 -717
- package/core/server.js +0 -1363
- package/core/template/conf/env.json +0 -70
- package/core/template/conf/settings.json +0 -48
- package/core/template/conf/statics.json +0 -6
- package/core/template/conf/views.json +0 -16
- package/core/template/samples/bundle/config/app.json +0 -4
- package/core/template/samples/bundle/config/routing.json +0 -9
- package/core/template/samples/bundle/controllers/setup.js +0 -33
- package/core/template/views/js/vendor/readme.md +0 -1
- package/core/template/views/readme.md +0 -1
- package/core/utils/helpers/dateFormat.js +0 -264
- package/core/utils/helpers/index.js +0 -202
- package/core/utils/index.js +0 -75
- package/core/utils/lib/cmd/app.js +0 -686
- package/core/utils/lib/cmd/basic.help.txt +0 -40
- package/core/utils/lib/cmd/basic.js +0 -141
- package/core/utils/lib/cmd/gina-add-bundle.js +0 -328
- package/core/utils/lib/cmd/gina-add-views.js +0 -99
- package/core/utils/lib/cmd/gina-build.js +0 -218
- package/core/utils/lib/cmd/gina-clean.js +0 -26
- package/core/utils/lib/cmd/gina-connect.js +0 -176
- package/core/utils/lib/cmd/gina-delete-bundle.js +0 -176
- package/core/utils/lib/cmd/gina-deploy.js +0 -452
- package/core/utils/lib/cmd/gina-init-project.js +0 -83
- package/core/utils/lib/cmd/gina-start-bundle.js +0 -3
- package/core/utils/lib/cmd/gina-start.js +0 -3
- package/core/utils/lib/cmd/index.js +0 -157
- package/core/utils/lib/cmd/project.js +0 -14
- package/core/utils/lib/collection/src/main.js +0 -650
- package/core/utils/lib/logger/containers/file.js +0 -11
- package/core/utils/lib/logger/index.js +0 -260
- package/core/utils/lib/merge/src/main.js +0 -344
- package/core/utils/lib/proc.js +0 -416
- package/core/utils/lib/routing/src/main.js +0 -165
- package/documentation/css/default.css +0 -3
- package/documentation/html/home.html +0 -6
- package/documentation/html/inc/_footer.html +0 -5
- package/documentation/html/layout.html +0 -21
- package/documentation/img/debug-conf1.png +0 -0
- package/documentation/img/debug-conf2.png +0 -0
- package/documentation/img/debug-conf3.png +0 -0
- package/documentation/img/debug-conf4.png +0 -0
- package/documentation/img/debug-conf5.png +0 -0
- package/documentation/img/debug-conf6.png +0 -0
- package/documentation/img/debug-conf7.png +0 -0
- package/documentation/img/debug-new1.png +0 -0
- package/documentation/img/debug-new2.png +0 -0
- package/documentation/img/debug-start.png +0 -0
- package/documentation/md/api/controller/main.md +0 -74
- package/migration_note.md +0 -7
- package/package-lock.json +0 -611
- package/script/pre_publish.js +0 -207
- package/tutorial/Commands/README.md +0 -56
- package/tutorial/Commands/add-bundle-result.png +0 -0
- package/tutorial/Commands/add-bundle.png +0 -0
- package/tutorial/Commands/delete-bundle.png +0 -0
- package/tutorial/Commands/help.png +0 -0
- package/tutorial/Commands/init-project.png +0 -0
- package/tutorial/Commands/start-bundle-result.png +0 -0
- package/tutorial/Commands/start-bundle-stop.png +0 -0
- package/tutorial/Commands/start-bundle.png +0 -0
- package/tutorial/Commands/version.png +0 -0
- package/tutorial/ETC/README.md +0 -74
- package/tutorial/ETC/add-bundle-result.png +0 -0
- package/tutorial/ETC/add-bundle.png +0 -0
- package/tutorial/ETC/init-project.png +0 -0
- package/tutorial/Install/README.md +0 -54
- package/tutorial/Install/git-get.png +0 -0
- package/tutorial/Install/git-install-end.png +0 -0
- package/tutorial/Install/git-install-result.png +0 -0
- package/tutorial/Install/git-install-start.png +0 -0
- package/tutorial/Install/install-end.png +0 -0
- package/tutorial/Install/install-result.png +0 -0
- package/tutorial/Install/install-start.png +0 -0
- package/tutorial/WebStorm/README.md +0 -30
- package/tutorial/WebStorm/closure-compiler.png +0 -0
- package/tutorial/WebStorm/sass.png +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var fs = require('fs'),
|
|
2
|
+
WritableStream = require('stream').Writable
|
|
3
|
+
|| require('readable-stream').Writable,
|
|
4
|
+
inherits = require('util').inherits;
|
|
5
|
+
|
|
6
|
+
var parseParams = require('./utils').parseParams;
|
|
7
|
+
|
|
8
|
+
function Busboy(opts) {
|
|
9
|
+
if (!(this instanceof Busboy))
|
|
10
|
+
return new Busboy(opts);
|
|
11
|
+
if (opts.highWaterMark !== undefined)
|
|
12
|
+
WritableStream.call(this, { highWaterMark: opts.highWaterMark });
|
|
13
|
+
else
|
|
14
|
+
WritableStream.call(this);
|
|
15
|
+
|
|
16
|
+
this._done = false;
|
|
17
|
+
this._parser = undefined;
|
|
18
|
+
this._finished = false;
|
|
19
|
+
|
|
20
|
+
this.opts = opts;
|
|
21
|
+
if (opts.headers && typeof opts.headers['content-type'] === 'string')
|
|
22
|
+
this.parseHeaders(opts.headers);
|
|
23
|
+
else
|
|
24
|
+
throw new Error('Missing Content-Type');
|
|
25
|
+
}
|
|
26
|
+
inherits(Busboy, WritableStream);
|
|
27
|
+
|
|
28
|
+
Busboy.prototype.emit = function(ev) {
|
|
29
|
+
if (ev === 'finish') {
|
|
30
|
+
if (!this._done) {
|
|
31
|
+
this._parser && this._parser.end();
|
|
32
|
+
return;
|
|
33
|
+
} else if (this._finished) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this._finished = true;
|
|
37
|
+
}
|
|
38
|
+
WritableStream.prototype.emit.apply(this, arguments);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
Busboy.prototype.parseHeaders = function(headers) {
|
|
42
|
+
this._parser = undefined;
|
|
43
|
+
if (headers['content-type']) {
|
|
44
|
+
var parsed = parseParams(headers['content-type']),
|
|
45
|
+
matched, type;
|
|
46
|
+
for (var i = 0; i < TYPES.length; ++i) {
|
|
47
|
+
type = TYPES[i];
|
|
48
|
+
if (typeof type.detect === 'function')
|
|
49
|
+
matched = type.detect(parsed);
|
|
50
|
+
else
|
|
51
|
+
matched = type.detect.test(parsed[0]);
|
|
52
|
+
if (matched)
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
if (matched) {
|
|
56
|
+
var cfg = {
|
|
57
|
+
limits: this.opts.limits,
|
|
58
|
+
headers: headers,
|
|
59
|
+
parsedConType: parsed,
|
|
60
|
+
highWaterMark: undefined,
|
|
61
|
+
fileHwm: undefined,
|
|
62
|
+
defCharset: undefined,
|
|
63
|
+
preservePath: false
|
|
64
|
+
};
|
|
65
|
+
if (this.opts.highWaterMark)
|
|
66
|
+
cfg.highWaterMark = this.opts.highWaterMark;
|
|
67
|
+
if (this.opts.fileHwm)
|
|
68
|
+
cfg.fileHwm = this.opts.fileHwm;
|
|
69
|
+
cfg.defCharset = this.opts.defCharset;
|
|
70
|
+
cfg.preservePath = this.opts.preservePath;
|
|
71
|
+
this._parser = type(this, cfg);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
throw new Error('Unsupported content type: ' + headers['content-type']);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
Busboy.prototype._write = function(chunk, encoding, cb) {
|
|
79
|
+
if (!this._parser)
|
|
80
|
+
return cb(new Error('Not ready to parse. Missing Content-Type?'));
|
|
81
|
+
this._parser.write(chunk, cb);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var TYPES = [
|
|
85
|
+
require('./types/multipart'),
|
|
86
|
+
require('./types/urlencoded'),
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
module.exports = Busboy;
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
// TODO:
|
|
2
|
+
// * support 1 nested multipart level
|
|
3
|
+
// (see second multipart example here:
|
|
4
|
+
// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
|
|
5
|
+
// * support limits.fieldNameSize
|
|
6
|
+
// -- this will require modifications to utils.parseParams
|
|
7
|
+
|
|
8
|
+
var ReadableStream = require('stream').Readable || require('readable-stream'),
|
|
9
|
+
inherits = require('util').inherits;
|
|
10
|
+
|
|
11
|
+
var Dicer = require('dicer');
|
|
12
|
+
|
|
13
|
+
var parseParams = require('../utils').parseParams,
|
|
14
|
+
decodeText = require('../utils').decodeText,
|
|
15
|
+
basename = require('../utils').basename;
|
|
16
|
+
|
|
17
|
+
var RE_BOUNDARY = /^boundary$/i,
|
|
18
|
+
RE_FIELD = /^form-data$/i,
|
|
19
|
+
RE_CHARSET = /^charset$/i,
|
|
20
|
+
RE_FILENAME = /^filename$/i,
|
|
21
|
+
RE_NAME = /^name$/i,
|
|
22
|
+
RE_GROUP = /^group$/i;
|
|
23
|
+
|
|
24
|
+
Multipart.detect = /^multipart\/form-data/i;
|
|
25
|
+
function Multipart(boy, cfg) {
|
|
26
|
+
if (!(this instanceof Multipart))
|
|
27
|
+
return new Multipart(boy, cfg);
|
|
28
|
+
var i,
|
|
29
|
+
len,
|
|
30
|
+
self = this,
|
|
31
|
+
boundary,
|
|
32
|
+
limits = cfg.limits,
|
|
33
|
+
parsedConType = cfg.parsedConType || [],
|
|
34
|
+
defCharset = cfg.defCharset || 'utf8',
|
|
35
|
+
preservePath = cfg.preservePath,
|
|
36
|
+
fileopts = (typeof cfg.fileHwm === 'number'
|
|
37
|
+
? { highWaterMark: cfg.fileHwm }
|
|
38
|
+
: {});
|
|
39
|
+
|
|
40
|
+
for (i = 0, len = parsedConType.length; i < len; ++i) {
|
|
41
|
+
if (Array.isArray(parsedConType[i])
|
|
42
|
+
&& RE_BOUNDARY.test(parsedConType[i][0])) {
|
|
43
|
+
boundary = parsedConType[i][1];
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function checkFinished() {
|
|
49
|
+
if (nends === 0 && finished && !boy._done) {
|
|
50
|
+
finished = false;
|
|
51
|
+
process.nextTick(function() {
|
|
52
|
+
boy._done = true;
|
|
53
|
+
boy.emit('finish');
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (typeof boundary !== 'string')
|
|
59
|
+
throw new Error('Multipart: Boundary not found');
|
|
60
|
+
|
|
61
|
+
var fieldSizeLimit = (limits && typeof limits.fieldSize === 'number'
|
|
62
|
+
? limits.fieldSize
|
|
63
|
+
: 1 * 1024 * 1024),
|
|
64
|
+
fileSizeLimit = (limits && typeof limits.fileSize === 'number'
|
|
65
|
+
? limits.fileSize
|
|
66
|
+
: Infinity),
|
|
67
|
+
filesLimit = (limits && typeof limits.files === 'number'
|
|
68
|
+
? limits.files
|
|
69
|
+
: Infinity),
|
|
70
|
+
fieldsLimit = (limits && typeof limits.fields === 'number'
|
|
71
|
+
? limits.fields
|
|
72
|
+
: Infinity),
|
|
73
|
+
partsLimit = (limits && typeof limits.parts === 'number'
|
|
74
|
+
? limits.parts
|
|
75
|
+
: Infinity);
|
|
76
|
+
|
|
77
|
+
var nfiles = 0,
|
|
78
|
+
nfields = 0,
|
|
79
|
+
nends = 0,
|
|
80
|
+
curFile,
|
|
81
|
+
curField,
|
|
82
|
+
finished = false;
|
|
83
|
+
|
|
84
|
+
this._needDrain = false;
|
|
85
|
+
this._pause = false;
|
|
86
|
+
this._cb = undefined;
|
|
87
|
+
this._nparts = 0;
|
|
88
|
+
this._boy = boy;
|
|
89
|
+
|
|
90
|
+
var parserCfg = {
|
|
91
|
+
boundary: boundary,
|
|
92
|
+
maxHeaderPairs: (limits && limits.headerPairs)
|
|
93
|
+
};
|
|
94
|
+
if (fileopts.highWaterMark)
|
|
95
|
+
parserCfg.partHwm = fileopts.highWaterMark;
|
|
96
|
+
if (cfg.highWaterMark)
|
|
97
|
+
parserCfg.highWaterMark = cfg.highWaterMark;
|
|
98
|
+
|
|
99
|
+
this.parser = new Dicer(parserCfg);
|
|
100
|
+
this.parser.on('drain', function() {
|
|
101
|
+
self._needDrain = false;
|
|
102
|
+
if (self._cb && !self._pause) {
|
|
103
|
+
var cb = self._cb;
|
|
104
|
+
self._cb = undefined;
|
|
105
|
+
cb();
|
|
106
|
+
}
|
|
107
|
+
}).on('part', function onPart(part) {
|
|
108
|
+
if (++self._nparts > partsLimit) {
|
|
109
|
+
self.parser.removeListener('part', onPart);
|
|
110
|
+
self.parser.on('part', skipPart);
|
|
111
|
+
boy.hitPartsLimit = true;
|
|
112
|
+
boy.emit('partsLimit');
|
|
113
|
+
return skipPart(part);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
|
|
117
|
+
// us emit 'end' early since we know the part has ended if we are already
|
|
118
|
+
// seeing the next part
|
|
119
|
+
if (curField) {
|
|
120
|
+
var field = curField;
|
|
121
|
+
field.emit('end');
|
|
122
|
+
field.removeAllListeners('end');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
part.on('header', function(header) {
|
|
126
|
+
var contype,
|
|
127
|
+
fieldname,
|
|
128
|
+
parsed,
|
|
129
|
+
charset,
|
|
130
|
+
encoding,
|
|
131
|
+
filename,
|
|
132
|
+
group,
|
|
133
|
+
nsize = 0;
|
|
134
|
+
|
|
135
|
+
if (header['content-type']) {
|
|
136
|
+
parsed = parseParams(header['content-type'][0]);
|
|
137
|
+
if (parsed[0]) {
|
|
138
|
+
contype = parsed[0].toLowerCase();
|
|
139
|
+
for (i = 0, len = parsed.length; i < len; ++i) {
|
|
140
|
+
if (RE_CHARSET.test(parsed[i][0])) {
|
|
141
|
+
charset = parsed[i][1].toLowerCase();
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (contype === undefined)
|
|
149
|
+
contype = 'text/plain';
|
|
150
|
+
if (charset === undefined)
|
|
151
|
+
charset = defCharset;
|
|
152
|
+
|
|
153
|
+
if (header['content-disposition']) {
|
|
154
|
+
parsed = parseParams(header['content-disposition'][0]);
|
|
155
|
+
if (!RE_FIELD.test(parsed[0]))
|
|
156
|
+
return skipPart(part);
|
|
157
|
+
for (i = 0, len = parsed.length; i < len; ++i) {
|
|
158
|
+
if (RE_NAME.test(parsed[i][0])) {
|
|
159
|
+
fieldname = decodeText(parsed[i][1], 'binary', 'utf8');
|
|
160
|
+
} else if (RE_GROUP.test(parsed[i][0])) {
|
|
161
|
+
group = decodeText(parsed[i][1], 'binary', 'utf8');
|
|
162
|
+
} else if (RE_FILENAME.test(parsed[i][0])) {
|
|
163
|
+
filename = decodeText(parsed[i][1], 'binary', 'utf8');
|
|
164
|
+
if (!preservePath)
|
|
165
|
+
filename = basename(filename);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
} else
|
|
169
|
+
return skipPart(part);
|
|
170
|
+
|
|
171
|
+
if (header['content-transfer-encoding'])
|
|
172
|
+
encoding = header['content-transfer-encoding'][0].toLowerCase();
|
|
173
|
+
else
|
|
174
|
+
encoding = '7bit';
|
|
175
|
+
|
|
176
|
+
var onData,
|
|
177
|
+
onEnd;
|
|
178
|
+
if (contype === 'application/octet-stream' || filename !== undefined) {
|
|
179
|
+
// file/binary field
|
|
180
|
+
if (nfiles === filesLimit) {
|
|
181
|
+
if (!boy.hitFilesLimit) {
|
|
182
|
+
boy.hitFilesLimit = true;
|
|
183
|
+
boy.emit('filesLimit');
|
|
184
|
+
}
|
|
185
|
+
return skipPart(part);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
++nfiles;
|
|
189
|
+
|
|
190
|
+
if (!boy._events.file) {
|
|
191
|
+
self.parser._ignore();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
++nends;
|
|
196
|
+
var file = new FileStream(fileopts);
|
|
197
|
+
curFile = file;
|
|
198
|
+
file.on('end', function() {
|
|
199
|
+
--nends;
|
|
200
|
+
checkFinished();
|
|
201
|
+
if (self._cb && !self._needDrain) {
|
|
202
|
+
var cb = self._cb;
|
|
203
|
+
self._cb = undefined;
|
|
204
|
+
cb();
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
file._read = function(n) {
|
|
208
|
+
if (!self._pause)
|
|
209
|
+
return;
|
|
210
|
+
self._pause = false;
|
|
211
|
+
if (self._cb && !self._needDrain) {
|
|
212
|
+
var cb = self._cb;
|
|
213
|
+
self._cb = undefined;
|
|
214
|
+
cb();
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
boy.emit('file', fieldname, file, filename, encoding, contype, group);
|
|
218
|
+
|
|
219
|
+
onData = function(data) {
|
|
220
|
+
if ((nsize += data.length) > fileSizeLimit) {
|
|
221
|
+
var extralen = (fileSizeLimit - (nsize - data.length));
|
|
222
|
+
if (extralen > 0)
|
|
223
|
+
file.push(data.slice(0, extralen));
|
|
224
|
+
file.emit('limit');
|
|
225
|
+
file.truncated = true;
|
|
226
|
+
part.removeAllListeners('data');
|
|
227
|
+
} else if (!file.push(data))
|
|
228
|
+
self._pause = true;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
onEnd = function() {
|
|
232
|
+
curFile = undefined;
|
|
233
|
+
file.push(null);
|
|
234
|
+
};
|
|
235
|
+
} else {
|
|
236
|
+
// non-file field
|
|
237
|
+
if (nfields === fieldsLimit) {
|
|
238
|
+
if (!boy.hitFieldsLimit) {
|
|
239
|
+
boy.hitFieldsLimit = true;
|
|
240
|
+
boy.emit('fieldsLimit');
|
|
241
|
+
}
|
|
242
|
+
return skipPart(part);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
++nfields;
|
|
246
|
+
++nends;
|
|
247
|
+
var buffer = '',
|
|
248
|
+
truncated = false;
|
|
249
|
+
curField = part;
|
|
250
|
+
|
|
251
|
+
onData = function(data) {
|
|
252
|
+
if ((nsize += data.length) > fieldSizeLimit) {
|
|
253
|
+
var extralen = (fieldSizeLimit - (nsize - data.length));
|
|
254
|
+
buffer += data.toString('binary', 0, extralen);
|
|
255
|
+
truncated = true;
|
|
256
|
+
part.removeAllListeners('data');
|
|
257
|
+
} else
|
|
258
|
+
buffer += data.toString('binary');
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
onEnd = function() {
|
|
262
|
+
curField = undefined;
|
|
263
|
+
if (buffer.length)
|
|
264
|
+
buffer = decodeText(buffer, 'binary', charset);
|
|
265
|
+
boy.emit('field', fieldname, buffer, false, truncated, encoding, contype);
|
|
266
|
+
--nends;
|
|
267
|
+
checkFinished();
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
|
|
272
|
+
broken. Streams2/streams3 is a huge black box of confusion, but
|
|
273
|
+
somehow overriding the sync state seems to fix things again (and still
|
|
274
|
+
seems to work for previous node versions).
|
|
275
|
+
*/
|
|
276
|
+
part._readableState.sync = false;
|
|
277
|
+
|
|
278
|
+
part.on('data', onData);
|
|
279
|
+
part.on('end', onEnd);
|
|
280
|
+
}).on('error', function(err) {
|
|
281
|
+
if (curFile)
|
|
282
|
+
curFile.emit('error', err);
|
|
283
|
+
});
|
|
284
|
+
}).on('error', function(err) {
|
|
285
|
+
boy.emit('error', err);
|
|
286
|
+
}).on('finish', function() {
|
|
287
|
+
finished = true;
|
|
288
|
+
checkFinished();
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
Multipart.prototype.write = function(chunk, cb) {
|
|
293
|
+
var r;
|
|
294
|
+
if ((r = this.parser.write(chunk)) && !this._pause)
|
|
295
|
+
cb();
|
|
296
|
+
else {
|
|
297
|
+
this._needDrain = !r;
|
|
298
|
+
this._cb = cb;
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
Multipart.prototype.end = function() {
|
|
303
|
+
var self = this;
|
|
304
|
+
if (this._nparts === 0 && !self._boy._done) {
|
|
305
|
+
process.nextTick(function() {
|
|
306
|
+
self._boy._done = true;
|
|
307
|
+
self._boy.emit('finish');
|
|
308
|
+
});
|
|
309
|
+
} else if (this.parser.writable)
|
|
310
|
+
this.parser.end();
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
function skipPart(part) {
|
|
314
|
+
part.resume();
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function FileStream(opts) {
|
|
318
|
+
if (!(this instanceof FileStream))
|
|
319
|
+
return new FileStream(opts);
|
|
320
|
+
ReadableStream.call(this, opts);
|
|
321
|
+
|
|
322
|
+
this.truncated = false;
|
|
323
|
+
}
|
|
324
|
+
inherits(FileStream, ReadableStream);
|
|
325
|
+
|
|
326
|
+
FileStream.prototype._read = function(n) {};
|
|
327
|
+
|
|
328
|
+
module.exports = Multipart;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
var Decoder = require('../utils').Decoder,
|
|
2
|
+
decodeText = require('../utils').decodeText;
|
|
3
|
+
|
|
4
|
+
var RE_CHARSET = /^charset$/i;
|
|
5
|
+
|
|
6
|
+
UrlEncoded.detect = /^application\/x-www-form-urlencoded/i;
|
|
7
|
+
function UrlEncoded(boy, cfg) {
|
|
8
|
+
if (!(this instanceof UrlEncoded))
|
|
9
|
+
return new UrlEncoded(boy, cfg);
|
|
10
|
+
var limits = cfg.limits,
|
|
11
|
+
headers = cfg.headers,
|
|
12
|
+
parsedConType = cfg.parsedConType;
|
|
13
|
+
this.boy = boy;
|
|
14
|
+
|
|
15
|
+
this.fieldSizeLimit = (limits && typeof limits.fieldSize === 'number'
|
|
16
|
+
? limits.fieldSize
|
|
17
|
+
: 1 * 1024 * 1024);
|
|
18
|
+
this.fieldNameSizeLimit = (limits && typeof limits.fieldNameSize === 'number'
|
|
19
|
+
? limits.fieldNameSize
|
|
20
|
+
: 100);
|
|
21
|
+
this.fieldsLimit = (limits && typeof limits.fields === 'number'
|
|
22
|
+
? limits.fields
|
|
23
|
+
: Infinity);
|
|
24
|
+
|
|
25
|
+
var charset;
|
|
26
|
+
for (var i = 0, len = parsedConType.length; i < len; ++i) {
|
|
27
|
+
if (Array.isArray(parsedConType[i])
|
|
28
|
+
&& RE_CHARSET.test(parsedConType[i][0])) {
|
|
29
|
+
charset = parsedConType[i][1].toLowerCase();
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (charset === undefined)
|
|
35
|
+
charset = cfg.defCharset || 'utf8';
|
|
36
|
+
|
|
37
|
+
this.decoder = new Decoder();
|
|
38
|
+
this.charset = charset;
|
|
39
|
+
this._fields = 0;
|
|
40
|
+
this._state = 'key';
|
|
41
|
+
this._checkingBytes = true;
|
|
42
|
+
this._bytesKey = 0;
|
|
43
|
+
this._bytesVal = 0;
|
|
44
|
+
this._key = '';
|
|
45
|
+
this._val = '';
|
|
46
|
+
this._keyTrunc = false;
|
|
47
|
+
this._valTrunc = false;
|
|
48
|
+
this._hitlimit = false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
UrlEncoded.prototype.write = function(data, cb) {
|
|
52
|
+
if (this._fields === this.fieldsLimit) {
|
|
53
|
+
if (!this.boy.hitFieldsLimit) {
|
|
54
|
+
this.boy.hitFieldsLimit = true;
|
|
55
|
+
this.boy.emit('fieldsLimit');
|
|
56
|
+
}
|
|
57
|
+
return cb();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var idxeq, idxamp, i, p = 0, len = data.length;
|
|
61
|
+
|
|
62
|
+
while (p < len) {
|
|
63
|
+
if (this._state === 'key') {
|
|
64
|
+
idxeq = idxamp = undefined;
|
|
65
|
+
for (i = p; i < len; ++i) {
|
|
66
|
+
if (!this._checkingBytes)
|
|
67
|
+
++p;
|
|
68
|
+
if (data[i] === 0x3D/*=*/) {
|
|
69
|
+
idxeq = i;
|
|
70
|
+
break;
|
|
71
|
+
} else if (data[i] === 0x26/*&*/) {
|
|
72
|
+
idxamp = i;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
|
|
76
|
+
this._hitLimit = true;
|
|
77
|
+
break;
|
|
78
|
+
} else if (this._checkingBytes)
|
|
79
|
+
++this._bytesKey;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (idxeq !== undefined) {
|
|
83
|
+
// key with assignment
|
|
84
|
+
if (idxeq > p)
|
|
85
|
+
this._key += this.decoder.write(data.toString('binary', p, idxeq));
|
|
86
|
+
this._state = 'val';
|
|
87
|
+
|
|
88
|
+
this._hitLimit = false;
|
|
89
|
+
this._checkingBytes = true;
|
|
90
|
+
this._val = '';
|
|
91
|
+
this._bytesVal = 0;
|
|
92
|
+
this._valTrunc = false;
|
|
93
|
+
this.decoder.reset();
|
|
94
|
+
|
|
95
|
+
p = idxeq + 1;
|
|
96
|
+
} else if (idxamp !== undefined) {
|
|
97
|
+
// key with no assignment
|
|
98
|
+
++this._fields;
|
|
99
|
+
var key, keyTrunc = this._keyTrunc;
|
|
100
|
+
if (idxamp > p)
|
|
101
|
+
key = (this._key += this.decoder.write(data.toString('binary', p, idxamp)));
|
|
102
|
+
else
|
|
103
|
+
key = this._key;
|
|
104
|
+
|
|
105
|
+
this._hitLimit = false;
|
|
106
|
+
this._checkingBytes = true;
|
|
107
|
+
this._key = '';
|
|
108
|
+
this._bytesKey = 0;
|
|
109
|
+
this._keyTrunc = false;
|
|
110
|
+
this.decoder.reset();
|
|
111
|
+
|
|
112
|
+
if (key.length) {
|
|
113
|
+
this.boy.emit('field', decodeText(key, 'binary', this.charset),
|
|
114
|
+
'',
|
|
115
|
+
keyTrunc,
|
|
116
|
+
false);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
p = idxamp + 1;
|
|
120
|
+
if (this._fields === this.fieldsLimit)
|
|
121
|
+
return cb();
|
|
122
|
+
} else if (this._hitLimit) {
|
|
123
|
+
// we may not have hit the actual limit if there are encoded bytes...
|
|
124
|
+
if (i > p)
|
|
125
|
+
this._key += this.decoder.write(data.toString('binary', p, i));
|
|
126
|
+
p = i;
|
|
127
|
+
if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
|
|
128
|
+
// yep, we actually did hit the limit
|
|
129
|
+
this._checkingBytes = false;
|
|
130
|
+
this._keyTrunc = true;
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
if (p < len)
|
|
134
|
+
this._key += this.decoder.write(data.toString('binary', p));
|
|
135
|
+
p = len;
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
idxamp = undefined;
|
|
139
|
+
for (i = p; i < len; ++i) {
|
|
140
|
+
if (!this._checkingBytes)
|
|
141
|
+
++p;
|
|
142
|
+
if (data[i] === 0x26/*&*/) {
|
|
143
|
+
idxamp = i;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
|
|
147
|
+
this._hitLimit = true;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
else if (this._checkingBytes)
|
|
151
|
+
++this._bytesVal;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (idxamp !== undefined) {
|
|
155
|
+
++this._fields;
|
|
156
|
+
if (idxamp > p)
|
|
157
|
+
this._val += this.decoder.write(data.toString('binary', p, idxamp));
|
|
158
|
+
this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
|
|
159
|
+
decodeText(this._val, 'binary', this.charset),
|
|
160
|
+
this._keyTrunc,
|
|
161
|
+
this._valTrunc);
|
|
162
|
+
this._state = 'key';
|
|
163
|
+
|
|
164
|
+
this._hitLimit = false;
|
|
165
|
+
this._checkingBytes = true;
|
|
166
|
+
this._key = '';
|
|
167
|
+
this._bytesKey = 0;
|
|
168
|
+
this._keyTrunc = false;
|
|
169
|
+
this.decoder.reset();
|
|
170
|
+
|
|
171
|
+
p = idxamp + 1;
|
|
172
|
+
if (this._fields === this.fieldsLimit)
|
|
173
|
+
return cb();
|
|
174
|
+
} else if (this._hitLimit) {
|
|
175
|
+
// we may not have hit the actual limit if there are encoded bytes...
|
|
176
|
+
if (i > p)
|
|
177
|
+
this._val += this.decoder.write(data.toString('binary', p, i));
|
|
178
|
+
p = i;
|
|
179
|
+
if ((this._val === '' && this.fieldSizeLimit === 0)
|
|
180
|
+
|| (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
|
|
181
|
+
// yep, we actually did hit the limit
|
|
182
|
+
this._checkingBytes = false;
|
|
183
|
+
this._valTrunc = true;
|
|
184
|
+
}
|
|
185
|
+
} else {
|
|
186
|
+
if (p < len)
|
|
187
|
+
this._val += this.decoder.write(data.toString('binary', p));
|
|
188
|
+
p = len;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
cb();
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
UrlEncoded.prototype.end = function() {
|
|
196
|
+
if (this.boy._done)
|
|
197
|
+
return;
|
|
198
|
+
|
|
199
|
+
if (this._state === 'key' && this._key.length > 0) {
|
|
200
|
+
this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
|
|
201
|
+
'',
|
|
202
|
+
this._keyTrunc,
|
|
203
|
+
false);
|
|
204
|
+
} else if (this._state === 'val') {
|
|
205
|
+
this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
|
|
206
|
+
decodeText(this._val, 'binary', this.charset),
|
|
207
|
+
this._keyTrunc,
|
|
208
|
+
this._valTrunc);
|
|
209
|
+
}
|
|
210
|
+
this.boy._done = true;
|
|
211
|
+
this.boy.emit('finish');
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
module.exports = UrlEncoded;
|