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,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* This file is part of the gina package.
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2009-2022 Rhinostone <contact@gina.io>
|
|
4
4
|
*
|
|
5
5
|
* For the full copyright and license information, please view the LICENSE
|
|
6
6
|
* file that was distributed with this source code.
|
|
@@ -12,13 +12,13 @@ var fs = require('fs');
|
|
|
12
12
|
* Gina.Core.Locales Class
|
|
13
13
|
*
|
|
14
14
|
* @package Gina.Core
|
|
15
|
-
* @author Rhinostone <gina
|
|
15
|
+
* @author Rhinostone <contact@gina.io>
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
function Locales() {
|
|
19
19
|
|
|
20
20
|
var _require = function(path) {
|
|
21
|
-
var cacheless = (process.env.
|
|
21
|
+
var cacheless = (process.env.NODE_ENV_IS_DEV == 'false') ? false : true;
|
|
22
22
|
if (cacheless) {
|
|
23
23
|
try {
|
|
24
24
|
delete require.cache[require.resolve(path)];
|
|
@@ -49,7 +49,8 @@ function Locales() {
|
|
|
49
49
|
for (var f = 0, len = files.length; f < len; ++f) {
|
|
50
50
|
if ( ! /^\./.test(files[f]) || f == len-1 ) {
|
|
51
51
|
key = files[f].split(/\./)[0];
|
|
52
|
-
regions[i] = { lang: key, content: _require( dir + '/' + files[f] ) }
|
|
52
|
+
regions[i] = { lang: key, content: _require( dir + '/' + files[f] ) };
|
|
53
|
+
++i
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// imports
|
|
2
2
|
var fs = require('fs');
|
|
3
|
-
var
|
|
4
|
-
var helpers =
|
|
5
|
-
var console =
|
|
6
|
-
var inherits =
|
|
7
|
-
var merge =
|
|
3
|
+
var lib = require('./../../../lib') || require.cache[require.resolve('./../../../lib')];
|
|
4
|
+
var helpers = lib.helpers;
|
|
5
|
+
var console = lib.logger;
|
|
6
|
+
var inherits = lib.inherits;
|
|
7
|
+
var merge = lib.merge;
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -15,8 +15,7 @@ function Make() {
|
|
|
15
15
|
var self = {}, rec = {};
|
|
16
16
|
|
|
17
17
|
var setup = function () {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
|
|
20
19
|
var opt = {}
|
|
21
20
|
, filename = null
|
|
22
21
|
, targets = [ 'currency', 'region' ]
|
|
@@ -74,7 +73,10 @@ function Make() {
|
|
|
74
73
|
};
|
|
75
74
|
|
|
76
75
|
if ( opt.region != 'en' ) {
|
|
77
|
-
rec.mapping[ 'official_name_' + opt.region ] =
|
|
76
|
+
rec.mapping[ 'official_name_' + opt.region ] = JSON.clone(rec.mapping["official_name_en"]);
|
|
77
|
+
// remove default
|
|
78
|
+
delete rec.mapping["official_name_en"];
|
|
79
|
+
console.debug('region set to ', opt.region);
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
cleanMapping();
|
|
@@ -100,9 +102,10 @@ function Make() {
|
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
var cleanMapping = function() {
|
|
103
|
-
var newMapping = {};
|
|
104
|
-
for (
|
|
105
|
-
|
|
105
|
+
var newMapping = {}, key = null;
|
|
106
|
+
for (let map in rec.mapping) {
|
|
107
|
+
key = map.replace(/(^[\s]|((?![_-\s+a-zA-Z0-9]).)*)/g, '');
|
|
108
|
+
newMapping[key] = rec.mapping[map]
|
|
106
109
|
}
|
|
107
110
|
rec.mapping = newMapping;
|
|
108
111
|
}
|
|
@@ -156,7 +159,7 @@ function Make() {
|
|
|
156
159
|
|
|
157
160
|
if (o === key) {
|
|
158
161
|
|
|
159
|
-
var _args = JSON.
|
|
162
|
+
var _args = JSON.clone(args);
|
|
160
163
|
_args.splice(0, 1);
|
|
161
164
|
|
|
162
165
|
for (var a = i, aLen = _args.length; a < aLen; ++a) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* This file is part of the gina package.
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2009-2022 Rhinostone <contact@gina.io>
|
|
4
4
|
*
|
|
5
5
|
* For the full copyright and license information, please view the LICENSE
|
|
6
6
|
* file that was distributed with this source code.
|
|
@@ -20,7 +20,7 @@ var modelUtil = new utils.Model();
|
|
|
20
20
|
*
|
|
21
21
|
* @package Gina
|
|
22
22
|
* @namespace Gina.Model
|
|
23
|
-
* @author Rhinostone <gina
|
|
23
|
+
* @author Rhinostone <contact@gina.io>
|
|
24
24
|
* @api Public
|
|
25
25
|
*/
|
|
26
26
|
function EntitySuper(conn, caller) {
|
|
@@ -33,7 +33,7 @@ function EntitySuper(conn, caller) {
|
|
|
33
33
|
var local = {}
|
|
34
34
|
var self = this;
|
|
35
35
|
var caller = caller || undefined;
|
|
36
|
-
var cacheless = (process.env.
|
|
36
|
+
var cacheless = (process.env.NODE_ENV_IS_DEV == 'false') ? false : true;
|
|
37
37
|
|
|
38
38
|
var init = function(conn, caller) {
|
|
39
39
|
|
|
@@ -42,6 +42,10 @@ function EntitySuper(conn, caller) {
|
|
|
42
42
|
if (!EntitySuper[self.name]) {
|
|
43
43
|
EntitySuper[self.name] = {}
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
if ( !EntitySuper[self.name]._conn ) {
|
|
47
|
+
EntitySuper[self.name]._conn = conn;
|
|
48
|
+
}
|
|
45
49
|
|
|
46
50
|
if ( !EntitySuper[self.name].instance ) {
|
|
47
51
|
return setListeners(caller)
|
|
@@ -49,91 +53,7 @@ function EntitySuper(conn, caller) {
|
|
|
49
53
|
return EntitySuper[self.name].instance
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
// TODO - remove this ...
|
|
54
|
-
// var loadMembers = function(caller) {
|
|
55
|
-
//
|
|
56
|
-
// var filename = self._filename
|
|
57
|
-
// , imports = ''
|
|
58
|
-
// , str = fs.readFileSync(filename).toString()
|
|
59
|
-
// , source = str;
|
|
60
|
-
//
|
|
61
|
-
// var first = source.indexOf('{') + 1
|
|
62
|
-
// var last = source.lastIndexOf('}') -1;
|
|
63
|
-
//
|
|
64
|
-
// // extract imports
|
|
65
|
-
// imports = str.substring(0, first)
|
|
66
|
-
// .replace(/function(.*)/, '')
|
|
67
|
-
// .replace(/require\(/g, 'module.require(')
|
|
68
|
-
// .replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(\/\/.*)/g, '');//remove comments
|
|
69
|
-
//
|
|
70
|
-
// // extract function body
|
|
71
|
-
// source = source.substring(first, last);
|
|
72
|
-
//
|
|
73
|
-
// source = 'var module = arguments[0];\n\r' + imports + source;
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
// var EntityOrigin = new Function(source);
|
|
78
|
-
// for (var c in self) {
|
|
79
|
-
// if (!EntityOrigin[c])
|
|
80
|
-
// EntityOrigin.prototype[c] = self[c]
|
|
81
|
-
// }
|
|
82
|
-
//
|
|
83
|
-
// var obj = new EntityOrigin(module);
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
// var methodList = {}
|
|
88
|
-
// , args = []
|
|
89
|
-
// , variables = ''
|
|
90
|
-
// , placeholder = ''
|
|
91
|
-
// , functionBody = '';
|
|
92
|
-
//
|
|
93
|
-
// obj._methods = [];
|
|
94
|
-
// for (var prop in obj) {
|
|
95
|
-
// if (typeof(obj[prop]) != 'function') continue;
|
|
96
|
-
//
|
|
97
|
-
// str = obj[prop].toString();
|
|
98
|
-
// variables = str.match(/\((.*)\)/g)[0];
|
|
99
|
-
// args = [];
|
|
100
|
-
//
|
|
101
|
-
// if (variables.length) {
|
|
102
|
-
// variables = variables.replace(/\(|\)/g, '').replace(/\s*/g, '');
|
|
103
|
-
// if (variables) args = variables.split(/\,/g);
|
|
104
|
-
// }
|
|
105
|
-
//
|
|
106
|
-
// first = str.indexOf('{') + 1
|
|
107
|
-
// last = str.lastIndexOf('}') - 1;
|
|
108
|
-
// str = str.substring(first, last);
|
|
109
|
-
//
|
|
110
|
-
// if (!self[prop]) {
|
|
111
|
-
// if (typeof(obj[prop]) == 'function') {
|
|
112
|
-
// self[prop] = obj[prop];
|
|
113
|
-
// self._methods.push(prop);
|
|
114
|
-
// }
|
|
115
|
-
// }
|
|
116
|
-
// }
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
// if (caller) {
|
|
120
|
-
// if ( !EntitySuper[caller].instance ) {
|
|
121
|
-
// EntitySuper[caller].instance = {
|
|
122
|
-
// _relations: {}
|
|
123
|
-
// }
|
|
124
|
-
// }
|
|
125
|
-
//
|
|
126
|
-
// } else {
|
|
127
|
-
// if ( !EntitySuper[self.name].instance ) {
|
|
128
|
-
// EntitySuper[self.name].instance = {
|
|
129
|
-
// _relations: {}
|
|
130
|
-
// }
|
|
131
|
-
// }
|
|
132
|
-
// }
|
|
133
|
-
//
|
|
134
|
-
// return setListeners(caller)
|
|
135
|
-
//
|
|
136
|
-
// }
|
|
56
|
+
|
|
137
57
|
|
|
138
58
|
/**
|
|
139
59
|
* Set all main listenners at once
|
|
@@ -162,7 +82,7 @@ function EntitySuper(conn, caller) {
|
|
|
162
82
|
var eventName = '';
|
|
163
83
|
for (var prop in entity) {
|
|
164
84
|
eventName = shortName +'#'+ prop;
|
|
165
|
-
if ( typeof(entity[prop]) == 'function' && new RegExp('(' + eventName + '\'|' + eventName + '\"|' + eventName + '$)').test(entity[prop].toString()) ) {
|
|
85
|
+
if (self._methods.indexOf(prop) < 0 && typeof(entity[prop]) == 'function' && new RegExp('(' + eventName + '\'|' + eventName + '\"|' + eventName + '$)').test(entity[prop].toString()) ) {
|
|
166
86
|
self._methods.push(prop)
|
|
167
87
|
}
|
|
168
88
|
}
|
|
@@ -177,20 +97,27 @@ function EntitySuper(conn, caller) {
|
|
|
177
97
|
, methods = self._methods;
|
|
178
98
|
|
|
179
99
|
|
|
180
|
-
for (var
|
|
100
|
+
for (var m = 0, mLen = methods.length; m < mLen; ++m) {
|
|
181
101
|
if (
|
|
182
|
-
typeof(entity[methods[
|
|
183
|
-
&&
|
|
102
|
+
typeof(entity[methods[m]]) == 'function'
|
|
103
|
+
&& m != 'onComplete'
|
|
184
104
|
) {
|
|
105
|
+
|
|
106
|
+
if ( triggers.indexOf(shortName + '#' + methods[m]) < 0 ) {
|
|
107
|
+
events[i] = {
|
|
108
|
+
index: i,
|
|
109
|
+
shortName: shortName + '#' + methods[m],
|
|
110
|
+
method: methods[m],
|
|
111
|
+
entityName: entityName
|
|
112
|
+
};
|
|
185
113
|
|
|
186
|
-
|
|
187
|
-
shortName
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
114
|
+
|
|
115
|
+
triggers.push(shortName + '#' + methods[m]);
|
|
116
|
+
|
|
117
|
+
++i;
|
|
118
|
+
}
|
|
191
119
|
|
|
192
|
-
|
|
193
|
-
++i;
|
|
120
|
+
|
|
194
121
|
}
|
|
195
122
|
}
|
|
196
123
|
|
|
@@ -206,7 +133,7 @@ function EntitySuper(conn, caller) {
|
|
|
206
133
|
|
|
207
134
|
for (var i = 0; i < events.length; ++i) {
|
|
208
135
|
|
|
209
|
-
entity.removeAllListeners(events[i].shortName); // added
|
|
136
|
+
entity.removeAllListeners(events[i].shortName); // added to prevent adding new listners on each new querie
|
|
210
137
|
//console.debug('placing event: '+ events[i].shortName +'\n');
|
|
211
138
|
f = events[i].method;
|
|
212
139
|
fSource = entity[f].toString();
|
|
@@ -214,7 +141,7 @@ function EntitySuper(conn, caller) {
|
|
|
214
141
|
// only if method content is about the event
|
|
215
142
|
if (methods.indexOf(f) > -1 && new RegExp('(' + events[i].shortName + '\'|' + events[i].shortName + '\"|' + events[i].shortName + '$)').test(fSource)) {
|
|
216
143
|
|
|
217
|
-
|
|
144
|
+
// CRUD | model's methods, for the n1ql, look into connector/<connectorName>/index.js
|
|
218
145
|
entity[f] = (function onEntityEvent(e, m, i, source) {
|
|
219
146
|
|
|
220
147
|
var cached = entity[m];
|
|
@@ -226,79 +153,108 @@ function EntitySuper(conn, caller) {
|
|
|
226
153
|
variables = variables.replace(/\(|\)/g, '').replace(/\s*/g, '');
|
|
227
154
|
if (variables) args = variables.split(/\,/g);
|
|
228
155
|
}
|
|
229
|
-
|
|
230
156
|
// TODO - retrieve argument while the method is being rewritten
|
|
231
157
|
return function () {
|
|
232
158
|
|
|
233
159
|
// retrieving local arguments, & binding it to the event callback
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* handle promises with async/await
|
|
163
|
+
*
|
|
164
|
+
* NB.: Always use the prefix `db` inside an entity file
|
|
165
|
+
* instead of using `this.getRelation(entityName)`
|
|
166
|
+
*
|
|
167
|
+
* e.g.:
|
|
168
|
+
* var recordJob = promisify(db.jobEntity.insert);
|
|
169
|
+
* await recordJob(jobObj)
|
|
170
|
+
* .then( function onJob(_jobObj) {
|
|
171
|
+
* jobObj = _jobObj;
|
|
172
|
+
* })
|
|
173
|
+
* .catch( function onJobErr(_err) {
|
|
174
|
+
* jobErr = _err;
|
|
175
|
+
* });
|
|
176
|
+
*
|
|
177
|
+
*/
|
|
178
|
+
if ( typeof(this[m]) == 'undefined' && typeof(arguments[arguments.length-1]) == 'function' ) {
|
|
179
|
+
|
|
180
|
+
var promise = function() {
|
|
181
|
+
var cb = arguments[arguments.length-1];
|
|
182
|
+
|
|
183
|
+
if (entity._triggers.indexOf(events[i].shortName) > -1) {
|
|
184
|
+
console.debug('[ MODEL ][ ENTITY ] Setting listener for: [ ' + self.model + '/' + events[i].entityName + '::' + events[i].shortName + ' ]');
|
|
185
|
+
|
|
186
|
+
if (typeof(entity._arguments) == 'undefined' || typeof(entity._arguments) != 'undefined' && typeof(entity._arguments[events[i].shortName]) == 'undefined') {
|
|
187
|
+
|
|
188
|
+
if (entity.listenerCount(events[i].shortName) > 0) {
|
|
189
|
+
entity.removeAllListeners([events[i].shortName])
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
entity.once(events[i].shortName, function () { // cannot be `entity.on` for prod/stage
|
|
193
|
+
// check if not already fired
|
|
194
|
+
if (entity._callbacks[events[i].shortName]) {
|
|
195
|
+
|
|
196
|
+
entity.removeAllListeners([events[i].shortName]);
|
|
197
|
+
console.log('\nFIRING #1 - promise ' + events[i].shortName +'('+ events[i].index +')');
|
|
198
|
+
cb.apply(this, arguments);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
// backing up callback
|
|
204
|
+
entity._callbacks[events[i].shortName] = cb;
|
|
205
|
+
} else { // in case the event is not ready yet
|
|
206
|
+
console.log('\nFIRING #2 - promise' + events[i].shortName);
|
|
207
|
+
cb.apply(entity[m], entity._arguments[events[i].shortName])
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
promise.apply(null, arguments);
|
|
213
|
+
cached.apply(promise, arguments);
|
|
214
|
+
return promise;
|
|
215
|
+
} //else is normal case
|
|
216
|
+
|
|
217
|
+
cached.apply(this[m], arguments);
|
|
218
|
+
|
|
237
219
|
this[m].onComplete = function (cb) {
|
|
238
220
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
//Setting local listener : normal case
|
|
221
|
+
//Setting local listener : normal case
|
|
242
222
|
if (entity._triggers.indexOf(events[i].shortName) > -1) {
|
|
243
|
-
|
|
223
|
+
console.debug('[ MODEL ][ ENTITY ] Setting listener for: [ ' + self.model + '/' + events[i].entityName + '::' + events[i].shortName + ' ]');
|
|
224
|
+
|
|
244
225
|
if (typeof(entity._arguments) == 'undefined' || typeof(entity._arguments) != 'undefined' && typeof(entity._arguments[events[i].shortName]) == 'undefined') {
|
|
226
|
+
|
|
227
|
+
if (entity.listenerCount(events[i].shortName) > 0) {
|
|
228
|
+
entity.removeAllListeners([events[i].shortName])
|
|
229
|
+
}
|
|
230
|
+
|
|
245
231
|
entity.once(events[i].shortName, function () { // cannot be `entity.on` for prod/stage
|
|
246
|
-
// check if not already fired
|
|
247
|
-
if (entity._callbacks[events[i].shortName])
|
|
232
|
+
// check if not already fired
|
|
233
|
+
if (entity._callbacks[events[i].shortName]) {
|
|
234
|
+
|
|
235
|
+
entity.removeAllListeners([events[i].shortName]);
|
|
236
|
+
console.log('\nFIRING #1 ' + events[i].shortName +'('+ events[i].index +')');
|
|
248
237
|
cb.apply(this[m], arguments);
|
|
238
|
+
//cb.apply(this, arguments);
|
|
239
|
+
}
|
|
240
|
+
|
|
249
241
|
});
|
|
242
|
+
|
|
250
243
|
|
|
251
244
|
// backing up callback
|
|
252
245
|
entity._callbacks[events[i].shortName] = cb;
|
|
253
246
|
} else { // in case the event is not ready yet
|
|
247
|
+
console.log('\nFIRING #2 ' + events[i].shortName);
|
|
254
248
|
cb.apply(entity[m], entity._arguments[events[i].shortName])
|
|
255
249
|
}
|
|
256
250
|
}
|
|
257
251
|
}
|
|
252
|
+
|
|
253
|
+
|
|
258
254
|
|
|
259
255
|
return this[m] // chaining event & method
|
|
260
256
|
};
|
|
261
257
|
|
|
262
|
-
|
|
263
|
-
// var func = function () {
|
|
264
|
-
//
|
|
265
|
-
// // retrieving local arguments, & binding it to the event callback
|
|
266
|
-
//
|
|
267
|
-
// cached.apply(this[m], arguments);
|
|
268
|
-
//
|
|
269
|
-
// this[m].onComplete = function (cb) {
|
|
270
|
-
//
|
|
271
|
-
// console.debug('setting listener for: [ ' + self.model + '/' + events[i].entityName + '::' + events[i].shortName + ' ]');
|
|
272
|
-
//
|
|
273
|
-
// //Setting local listener : normal case
|
|
274
|
-
// if (entity._triggers.indexOf(events[i].shortName) > -1) {
|
|
275
|
-
//
|
|
276
|
-
// if (typeof(entity._arguments) == 'undefined' || typeof(entity._arguments) != 'undefined' && typeof(entity._arguments[events[i].shortName]) == 'undefined') {
|
|
277
|
-
// entity.once(events[i].shortName, function () { // cannot be `entity.on` for prod/stage
|
|
278
|
-
// // check if not already fired
|
|
279
|
-
// if (entity._callbacks[events[i].shortName])
|
|
280
|
-
// cb.apply(this[m], arguments);
|
|
281
|
-
// });
|
|
282
|
-
//
|
|
283
|
-
// // backing up callback
|
|
284
|
-
// entity._callbacks[events[i].shortName] = cb;
|
|
285
|
-
// } else { // in case the event is not ready yet
|
|
286
|
-
// cb.apply(entity[m], entity._arguments[events[i].shortName])
|
|
287
|
-
// }
|
|
288
|
-
// }
|
|
289
|
-
// }
|
|
290
|
-
//
|
|
291
|
-
// return this[m] // chaining event & method
|
|
292
|
-
// };
|
|
293
|
-
//
|
|
294
|
-
// var funcStr = func.toString();
|
|
295
|
-
// var first = funcStr.indexOf('{') + 1
|
|
296
|
-
// var last = funcStr.lastIndexOf('}') -1;
|
|
297
|
-
//
|
|
298
|
-
// funcStr = funcStr.substring(first, last);
|
|
299
|
-
//
|
|
300
|
-
// return new Function(variables, funcStr)
|
|
301
|
-
|
|
302
258
|
}(events[i].shortName, f, i, fSource));
|
|
303
259
|
|
|
304
260
|
// just for display purpose: will be overriden by the previous code
|
|
@@ -347,8 +303,7 @@ function EntitySuper(conn, caller) {
|
|
|
347
303
|
|
|
348
304
|
var args = Array.prototype.slice.call(arguments);
|
|
349
305
|
var trigger = args.splice(0, 1)[0];
|
|
350
|
-
|
|
351
|
-
//self.removeAllListener(trigger);
|
|
306
|
+
|
|
352
307
|
if ( !/\#/.test(trigger) ) {
|
|
353
308
|
throw new Error('trigger name not properly set: use `#` between the entity name and the method reference');
|
|
354
309
|
process.exit(1)
|
|
@@ -376,25 +331,44 @@ function EntitySuper(conn, caller) {
|
|
|
376
331
|
|
|
377
332
|
if ( self._triggers.indexOf(events[i].shortName) > -1 ) {
|
|
378
333
|
// reusable event
|
|
379
|
-
self
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
334
|
+
self
|
|
335
|
+
//.off(events[i].shortName, function(){ delete self._callbacks[trigger]; })
|
|
336
|
+
.on(events[i].shortName, function () {
|
|
337
|
+
console.log('\nFIRING #3 ' + trigger);
|
|
338
|
+
this._callbacks[trigger.replace(/[0-9]/g, '')].apply(this[method], arguments);
|
|
339
|
+
delete self._callbacks[trigger];
|
|
340
|
+
})
|
|
384
341
|
}
|
|
385
342
|
|
|
386
343
|
} else {
|
|
387
344
|
if ( typeof(self._callbacks[trigger]) != 'undefined' ) {
|
|
345
|
+
console.log('\nFIRING #4 ' + trigger);
|
|
388
346
|
self._callbacks[trigger].apply(this, args);
|
|
389
347
|
delete self._callbacks[trigger];
|
|
390
348
|
} else {
|
|
391
|
-
self
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
//
|
|
396
|
-
|
|
397
|
-
|
|
349
|
+
self
|
|
350
|
+
// .off(trigger, function(){
|
|
351
|
+
// if (!this._arguments) {
|
|
352
|
+
// this._arguments = {}
|
|
353
|
+
// }
|
|
354
|
+
|
|
355
|
+
// if ( typeof(this._arguments[trigger]) != 'undefined' ) {
|
|
356
|
+
// delete this._arguments[trigger];
|
|
357
|
+
// }
|
|
358
|
+
// })
|
|
359
|
+
.once(trigger, function () {// patched for Air Liquide: case when emit occurs before listener is ready
|
|
360
|
+
if (!this._arguments) {
|
|
361
|
+
this._arguments = {}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// retrieving local arguments, & binding it to the event callback
|
|
365
|
+
if ( typeof(this._arguments[trigger]) == 'undefined' ) {
|
|
366
|
+
console.log('\nFIRING #5 ' + trigger);
|
|
367
|
+
|
|
368
|
+
this._arguments[trigger] = arguments;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
})
|
|
398
372
|
}
|
|
399
373
|
}
|
|
400
374
|
}
|
|
@@ -543,7 +517,7 @@ function EntitySuper(conn, caller) {
|
|
|
543
517
|
* Get connection from entity
|
|
544
518
|
* */
|
|
545
519
|
this.getConnection = function() {
|
|
546
|
-
var conn = local.conn
|
|
520
|
+
var conn = local.conn || self._conn;
|
|
547
521
|
return ( typeof(conn) != 'undefined' ) ? conn : null;
|
|
548
522
|
}
|
|
549
523
|
|
|
@@ -551,7 +525,8 @@ function EntitySuper(conn, caller) {
|
|
|
551
525
|
|
|
552
526
|
var ntt = entity;
|
|
553
527
|
entity = entity.substr(0,1).toUpperCase() + entity.substr(1);
|
|
554
|
-
|
|
528
|
+
var nttName = entity;
|
|
529
|
+
|
|
555
530
|
if ( !/Entity$/.test(entity) ) {
|
|
556
531
|
entity = entity + 'Entity'
|
|
557
532
|
}
|
|
@@ -576,14 +551,25 @@ function EntitySuper(conn, caller) {
|
|
|
576
551
|
if ( typeof(modelUtil.entities[self.bundle][self.model][entity]) != 'function' ) {
|
|
577
552
|
throw new Error('Model entity not found: `'+ entity + '` while trying to call '+ callerName +'Entity.getEntity('+ entity +')');
|
|
578
553
|
}
|
|
579
|
-
|
|
580
|
-
|
|
554
|
+
|
|
555
|
+
// fixed on May 2019, 21st : need for `this.getEntity(...)` inside the model
|
|
556
|
+
if ( typeof(EntitySuper[callerName].instance._relations[entityName]) == 'undefined' ) {
|
|
557
|
+
|
|
558
|
+
if ( typeof(EntitySuper[entityName]) != 'undefined' && typeof(EntitySuper[entityName].instance) != 'undefined' ) {
|
|
559
|
+
|
|
560
|
+
EntitySuper[callerName].instance._relations[entityName] = new modelUtil.entities[self.bundle][self.model][entity](self.getConnection(), callerName)
|
|
561
|
+
} else { // regular case
|
|
562
|
+
new modelUtil.entities[self.bundle][self.model][entity](self.getConnection(), callerName);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
return EntitySuper[callerName].instance._relations[entityName]
|
|
581
568
|
}
|
|
582
569
|
}
|
|
583
570
|
|
|
584
571
|
} catch (err) {
|
|
585
572
|
throw err;
|
|
586
|
-
return null
|
|
587
573
|
}
|
|
588
574
|
}
|
|
589
575
|
|
|
@@ -592,32 +578,6 @@ function EntitySuper(conn, caller) {
|
|
|
592
578
|
}
|
|
593
579
|
|
|
594
580
|
|
|
595
|
-
|
|
596
|
-
///**
|
|
597
|
-
// * Get config
|
|
598
|
-
// *
|
|
599
|
-
// * @param {string} [name] - Conf name without extension.
|
|
600
|
-
// * @return {object} result
|
|
601
|
-
// *
|
|
602
|
-
// * TODO - Protect result
|
|
603
|
-
// * */
|
|
604
|
-
//this.getConfig = function(name) {
|
|
605
|
-
// var tmp = null;
|
|
606
|
-
//
|
|
607
|
-
// if ( typeof(name) != 'undefined' ) {
|
|
608
|
-
// try {
|
|
609
|
-
// // needs to be read only
|
|
610
|
-
// tmp = JSON.stringify(local.options.conf.content[name]);
|
|
611
|
-
// return JSON.parse(tmp)
|
|
612
|
-
// } catch (err) {
|
|
613
|
-
// return undefined
|
|
614
|
-
// }
|
|
615
|
-
// } else {
|
|
616
|
-
// tmp = JSON.stringify(local.options.conf);
|
|
617
|
-
// return JSON.parse(tmp)
|
|
618
|
-
// }
|
|
619
|
-
//}
|
|
620
|
-
|
|
621
581
|
return init(conn, caller)
|
|
622
582
|
};
|
|
623
583
|
|