gina 0.0.9-p91b → 0.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +46 -0
- package/{core/asset/html/static.html → Icon/r} +0 -0
- package/LICENSE +1 -1
- package/README-4Contributors.md +96 -0
- package/README.md +296 -104
- package/bin/cli +287 -0
- package/bin/cli-debug +60 -0
- package/bin/cmd +184 -0
- package/bin/gina +180 -0
- package/config/logger.json +17 -0
- package/doc/framework/cli/doc.json +9 -0
- package/doc/framework/index.md +60 -0
- package/framework/v0.1.1-alpha.2/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.2}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.2/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.2/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.2/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.2/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.2/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.2/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.2/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.2/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.2/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.2/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.2/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.2/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.2/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.2/core/router.js +664 -0
- package/framework/v0.1.1-alpha.2/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.2/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.2/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.2/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.2/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.2/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.2/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.2/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.2/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.2/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.2/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.2/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.2/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.2/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.2/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.2/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.2/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.2/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.2/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.2/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.2/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.2/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/main.js +734 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.2/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.2/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.2/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.2/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.2/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.2/package.json +14 -0
- package/package.json +35 -33
- package/resources/etc/init.d/debian/gina +117 -0
- package/resources/home/framework/env.json +34 -0
- package/resources/home/framework/locals.json +14 -0
- package/resources/home/framework/project.json +48 -0
- package/resources/home/framework/projects.json +6 -0
- package/resources/home/main.json +47 -0
- package/resources/home/settings.json +22 -0
- package/resources/home/user/extensions/logger/default/config.json +77 -0
- package/resources/home/user/extensions/logger/file/config.json +11 -0
- package/resources/img/android-chrome-192x192.png +0 -0
- package/resources/img/android-chrome-512x512.png +0 -0
- package/resources/img/apple-touch-icon.png +0 -0
- package/resources/img/favicon-16x16.png +0 -0
- package/resources/img/favicon-32x32.png +0 -0
- package/resources/img/favicon.ico +0 -0
- package/resources/package.json.template +50 -0
- package/script/lib.js +24 -0
- package/script/post_install.js +449 -157
- package/script/pre_install.js +277 -36
- package/script/prepare_version.js +425 -0
- package/utils/helper.js +438 -0
- package/utils/prototypes.js +239 -0
- package/utils/prototypes.json_clone.js +175 -0
- package/.npmignore +0 -6
- package/MIDDLEWARE +0 -1
- package/SUCCESS +0 -1
- package/VERSION +0 -1
- package/core/asset/html/nolayout.html +0 -1
- package/core/asset/js/plugin/build.dev.json +0 -28
- package/core/asset/js/plugin/build.json +0 -31
- package/core/asset/js/plugin/dist/gina.min.css +0 -1
- package/core/asset/js/plugin/dist/gina.min.css.map +0 -1
- package/core/asset/js/plugin/dist/gina.min.js +0 -13731
- package/core/asset/js/plugin/dist/gina.min.js.map +0 -42
- package/core/asset/js/plugin/dist/gina.onload.min.js +0 -3
- package/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
- package/core/asset/js/plugin/readme.md +0 -152
- package/core/asset/js/plugin/src/gina/main.js +0 -132
- package/core/asset/js/plugin/src/gina/popin/css/design.css +0 -23
- package/core/asset/js/plugin/src/gina/popin/css/main.css +0 -1112
- package/core/asset/js/plugin/src/gina/popin/css/popin.css +0 -3
- package/core/asset/js/plugin/src/gina/popin/css/popin.css.map +0 -1
- package/core/asset/js/plugin/src/gina/popin/doc/TOC.md +0 -29
- package/core/asset/js/plugin/src/gina/popin/doc/css.md +0 -162
- package/core/asset/js/plugin/src/gina/popin/doc/extend.md +0 -663
- package/core/asset/js/plugin/src/gina/popin/doc/faq.md +0 -46
- package/core/asset/js/plugin/src/gina/popin/doc/html.md +0 -227
- package/core/asset/js/plugin/src/gina/popin/doc/js.md +0 -37
- package/core/asset/js/plugin/src/gina/popin/doc/misc.md +0 -178
- package/core/asset/js/plugin/src/gina/popin/doc/usage.md +0 -130
- package/core/asset/js/plugin/src/gina/popin/main.js +0 -783
- package/core/asset/js/plugin/src/gina/popin/sass/config.sass +0 -37
- package/core/asset/js/plugin/src/gina/popin/sass/gina-design.sass +0 -622
- package/core/asset/js/plugin/src/gina/popin/sass/gina-popin.sass +0 -54
- package/core/asset/js/plugin/src/gina/popin/sass/helper.scss +0 -73
- package/core/asset/js/plugin/src/gina/toolbar/.npmignore +0 -19
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css +0 -433
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css.map +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/index.html +0 -285
- package/core/asset/js/plugin/src/gina/toolbar/index.kit +0 -120
- package/core/asset/js/plugin/src/gina/toolbar/jquery-3.1.0.min.js +0 -4
- package/core/asset/js/plugin/src/gina/toolbar/main.js +0 -693
- package/core/asset/js/plugin/src/gina/toolbar/mock.gina.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/mock.user.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/readme.md +0 -7
- package/core/asset/js/plugin/src/gina/toolbar/sass/toolbar.sass +0 -563
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/info-optim.svg +0 -13
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/logo-gina.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings-big.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.afdesign +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/test.jpg +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/toolbar.html +0 -104
- package/core/asset/js/plugin/src/gina/utils/dom.js +0 -24
- package/core/asset/js/plugin/src/gina/utils/events.js +0 -201
- package/core/asset/js/plugin/src/gina/utils/loader.js +0 -57
- package/core/asset/js/plugin/src/main.js +0 -235
- package/core/asset/js/plugin/src/vendor/jquery/1.11.1-css-event_alias.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/1.12.4.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/2.1.1-css-event_alias-sizzle.min.js +0 -4
- package/core/asset/js/plugin/src/vendor/jquery/README.md +0 -14
- package/core/asset/js/plugin/src/vendor/jquery/slim-3.1.1.min.js +0 -4
- package/core/config.js +0 -1225
- package/core/controller/controller.js +0 -1860
- package/core/gna.js +0 -908
- package/core/plugins/lib/validator/src/form-validator.js +0 -788
- package/core/plugins/lib/validator/src/main.js +0 -2056
- package/core/router.js +0 -717
- package/core/server.js +0 -1363
- package/core/template/conf/env.json +0 -70
- package/core/template/conf/settings.json +0 -48
- package/core/template/conf/statics.json +0 -6
- package/core/template/conf/views.json +0 -16
- package/core/template/samples/bundle/config/app.json +0 -4
- package/core/template/samples/bundle/config/routing.json +0 -9
- package/core/template/samples/bundle/controllers/setup.js +0 -33
- package/core/template/views/js/vendor/readme.md +0 -1
- package/core/template/views/readme.md +0 -1
- package/core/utils/helpers/dateFormat.js +0 -264
- package/core/utils/helpers/index.js +0 -202
- package/core/utils/index.js +0 -75
- package/core/utils/lib/cmd/app.js +0 -686
- package/core/utils/lib/cmd/basic.help.txt +0 -40
- package/core/utils/lib/cmd/basic.js +0 -141
- package/core/utils/lib/cmd/gina-add-bundle.js +0 -328
- package/core/utils/lib/cmd/gina-add-views.js +0 -99
- package/core/utils/lib/cmd/gina-build.js +0 -218
- package/core/utils/lib/cmd/gina-clean.js +0 -26
- package/core/utils/lib/cmd/gina-connect.js +0 -176
- package/core/utils/lib/cmd/gina-delete-bundle.js +0 -176
- package/core/utils/lib/cmd/gina-deploy.js +0 -452
- package/core/utils/lib/cmd/gina-init-project.js +0 -83
- package/core/utils/lib/cmd/gina-start-bundle.js +0 -3
- package/core/utils/lib/cmd/gina-start.js +0 -3
- package/core/utils/lib/cmd/index.js +0 -157
- package/core/utils/lib/cmd/project.js +0 -14
- package/core/utils/lib/collection/src/main.js +0 -650
- package/core/utils/lib/logger/containers/file.js +0 -11
- package/core/utils/lib/logger/index.js +0 -260
- package/core/utils/lib/merge/src/main.js +0 -344
- package/core/utils/lib/proc.js +0 -416
- package/core/utils/lib/routing/src/main.js +0 -165
- package/documentation/css/default.css +0 -3
- package/documentation/html/home.html +0 -6
- package/documentation/html/inc/_footer.html +0 -5
- package/documentation/html/layout.html +0 -21
- package/documentation/img/debug-conf1.png +0 -0
- package/documentation/img/debug-conf2.png +0 -0
- package/documentation/img/debug-conf3.png +0 -0
- package/documentation/img/debug-conf4.png +0 -0
- package/documentation/img/debug-conf5.png +0 -0
- package/documentation/img/debug-conf6.png +0 -0
- package/documentation/img/debug-conf7.png +0 -0
- package/documentation/img/debug-new1.png +0 -0
- package/documentation/img/debug-new2.png +0 -0
- package/documentation/img/debug-start.png +0 -0
- package/documentation/md/api/controller/main.md +0 -74
- package/migration_note.md +0 -7
- package/package-lock.json +0 -611
- package/script/pre_publish.js +0 -207
- package/tutorial/Commands/README.md +0 -56
- package/tutorial/Commands/add-bundle-result.png +0 -0
- package/tutorial/Commands/add-bundle.png +0 -0
- package/tutorial/Commands/delete-bundle.png +0 -0
- package/tutorial/Commands/help.png +0 -0
- package/tutorial/Commands/init-project.png +0 -0
- package/tutorial/Commands/start-bundle-result.png +0 -0
- package/tutorial/Commands/start-bundle-stop.png +0 -0
- package/tutorial/Commands/start-bundle.png +0 -0
- package/tutorial/Commands/version.png +0 -0
- package/tutorial/ETC/README.md +0 -74
- package/tutorial/ETC/add-bundle-result.png +0 -0
- package/tutorial/ETC/add-bundle.png +0 -0
- package/tutorial/ETC/init-project.png +0 -0
- package/tutorial/Install/README.md +0 -54
- package/tutorial/Install/git-get.png +0 -0
- package/tutorial/Install/git-install-end.png +0 -0
- package/tutorial/Install/git-install-result.png +0 -0
- package/tutorial/Install/git-install-start.png +0 -0
- package/tutorial/Install/install-end.png +0 -0
- package/tutorial/Install/install-result.png +0 -0
- package/tutorial/Install/install-start.png +0 -0
- package/tutorial/WebStorm/README.md +0 -30
- package/tutorial/WebStorm/closure-compiler.png +0 -0
- package/tutorial/WebStorm/sass.png +0 -0
|
@@ -0,0 +1,528 @@
|
|
|
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
|
+
* Credits & thanks to Steven Levithan :)
|
|
10
|
+
* http://blog.stevenlevithan.com/archives/date-time-format
|
|
11
|
+
*
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* Original Copyrights
|
|
15
|
+
* Date Format 1.2.3
|
|
16
|
+
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
|
17
|
+
* MIT license
|
|
18
|
+
*
|
|
19
|
+
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
|
20
|
+
* and Kris Kowal <cixar.com/~kris.kowal/>
|
|
21
|
+
*
|
|
22
|
+
* Accepts a date, a mask, or a date and a mask.
|
|
23
|
+
* Returns a formatted version of the given date.
|
|
24
|
+
* The date defaults to the current date/time.
|
|
25
|
+
* The mask defaults to dateFormat.masks.default.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} date
|
|
28
|
+
* @param {string} mask
|
|
29
|
+
*/
|
|
30
|
+
function DateFormatHelper() {
|
|
31
|
+
|
|
32
|
+
var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
|
|
33
|
+
var merge = (isGFFCtx) ? require('utils/merge') : require('./../lib/merge');
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// if ( typeof(define) === 'function' && define.amd ) {
|
|
37
|
+
// var Date = this.Date;
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
var self = {};
|
|
41
|
+
// language-country
|
|
42
|
+
self.culture = 'en-US'; // by default
|
|
43
|
+
self.lang = 'en'; // by default
|
|
44
|
+
|
|
45
|
+
self.masks = {
|
|
46
|
+
// i18n
|
|
47
|
+
"default": "ddd mmm dd yyyy HH:MM:ss",
|
|
48
|
+
shortDate: "m/d/yy",
|
|
49
|
+
shortDate2: "mm/dd/yyyy",
|
|
50
|
+
mediumDate: "mmm d, yyyy",
|
|
51
|
+
longDate: "mmmm d, yyyy",
|
|
52
|
+
fullDate: "dddd, mmmm d, yyyy",
|
|
53
|
+
// common
|
|
54
|
+
cookieDate: "GMT:ddd, dd mmm yyyy HH:MM:ss",
|
|
55
|
+
logger: "yyyy mmm dd HH:MM:ss",
|
|
56
|
+
shortTime: "h:MM TT",
|
|
57
|
+
shortTime2: "h:MM",
|
|
58
|
+
mediumTime: "h:MM:ss TT",
|
|
59
|
+
mediumTime2: "h:MM:ss",
|
|
60
|
+
longTime: "h:MM:ss TT Z",
|
|
61
|
+
longTime2: "h:MM:ss TT",
|
|
62
|
+
concatenatedDate: "yyyymmdd",
|
|
63
|
+
isoDate: "yyyy-mm-dd",
|
|
64
|
+
isoTime: "HH:MM:ss",
|
|
65
|
+
shortIsoTime: "HH:MM",
|
|
66
|
+
longIsoTime: "HH:MM:ss TT",
|
|
67
|
+
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
|
|
68
|
+
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
self.i18n = {
|
|
72
|
+
'en': {
|
|
73
|
+
dayNames: [
|
|
74
|
+
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
|
|
75
|
+
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
|
76
|
+
],
|
|
77
|
+
monthNames: [
|
|
78
|
+
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
|
79
|
+
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
|
80
|
+
],
|
|
81
|
+
masks: {
|
|
82
|
+
"default": "ddd mmm dd yyyy HH:MM:ss",
|
|
83
|
+
shortDate: "m/d/yy",
|
|
84
|
+
shortDate2: "mm/dd/yyyy",
|
|
85
|
+
mediumDate: "mmm d, yyyy",
|
|
86
|
+
longDate: "mmmm d, yyyy",
|
|
87
|
+
fullDate: "dddd, mmmm d, yyyy"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
'fr': {
|
|
91
|
+
dayNames: [
|
|
92
|
+
"dim", "lun", "mar", "mer", "jeu", "ven", "sam",
|
|
93
|
+
"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"
|
|
94
|
+
],
|
|
95
|
+
monthNames: [
|
|
96
|
+
"Jan", "Fév", "Mar", "Avr", "Mai", "Jui", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc",
|
|
97
|
+
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
|
|
98
|
+
],
|
|
99
|
+
masks: {
|
|
100
|
+
"default": "ddd mmm dd yyyy HH:MM:ss",
|
|
101
|
+
shortDate: "d/m/yy",
|
|
102
|
+
shortDate2: "dd/mm/yyyy",
|
|
103
|
+
mediumDate: "d mmm, yyyy",
|
|
104
|
+
longDate: "d mmmm, yyyy",
|
|
105
|
+
fullDate: "dddd, d mmmm, yyyy"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
* @param {string} culture (5 chars) | lang (2 chars)
|
|
113
|
+
*/
|
|
114
|
+
var setCulture = function(date, culture) {
|
|
115
|
+
if (/\-/.test(culture) ) {
|
|
116
|
+
self.culture = culture;
|
|
117
|
+
self.lang = culture.split(/\-/)[0];
|
|
118
|
+
} else {
|
|
119
|
+
self.lang = culture
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return this
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
var format = function(date, mask, utc) {
|
|
126
|
+
|
|
127
|
+
// if ( typeof(merge) == 'undefined' || !merge ) {
|
|
128
|
+
// merge = (isGFFCtx) ? require('utils/merge') : require('./../lib/merge');
|
|
129
|
+
|
|
130
|
+
// }
|
|
131
|
+
|
|
132
|
+
var dF = self
|
|
133
|
+
, i18n = dF.i18n[dF.lang] || dF.i18n['en']
|
|
134
|
+
//, masksList = merge(i18n.masks, dF.masks)
|
|
135
|
+
, masksList = null
|
|
136
|
+
;
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
masksList = merge(i18n.masks, dF.masks);
|
|
140
|
+
} catch( mergeErr) {
|
|
141
|
+
// called from logger - redefinition needed for none-dev env: cache issue
|
|
142
|
+
isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
|
|
143
|
+
merge = (isGFFCtx) ? require('utils/merge') : require('./../lib/merge');
|
|
144
|
+
masksList = merge(i18n.masks, dF.masks);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if ( typeof(dF.i18n[dF.culture]) != 'undefined' ) {
|
|
148
|
+
i18n = dF.i18n[dF.culture];
|
|
149
|
+
if ( typeof(dF.i18n[dF.culture].mask) != 'undefined' ) {
|
|
150
|
+
masksList = merge(i18n.masks, dF.masks)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
|
|
155
|
+
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
|
156
|
+
timezoneClip = /[^-+\dA-Z]/g,
|
|
157
|
+
pad = function (val, len) {
|
|
158
|
+
val = String(val);
|
|
159
|
+
len = len || 2;
|
|
160
|
+
while (val.length < len) val = "0" + val;
|
|
161
|
+
return val;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
|
|
165
|
+
if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
|
|
166
|
+
mask = date;
|
|
167
|
+
date = undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Passing date through Date applies Date.parse, if necessary
|
|
171
|
+
date = date ? new Date(date) : new Date();
|
|
172
|
+
if (isNaN(date)) throw SyntaxError("invalid date");
|
|
173
|
+
|
|
174
|
+
mask = String(masksList[mask] || mask || masksList["default"]);
|
|
175
|
+
|
|
176
|
+
// Allow setting the utc argument via the mask
|
|
177
|
+
if (mask.slice(0, 4) == "UTC:") {
|
|
178
|
+
mask = mask.slice(4);
|
|
179
|
+
utc = true;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var _ = utc ? "getUTC" : "get",
|
|
183
|
+
d = date[_ + "Date"](),
|
|
184
|
+
D = date[_ + "Day"](),
|
|
185
|
+
m = date[_ + "Month"](),
|
|
186
|
+
y = date[_ + "FullYear"](),
|
|
187
|
+
H = date[_ + "Hours"](),
|
|
188
|
+
M = date[_ + "Minutes"](),
|
|
189
|
+
s = date[_ + "Seconds"](),
|
|
190
|
+
L = date[_ + "Milliseconds"](),
|
|
191
|
+
o = utc ? 0 : date.getTimezoneOffset(),
|
|
192
|
+
flags = {
|
|
193
|
+
d: d,
|
|
194
|
+
dd: pad(d),
|
|
195
|
+
ddd: i18n.dayNames[D],
|
|
196
|
+
dddd: i18n.dayNames[D + 7],
|
|
197
|
+
m: m + 1,
|
|
198
|
+
mm: pad(m + 1),
|
|
199
|
+
mmm: i18n.monthNames[m],
|
|
200
|
+
mmmm: i18n.monthNames[m + 12],
|
|
201
|
+
yy: String(y).slice(2),
|
|
202
|
+
yyyy: y,
|
|
203
|
+
h: H % 12 || 12,
|
|
204
|
+
hh: pad(H % 12 || 12),
|
|
205
|
+
H: H,
|
|
206
|
+
HH: pad(H),
|
|
207
|
+
M: M,
|
|
208
|
+
MM: pad(M),
|
|
209
|
+
s: s,
|
|
210
|
+
ss: pad(s),
|
|
211
|
+
l: pad(L, 3),
|
|
212
|
+
L: pad(L > 99 ? Math.round(L / 10) : L),
|
|
213
|
+
t: H < 12 ? "a" : "p",
|
|
214
|
+
tt: H < 12 ? "am" : "pm",
|
|
215
|
+
T: H < 12 ? "A" : "P",
|
|
216
|
+
TT: H < 12 ? "AM" : "PM",
|
|
217
|
+
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
|
|
218
|
+
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
|
219
|
+
S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
return mask.replace(token, function ($0) {
|
|
225
|
+
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Get mask name from a given format
|
|
231
|
+
*
|
|
232
|
+
* @param {string} format
|
|
233
|
+
*
|
|
234
|
+
* @returns {string} maskName
|
|
235
|
+
* */
|
|
236
|
+
// var getMaskNameFromFormat = function (format) {
|
|
237
|
+
|
|
238
|
+
// var name = "default";
|
|
239
|
+
|
|
240
|
+
// for (var f in self.masks) {
|
|
241
|
+
// if ( self.masks[f] === format )
|
|
242
|
+
// return f
|
|
243
|
+
// }
|
|
244
|
+
|
|
245
|
+
// return name
|
|
246
|
+
// }
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Count days from the current date to another
|
|
251
|
+
*
|
|
252
|
+
* TODO - add a closure to `ignoreWeekend()` based on Lib::Validator
|
|
253
|
+
* TODO - add a closure to `ignoreFromList(array)` based on Lib::Validator
|
|
254
|
+
*
|
|
255
|
+
* @param {object} dateTo
|
|
256
|
+
* @returns {number} count
|
|
257
|
+
* */
|
|
258
|
+
var countDaysTo = function(date, dateTo) {
|
|
259
|
+
|
|
260
|
+
if ( dateTo instanceof Date) {
|
|
261
|
+
// The number of milliseconds in one day
|
|
262
|
+
var oneDay = 1000 * 60 * 60 * 24
|
|
263
|
+
|
|
264
|
+
// Convert both dates to milliseconds
|
|
265
|
+
var date1Ms = date.getTime()
|
|
266
|
+
var date2Ms = dateTo.getTime()
|
|
267
|
+
|
|
268
|
+
// Calculate the difference in milliseconds
|
|
269
|
+
var count = Math.abs(date1Ms - date2Ms)
|
|
270
|
+
|
|
271
|
+
// Convert back to days and return
|
|
272
|
+
return Math.round(count/oneDay);
|
|
273
|
+
} else {
|
|
274
|
+
throw new Error('dateTo is not instance of Date() !')
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Will give an array of dates between the current date to a targeted date
|
|
280
|
+
*
|
|
281
|
+
* TODO - add a closure to `ignoreWeekend()` based on Utils::Validator
|
|
282
|
+
* TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator
|
|
283
|
+
*
|
|
284
|
+
* @param {object} dateTo
|
|
285
|
+
* @param {string} [ mask ]
|
|
286
|
+
*
|
|
287
|
+
* @returns {array} dates
|
|
288
|
+
* */
|
|
289
|
+
var getDaysTo = function(date, dateTo, mask) {
|
|
290
|
+
|
|
291
|
+
if ( dateTo instanceof Date) {
|
|
292
|
+
var count = countDaysTo(date, dateTo)
|
|
293
|
+
, month = date.getMonth()
|
|
294
|
+
, year = date.getFullYear()
|
|
295
|
+
, day = date.getDate() + 1
|
|
296
|
+
, dateObj = new Date(year, month, day)
|
|
297
|
+
, days = []
|
|
298
|
+
, i = 0;
|
|
299
|
+
|
|
300
|
+
for (; i < count; ++i) {
|
|
301
|
+
if ( typeof(mask) != 'undefined' ) {
|
|
302
|
+
days.push(new Date(dateObj).format(mask));
|
|
303
|
+
} else {
|
|
304
|
+
days.push(new Date(dateObj));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
dateObj.setDate(dateObj.getDate() + 1);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return days || [];
|
|
311
|
+
} else {
|
|
312
|
+
throw new Error('dateTo is not instance of Date() !')
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
var getDaysInMonth = function(date) {
|
|
317
|
+
var month = date.getMonth();
|
|
318
|
+
var year = date.getFullYear();
|
|
319
|
+
var dateObj = new Date(year, month, 1);
|
|
320
|
+
var days = [];
|
|
321
|
+
while (dateObj.getMonth() === month) {
|
|
322
|
+
days.push(new Date(dateObj));
|
|
323
|
+
dateObj.setDate(dateObj.getDate() + 1);
|
|
324
|
+
}
|
|
325
|
+
return days;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* getQuarter
|
|
331
|
+
* Get quarter number
|
|
332
|
+
* To test : https://planetcalc.com/1252/
|
|
333
|
+
* Based on fiscal year- See.: https://en.wikipedia.org/wiki/Fiscal_year
|
|
334
|
+
*
|
|
335
|
+
* TODO - Complete fiscalCodes
|
|
336
|
+
*
|
|
337
|
+
* @param {object} [date] if not defined, will take today's value
|
|
338
|
+
* @param {string} [code] - us|eu
|
|
339
|
+
*
|
|
340
|
+
* @returns {number} quarterNumber - 1 to 4
|
|
341
|
+
*/
|
|
342
|
+
var fiscalCodes = ['us', 'eu', 'corporate'];
|
|
343
|
+
var getQuarter = function(date, code) {
|
|
344
|
+
if (
|
|
345
|
+
arguments.length == 1
|
|
346
|
+
&& typeof(arguments[0]) == 'string'
|
|
347
|
+
) {
|
|
348
|
+
if ( fiscalCodes.indexOf(arguments[0].toLowerCase()) < 0 ) {
|
|
349
|
+
throw new Error('Quarter '+ arguments[0] +' code not supported !');
|
|
350
|
+
}
|
|
351
|
+
date = new Date();
|
|
352
|
+
code = arguments[0]
|
|
353
|
+
}
|
|
354
|
+
if ( typeof(date) == 'undefined' ) {
|
|
355
|
+
date = new Date();
|
|
356
|
+
}
|
|
357
|
+
if ( typeof(code) == 'undefined') {
|
|
358
|
+
code = 'corporate';
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
code = code.toLowerCase();
|
|
362
|
+
var q = [1,2,3,4]; // EU & corporates by default
|
|
363
|
+
switch (code) {
|
|
364
|
+
case 'us':
|
|
365
|
+
q = [4,1,2,3];
|
|
366
|
+
break;
|
|
367
|
+
|
|
368
|
+
case 'corportate':
|
|
369
|
+
case 'eu':
|
|
370
|
+
q = [1,2,3,4]
|
|
371
|
+
break;
|
|
372
|
+
default:
|
|
373
|
+
// EU & corporates by default
|
|
374
|
+
q = [1,2,3,4];
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return q[Math.floor(date.getMonth() / 3)];
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* getHalfYear
|
|
383
|
+
*
|
|
384
|
+
* Based on fiscal year- See.: https://en.wikipedia.org/wiki/Fiscal_year
|
|
385
|
+
*
|
|
386
|
+
* @param {object} date
|
|
387
|
+
* @param {string} code
|
|
388
|
+
*
|
|
389
|
+
* @returns halfYear number - 1 to 2
|
|
390
|
+
*/
|
|
391
|
+
var getHalfYear = function(date, code) {
|
|
392
|
+
if (
|
|
393
|
+
arguments.length == 1
|
|
394
|
+
&& typeof(arguments[0]) == 'string'
|
|
395
|
+
) {
|
|
396
|
+
if ( fiscalCodes.indexOf(arguments[0].toLowerCase()) < 0 ) {
|
|
397
|
+
throw new Error('Quarter '+ arguments[0] +' code not supported !');
|
|
398
|
+
}
|
|
399
|
+
date = new Date();
|
|
400
|
+
code = arguments[0]
|
|
401
|
+
}
|
|
402
|
+
if ( typeof(date) == 'undefined' ) {
|
|
403
|
+
date = new Date();
|
|
404
|
+
}
|
|
405
|
+
if ( typeof(code) == 'undefined') {
|
|
406
|
+
code = 'corporate';
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
code = code.toLowerCase();
|
|
410
|
+
|
|
411
|
+
return (date.getQuarter(code) <=2 ) ? 1 : 2;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* getWeekISO8601
|
|
416
|
+
* Get week number
|
|
417
|
+
* ISO 8601
|
|
418
|
+
* To test : https://planetcalc.com/1252/
|
|
419
|
+
*
|
|
420
|
+
* @param {object} [date] if not defined, will take today's value
|
|
421
|
+
*
|
|
422
|
+
* @returns {number} weekNumber
|
|
423
|
+
*/
|
|
424
|
+
var getWeekISO8601 = function(date) {
|
|
425
|
+
// Copy date so don't modify original
|
|
426
|
+
d = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
427
|
+
// Make Sunday's day number 7
|
|
428
|
+
var dayNum = d.getDay() || 7;
|
|
429
|
+
d.setDate(d.getDate() + 4 - dayNum);
|
|
430
|
+
var yearStart = new Date(Date.parse(d.getFullYear(),0,1));
|
|
431
|
+
|
|
432
|
+
return Math.ceil((((d - yearStart) / 86400000) + 1)/7)
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* getWeek
|
|
437
|
+
* Get week number
|
|
438
|
+
* To test : https://planetcalc.com/1252/
|
|
439
|
+
*
|
|
440
|
+
* @param {object} [date] if not defined, will take today's value
|
|
441
|
+
*
|
|
442
|
+
* @returns {number} weekNumber - 1 to 53
|
|
443
|
+
*/
|
|
444
|
+
var getWeek = function(date, standardMethod) {
|
|
445
|
+
if ( typeof(date) == 'undefined' ) {
|
|
446
|
+
date = new Date();
|
|
447
|
+
}
|
|
448
|
+
if ( typeof(standardMethod) == 'undefined') {
|
|
449
|
+
standardMethod = 'ISO 8601';
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
standardMethod = standardMethod.replace(/\s+/g, '').toLowerCase();
|
|
453
|
+
switch (standardMethod) {
|
|
454
|
+
case 'corporate':
|
|
455
|
+
case 'eu':
|
|
456
|
+
case 'iso8601':
|
|
457
|
+
return getWeekISO8601(date)
|
|
458
|
+
|
|
459
|
+
default:
|
|
460
|
+
return getWeekISO8601(date)
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Add or subtract hours
|
|
466
|
+
* Adding 2 hours
|
|
467
|
+
* => myDate.addHours(2)
|
|
468
|
+
* Subtracting 10 hours
|
|
469
|
+
* => myDate.addHours(-10)
|
|
470
|
+
* */
|
|
471
|
+
var addHours = function(date, h) {
|
|
472
|
+
var copiedDate = new Date(date.getTime());
|
|
473
|
+
copiedDate.setHours(copiedDate.getHours() + h);
|
|
474
|
+
return copiedDate;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Add or subtract days
|
|
480
|
+
* Adding 2 days
|
|
481
|
+
* => myDate.addDays(2)
|
|
482
|
+
* Subtracting 10 days
|
|
483
|
+
* => myDate.addDays(-10)
|
|
484
|
+
* */
|
|
485
|
+
var addDays = function(date, d) {
|
|
486
|
+
var copiedDate = new Date(date.getTime());
|
|
487
|
+
copiedDate.setHours(copiedDate.getHours() + d * 24);
|
|
488
|
+
return copiedDate;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Add or subtract years
|
|
493
|
+
* Adding 2 days
|
|
494
|
+
* => myDate.addYears(2)
|
|
495
|
+
* Subtracting 10 years
|
|
496
|
+
* => myDate.addYears(-10)
|
|
497
|
+
* */
|
|
498
|
+
var addYears = function(date, y) {
|
|
499
|
+
var copiedDate = new Date(date.getTime());
|
|
500
|
+
copiedDate.setFullYear(copiedDate.getFullYear() + y);
|
|
501
|
+
return copiedDate;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
var _proto = {
|
|
505
|
+
setCulture : setCulture,
|
|
506
|
+
format : format,
|
|
507
|
+
countDaysTo : countDaysTo,
|
|
508
|
+
getDaysTo : getDaysTo,
|
|
509
|
+
getDaysInMonth : getDaysInMonth,
|
|
510
|
+
getQuarter : getQuarter,
|
|
511
|
+
getHalfYear : getHalfYear,
|
|
512
|
+
getWeek : getWeek,
|
|
513
|
+
addHours : addHours,
|
|
514
|
+
addDays : addDays,
|
|
515
|
+
addYears : addYears
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
return _proto
|
|
519
|
+
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
if ( ( typeof(module) !== 'undefined' ) && module.exports ) {
|
|
523
|
+
// Publish as node.js module
|
|
524
|
+
module.exports = DateFormatHelper
|
|
525
|
+
} else if ( typeof(define) === 'function' && define.amd) {
|
|
526
|
+
// Publish as AMD module
|
|
527
|
+
define( function() { return DateFormatHelper })
|
|
528
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
* @module Helpers
|
|
12
|
+
*
|
|
13
|
+
* Gina Utils Helpers
|
|
14
|
+
*
|
|
15
|
+
* @package Gina.Utils
|
|
16
|
+
* @namespace Gina.Utils.Helpers
|
|
17
|
+
* @author Rhinostone <contact@gina.io>
|
|
18
|
+
*/
|
|
19
|
+
var _require = function(path) {
|
|
20
|
+
var cacheless = (process.env.NODE_ENV_IS_DEV == 'false') ? false : true;
|
|
21
|
+
if ( cacheless && !/context/.test(path) ) { // all but the context
|
|
22
|
+
try {
|
|
23
|
+
delete require.cache[require.resolve(path)];
|
|
24
|
+
return require(path)
|
|
25
|
+
} catch (err) {
|
|
26
|
+
throw err;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
} else {
|
|
30
|
+
return require(path)
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var helpers = {}
|
|
36
|
+
, path = __dirname
|
|
37
|
+
, files = fs.readdirSync(path)
|
|
38
|
+
, f = 0
|
|
39
|
+
, len = files.length
|
|
40
|
+
, helper = ''
|
|
41
|
+
, amdDefined = []
|
|
42
|
+
;
|
|
43
|
+
|
|
44
|
+
var PrototypesHelper = null, PluginsHelper = null;
|
|
45
|
+
// loading main helpers
|
|
46
|
+
for (; f < len; ++f) {
|
|
47
|
+
if ( ! /^\./.test(files[f]) && files[f] != 'index.js') {
|
|
48
|
+
helper = files[f].replace(/.js/, '');
|
|
49
|
+
if (/prototypes/i.test(helper)) {
|
|
50
|
+
PrototypesHelper = _require('./' + helper);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (/plugins/i.test(helper)) {
|
|
54
|
+
PluginsHelper = _require('./' + helper);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
helpers[helper] = _require('./' + helper)();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
new PrototypesHelper({
|
|
62
|
+
dateFormat: helpers.dateFormat
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// loading plugins helpers
|
|
66
|
+
if (
|
|
67
|
+
typeof(getContext) != 'undefined'
|
|
68
|
+
&& typeof(getContext().gina) != 'undefined'
|
|
69
|
+
) {
|
|
70
|
+
new PluginsHelper(getContext('gina').plugins);
|
|
71
|
+
}
|
|
72
|
+
// adding ApiError to helper in case Validator plugin is not loaded
|
|
73
|
+
if ( typeof(getContext) != 'undefined' && typeof(ApiError) == 'undefined' /*&& typeof(helpers.ApiError) == 'undefined'*/ ) {
|
|
74
|
+
//helpers.ApiError = require('./plugins/src/api-error');
|
|
75
|
+
ApiError = require('./plugins/src/api-error');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Publish as node.js module
|
|
79
|
+
module.exports = helpers;
|
|
File without changes
|
|
@@ -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
|
+
}
|