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
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_comment": "Please, don't touch this.",
|
|
3
|
-
"defEnv": "prod",
|
|
4
|
-
"registeredEnvs": [
|
|
5
|
-
"dev",
|
|
6
|
-
"debug",
|
|
7
|
-
"stage",
|
|
8
|
-
"prod"
|
|
9
|
-
],
|
|
10
|
-
"logLevels": [
|
|
11
|
-
"silly",
|
|
12
|
-
"trace",
|
|
13
|
-
"info",
|
|
14
|
-
"debug",
|
|
15
|
-
"warn",
|
|
16
|
-
"error"
|
|
17
|
-
],
|
|
18
|
-
"defExt": "",
|
|
19
|
-
"mountPath": "{executionPath}/bundles",
|
|
20
|
-
"globalTmpPath": "{executionPath}/tmp",
|
|
21
|
-
"logsPath": "{executionPath}/logs",
|
|
22
|
-
"{bundle}": {
|
|
23
|
-
"{env}": {
|
|
24
|
-
"bundlesPath": "{executionPath}/bundles",
|
|
25
|
-
"bundlePath": "{bundlesPath}/{bundle}",
|
|
26
|
-
"modelsPath": "{bundlesPath}/{bundle}/models",
|
|
27
|
-
"libPath": "{bundlesPath}/{bundle}/lib",
|
|
28
|
-
"releases": "{executionPath}/releases",
|
|
29
|
-
"sources": "{executionPath}/src",
|
|
30
|
-
"tmpPath": "{bundlesPath}/{bundle}/tmp",
|
|
31
|
-
"protocol": "http",
|
|
32
|
-
"port": {
|
|
33
|
-
"http": 82,
|
|
34
|
-
"https": 443,
|
|
35
|
-
"ftp": 21,
|
|
36
|
-
"ssh": 22
|
|
37
|
-
},
|
|
38
|
-
"template": false,
|
|
39
|
-
"server": {
|
|
40
|
-
"webroot": "/",
|
|
41
|
-
"webrootAutoredirect": true,
|
|
42
|
-
"response": {
|
|
43
|
-
"header": {
|
|
44
|
-
"accept-language": "en-US,en;q=0.8,fr;q=0.6",
|
|
45
|
-
"X-Powered-By": "Gina I/O - v{version}"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"encoding": "utf8",
|
|
50
|
-
"files": {
|
|
51
|
-
"app": "app.json",
|
|
52
|
-
"connectors": "connectors.json",
|
|
53
|
-
"routing": "routing.json",
|
|
54
|
-
"settings": "settings.json",
|
|
55
|
-
"statics": "statics.json",
|
|
56
|
-
"views": "views.json",
|
|
57
|
-
"watchers": "watchers.json"
|
|
58
|
-
},
|
|
59
|
-
"contexts": {
|
|
60
|
-
"paths": {}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"system": {},
|
|
65
|
-
"log": [
|
|
66
|
-
{
|
|
67
|
-
"path": "/logs/gina"
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"upload": {
|
|
3
|
-
"_comment": "for more details, check out https://github.com/andrewrk/node-multiparty",
|
|
4
|
-
"encoding": "utf8",
|
|
5
|
-
"maxFieldsSize": "2MB",
|
|
6
|
-
"maxFields": "1000"
|
|
7
|
-
},
|
|
8
|
-
"engine.io": {
|
|
9
|
-
"port": 8888
|
|
10
|
-
},
|
|
11
|
-
"livereload": {},
|
|
12
|
-
"locale": {
|
|
13
|
-
"preferedLanguages": [ "en-US" ],
|
|
14
|
-
"region": "EN",
|
|
15
|
-
"firstDayOfWeek": 1,
|
|
16
|
-
"calendar": "gregorian",
|
|
17
|
-
"temperature": "celsius",
|
|
18
|
-
"number": {
|
|
19
|
-
"grouping": null,
|
|
20
|
-
"decimal": "."
|
|
21
|
-
},
|
|
22
|
-
"currency": {
|
|
23
|
-
"code": "usd",
|
|
24
|
-
"grouping": null,
|
|
25
|
-
"decimal": "."
|
|
26
|
-
},
|
|
27
|
-
"measurementUnits": "metric",
|
|
28
|
-
"dateFormat": {
|
|
29
|
-
"short": "mm/dd/yyyy",
|
|
30
|
-
"medium": "mmm d, yyyy",
|
|
31
|
-
"long": "mmmm d, yyyy",
|
|
32
|
-
"full": "dddd, mmmm d, yyyy"
|
|
33
|
-
},
|
|
34
|
-
"24HourTimeFormat": true,
|
|
35
|
-
"timeFormat": {
|
|
36
|
-
"default": {
|
|
37
|
-
"short": "h:MM:ss",
|
|
38
|
-
"medium": "h:MM:ss",
|
|
39
|
-
"long": "h:MM:ss TT"
|
|
40
|
-
},
|
|
41
|
-
"24H": {
|
|
42
|
-
"short": "HH:MM",
|
|
43
|
-
"medium": "HH:MM:ss",
|
|
44
|
-
"long": "HH:MM:ss TT"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"default": {
|
|
3
|
-
"layout": "{views}/html/layout.html",
|
|
4
|
-
"noLayout": "{gina}/core/asset/html/nolayout.html",
|
|
5
|
-
"forms": "{views}/forms",
|
|
6
|
-
"handlers": "{views}/handlers",
|
|
7
|
-
"useRouteNameAsFilename": true,
|
|
8
|
-
"http-metas": {
|
|
9
|
-
"content-type": "text/html"
|
|
10
|
-
},
|
|
11
|
-
"stylesheets": [],
|
|
12
|
-
"javascripts": [],
|
|
13
|
-
"_pluginLoader": "{src:{gina}/core/asset/js/plugin/src/utils/loader.js}",
|
|
14
|
-
"pluginLoader": "{src:{gina}/core/asset/js/plugin/dist/gina.onload.min.js}"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Setup Class
|
|
3
|
-
* Allows you to extend setup to all your controllers
|
|
4
|
-
*
|
|
5
|
-
* E.g.: use it inside the controller `onReady` by calling `self.setup(req, res, next)`
|
|
6
|
-
*
|
|
7
|
-
* N.B.:
|
|
8
|
-
* Setup Class will only inherit from a few members from the SuperController.
|
|
9
|
-
* If you want all member from the SuperController, you need still can inherit from it this way:
|
|
10
|
-
*
|
|
11
|
-
* var utils = require('gina').utils;
|
|
12
|
-
* var inherits = utils.inherits;
|
|
13
|
-
*
|
|
14
|
-
* then right before exporting SetupClass
|
|
15
|
-
*
|
|
16
|
-
* var Controller = require('./controller.js');
|
|
17
|
-
* SetupClass = inherits(SetupClass, Controller);
|
|
18
|
-
* module.exports = SetupClass
|
|
19
|
-
*
|
|
20
|
-
* @param {object} req
|
|
21
|
-
* @param {object} res
|
|
22
|
-
* @callback next
|
|
23
|
-
* */
|
|
24
|
-
function SetupClass(req, res, next){
|
|
25
|
-
// get `app` config
|
|
26
|
-
// var conf = this.getConfig('app')
|
|
27
|
-
|
|
28
|
-
// defining filters
|
|
29
|
-
//var swig = this.engine;
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
module.exports = SetupClass
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Vendor is used for files like `jquery.min.js`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
`Views` is the public directory.
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Credits & thanks to Steven Levithan :)
|
|
3
|
-
* http://blog.stevenlevithan.com/archives/date-time-format
|
|
4
|
-
*
|
|
5
|
-
* Date Format 1.2.3
|
|
6
|
-
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
|
7
|
-
* MIT license
|
|
8
|
-
*
|
|
9
|
-
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
|
10
|
-
* and Kris Kowal <cixar.com/~kris.kowal/>
|
|
11
|
-
*
|
|
12
|
-
* Accepts a date, a mask, or a date and a mask.
|
|
13
|
-
* Returns a formatted version of the given date.
|
|
14
|
-
* The date defaults to the current date/time.
|
|
15
|
-
* The mask defaults to dateFormat.masks.default.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} date
|
|
18
|
-
* @param {string} mask
|
|
19
|
-
*/
|
|
20
|
-
function DateFormatHelper() {
|
|
21
|
-
|
|
22
|
-
var self = {};
|
|
23
|
-
|
|
24
|
-
self.masks = {
|
|
25
|
-
"default": "ddd mmm dd yyyy HH:MM:ss",
|
|
26
|
-
shortDate: "m/d/yy",
|
|
27
|
-
shortDate2: "mm/dd/yyyy",
|
|
28
|
-
mediumDate: "mmm d, yyyy",
|
|
29
|
-
longDate: "mmmm d, yyyy",
|
|
30
|
-
fullDate: "dddd, mmmm d, yyyy",
|
|
31
|
-
shortTime: "h:MM TT",
|
|
32
|
-
shortTime2: "h:MM",
|
|
33
|
-
mediumTime: "h:MM:ss TT",
|
|
34
|
-
mediumTime2: "h:MM:ss",
|
|
35
|
-
longTime: "h:MM:ss TT Z",
|
|
36
|
-
longTime2: "h:MM:ss TT",
|
|
37
|
-
concatenatedDate: "yyyymmdd",
|
|
38
|
-
isoDate: "yyyy-mm-dd",
|
|
39
|
-
isoTime: "HH:MM:ss",
|
|
40
|
-
shortIsoTime: "HH:MM",
|
|
41
|
-
longIsoTime: "HH:MM:ss TT",
|
|
42
|
-
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
|
|
43
|
-
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
self.i18n = {
|
|
48
|
-
dayNames: [
|
|
49
|
-
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
|
|
50
|
-
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
|
51
|
-
],
|
|
52
|
-
monthNames: [
|
|
53
|
-
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
|
54
|
-
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
|
55
|
-
]
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
var format = function(date, mask, utc) {
|
|
59
|
-
var dF = self;
|
|
60
|
-
|
|
61
|
-
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
|
|
62
|
-
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
|
63
|
-
timezoneClip = /[^-+\dA-Z]/g,
|
|
64
|
-
pad = function (val, len) {
|
|
65
|
-
val = String(val);
|
|
66
|
-
len = len || 2;
|
|
67
|
-
while (val.length < len) val = "0" + val;
|
|
68
|
-
return val;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
|
|
72
|
-
if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
|
|
73
|
-
mask = date;
|
|
74
|
-
date = undefined;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Passing date through Date applies Date.parse, if necessary
|
|
78
|
-
date = date ? new Date(date) : new Date;
|
|
79
|
-
if (isNaN(date)) throw SyntaxError("invalid date");
|
|
80
|
-
|
|
81
|
-
mask = String(dF.masks[mask] || mask || dF.masks["default"]);
|
|
82
|
-
|
|
83
|
-
// Allow setting the utc argument via the mask
|
|
84
|
-
if (mask.slice(0, 4) == "UTC:") {
|
|
85
|
-
mask = mask.slice(4);
|
|
86
|
-
utc = true;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
var _ = utc ? "getUTC" : "get",
|
|
90
|
-
d = date[_ + "Date"](),
|
|
91
|
-
D = date[_ + "Day"](),
|
|
92
|
-
m = date[_ + "Month"](),
|
|
93
|
-
y = date[_ + "FullYear"](),
|
|
94
|
-
H = date[_ + "Hours"](),
|
|
95
|
-
M = date[_ + "Minutes"](),
|
|
96
|
-
s = date[_ + "Seconds"](),
|
|
97
|
-
L = date[_ + "Milliseconds"](),
|
|
98
|
-
o = utc ? 0 : date.getTimezoneOffset(),
|
|
99
|
-
flags = {
|
|
100
|
-
d: d,
|
|
101
|
-
dd: pad(d),
|
|
102
|
-
ddd: dF.i18n.dayNames[D],
|
|
103
|
-
dddd: dF.i18n.dayNames[D + 7],
|
|
104
|
-
m: m + 1,
|
|
105
|
-
mm: pad(m + 1),
|
|
106
|
-
mmm: dF.i18n.monthNames[m],
|
|
107
|
-
mmmm: dF.i18n.monthNames[m + 12],
|
|
108
|
-
yy: String(y).slice(2),
|
|
109
|
-
yyyy: y,
|
|
110
|
-
h: H % 12 || 12,
|
|
111
|
-
hh: pad(H % 12 || 12),
|
|
112
|
-
H: H,
|
|
113
|
-
HH: pad(H),
|
|
114
|
-
M: M,
|
|
115
|
-
MM: pad(M),
|
|
116
|
-
s: s,
|
|
117
|
-
ss: pad(s),
|
|
118
|
-
l: pad(L, 3),
|
|
119
|
-
L: pad(L > 99 ? Math.round(L / 10) : L),
|
|
120
|
-
t: H < 12 ? "a" : "p",
|
|
121
|
-
tt: H < 12 ? "am" : "pm",
|
|
122
|
-
T: H < 12 ? "A" : "P",
|
|
123
|
-
TT: H < 12 ? "AM" : "PM",
|
|
124
|
-
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
|
|
125
|
-
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
|
126
|
-
S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return mask.replace(token, function ($0) {
|
|
132
|
-
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Get mask name from a given format
|
|
138
|
-
*
|
|
139
|
-
* @param {string} format
|
|
140
|
-
*
|
|
141
|
-
* @return {string} maskName
|
|
142
|
-
* */
|
|
143
|
-
var getMaskNameFromFormat = function (format) {
|
|
144
|
-
|
|
145
|
-
var name = "default";
|
|
146
|
-
|
|
147
|
-
for (var f in self.masks) {
|
|
148
|
-
if ( self.masks[f] === format )
|
|
149
|
-
return f
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return name
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Count days from the current date to another
|
|
158
|
-
*
|
|
159
|
-
* TODO - add a closure to `ignoreWeekend()` based on Utils::Validator
|
|
160
|
-
* TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator
|
|
161
|
-
*
|
|
162
|
-
* @param {object} dateTo
|
|
163
|
-
* @return {number} count
|
|
164
|
-
* */
|
|
165
|
-
var countDaysTo = function(date, dateTo) {
|
|
166
|
-
|
|
167
|
-
if ( dateTo instanceof Date) {
|
|
168
|
-
// The number of milliseconds in one day
|
|
169
|
-
var oneDay = 1000 * 60 * 60 * 24
|
|
170
|
-
|
|
171
|
-
// Convert both dates to milliseconds
|
|
172
|
-
var date1Ms = date.getTime()
|
|
173
|
-
var date2Ms = dateTo.getTime()
|
|
174
|
-
|
|
175
|
-
// Calculate the difference in milliseconds
|
|
176
|
-
var count = Math.abs(date1Ms - date2Ms)
|
|
177
|
-
|
|
178
|
-
// Convert back to days and return
|
|
179
|
-
return Math.round(count/oneDay);
|
|
180
|
-
} else {
|
|
181
|
-
throw new Error('dateTo is not instance of Date() !')
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Will give an array of dates between the current date to a targeted date
|
|
187
|
-
*
|
|
188
|
-
* TODO - add a closure to `ignoreWeekend()` based on Utils::Validator
|
|
189
|
-
* TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator
|
|
190
|
-
*
|
|
191
|
-
* @param {object} dateTo
|
|
192
|
-
* @param {string} [ mask ]
|
|
193
|
-
*
|
|
194
|
-
* @return {array} dates
|
|
195
|
-
* */
|
|
196
|
-
var getDaysTo = function(date, dateTo, mask) {
|
|
197
|
-
|
|
198
|
-
if ( dateTo instanceof Date) {
|
|
199
|
-
var count = countDaysTo(date, dateTo)
|
|
200
|
-
, month = date.getMonth()
|
|
201
|
-
, year = date.getFullYear()
|
|
202
|
-
, day = date.getDate() + 1
|
|
203
|
-
, dateObj = new Date(year, month, day)
|
|
204
|
-
, days = []
|
|
205
|
-
, i = 0;
|
|
206
|
-
|
|
207
|
-
for (; i < count; ++i) {
|
|
208
|
-
if ( typeof(mask) != 'undefined' ) {
|
|
209
|
-
days.push(new Date(dateObj).format(mask));
|
|
210
|
-
} else {
|
|
211
|
-
days.push(new Date(dateObj));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
dateObj.setDate(dateObj.getDate() + 1);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return days || [];
|
|
218
|
-
} else {
|
|
219
|
-
throw new Error('dateTo is not instance of Date() !')
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
var getDaysInMonth = function(date) {
|
|
224
|
-
var month = date.getMonth();
|
|
225
|
-
var year = date.getFullYear();
|
|
226
|
-
var dateObj = new Date(year, month, 1);
|
|
227
|
-
var days = [];
|
|
228
|
-
while (dateObj.getMonth() === month) {
|
|
229
|
-
days.push(new Date(dateObj));
|
|
230
|
-
dateObj.setDate(dateObj.getDate() + 1);
|
|
231
|
-
}
|
|
232
|
-
return days;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Add or subtract hours
|
|
237
|
-
* Adding 2 hours
|
|
238
|
-
* => myDate.addHours(2)
|
|
239
|
-
* Subtracting 10 hours
|
|
240
|
-
* => myDate.addHours(-10)
|
|
241
|
-
* */
|
|
242
|
-
var addHours = function(date, h) {
|
|
243
|
-
var copiedDate = new Date(date.getTime());
|
|
244
|
-
copiedDate.setHours(copiedDate.getHours()+h);
|
|
245
|
-
return copiedDate;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return {
|
|
249
|
-
format : format,
|
|
250
|
-
countDaysTo : countDaysTo,
|
|
251
|
-
getDaysTo : getDaysTo,
|
|
252
|
-
getDaysInMonth : getDaysInMonth,
|
|
253
|
-
addHours : addHours
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
if ( ( typeof(module) !== 'undefined' ) && module.exports ) {
|
|
259
|
-
// Publish as node.js module
|
|
260
|
-
module.exports = DateFormatHelper
|
|
261
|
-
} else if ( typeof(define) === 'function' && define.amd) {
|
|
262
|
-
// Publish as AMD module
|
|
263
|
-
define( function() { return DateFormatHelper })
|
|
264
|
-
}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the gina package.
|
|
3
|
-
* Copyright (c) 2016 Rhinostone <gina@rhinostone.com>
|
|
4
|
-
*
|
|
5
|
-
* For the full copyright and license information, please view the LICENSE
|
|
6
|
-
* file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
var fs = require('fs');
|
|
10
|
-
/**
|
|
11
|
-
* @module Helpers
|
|
12
|
-
*
|
|
13
|
-
* Gina Utils Helpers
|
|
14
|
-
*
|
|
15
|
-
* @package Gina.Utils
|
|
16
|
-
* @namespace Gina.Utils.Helpers
|
|
17
|
-
* @author Rhinostone <gina@rhinostone.com>
|
|
18
|
-
*/
|
|
19
|
-
var _require = function(path) {
|
|
20
|
-
var cacheless = (process.env.IS_CACHELESS == 'false') ? false : true;
|
|
21
|
-
if ( cacheless && !/context/.test(path) ) { // all but the context
|
|
22
|
-
try {
|
|
23
|
-
delete require.cache[require.resolve(path)];
|
|
24
|
-
return require(path)
|
|
25
|
-
} catch (err) {
|
|
26
|
-
throw err;
|
|
27
|
-
return {}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
} else {
|
|
31
|
-
return require(path)
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
var helpers = {}
|
|
36
|
-
, path = __dirname
|
|
37
|
-
, files = fs.readdirSync(path)
|
|
38
|
-
, f = 0
|
|
39
|
-
, len = files.length
|
|
40
|
-
, helper = '';
|
|
41
|
-
|
|
42
|
-
for (; f < len; ++f) {
|
|
43
|
-
if ( ! /^\./.test(files[f]) && files[f] != 'index.js') {
|
|
44
|
-
helper = files[f].replace(/.js/, '');
|
|
45
|
-
helpers[helper] = _require('./' + helper)()
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
module.exports = helpers;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Format date
|
|
54
|
-
* @return {array} Return formated date
|
|
55
|
-
**/
|
|
56
|
-
Object.defineProperty( Date.prototype, 'format', {
|
|
57
|
-
writable: false,
|
|
58
|
-
enumerable: false,
|
|
59
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
60
|
-
configurable: true,
|
|
61
|
-
value: function(mask, utc){ return helpers.dateFormat.format(this, mask, utc) }
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Count days between current & dateTo
|
|
65
|
-
* @return {array} Return formated date
|
|
66
|
-
**/
|
|
67
|
-
Object.defineProperty( Date.prototype, 'countDaysTo', {
|
|
68
|
-
writable: false,
|
|
69
|
-
enumerable: false,
|
|
70
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
71
|
-
configurable: true,
|
|
72
|
-
value: function(dateTo){ return helpers.dateFormat.countDaysTo(this, dateTo) }
|
|
73
|
-
});
|
|
74
|
-
/**
|
|
75
|
-
* Get days between current & dateTo
|
|
76
|
-
* @return {array} Return formated date
|
|
77
|
-
**/
|
|
78
|
-
Object.defineProperty( Date.prototype, 'getDaysTo', {
|
|
79
|
-
writable: false,
|
|
80
|
-
enumerable: false,
|
|
81
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
82
|
-
configurable: true,
|
|
83
|
-
value: function(dateTo, mask){ return helpers.dateFormat.getDaysTo(this, dateTo, mask) }
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get days in the current month date
|
|
88
|
-
* @return {array} Return days
|
|
89
|
-
**/
|
|
90
|
-
Object.defineProperty( Date.prototype, 'getDaysInMonth', {
|
|
91
|
-
writable: false,
|
|
92
|
-
enumerable: false,
|
|
93
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
94
|
-
configurable: true,
|
|
95
|
-
value: function(){ return helpers.dateFormat.getDaysInMonth(this) }
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Add or subtract hours from current date
|
|
100
|
-
* @param {number} h
|
|
101
|
-
* @return {date} Return date
|
|
102
|
-
**/
|
|
103
|
-
Object.defineProperty( Date.prototype, 'addHours', {
|
|
104
|
-
writable: false,
|
|
105
|
-
enumerable: false,
|
|
106
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
107
|
-
configurable: true,
|
|
108
|
-
value: function(h){ return helpers.dateFormat.addHours(this, h) }
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* clone array
|
|
113
|
-
* @return {array} Return cloned array
|
|
114
|
-
**/
|
|
115
|
-
Object.defineProperty( Array.prototype, 'clone', {
|
|
116
|
-
writable: false,
|
|
117
|
-
enumerable: false,
|
|
118
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
119
|
-
configurable: true,
|
|
120
|
-
value: function(){ return this.slice(0) }
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
/***/
|
|
124
|
-
Array.prototype.toString = function(){
|
|
125
|
-
return this.join();
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
Object.defineProperty( Array.prototype, 'inArray', {
|
|
130
|
-
writable: false,
|
|
131
|
-
enumerable: false,
|
|
132
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
133
|
-
configurable: true,
|
|
134
|
-
value: function(o){ return this.indexOf(o)!=-1 }
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
if ( typeof(Array.from) == 'undefined' ) { // if not under ES6
|
|
138
|
-
|
|
139
|
-
Object.defineProperty( Array.prototype, 'from', {
|
|
140
|
-
writable: false,
|
|
141
|
-
enumerable: false,
|
|
142
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
143
|
-
configurable: true,
|
|
144
|
-
value: function(a){
|
|
145
|
-
var seen = {}
|
|
146
|
-
, out = []
|
|
147
|
-
, len = a.length
|
|
148
|
-
, j = 0;
|
|
149
|
-
|
|
150
|
-
for(var i = 0; i < len; i++) {
|
|
151
|
-
var item = a[i];
|
|
152
|
-
if(seen[item] !== 1) {
|
|
153
|
-
seen[item] = 1;
|
|
154
|
-
out[j++] = item
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return out
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
Object.defineProperty( Object.prototype, 'count', {
|
|
164
|
-
writable: true,
|
|
165
|
-
enumerable: false,
|
|
166
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
167
|
-
configurable: true,
|
|
168
|
-
value: function(){
|
|
169
|
-
try {
|
|
170
|
-
var self = this;
|
|
171
|
-
if (this instanceof String) self = JSON.parse(this);
|
|
172
|
-
var i = 0;
|
|
173
|
-
for (var prop in this)
|
|
174
|
-
if (this.hasOwnProperty(prop)) ++i;
|
|
175
|
-
|
|
176
|
-
return i;
|
|
177
|
-
} catch (err) {
|
|
178
|
-
return i
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* __stack Get current stack
|
|
186
|
-
* @return {Object} stack Current stack
|
|
187
|
-
**/
|
|
188
|
-
Object.defineProperty(global, '__stack', {
|
|
189
|
-
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
190
|
-
configurable: true,
|
|
191
|
-
get: function(){
|
|
192
|
-
var orig = Error.prepareStackTrace;
|
|
193
|
-
Error.prepareStackTrace = function(_, stack){
|
|
194
|
-
return stack;
|
|
195
|
-
};
|
|
196
|
-
var err = new Error;
|
|
197
|
-
Error.captureStackTrace(err, arguments.callee);
|
|
198
|
-
var stack = err.stack;
|
|
199
|
-
Error.prepareStackTrace = orig;
|
|
200
|
-
return stack;
|
|
201
|
-
}
|
|
202
|
-
});
|