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,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "json",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "JSON helper",
|
|
5
|
+
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Maritn-Luther ETOUMAN",
|
|
8
|
+
"email": "martinluther@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,160 @@
|
|
|
1
|
+
//var console = require('./../../../lib/logger');
|
|
2
|
+
var merge = require('./../../../lib/merge');
|
|
3
|
+
var statusCodes = requireJSON(__dirname + '/../../../core/status.codes');
|
|
4
|
+
//var statusCodes = requireJSON( _( getPath('gina').core + '/status.codes') );
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* var e = null;
|
|
9
|
+
* // Server errors
|
|
10
|
+
* e = new ApiError('This is a generic server error.'); // default error.status -> 500
|
|
11
|
+
* e = new ApiError('This a server specific server error.', 501);
|
|
12
|
+
*
|
|
13
|
+
* // Client errors
|
|
14
|
+
* e = new ApiError('This is client error.', 498);
|
|
15
|
+
* e = new ApiError('This is client error.', 'token', 498); // where `token` is the frontend field: <input type="hiden" name="token">
|
|
16
|
+
* or
|
|
17
|
+
* e = new ApiError('This is client error.', 'token');
|
|
18
|
+
* e.status = 498;
|
|
19
|
+
*
|
|
20
|
+
* // Client bundled error
|
|
21
|
+
* e = new ApiError(['This is preconditioned #1 client error.', 'This is preconditioned #2 client error.'], ['firstName', 'lastName']);
|
|
22
|
+
*
|
|
23
|
+
* @param {string|array} errorMessage
|
|
24
|
+
* @param {string} [fieldName]
|
|
25
|
+
* @param {number} [errorStatus] - 500 by default for the server and 412 for the client
|
|
26
|
+
*
|
|
27
|
+
* @returns {object} errorObject
|
|
28
|
+
*/
|
|
29
|
+
function ApiError(errorMessage, fieldName, errorStatus) {
|
|
30
|
+
var e = null;
|
|
31
|
+
|
|
32
|
+
if ( typeof(merge) != 'function' ) {
|
|
33
|
+
merge = require('./../../../lib/merge');
|
|
34
|
+
}
|
|
35
|
+
if ( typeof(statusCodes) == 'undefined' ) {
|
|
36
|
+
var statusCodes = requireJSON(__dirname + '/../../../core/status.codes');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if ( typeof(errorMessage) == 'object' && errorMessage instanceof Error ) {
|
|
40
|
+
e = JSON.clone(errorMessage);
|
|
41
|
+
errorMessage = e.message || e.stack;
|
|
42
|
+
} else {
|
|
43
|
+
e = new Error(errorMessage);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var isClientError = (arguments.length == 3) ? true : false;
|
|
47
|
+
if ( arguments.length == 2 ) {
|
|
48
|
+
// server error
|
|
49
|
+
if ( typeof(arguments[1]) == 'number' ) {
|
|
50
|
+
errorStatus = arguments[1];
|
|
51
|
+
if (!e.status) {
|
|
52
|
+
e.status = errorStatus;
|
|
53
|
+
}
|
|
54
|
+
fieldName = null;
|
|
55
|
+
}
|
|
56
|
+
// client error
|
|
57
|
+
else if ( Array.isArray(arguments[1]) || typeof(arguments[1]) == 'string' ) {
|
|
58
|
+
isClientError = true;
|
|
59
|
+
errorStatus = 412; // by default
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
throw new Error('ApiError: Bad usage.');
|
|
63
|
+
}
|
|
64
|
+
} else if (arguments.length == 1) {
|
|
65
|
+
fieldName = null;
|
|
66
|
+
errorStatus = null;
|
|
67
|
+
}
|
|
68
|
+
// Server Error
|
|
69
|
+
if (!isClientError) {
|
|
70
|
+
// TODO - Reformat stack to remove the first lines
|
|
71
|
+
if (!e.status)
|
|
72
|
+
e.status = errorStatus || 500;
|
|
73
|
+
|
|
74
|
+
if ( typeof(statusCodes[e.status]) != 'undefined' ) {
|
|
75
|
+
e.error = statusCodes[e.status];
|
|
76
|
+
} else {
|
|
77
|
+
console.warn('[ ApiValidator ] statusCode `'+ e.status +'` not matching any definition in `'+_( getPath('gina').core + '/status.codes')+'`\nPlease contact the Gina dev team to add one if required');
|
|
78
|
+
}
|
|
79
|
+
if (!e.message)
|
|
80
|
+
e.message = errorMessage;
|
|
81
|
+
|
|
82
|
+
return e;
|
|
83
|
+
}
|
|
84
|
+
// Client Error
|
|
85
|
+
e.status = errorStatus || 412;
|
|
86
|
+
if ( typeof(statusCodes[e.status]) != 'undefined' ) {
|
|
87
|
+
e.error = statusCodes[e.status];
|
|
88
|
+
} else {
|
|
89
|
+
console.warn('[ ApiValidator ] statusCode `'+ e.status +'` not matching any definition in `'+_( corePath + '/status.codes')+'`\nPlease contact the Gina dev team to add one if required');
|
|
90
|
+
}
|
|
91
|
+
if (!fieldName) { // Client error without defined field
|
|
92
|
+
e.message = errorMessage;
|
|
93
|
+
return e;
|
|
94
|
+
}
|
|
95
|
+
var ctx = getContext();
|
|
96
|
+
var clientError = merge({
|
|
97
|
+
tag : '', // internal framework reference
|
|
98
|
+
fields : {},
|
|
99
|
+
path : ''
|
|
100
|
+
}, e);
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
var formatClientError = function(ctx, error, errorMessage, fieldName) {
|
|
104
|
+
error.fields[fieldName] = errorMessage;
|
|
105
|
+
var bundleName = ctx.bundle
|
|
106
|
+
, stackObj = __stack[2]
|
|
107
|
+
;
|
|
108
|
+
if ( typeof(stackObj) == 'object' ) {
|
|
109
|
+
try {
|
|
110
|
+
error.tag += bundleName +':';
|
|
111
|
+
var filename = stackObj.getFileName();
|
|
112
|
+
var re = new RegExp('('+bundleName+'\/)(model|controller)');
|
|
113
|
+
if ( re.test(filename) ) {
|
|
114
|
+
var paths = getPaths(), path = null;
|
|
115
|
+
// model
|
|
116
|
+
if ( /model/i.test(filename) ) {
|
|
117
|
+
path = paths.models.substr(paths.models.lastIndexOf(bundleName)) +'/'+ filename.substr(filename.lastIndexOf(bundleName+'\/models'));
|
|
118
|
+
error.tag += 'model:'
|
|
119
|
+
}
|
|
120
|
+
// controller
|
|
121
|
+
else {
|
|
122
|
+
path = paths.controllers.substr(paths.controllers.lastIndexOf(bundleName)) +'/'+ filename.substr(filename.lastIndexOf(bundleName+'\/controllers'));
|
|
123
|
+
error.tag += 'controller:';
|
|
124
|
+
var controllerInstanceString = path.match(/controller\.(.*)\.js/)[1] || null;
|
|
125
|
+
error.tag += (controllerInstanceString) ? controllerInstanceString : 'controller:';
|
|
126
|
+
}
|
|
127
|
+
error.path = path;
|
|
128
|
+
}
|
|
129
|
+
var funcName = stackObj.getFunctionName();
|
|
130
|
+
error.tag += funcName.replace(/\./g, ':') +' :'+stackObj.getLineNumber()+':'+stackObj.getColumnNumber();
|
|
131
|
+
//error.fields[fieldName][funcName] = errorMessage;
|
|
132
|
+
} catch (err) {
|
|
133
|
+
error.tag = 'N/A';
|
|
134
|
+
error.stack = err.stack;
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
//error.fields[fieldName]['isApiError'] = errorMessage;
|
|
138
|
+
error.tag = 'N/A';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return error;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if ( Array.isArray(fieldName) ) {
|
|
145
|
+
for (let i = 0, len = errorMessage.length; i < len; i++) {
|
|
146
|
+
clientError = formatClientError(ctx, clientError, errorMessage[i], fieldName[i]);
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
clientError = formatClientError(ctx, clientError, errorMessage, fieldName);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return clientError;
|
|
153
|
+
}
|
|
154
|
+
if ( ( typeof(module) !== 'undefined' ) && module.exports ) {
|
|
155
|
+
// Publish as node.js module
|
|
156
|
+
module.exports = ApiError;
|
|
157
|
+
} else if ( typeof(define) === 'function' && define.amd) {
|
|
158
|
+
// Publish as AMD module
|
|
159
|
+
define( function() { return ApiError });
|
|
160
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
var fs = require('fs');
|
|
10
|
+
/**
|
|
11
|
+
* PluginsHelper
|
|
12
|
+
*
|
|
13
|
+
* @package Gina.Utils.Helpers
|
|
14
|
+
* @author Rhinostone <contact@gina.io>
|
|
15
|
+
* @api public
|
|
16
|
+
* */
|
|
17
|
+
|
|
18
|
+
module.exports = function(loadedPlugins){
|
|
19
|
+
for (let plugin in loadedPlugins) {
|
|
20
|
+
switch (plugin) {
|
|
21
|
+
case 'Validator':
|
|
22
|
+
// Global
|
|
23
|
+
// TODO - load from `loadedPlugins[plugin].helpers { 'ApiError': 'api-error'}
|
|
24
|
+
if ( typeof(ApiError) == 'undefined')
|
|
25
|
+
ApiError = require('./api-error');
|
|
26
|
+
break;
|
|
27
|
+
|
|
28
|
+
default:
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};//EO JSONHelper.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
function PrototypesHelper(instance) {
|
|
2
|
+
|
|
3
|
+
var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
|
|
4
|
+
|
|
5
|
+
var local = instance || null;
|
|
6
|
+
var envVars = null;
|
|
7
|
+
// since for some cases we cannot use gina envVars directly
|
|
8
|
+
if (
|
|
9
|
+
typeof(GINA_DIR) == 'undefined'
|
|
10
|
+
&& !isGFFCtx
|
|
11
|
+
&& typeof(process) != 'undefined'
|
|
12
|
+
&& process.argv.length > 3
|
|
13
|
+
) {
|
|
14
|
+
if ( /^\{/.test(process.argv[2]) ) {
|
|
15
|
+
envVars = JSON.parse(process.argv[2]).envVars;
|
|
16
|
+
}
|
|
17
|
+
// minions case
|
|
18
|
+
else if ( /\.ctx$/.test(process.argv[2]) ) {
|
|
19
|
+
var fs = require('fs');
|
|
20
|
+
var envVarFile = process.argv[2].split(/\-\-argv\-filename\=/)[1];
|
|
21
|
+
envVars = JSON.parse(fs.readFileSync(envVarFile).toString()).envVars;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
// else if (isGFFCtx) {
|
|
26
|
+
// envVars = window;
|
|
27
|
+
// }
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// dateFormat proto
|
|
31
|
+
if ( local && typeof(local) != 'undefined' && typeof(local.dateFormat) != 'undefined' ) {
|
|
32
|
+
for (let method in local.dateFormat) {
|
|
33
|
+
|
|
34
|
+
if ( typeof(Date[method]) != 'undefined' )
|
|
35
|
+
continue;
|
|
36
|
+
|
|
37
|
+
Object.defineProperty( Date.prototype, method, {
|
|
38
|
+
writable: false,
|
|
39
|
+
enumerable: false,
|
|
40
|
+
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
41
|
+
configurable: true,
|
|
42
|
+
value: function() {
|
|
43
|
+
|
|
44
|
+
var newArgs = { 0: this }, i = 1;
|
|
45
|
+
for (var a in arguments) {
|
|
46
|
+
newArgs[i] = arguments[a];
|
|
47
|
+
++i
|
|
48
|
+
}
|
|
49
|
+
newArgs.length = i;
|
|
50
|
+
// don't touch this, we need the name
|
|
51
|
+
const name = method;
|
|
52
|
+
|
|
53
|
+
return local.dateFormat[name].apply(this, newArgs );
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if ( typeof(Array.clone) == 'undefined' ) {
|
|
63
|
+
/**
|
|
64
|
+
* clone array
|
|
65
|
+
*
|
|
66
|
+
* @returns {array} Return cloned array
|
|
67
|
+
* @supress {misplacedTypeAnnotation}
|
|
68
|
+
**/
|
|
69
|
+
Object.defineProperty( Array.prototype, 'clone', {
|
|
70
|
+
writable: false,
|
|
71
|
+
enumerable: false,
|
|
72
|
+
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
73
|
+
configurable: true,
|
|
74
|
+
value: function(){ return this.slice(0); }
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if ( typeof(JSON.clone) == 'undefined' && !isGFFCtx ) {
|
|
79
|
+
if ( typeof(envVars) != 'undefined' ) {
|
|
80
|
+
JSON.clone = require( envVars.GINA_DIR +'/utils/prototypes.json_clone');
|
|
81
|
+
} else {
|
|
82
|
+
JSON.clone = require( GINA_DIR +'/utils/prototypes.json_clone');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if ( typeof(JSON.escape) == 'undefined' ) {
|
|
87
|
+
/**
|
|
88
|
+
* JSON.escape
|
|
89
|
+
* Escape special characters
|
|
90
|
+
*
|
|
91
|
+
* Changes made here must be reflected in:
|
|
92
|
+
* - gina/utils/prototypes.js
|
|
93
|
+
* - gina/framework/version/helpers/prototypes.js
|
|
94
|
+
* - gina/framework/version/core/asset/js/plugin/src/gina/utils/polyfill.js
|
|
95
|
+
*
|
|
96
|
+
* @param {object} jsonStr
|
|
97
|
+
*
|
|
98
|
+
* @returns {object} escaped JSON string
|
|
99
|
+
**/
|
|
100
|
+
var escape = function(jsonStr){
|
|
101
|
+
try {
|
|
102
|
+
return jsonStr
|
|
103
|
+
.replace(/\n/g, "\\n")
|
|
104
|
+
.replace(/\r/g, "\\r")
|
|
105
|
+
.replace(/\t/g, "\\t")
|
|
106
|
+
;
|
|
107
|
+
} catch (err) {
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
JSON.escape = escape;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
if ( typeof(Array.toString) == 'undefined' ) {
|
|
117
|
+
Array.prototype.toString = function(){
|
|
118
|
+
return this.join();
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if ( typeof(Array.inArray) == 'undefined' ) {
|
|
123
|
+
Object.defineProperty( Array.prototype, 'inArray', {
|
|
124
|
+
writable: false,
|
|
125
|
+
enumerable: false,
|
|
126
|
+
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
127
|
+
configurable: true,
|
|
128
|
+
value: function(o){ return this.indexOf(o)!=-1 }
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if ( typeof(Array.from) == 'undefined' ) { // if not under ES6
|
|
133
|
+
|
|
134
|
+
Object.defineProperty( Array.prototype, 'from', {
|
|
135
|
+
writable: false,
|
|
136
|
+
enumerable: false,
|
|
137
|
+
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
138
|
+
configurable: true,
|
|
139
|
+
value: function(a){
|
|
140
|
+
var seen = {}
|
|
141
|
+
, out = []
|
|
142
|
+
, len = a.length
|
|
143
|
+
, j = 0;
|
|
144
|
+
|
|
145
|
+
for(var i = 0; i < len; i++) {
|
|
146
|
+
var item = a[i];
|
|
147
|
+
if(seen[item] !== 1) {
|
|
148
|
+
seen[item] = 1;
|
|
149
|
+
out[j++] = item
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return out
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if ( typeof(Object.count) == 'undefined' ) {
|
|
159
|
+
Object.defineProperty( Object.prototype, 'count', {
|
|
160
|
+
writable: true,
|
|
161
|
+
enumerable: false,
|
|
162
|
+
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
163
|
+
configurable: true,
|
|
164
|
+
value: function(){
|
|
165
|
+
var i = 0;
|
|
166
|
+
try {
|
|
167
|
+
var self = this;
|
|
168
|
+
if (this instanceof String) self = JSON.parse(this);
|
|
169
|
+
|
|
170
|
+
for (var prop in this)
|
|
171
|
+
if (this.hasOwnProperty(prop)) ++i;
|
|
172
|
+
|
|
173
|
+
return i;
|
|
174
|
+
} catch (err) {
|
|
175
|
+
return i;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
if ( typeof(global) != 'undefined' && typeof(global.__stack) == 'undefined' ) {
|
|
185
|
+
/**
|
|
186
|
+
* __stack Get current stack
|
|
187
|
+
* @returns {Object} stack Current stack
|
|
188
|
+
* @suppress {es5Strict}
|
|
189
|
+
**/
|
|
190
|
+
Object.defineProperty(global, '__stack', {
|
|
191
|
+
//If loaded several times, it can lead to an exception. That's why I put this.
|
|
192
|
+
configurable: true,
|
|
193
|
+
get: function(){
|
|
194
|
+
var orig = Error.prepareStackTrace;
|
|
195
|
+
Error.prepareStackTrace = function(_, stack){
|
|
196
|
+
return stack;
|
|
197
|
+
};
|
|
198
|
+
var err = new Error;
|
|
199
|
+
/** @suppress {es5Strict} */
|
|
200
|
+
Error.captureStackTrace(err, arguments.callee);
|
|
201
|
+
var stack = err.stack;
|
|
202
|
+
Error.prepareStackTrace = orig;
|
|
203
|
+
return stack;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if ( ( typeof(module) !== 'undefined' ) && module.exports ) {
|
|
212
|
+
// Publish as node.js module
|
|
213
|
+
module.exports = PrototypesHelper
|
|
214
|
+
} else if ( typeof(define) === 'function' && define.amd) {
|
|
215
|
+
// Publish as AMD module
|
|
216
|
+
define( function() { return PrototypesHelper })
|
|
217
|
+
}
|
|
218
|
+
|
|
@@ -8,13 +8,18 @@ module.exports = function () {
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Run commande on local cli
|
|
11
|
+
*
|
|
12
|
+
* Could also be used to open an url but need some tweaking
|
|
13
|
+
* // sample of a cross platform `open` command
|
|
14
|
+
* e.g.: var openCmd = (process.platform == 'darwin'? 'open': process.platform == 'win32'? 'start': 'xdg-open');
|
|
11
15
|
*
|
|
12
16
|
* @param cmdLine {array|string}
|
|
13
17
|
* @param opt {object}
|
|
14
18
|
*
|
|
15
19
|
*
|
|
16
20
|
* */
|
|
17
|
-
run = function(cmdline, opt) {
|
|
21
|
+
run = function(cmdline, opt, cb) {
|
|
22
|
+
|
|
18
23
|
var pathArr = (new _(__dirname).toUnixStyle().split(/\//g));
|
|
19
24
|
var root = pathArr.splice(0, pathArr.length-6).join('/');
|
|
20
25
|
|
|
@@ -36,6 +41,22 @@ module.exports = function () {
|
|
|
36
41
|
var result, error = false;
|
|
37
42
|
var hasCalledBack = false;
|
|
38
43
|
var e = new EventEmitter();
|
|
44
|
+
|
|
45
|
+
e.onData = function(callback) {
|
|
46
|
+
e.once('run#data', callback);
|
|
47
|
+
|
|
48
|
+
e.once('run#err', callback);
|
|
49
|
+
|
|
50
|
+
return e
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
e.onComplete = function(callback) {
|
|
54
|
+
e.once('run#complete', function(err, data) {
|
|
55
|
+
callback(err, data);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return e
|
|
59
|
+
};
|
|
39
60
|
|
|
40
61
|
//console.log( opt.cwd );
|
|
41
62
|
//console.log( 'running ', cmdline);
|
|
@@ -45,14 +66,20 @@ module.exports = function () {
|
|
|
45
66
|
if (typeof(cmdline) == 'string') {
|
|
46
67
|
cmdline = cmdline.split(' ')
|
|
47
68
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
69
|
+
|
|
70
|
+
console.debug('opt.outToProcessSTD => ', opt.outToProcessSTD);
|
|
71
|
+
if ( typeof(opt) != 'undefined' && typeof(opt.outToProcessSTD) != 'undefined' && /^true$/i.test(opt.outToProcessSTD) ) {
|
|
72
|
+
// mainly used for task like `npm install`. This is not the default setup
|
|
73
|
+
cmd = spawn(cmdline.splice(0,1).toString(), cmdline, { cwd: opt.cwd, stdio: [ process.stdin, process.stdout, process.stderr ] });
|
|
74
|
+
} else {
|
|
75
|
+
cmd = spawn(cmdline.splice(0,1).toString(), cmdline, { cwd: opt.cwd, stdio: [ 'ignore', out, err ] });
|
|
76
|
+
}
|
|
51
77
|
cmd.on('stdout', function(data) {
|
|
52
78
|
var str = data.toString();
|
|
53
79
|
var lines = str.split(/(\r?\n)/g);
|
|
54
80
|
result = lines.join('');
|
|
55
|
-
|
|
81
|
+
console.log('out: ', result);
|
|
82
|
+
|
|
56
83
|
e.emit('run#data', result)
|
|
57
84
|
});
|
|
58
85
|
|
|
@@ -60,9 +87,14 @@ module.exports = function () {
|
|
|
60
87
|
cmd.on('stderr', function (err) {
|
|
61
88
|
var str = err.toString();
|
|
62
89
|
error = str || false;
|
|
63
|
-
|
|
90
|
+
console.log('err: ', error);
|
|
91
|
+
|
|
64
92
|
e.emit('run#err', error)
|
|
65
93
|
});
|
|
94
|
+
|
|
95
|
+
// cmd.on('exit', function (code){
|
|
96
|
+
// console.debug('exiting with code '+ code +' ....');
|
|
97
|
+
// });
|
|
66
98
|
|
|
67
99
|
cmd.on('close', function (code) {
|
|
68
100
|
|
|
@@ -73,7 +105,7 @@ module.exports = function () {
|
|
|
73
105
|
if ( fs.existsSync(errFile) ) fs.unlinkSync(errFile);
|
|
74
106
|
|
|
75
107
|
if (error) {
|
|
76
|
-
cmd.emit('stderr',
|
|
108
|
+
cmd.emit('stderr', Buffer.from(error))
|
|
77
109
|
}
|
|
78
110
|
|
|
79
111
|
|
|
@@ -83,7 +115,7 @@ module.exports = function () {
|
|
|
83
115
|
if (fs.existsSync(outFile) ) fs.unlinkSync(outFile);
|
|
84
116
|
|
|
85
117
|
if ( data ) {
|
|
86
|
-
cmd.emit('stdout',
|
|
118
|
+
cmd.emit('stdout', Buffer.from(data))
|
|
87
119
|
}
|
|
88
120
|
|
|
89
121
|
|
|
@@ -92,8 +124,16 @@ module.exports = function () {
|
|
|
92
124
|
}
|
|
93
125
|
|
|
94
126
|
if (code == 0 ) {
|
|
127
|
+
if (cb) {
|
|
128
|
+
cb(error, result);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
95
131
|
e.emit('run#complete', error, result)
|
|
96
132
|
} else {
|
|
133
|
+
if (cb) {
|
|
134
|
+
cb('task::run encountered an error: ' + error, result);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
97
137
|
e.emit('run#complete', 'task::run encountered an error: ' + error, result)
|
|
98
138
|
}
|
|
99
139
|
|
|
@@ -103,27 +143,7 @@ module.exports = function () {
|
|
|
103
143
|
}
|
|
104
144
|
});
|
|
105
145
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
e.once('run#data', function(data) {
|
|
109
|
-
callback(data)
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
e.once('run#err', function(err, data) {
|
|
113
|
-
callback(err, data)
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
return e
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
e.onComplete = function(callback) {
|
|
121
|
-
e.once('run#complete', function(err, data) {
|
|
122
|
-
callback(err, data)
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
return e
|
|
126
|
-
};
|
|
146
|
+
|
|
127
147
|
|
|
128
148
|
return e
|
|
129
149
|
};
|
|
@@ -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.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* TextHelper
|
|
11
11
|
*
|
|
12
12
|
* @package Gina.Utils.Helpers
|
|
13
|
-
* @author Rhinostone <gina
|
|
13
|
+
* @author Rhinostone <contact@gina.io>
|
|
14
14
|
* @api public
|
|
15
15
|
* */
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ module.exports = function(){
|
|
|
20
20
|
* @todo
|
|
21
21
|
* __ Translate a given string into the i18n for local value
|
|
22
22
|
*
|
|
23
|
-
* @
|
|
23
|
+
* @returns {string} i18nValue Return the translated string
|
|
24
24
|
* */
|
|
25
25
|
__ = function(str){
|
|
26
26
|
var self = __;
|
|
@@ -41,7 +41,7 @@ module.exports = function(){
|
|
|
41
41
|
/**
|
|
42
42
|
* trim prototype
|
|
43
43
|
*
|
|
44
|
-
* @
|
|
44
|
+
* @returns {string} result
|
|
45
45
|
* */
|
|
46
46
|
if (!String.prototype.trim) {
|
|
47
47
|
String.prototype.trim = function(){
|
|
@@ -52,20 +52,20 @@ if (!String.prototype.trim) {
|
|
|
52
52
|
/**
|
|
53
53
|
* ltrim prototype
|
|
54
54
|
*
|
|
55
|
-
* @
|
|
55
|
+
* @returns {string} result
|
|
56
56
|
* */
|
|
57
57
|
String.prototype.ltrim=function(){return this.replace(/^\s+/,'');};
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* rtrim prototype
|
|
61
61
|
*
|
|
62
|
-
* @
|
|
62
|
+
* @returns {string} result
|
|
63
63
|
* */
|
|
64
64
|
String.prototype.rtrim=function(){return this.replace(/\s+$/,'');};
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* gtrim prototype - Global / full trim
|
|
68
68
|
*
|
|
69
|
-
* @
|
|
69
|
+
* @returns {string} result
|
|
70
70
|
* */
|
|
71
71
|
String.prototype.gtrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,'').replace(/\s+/g,' ');};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "archiver",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Archiver lib",
|
|
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
|
+
}
|