gina 0.0.9-p91c → 0.1.1-alpha.3
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.3/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.3}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.3/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.3/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.3/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.3/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.3/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.3/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.3/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.3/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.3/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.3/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.3/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.3/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.3/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.3/core/router.js +664 -0
- package/framework/v0.1.1-alpha.3/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.3/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.3/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.3/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.3/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.3/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.3/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.3/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.3/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.3/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.3/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.3/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.3/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.3/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.3/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.3/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.3/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.3/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.3/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.3/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.3/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.3/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/main.js +739 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.3/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.3/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.3/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.3/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.3/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.3/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 -13732
- 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 -789
- 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,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the gina package.
|
|
3
|
+
* Copyright (c) 2009-2022 Rhinostone <contact@gina.io>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var fs = require('fs');
|
|
9
|
+
|
|
10
|
+
//var inherits = require(require.resolve('./inherits'));
|
|
11
|
+
var helpers = require('./../helpers');
|
|
12
|
+
var console = require('./logger');
|
|
13
|
+
|
|
14
|
+
function SessionStore(session) {
|
|
15
|
+
|
|
16
|
+
var ctx = getContext()
|
|
17
|
+
, bundle = ctx.bundle
|
|
18
|
+
, env = ctx.env
|
|
19
|
+
, conf = getConfig()[bundle][env]
|
|
20
|
+
, connectorsPath = conf.connectorsPath
|
|
21
|
+
, connector = conf.content.connectors[session.name].connector
|
|
22
|
+
;
|
|
23
|
+
var connectorName = 'couchbase';
|
|
24
|
+
var filename = _(connectorsPath + '/'+ connector +'/lib/session-store.js', true);
|
|
25
|
+
|
|
26
|
+
if ( !fs.existsSync(filename) ) {
|
|
27
|
+
throw new Error('SessionStore could not be loaded: `'+ filename+'` is missing');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return require(filename)(session, bundle)
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = SessionStore;
|
|
@@ -5,17 +5,25 @@ var inherits = require(require.resolve('./inherits'));
|
|
|
5
5
|
var helpers = require('./../helpers');
|
|
6
6
|
var console = require('./logger');
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* SSH SHELL
|
|
10
|
+
*/
|
|
9
11
|
function Shell () {
|
|
10
12
|
|
|
11
13
|
var self = this;
|
|
12
14
|
var local = {
|
|
13
15
|
chdir : undefined,
|
|
16
|
+
console: undefined
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
this.setOptions = function(opt) {
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
for (let name in opt) {
|
|
22
|
+
if ( Object.keys(local).indexOf(name) < 0 ) {
|
|
23
|
+
throw new Error('Option `'+ name +'` not supported !')
|
|
24
|
+
}
|
|
25
|
+
console.log('Settings options for ', name);
|
|
26
|
+
local[name] = opt[name]
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
29
|
|
|
@@ -30,24 +38,32 @@ function Shell () {
|
|
|
30
38
|
* @param {boolean} runLocal
|
|
31
39
|
* */
|
|
32
40
|
this.run = function(cmdline, runLocal) {
|
|
33
|
-
var opt = getOptions();
|
|
34
|
-
var outFile = _(getPath('globalTmpPath') + '/out.log');
|
|
35
|
-
var errFile = _(getPath('globalTmpPath') + '/err.log');
|
|
36
|
-
var out = fs.openSync(outFile, 'a');
|
|
37
|
-
var err = fs.openSync(errFile, 'a');
|
|
38
41
|
|
|
39
|
-
var
|
|
42
|
+
var opt = getOptions()
|
|
43
|
+
, outFile = _(GINA_TMPDIR + '/out.log')
|
|
44
|
+
, errFile = _(GINA_TMPDIR + '/err.log')
|
|
45
|
+
, out = fs.openSync(outFile, 'a')
|
|
46
|
+
, err = fs.openSync(errFile, 'a')
|
|
47
|
+
;
|
|
40
48
|
|
|
41
|
-
var
|
|
42
|
-
var
|
|
49
|
+
//var root = opt.chdir || getPath('root');
|
|
50
|
+
var root = opt.chdir;
|
|
51
|
+
|
|
52
|
+
var result = null
|
|
53
|
+
, error = false
|
|
54
|
+
, hasCalledBack = false
|
|
55
|
+
;
|
|
56
|
+
|
|
57
|
+
var _console = ( typeof(local.console) != 'undefined' ) ? local.console : console;
|
|
43
58
|
|
|
44
59
|
var e = new EventEmitter();
|
|
45
60
|
|
|
46
|
-
var cmd;
|
|
61
|
+
var cmd = null;
|
|
62
|
+
|
|
47
63
|
if ( isWin32() ) {
|
|
48
64
|
throw new Error('Windows platform not supported yet for command line forward');
|
|
49
|
-
process.exit(1)
|
|
50
65
|
}
|
|
66
|
+
|
|
51
67
|
if ( typeof(runLocal) != 'undefined' && runLocal == true ) {
|
|
52
68
|
|
|
53
69
|
// cmdline must be an array !!
|
|
@@ -58,13 +74,15 @@ function Shell () {
|
|
|
58
74
|
cmd = spawn(cmdline.splice(0,1).toString(), cmdline, { cwd: root, stdio: [ 'ignore', out, err ] })
|
|
59
75
|
|
|
60
76
|
} else {
|
|
61
|
-
|
|
77
|
+
_console.debug('running: ssh ', cmdline);
|
|
62
78
|
cmd = spawn('ssh', [ self.host, cmdline ], { stdio: [ 'ignore', out, err ] })
|
|
63
79
|
}
|
|
64
80
|
|
|
65
81
|
cmd.on('stdout', function(data) {
|
|
66
|
-
|
|
67
|
-
var
|
|
82
|
+
|
|
83
|
+
var str = data.toString();
|
|
84
|
+
var lines = str.split(/(\r?\n)/g);
|
|
85
|
+
|
|
68
86
|
result = lines.join('');
|
|
69
87
|
|
|
70
88
|
e.emit('run#data', result)
|
|
@@ -72,10 +90,10 @@ function Shell () {
|
|
|
72
90
|
|
|
73
91
|
// Errors are readable in the onComplete callback
|
|
74
92
|
cmd.on('stderr', function (err) {
|
|
75
|
-
var err = err.toString();
|
|
76
|
-
//error = new Error(err).stack || false;
|
|
77
|
-
error = err || false;
|
|
78
93
|
|
|
94
|
+
if (err) {
|
|
95
|
+
error = err.toString();
|
|
96
|
+
}
|
|
79
97
|
|
|
80
98
|
e.emit('run#err', error)
|
|
81
99
|
});
|
|
@@ -89,7 +107,7 @@ function Shell () {
|
|
|
89
107
|
if ( fs.existsSync(errFile) ) fs.unlinkSync(errFile);
|
|
90
108
|
|
|
91
109
|
if (error) {
|
|
92
|
-
//cmd.emit('stderr',
|
|
110
|
+
//cmd.emit('stderr', Buffer.from(error))
|
|
93
111
|
error = new Error(error).stack;
|
|
94
112
|
cmd.emit('stderr', error)
|
|
95
113
|
}
|
|
@@ -101,11 +119,11 @@ function Shell () {
|
|
|
101
119
|
if (fs.existsSync(outFile) ) fs.unlinkSync(outFile);
|
|
102
120
|
|
|
103
121
|
if ( data ) {
|
|
104
|
-
cmd.emit('stdout',
|
|
122
|
+
cmd.emit('stdout', Buffer.from(data))
|
|
105
123
|
}
|
|
106
124
|
|
|
107
125
|
|
|
108
|
-
if (error == '') {
|
|
126
|
+
if ( error == '' || typeof(error) == 'undefined' || error == undefined || error == null) {
|
|
109
127
|
error = false
|
|
110
128
|
}
|
|
111
129
|
|
|
@@ -117,7 +135,7 @@ function Shell () {
|
|
|
117
135
|
|
|
118
136
|
|
|
119
137
|
} catch (err) {
|
|
120
|
-
|
|
138
|
+
_console.error(err.stack)
|
|
121
139
|
}
|
|
122
140
|
});
|
|
123
141
|
|
|
@@ -129,18 +147,13 @@ function Shell () {
|
|
|
129
147
|
|
|
130
148
|
e.once('run#err', function(err, data) {
|
|
131
149
|
callback(err, data)
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
//return e
|
|
135
|
-
|
|
150
|
+
})
|
|
136
151
|
};
|
|
137
152
|
|
|
138
153
|
e.onComplete = function(callback) {
|
|
139
154
|
e.once('run#complete', function(err, data) {
|
|
140
155
|
callback(err, data)
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
//return e
|
|
156
|
+
})
|
|
144
157
|
};
|
|
145
158
|
|
|
146
159
|
return e
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "swig-filters",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Swig Filters",
|
|
5
|
+
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Maritn-Luther ETOUMAN",
|
|
8
|
+
"email": "contact@gina.io"
|
|
9
|
+
},
|
|
10
|
+
"copyright": "Copyright (c) 2009-2022 Rhinostone <contact@gina.io>",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=0.10.22"
|
|
13
|
+
},
|
|
14
|
+
"main": "src/main",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "nodeunit test"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"readmeFilename": "README.md"
|
|
20
|
+
}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the gina package.
|
|
3
|
+
* Copyright (c) 2009-2022 Rhinostone <contact@gina.io>
|
|
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
|
+
/**
|
|
10
|
+
* SwigFilters
|
|
11
|
+
* ------
|
|
12
|
+
* Setup
|
|
13
|
+
* ------
|
|
14
|
+
* var filters = SwigFilters({
|
|
15
|
+
* options : local.options,
|
|
16
|
+
* isProxyHost : isProxyHost,
|
|
17
|
+
* throwError : self.throwError, // use ctx.throwError
|
|
18
|
+
* req : local.req,
|
|
19
|
+
* res : local.res
|
|
20
|
+
* });
|
|
21
|
+
* -----
|
|
22
|
+
* Call
|
|
23
|
+
* -----
|
|
24
|
+
* swig.setFilter('getUrl', filters.getUrl);
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* @package Gina.Lib
|
|
28
|
+
* @namespace Gina.Lib.SwigFilters
|
|
29
|
+
* @author Rhinostone <contact@gina.io>
|
|
30
|
+
* */
|
|
31
|
+
function SwigFilters(conf) {
|
|
32
|
+
|
|
33
|
+
var isGFFCtx = ((typeof (module) !== 'undefined') && module.exports) ? false : true;
|
|
34
|
+
|
|
35
|
+
var self = { options: conf };
|
|
36
|
+
var init = function() {
|
|
37
|
+
|
|
38
|
+
if ( typeof(SwigFilters.initialized) != 'undefined' ) {
|
|
39
|
+
return getInstance()
|
|
40
|
+
} else {
|
|
41
|
+
|
|
42
|
+
SwigFilters.instance = self;
|
|
43
|
+
|
|
44
|
+
if (self.options) {
|
|
45
|
+
SwigFilters.instance._options = self.options;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
SwigFilters.initialized = true;
|
|
49
|
+
|
|
50
|
+
return SwigFilters.instance
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var getInstance = function() {
|
|
55
|
+
if (conf) {
|
|
56
|
+
self.options = SwigFilters.instance._options = JSON.clone(conf);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return SwigFilters.instance
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
self.getConfig = function() {
|
|
63
|
+
return JSON.clone(self.options)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Allows you to get a bundle web root
|
|
67
|
+
self.getWebroot = function (input, obj) {
|
|
68
|
+
var url = null, prop = self.options.envObj.getConf(obj, options.conf.env);
|
|
69
|
+
if ( isProxyHost ) {
|
|
70
|
+
url = prop.server.scheme + '://'+ prop.host;
|
|
71
|
+
} else {
|
|
72
|
+
url = prop.server.scheme + '://'+ prop.host +':'+ prop.port[prop.server.protocol][prop.server.scheme];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if ( typeof(prop.server['webroot']) != 'undefined') {
|
|
76
|
+
url += prop.server['webroot']
|
|
77
|
+
}
|
|
78
|
+
return url
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// var getRouteDefinition = function(routing, rule, method) {
|
|
82
|
+
// var routeObject = null;
|
|
83
|
+
// for (r in routing) {
|
|
84
|
+
// if ( r == rule && routing[r].method.toLowerCase() == method.toLowerCase() ) {
|
|
85
|
+
// routeObject = routing[r];
|
|
86
|
+
// break;
|
|
87
|
+
// }
|
|
88
|
+
// }
|
|
89
|
+
|
|
90
|
+
// return routeObject;
|
|
91
|
+
// }
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* getUrl filter
|
|
95
|
+
*
|
|
96
|
+
* Usage:
|
|
97
|
+
* <a href="{{ '/homepage' | getUrl() }}">Homepage</a>
|
|
98
|
+
* <a href="{{ 'users-add' | getUrl({ id: user.id }) }}">Add User</a>
|
|
99
|
+
* <a href="{{ 'users-edit' | getUrl({ id: user.id }) }}">Edit user</a>
|
|
100
|
+
* <a href="{{ 'users-get-empty' | getUrl({ id: '' }) }}">Get empty</a>
|
|
101
|
+
* <a href="{{ 'users-list' | getUrl(null, 'http://domain.com') }}">Display all users</a>
|
|
102
|
+
* <a href="{{ '/dashboard' | getUrl(null, 'admin') }}">Go to admin bundle's dashboard page</a>
|
|
103
|
+
* <a href="{{ 'home@admin' | getUrl() }}">Go to admin bundle's dashboard page</a>
|
|
104
|
+
*
|
|
105
|
+
* // can also be used with standalone mode: will add webroot if current bundle is not master
|
|
106
|
+
* <script src="{{ '/js/vendor/modernizr-2.8.3.min.js' | getUrl() }}"></script>
|
|
107
|
+
* compiled as => <script src="/my-bundle/js/vendor/modernizr-2.8.3.min.js"></script>
|
|
108
|
+
*
|
|
109
|
+
* @param {string} route
|
|
110
|
+
* @param {object} params - can't be left blank if base is required -> null if not defined
|
|
111
|
+
* @param {string} [base] - can be a CDN, the http://domain.com or a bundle name
|
|
112
|
+
*
|
|
113
|
+
* @returns {string} relativeUrl|absoluteUrl - /sample/url.html or http://domain.com/sample/url.html
|
|
114
|
+
* */
|
|
115
|
+
self.getUrl = function (route, params, base) {
|
|
116
|
+
|
|
117
|
+
//var ctx = SwigFilters().getConfig();
|
|
118
|
+
//var ctx = self.options;
|
|
119
|
+
if (typeof(params) == 'undefined') {
|
|
120
|
+
params = {}
|
|
121
|
+
}
|
|
122
|
+
var ctx = SwigFilters.instance._options || self.options;
|
|
123
|
+
|
|
124
|
+
var config = null
|
|
125
|
+
, hostname = null
|
|
126
|
+
, wroot = null
|
|
127
|
+
, wrootRe = null
|
|
128
|
+
, isStandalone = null
|
|
129
|
+
, isMaster = null
|
|
130
|
+
, isProxyHost = ctx.isProxyHost
|
|
131
|
+
, routing = null
|
|
132
|
+
, rule = null
|
|
133
|
+
, url = NaN
|
|
134
|
+
, urlStr = null
|
|
135
|
+
, method = 'GET'
|
|
136
|
+
;
|
|
137
|
+
|
|
138
|
+
if (ctx.options.method != 'undefined') {
|
|
139
|
+
method = ctx.options.method
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// if no route, returns current route
|
|
143
|
+
if ( !route || typeof(route) == 'undefined') {
|
|
144
|
+
route = ctx.options.rule
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
config = {};
|
|
148
|
+
if (/\@/.test(route) && typeof(base) == 'undefined') {
|
|
149
|
+
var r = route.split(/\@/);
|
|
150
|
+
route = r[0].toLowerCase();
|
|
151
|
+
base = config.bundle = r[1];
|
|
152
|
+
} else {
|
|
153
|
+
if (
|
|
154
|
+
!/\@/.test(route)
|
|
155
|
+
&& !/\.(.*)$/.test(route)
|
|
156
|
+
&& typeof(base) == 'undefined'
|
|
157
|
+
) {
|
|
158
|
+
base = config.bundle = ctx.options.conf.bundle;
|
|
159
|
+
}
|
|
160
|
+
route = route.toLowerCase();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// setting default config
|
|
164
|
+
config = merge(config, ctx.options.conf);
|
|
165
|
+
hostname = '';
|
|
166
|
+
//console.debug('web roooot ', SwigFilters.instance._options.conf.server.webroot);
|
|
167
|
+
wroot = config.server.webroot;
|
|
168
|
+
isStandalone = (config.bundles.length > 1) ? true : false;
|
|
169
|
+
isMaster = (config.bundles[0] === config.bundle) ? true : false;
|
|
170
|
+
routing = config.routing;
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
if ( typeof(base) != 'undefined' ) {
|
|
174
|
+
|
|
175
|
+
// if base is not an URL, must be a bundle
|
|
176
|
+
if ( !/^(http|https)\:/.test(base) ) {
|
|
177
|
+
var mainConf = getContext('gina').Config.instance;
|
|
178
|
+
// is real bundle ?
|
|
179
|
+
if ( mainConf.allBundles.indexOf(base) > -1 ) {
|
|
180
|
+
// config override
|
|
181
|
+
config = mainConf.Env.getConf(base, mainConf.env);
|
|
182
|
+
|
|
183
|
+
// retrieve hostname, webroot & routing
|
|
184
|
+
hostname = config.hostname + config.server.webroot;
|
|
185
|
+
// rewrite hostname vs ctx.req.headers.host
|
|
186
|
+
if ( isProxyHost ) {
|
|
187
|
+
hostname = hostname.replace(/\:\d+/, '');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
config.bundle = base;
|
|
191
|
+
isStandalone = (mainConf.bundles.length > 1) ? true : false;
|
|
192
|
+
isMaster = (mainConf.bundles[0] === config.bundle) ? true : false;
|
|
193
|
+
|
|
194
|
+
} else {
|
|
195
|
+
ctx.throwError(ctx.res, 500, new Error('bundle `'+ base +'` not found: Swig.getUrl() filter encountered a problem while trying to compile base `'+base+'` and route `'+route+'`').stack)
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
wrootRe = new RegExp('^'+ config.server.webroot);
|
|
201
|
+
|
|
202
|
+
// is path ?
|
|
203
|
+
if (/^\//.test(route)) {
|
|
204
|
+
|
|
205
|
+
if ( !wrootRe.test(route) ) {
|
|
206
|
+
route = config.server.webroot + route.substr(1);
|
|
207
|
+
hostname = hostname.replace(new RegExp( config.server.webroot +'$'), '')
|
|
208
|
+
} else {
|
|
209
|
+
route = route.substr(1)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return hostname + route;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// rules are now unique per bundle : rule@bundle
|
|
216
|
+
rule = route + '@' + config.bundle;
|
|
217
|
+
//var ruleObj = getRouteDefinition(routing, rule, method);
|
|
218
|
+
var ruleObj = routing[rule];
|
|
219
|
+
if ( typeof(ruleObj) != 'undefined' && ruleObj != null ) { //found
|
|
220
|
+
|
|
221
|
+
url = ruleObj.url;
|
|
222
|
+
|
|
223
|
+
if ( typeof(ruleObj.requirements) != 'undefined' ) {
|
|
224
|
+
var urls = null
|
|
225
|
+
, i = 0
|
|
226
|
+
, len = null
|
|
227
|
+
, p = null
|
|
228
|
+
;
|
|
229
|
+
|
|
230
|
+
for (p in ruleObj.requirements) {
|
|
231
|
+
|
|
232
|
+
if ( /\,/.test(url) ) {
|
|
233
|
+
urls = url.split(/\,/g);
|
|
234
|
+
i = 0; len = urls.length;
|
|
235
|
+
for (; i< len; ++i) {
|
|
236
|
+
if ( params && /:/.test(urls[i]) ) {
|
|
237
|
+
urlStr = urls[i].replace(new RegExp(':'+p+'(\\W|$)', 'g'), params[p]+'$1');
|
|
238
|
+
break
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
url = (urlStr != null) ? urlStr : urls[0];
|
|
243
|
+
} else {
|
|
244
|
+
try {
|
|
245
|
+
url = url.replace(new RegExp(':'+p+'(\\W|$)', 'g'), params[p]+'$1')
|
|
246
|
+
} catch (err) {
|
|
247
|
+
ctx.throwError(ctx.res, 500, new Error('template compilation exception encoutered: [ '+ url +' ]\nsounds like you are having troubles with the following call `{{ "'+route+'" | getUrl() }}` where `'+p+'` parameter is expected according to your `routing.json`' +'\n'+ (err.stack||err.message)));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
if ( /\,/.test(url) ) {
|
|
253
|
+
url = url.split(/\,/g)[0] || null; // just taking the default one: using the first element unless it is empty.
|
|
254
|
+
if (!url) {
|
|
255
|
+
ctx.throwError(ctx.res, 500, new Error('please check your `routing.json` at the defined rule `'+ rule +'` : `url` attribute cannot be empty').stack)
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
if (hostname.length > 0) {
|
|
262
|
+
url = url.replace(wrootRe, '');
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// fix url in case of empty param value allowed by the routing rule
|
|
266
|
+
// to prevent having a folder.
|
|
267
|
+
// eg.: {..., id: '/^\\s*$/'} => {..., id: ''} => /path/to/ becoming /path/to
|
|
268
|
+
if ( /\/$/.test(url) && url != '/' )
|
|
269
|
+
url = url.substr(0, url.length-1);
|
|
270
|
+
|
|
271
|
+
url = hostname + url;
|
|
272
|
+
|
|
273
|
+
} else {
|
|
274
|
+
|
|
275
|
+
if ( typeof(routing['404@'+ config.bundle]) != 'undefined' && typeof(routing['404@'+ config.bundle].url) != 'undefined' ) {
|
|
276
|
+
//url = ( /^\//.test(routing['404@'+ config.bundle].url) ) ? hostname + routing['404@'+ config.bundle].url.substr(1) : hostname + routing['404@'+ config.bundle].url;
|
|
277
|
+
url = routing['404@'+ config.bundle].url.replace(wrootRe, '');
|
|
278
|
+
if (hostname.length > 0) {
|
|
279
|
+
url = url.replace(wrootRe, '');
|
|
280
|
+
}
|
|
281
|
+
url = hostname + url;
|
|
282
|
+
} else {
|
|
283
|
+
url = route;
|
|
284
|
+
if (hostname.length > 0) {
|
|
285
|
+
url = url.substr(1);
|
|
286
|
+
}
|
|
287
|
+
url = hostname + url
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return '404:['+ ctx.req.method +']'+rule
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return url
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Extends default `length` filter
|
|
297
|
+
self.length = function (input, obj) {
|
|
298
|
+
|
|
299
|
+
if ( typeof(input.count) != 'undefined' ) {
|
|
300
|
+
return input.count()
|
|
301
|
+
} else {
|
|
302
|
+
return input.length
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
self.nl2br = function(text, replacement) {
|
|
307
|
+
replacement = ( typeof( replacement ) != 'undefined' ) ? replacement : '<br/>';
|
|
308
|
+
return text.replace(/(\n|\r)/g, replacement);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
return init()
|
|
313
|
+
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if ((typeof (module) !== 'undefined') && module.exports) {
|
|
317
|
+
// Publish as node.js module
|
|
318
|
+
module.exports = SwigFilters
|
|
319
|
+
} else if (typeof (define) === 'function' && define.amd) {
|
|
320
|
+
// Publish as AMD module
|
|
321
|
+
define(function() { return SwigFilters })
|
|
322
|
+
}
|
|
File without changes
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
// Deprecated
|
|
1
2
|
function Url(env, routes) {
|
|
2
3
|
var self = this;
|
|
3
4
|
|
|
4
5
|
var init = function() {
|
|
5
6
|
self.base = '';
|
|
6
|
-
self.routes = JSON.
|
|
7
|
+
self.routes = JSON.clone(routes);
|
|
7
8
|
|
|
8
9
|
if (typeof(env.fqdn) != 'undefined' && env.fqdn != null) {
|
|
9
10
|
self.base = (/^http:\/\//.test(env.fqdn)) ? env.fqdn : 'http://'+env.fqdn
|
|
File without changes
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"default": {
|
|
3
3
|
"url": "/",
|
|
4
|
-
"param": { "
|
|
4
|
+
"param": { "control": "zero" }
|
|
5
5
|
},
|
|
6
6
|
"test1": {
|
|
7
7
|
"url": ["/one", "/one/"],
|
|
8
|
-
"param": { "
|
|
8
|
+
"param": { "control": "one" }
|
|
9
9
|
},
|
|
10
10
|
"test2": {
|
|
11
11
|
"requirements": {
|
|
12
12
|
"pone": ".*"
|
|
13
13
|
},
|
|
14
14
|
"url": "/:pone/two",
|
|
15
|
-
"param": { "
|
|
15
|
+
"param": { "control": "two", "pone" : ":pone" }
|
|
16
16
|
},
|
|
17
17
|
"test3": {
|
|
18
18
|
"requirements": {
|
|
19
19
|
"pone": ".*"
|
|
20
20
|
},
|
|
21
21
|
"url": "/three",
|
|
22
|
-
"param": { "
|
|
22
|
+
"param": { "control": "three" }
|
|
23
23
|
},
|
|
24
24
|
"test4": {
|
|
25
25
|
"requirements": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ptwo": ".*"
|
|
28
28
|
},
|
|
29
29
|
"url": "/:pone/four/:ptwo",
|
|
30
|
-
"param": { "
|
|
30
|
+
"param": { "control": "four", "pone" : ":pone", "ptwo" : ":ptwo" }
|
|
31
31
|
},
|
|
32
32
|
"test5": {
|
|
33
33
|
"requirements": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"ptwo": ".*"
|
|
36
36
|
},
|
|
37
37
|
"url": ["/:pone/five/:ptwo", "/five/:pone/:ptwoRi"],
|
|
38
|
-
"param": { "
|
|
38
|
+
"param": { "control": "five", "pone" : ":pone", "ptwo" : ":ptwo" }
|
|
39
39
|
},
|
|
40
40
|
"test6": {
|
|
41
41
|
"requirements": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"ptwo": "^[0-9]+$"
|
|
44
44
|
},
|
|
45
45
|
"url": "/six/:pone/:ptwo",
|
|
46
|
-
"param": { "
|
|
46
|
+
"param": { "control": "six", "pone" : ":pone", "ptwo" : ":ptwo" }
|
|
47
47
|
},
|
|
48
48
|
"test7": {
|
|
49
49
|
"requirements": {
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"ptwo": ".*"
|
|
52
52
|
},
|
|
53
53
|
"url": "/:pone/seven/:ptwo",
|
|
54
|
-
"param": { "
|
|
54
|
+
"param": { "control": "seven" }
|
|
55
55
|
},
|
|
56
56
|
"test8": {
|
|
57
57
|
"requirements": {
|
|
58
58
|
"pone": ".*"
|
|
59
59
|
},
|
|
60
60
|
"url": ["/eight/", "/eight/:pone"],
|
|
61
|
-
"param": { "
|
|
61
|
+
"param": { "control": "six" }
|
|
62
62
|
}
|
|
63
63
|
}
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var helpers = require('
|
|
1
|
+
var helpers = require('./../helpers');
|
|
2
2
|
var merge = require('./merge');
|
|
3
3
|
var dateFormat = helpers.dateFormat;
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @class Validator
|
|
7
|
-
*
|
|
7
|
+
* Backend validator
|
|
8
8
|
* e.g.:
|
|
9
9
|
* var data = req.post;
|
|
10
10
|
* var d = new Validator(data);
|
|
@@ -400,7 +400,7 @@ function Validator(data, errorLabels) {
|
|
|
400
400
|
*
|
|
401
401
|
* @param {string} [mask] - by default "yyyy-mm-dd"
|
|
402
402
|
*
|
|
403
|
-
* @
|
|
403
|
+
* @returns {date} date - extended by gina::utils::dateFormat; an adaptation of Steven Levithan's code
|
|
404
404
|
* */
|
|
405
405
|
self[el].isDate = function(mask) {
|
|
406
406
|
var val = this.value;
|
|
@@ -419,9 +419,9 @@ function Validator(data, errorLabels) {
|
|
|
419
419
|
|
|
420
420
|
var date = this.value = local.data[this.name] = new Date(newMask);
|
|
421
421
|
|
|
422
|
-
this.valid = (
|
|
422
|
+
this.valid = ( date instanceof Date ) ? true : false;
|
|
423
423
|
|
|
424
|
-
if (
|
|
424
|
+
if ( date instanceof Date === false ) {
|
|
425
425
|
local.errors[this.name].isDate = replace(this.error || local.errorLabels.isDate, this)
|
|
426
426
|
}
|
|
427
427
|
|
|
@@ -473,7 +473,7 @@ function Validator(data, errorLabels) {
|
|
|
473
473
|
/**
|
|
474
474
|
* Exclude when converting back to datas
|
|
475
475
|
*
|
|
476
|
-
* @
|
|
476
|
+
* @returns {object} data
|
|
477
477
|
* */
|
|
478
478
|
self[el].exclude = function() {
|
|
479
479
|
//if (!this.value) return self[this.name];
|
|
@@ -492,7 +492,7 @@ function Validator(data, errorLabels) {
|
|
|
492
492
|
/**
|
|
493
493
|
* Check if errors found during validation
|
|
494
494
|
*
|
|
495
|
-
* @
|
|
495
|
+
* @returns {boolean}
|
|
496
496
|
* */
|
|
497
497
|
self.isValid = function() {
|
|
498
498
|
var i = local.errors.count();
|