gina 0.1.6-alpha.1 → 0.1.6-alpha.100
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/LICENSE +1 -1
- package/README-4Contributors.md +14 -8
- package/README.md +26 -21
- package/bin/cli +14 -0
- package/bin/gina +29 -1
- package/framework/{v0.1.6-alpha.1/lib/inherits → v0.1.6-alpha.100}/LICENSE +1 -1
- package/framework/v0.1.6-alpha.100/VERSION +1 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/plugin/README.md +1 -0
- package/framework/v0.1.6-alpha.100/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/plugin/dist/vendor/gina/js/gina.js +638 -217
- package/framework/v0.1.6-alpha.100/core/asset/plugin/dist/vendor/gina/js/gina.min.js +777 -0
- package/framework/v0.1.6-alpha.100/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
- package/framework/v0.1.6-alpha.100/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +8 -0
- package/framework/v0.1.6-alpha.100/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/config.js +224 -71
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/index.js +105 -25
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/connector.v4.js +124 -22
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/controller/controller.js +624 -155
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/controller/index.js +2 -2
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/.github/workflows/ci.yml +24 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/.github/workflows/lint.yml +23 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/README.md +191 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +149 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +143 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +154 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +148 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/lib/index.js +57 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/lib/types/multipart.js +680 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/lib/types/urlencoded.js +350 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/lib/utils.js +596 -0
- package/framework/v0.1.6-alpha.100/core/deps/busboy-1.6.0/package.json +22 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/.travis.yml +4 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/LICENSE +21 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/bool.js +10 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/boolean_double.js +7 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/boolean_single.js +7 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/default_hash.js +8 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/default_singles.js +7 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/divide.js +8 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/line_count.js +20 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/line_count_options.js +29 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/line_count_wrap.js +29 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/nonopt.js +4 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/reflect.js +2 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/short.js +3 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/string.js +11 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/usage-options.js +19 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/example/xup.js +10 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/index.js +343 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/package.json +31 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/package.json.dist +39 -0
- package/framework/v0.1.6-alpha.100/core/deps/optimist-0.6.1/readme.markdown +513 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/HISTORY.md +498 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/LICENSE +7 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/README.md +88 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/bin/swig.js +161 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/bin/swig.js.dist +161 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/dist/swig.min.js +7 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/dist/swig.min.js.map +8 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/index.js +1 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/dateformatter.js +198 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/filters.js +630 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/lexer.js +306 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/loaders/filesystem.js +59 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/loaders/index.js +53 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/loaders/memory.js +63 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/parser.js +744 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/swig.js +740 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/autoescape.js +37 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/block.js +25 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/else.js +25 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/elseif.js +28 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/extends.js +19 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/filter.js +68 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/for.js +130 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/if.js +86 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/import.js +91 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/include.js +100 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/index.js +16 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/macro.js +79 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/parent.js +51 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/raw.js +23 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/set.js +109 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/tags/spaceless.js +42 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/lib/utils.js +184 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/package.json +57 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-1.4.2/package.json.dist +61 -0
- package/framework/v0.1.6-alpha.100/core/deps/swig-client/swig.js +5031 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/dev/index.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/dev/lib/factory.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/gna.js +110 -23
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/index.js +3 -3
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/src/make.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/mime.types +1 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/model/entity.js +5 -5
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/model/index.js +30 -26
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/model/template/entityFactory.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/model/template/index.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/index.js +3 -3
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/file/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/intl/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/storage/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/validator/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/validator/src/form-validator.js +39 -27
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/validator/src/main.js +360 -85
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/router.js +92 -47
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/server.isaac.js +91 -10
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/server.js +305 -129
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/status.codes +1 -11
- package/framework/v0.1.6-alpha.100/core/template/_gitignore +19 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/controllers/setup.js +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/command/gina.tpl +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/conf/env.json +28 -7
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/conf/templates.json +4 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/console.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/context.js +29 -12
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/data/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/data/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/dateFormat.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/index.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/json/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/json/src/main.js +6 -4
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/path.js +31 -15
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/plugins/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/plugins/src/api-error.js +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/plugins/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/task.js +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/text.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/archiver/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/archiver/src/main.js +11 -11
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/add.js +2 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/start.js +26 -11
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/get.js +1 -1
- package/framework/v0.1.6-alpha.100/lib/cmd/env/help.js +30 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/use.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/build.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/init.js +18 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/link-node-modules.js +2 -3
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/link.js +1 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/tail.js +28 -11
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/version.js +15 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/helper.js +130 -20
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/index.js +1 -1
- package/framework/v0.1.6-alpha.100/lib/cmd/minion/help.txt +18 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/add.js +13 -8
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/build.js +12 -3
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/list.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/protocol/list.js +71 -50
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/collection/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/collection/src/main.js +20 -14
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/config.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cron/package.json +2 -2
- package/framework/v0.1.6-alpha.100/lib/domain/dist/2025-03-14_13-41-20_UTC.dat +15754 -0
- package/framework/v0.1.6-alpha.100/lib/domain/dist/public_suffix_list.dat +15754 -0
- package/framework/v0.1.6-alpha.100/lib/domain/exemples/backend.js +12 -0
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/domain/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/domain/src/main.js +76 -6
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/generator/index.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/index.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100/lib/inherits}/LICENSE +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/inherits/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/inherits/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/containers/mq/listener.js +10 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/helper.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/math/index.js +1 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/merge/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/model.js +3 -3
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/proc.js +9 -1
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/routing/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/routing/src/main.js +72 -25
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/session-store.js +3 -3
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/swig-filters/package.json +2 -2
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/swig-filters/src/main.js +70 -15
- package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/validator.js +2 -2
- package/framework/v0.1.6-alpha.100/package.json +11 -0
- package/package.json +3 -3
- package/resources/package.json.template +1 -1
- package/script/post_install.js +1 -1
- package/script/pre_install.js +1 -1
- package/utils/helper.js +24 -0
- package/utils/prototypes.json_clone.js +8 -1
- package/framework/v0.1.6-alpha.1/VERSION +0 -1
- package/framework/v0.1.6-alpha.1/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
- package/framework/v0.1.6-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -765
- package/framework/v0.1.6-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
- package/framework/v0.1.6-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -7
- package/framework/v0.1.6-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
- package/framework/v0.1.6-alpha.1/core/deps/busboy/.travis.yml +0 -17
- package/framework/v0.1.6-alpha.1/core/deps/busboy/README.md +0 -225
- package/framework/v0.1.6-alpha.1/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -73
- package/framework/v0.1.6-alpha.1/core/deps/busboy/deps/encoding/encoding.js +0 -2391
- package/framework/v0.1.6-alpha.1/core/deps/busboy/lib/main.js +0 -89
- package/framework/v0.1.6-alpha.1/core/deps/busboy/lib/types/multipart.js +0 -328
- package/framework/v0.1.6-alpha.1/core/deps/busboy/lib/types/urlencoded.js +0 -214
- package/framework/v0.1.6-alpha.1/core/deps/busboy/lib/utils.js +0 -191
- package/framework/v0.1.6-alpha.1/core/deps/busboy/package.json +0 -69
- package/framework/v0.1.6-alpha.1/lib/domain/dist/public_suffix_list.dat +0 -14186
- package/framework/v0.1.6-alpha.1/lib/domain/exemples/backend.js +0 -0
- package/framework/v0.1.6-alpha.1/package.json +0 -14
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/AUTHORS +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/html/nolayout.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/html/static.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/img/android-chrome-192x192.png +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/img/android-chrome-512x512.png +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/img/apple-touch-icon.png +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/img/favicon-16x16.png +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/img/favicon-32x32.png +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/img/favicon.ico +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/asset/plugin/uuid.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/connector.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/connector.v2.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/connector.v3.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/n1ql.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/session-store.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/controller/controller.framework.js +0 -0
- /package/framework/{v0.1.6-alpha.1/core/deps/busboy → v0.1.6-alpha.100/core/deps/busboy-1.6.0}/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/dev/lib/class.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/dev/lib/tools.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/currency.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/dist/language/en.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/dist/language/fr.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/dist/region/en.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/dist/region/fr.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/src/resources/currency.csv +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/src/resources/region.csv +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/locales/src/resources/region.mapping.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/file/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/file/build.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/intl/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/intl/build.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/intl/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/storage/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/storage/build.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/storage/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/validator/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/plugins/lib/validator/build.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/server.express.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/config/app.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/config/routing.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/config/settings.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/config/templates.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle/index.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_public/css/default.css +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_public/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/command/gina.bat.tpl +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/conf/manifest.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/conf/package.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/conf/settings.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/conf/statics.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/error/client/json/401.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/error/client/json/403.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/error/client/json/404.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/error/server/html/50x.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/error/server/json/500.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/error/server/json/503.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/core/template/extensions/logger/config.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/data/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/data/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/json/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/json/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/plugins/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/helpers/prototypes.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/archiver/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/archiver/build.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/archiver/src/dep/jszip.min.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/aliases.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/arguments.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/copy.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/cp.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/help.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/list.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/rename.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/status.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/bundle/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/add.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/link-dev.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/list.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/set.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/env/unset.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/dot.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/get.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/help.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/msg.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/open.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/set.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/start.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/status.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/framework/update.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/gina-dev.1.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/gina-framework.1.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/gina.1.md +0 -0
- /package/framework/{v0.1.6-alpha.1/lib/cmd/env → v0.1.6-alpha.100/lib/cmd/minion}/help.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/msg.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/port/help.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/port/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/port/inc/scan.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/port/list.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/port/reset.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/port/set.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/arguments.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/help.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/import.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/move.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/rename.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/start.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/status.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/project/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/protocol/help.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/protocol/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/protocol/set.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/add.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/help.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/link-local.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/link-production.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/list.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/scope/use.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cmd/view/add.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/collection/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/collection/build.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cron/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/cron/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/domain/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/domain/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/domain/exemples/frontend.html +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/inherits/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/inherits/example/protected_inheritance.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/inherits/example/simple_inheritance.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/containers/default/index.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/containers/file/index.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/containers/mq/index.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/logger/src/containers/mq/speaker.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/merge/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/merge/example/merge.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/merge/example/merge_2_literal objects.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/merge/example/merge_and_preserve_first.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/merge/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/routing/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/routing/build.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/shell.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/swig-filters/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/url/README.md +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/url/index.js +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/url/mocks.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/url/routing.json +0 -0
- /package/framework/{v0.1.6-alpha.1 → v0.1.6-alpha.100}/lib/url/test.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file is part of the gina package.
|
|
4
|
-
* Copyright (c) 2009-
|
|
4
|
+
* Copyright (c) 2009-2025 Rhinostone <contact@gina.io>
|
|
5
5
|
*
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
//Imports.
|
|
11
11
|
var fs = require('fs');
|
|
12
12
|
const {promises: {readFile}} = require("fs");
|
|
13
|
+
const exec = require('child_process').exec;
|
|
13
14
|
var util = require('util');
|
|
14
15
|
var promisify = util.promisify;
|
|
15
16
|
var EventEmitter = require('events').EventEmitter;
|
|
16
|
-
var zlib = require('zlib');
|
|
17
|
+
var zlib = require('zlib'); // Included with NodeJS
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
const { Resolver } = require('node:dns').promises;
|
|
20
|
+
const resolver = new Resolver();
|
|
19
21
|
// var tls = require('tls');
|
|
20
22
|
// var crypto = require('crypto');
|
|
21
23
|
|
|
@@ -25,9 +27,9 @@ var inherits = lib.inherits;
|
|
|
25
27
|
var console = lib.logger;
|
|
26
28
|
var Collection = lib.Collection;
|
|
27
29
|
var routingLib = lib.routing;
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
var Domain = lib.Domain;
|
|
31
|
+
var domainLib = new Domain();
|
|
32
|
+
var swig = require('./../deps/swig-1.4.2');
|
|
31
33
|
var SwigFilters = lib.SwigFilters;
|
|
32
34
|
var statusCodes = requireJSON( _( getPath('gina').core + '/status.codes') );
|
|
33
35
|
|
|
@@ -68,24 +70,19 @@ function SuperController(options) {
|
|
|
68
70
|
var init = function() {
|
|
69
71
|
|
|
70
72
|
if ( typeof(SuperController.initialized) != 'undefined' ) {
|
|
71
|
-
return getInstance()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
SuperController.instance = self;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (local.options) {
|
|
78
|
-
SuperController.instance._options = local.options;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
SuperController.initialized = true;
|
|
73
|
+
return getInstance();
|
|
74
|
+
}
|
|
82
75
|
|
|
76
|
+
SuperController.instance = self;
|
|
77
|
+
if (local.options) {
|
|
78
|
+
SuperController.instance._options = local.options;
|
|
83
79
|
}
|
|
80
|
+
SuperController.initialized = true;
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
var getInstance = function() {
|
|
87
84
|
local.options = SuperController.instance._options = options;
|
|
88
|
-
// 2022-03-07
|
|
85
|
+
// Fixed on 2022-03-07 for none-developpement environnements (without cache)
|
|
89
86
|
self._options = local.options;
|
|
90
87
|
|
|
91
88
|
return SuperController.instance;
|
|
@@ -240,12 +237,12 @@ function SuperController(options) {
|
|
|
240
237
|
|
|
241
238
|
if ( /^:/.test(value) ) {
|
|
242
239
|
str = 'page.view.params.'+ key + '.';
|
|
243
|
-
set(str.
|
|
240
|
+
set(str.substring(0, str.length-1), req.params[value.substring(1)]);
|
|
244
241
|
} else if (/^(file|title)$/.test(key)) {
|
|
245
242
|
str = 'page.view.'+ key + '.';
|
|
246
|
-
set(str.
|
|
243
|
+
set(str.substring(0, str.length-1), value);
|
|
247
244
|
} else {
|
|
248
|
-
set(str.
|
|
245
|
+
set(str.substring(0, str.length-1), value)
|
|
249
246
|
}
|
|
250
247
|
|
|
251
248
|
str = 'page.'
|
|
@@ -322,10 +319,24 @@ function SuperController(options) {
|
|
|
322
319
|
|
|
323
320
|
var ctx = getContext('gina');
|
|
324
321
|
// new declaration && overrides
|
|
322
|
+
var arch = process.arch;
|
|
323
|
+
switch (process.arch) {
|
|
324
|
+
case 'x64':
|
|
325
|
+
arch = 'amd64'
|
|
326
|
+
break;
|
|
327
|
+
case 'armv7l':
|
|
328
|
+
arch = 'armhf'
|
|
329
|
+
break;
|
|
330
|
+
case 'x86':
|
|
331
|
+
arch = 'i386'
|
|
332
|
+
break;
|
|
333
|
+
default:
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
325
336
|
var version = {
|
|
326
337
|
"number" : ctx.version,
|
|
327
338
|
"platform" : process.platform,
|
|
328
|
-
"arch" :
|
|
339
|
+
"arch" : arch,
|
|
329
340
|
"nodejs" : process.versions.node,
|
|
330
341
|
"middleware" : ctx.middleware
|
|
331
342
|
};
|
|
@@ -336,15 +347,124 @@ function SuperController(options) {
|
|
|
336
347
|
set('page.environment.gina pid', GINA_PID);
|
|
337
348
|
set('page.environment.nodejs', version.nodejs +' '+ version.platform +' '+ version.arch);
|
|
338
349
|
set('page.environment.engine', options.conf.server.engine);//version.middleware
|
|
350
|
+
set('page.environment.uvThreadpoolSize', process.env.UV_THREADPOOL_SIZE);
|
|
339
351
|
set('page.environment.env', process.env.NODE_ENV);
|
|
340
|
-
set('page.environment.envIsDev',
|
|
352
|
+
set('page.environment.envIsDev', /^true$/i.test(process.env.NODE_ENV_IS_DEV) );
|
|
341
353
|
set('page.environment.scope', process.env.NODE_SCOPE);
|
|
342
354
|
set('page.environment.scopeIsLocal', /^true$/i.test(process.env.NODE_SCOPE_IS_LOCAL) );
|
|
343
355
|
set('page.environment.scopeIsProduction', /^true$/i.test(process.env.NODE_SCOPE_IS_PRODUCTION) );
|
|
344
356
|
set('page.environment.date.now', new Date().format("isoDateTime"));
|
|
357
|
+
set('page.environment.isCacheless', self.isCacheless());
|
|
358
|
+
|
|
359
|
+
// var requestPort = req.headers.port || req.headers[':port'];
|
|
360
|
+
// var isProxyHost = (
|
|
361
|
+
// typeof(req.headers.host) != 'undefined'
|
|
362
|
+
// && typeof(requestPort) != 'undefined'
|
|
363
|
+
// && /^(80|443)$/.test(requestPort)
|
|
364
|
+
// && local.options.conf.server.scheme +'://'+ req.headers.host +':'+ requestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
|
|
365
|
+
// ||
|
|
366
|
+
// typeof(req.headers[':authority']) != 'undefined'
|
|
367
|
+
// && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname
|
|
368
|
+
// ||
|
|
369
|
+
// typeof(req.headers.host) != 'undefined'
|
|
370
|
+
// && typeof(requestPort) != 'undefined'
|
|
371
|
+
// && /^(80|443)$/.test(requestPort)
|
|
372
|
+
// && req.headers.host == local.options.conf.host
|
|
373
|
+
// ||
|
|
374
|
+
// typeof(req.headers['x-nginx-proxy']) != 'undefined'
|
|
375
|
+
// && /^true$/i.test(req.headers['x-nginx-proxy'])
|
|
376
|
+
// ) ? true : false;
|
|
377
|
+
// setContext('isProxyHost', isProxyHost);
|
|
378
|
+
var isProxyHost = getContext('isProxyHost') || false;
|
|
379
|
+
set('page.environment.isProxyHost', isProxyHost);
|
|
380
|
+
if ( /^true$/.test(isProxyHost) ) {
|
|
381
|
+
set('page.environment.proxyHost', process.gina.PROXY_HOST);
|
|
382
|
+
set('page.environment.proxyHostname', process.gina.PROXY_HOSTNAME);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
var _config = ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV];
|
|
386
|
+
// by default
|
|
387
|
+
var hostname = _config.hostname + _config.server.webroot;
|
|
388
|
+
var scheme = hostname.match(/^(https|http)/)[0];
|
|
389
|
+
var requestPort = (local.req.headers.port||local.req.headers[':port']);
|
|
390
|
+
|
|
391
|
+
var hostPort = hostname.match(/(\:d+\/|\:\d+)$/);
|
|
392
|
+
hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : _config.port[_config.server.protocol][_config.server.scheme];
|
|
393
|
+
// Linking bundle B from bundle A wihtout proxy
|
|
394
|
+
var isSpecialCase = (
|
|
395
|
+
getContext('bundle') != _config.bundle
|
|
396
|
+
&& requestPort != hostPort
|
|
397
|
+
&& local.req.headers[':host'] != process.gina.PROXY_HOST
|
|
398
|
+
) ? true : false;
|
|
399
|
+
|
|
400
|
+
if (isSpecialCase) {
|
|
401
|
+
hostname = _config.hostname;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// if (
|
|
405
|
+
// isProxyHost
|
|
406
|
+
// && !isSpecialCase
|
|
407
|
+
// ) {
|
|
408
|
+
// // Rewrite hostname vs req.headers.host
|
|
409
|
+
// hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
|
|
410
|
+
|
|
411
|
+
// if (
|
|
412
|
+
// !/^(80|443)$/.test(requestPort)
|
|
413
|
+
// && !new RegExp(requestPort+'$').test(hostname)
|
|
414
|
+
// ) {
|
|
415
|
+
// hostname += ':'+ requestPort;
|
|
416
|
+
// }
|
|
417
|
+
// }
|
|
418
|
+
|
|
419
|
+
set('page.environment.hostname', hostname);
|
|
420
|
+
// Updating _config.rootDomain - 2024/04/15
|
|
421
|
+
// _config.rootDomain = domainLib.getRootDomain(hostname).value;
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
set('page.environment.rootDomain', _config.rootDomain);
|
|
425
|
+
set('page.environment.webroot', options.conf.server.webroot);
|
|
426
|
+
|
|
427
|
+
if ( typeof(ctx.config.envConf._isRoutingUpdateNeeded) == 'undefined') {
|
|
428
|
+
ctx.config.envConf._isRoutingUpdateNeeded = false;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (
|
|
432
|
+
typeof(ctx.config.envConf._proxyHostname) == 'undefined'
|
|
433
|
+
||
|
|
434
|
+
hostname != ctx.config.envConf._proxyHostname
|
|
435
|
+
) {
|
|
436
|
+
ctx.config.envConf._proxyHostname = (isProxyHost) ? hostname : null;
|
|
437
|
+
ctx.config.envConf._isRoutingUpdateNeeded = true;
|
|
438
|
+
}
|
|
345
439
|
|
|
440
|
+
if ( typeof(ctx.config.envConf._routingCloned) == 'undefined' ) {
|
|
441
|
+
ctx.config.envConf._routingCloned = JSON.clone(ctx.config.envConf.routing);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
var routing = local.options.conf.routing = ctx.config.envConf._routingCloned; // all routes
|
|
445
|
+
if ( /^true$/i.test(ctx.config.envConf._isRoutingUpdateNeeded) ) {
|
|
446
|
+
|
|
447
|
+
for (let r in ctx.config.envConf.routing) {
|
|
448
|
+
if ( isProxyHost ) {
|
|
449
|
+
local.options.conf.routing[r].host = hostname.replace(/^(https|http)\:\/\//, '');
|
|
450
|
+
local.options.conf.routing[r].hostname = hostname;
|
|
451
|
+
let scheme = hostname.match(/^(https|http)/)[0];
|
|
452
|
+
local.options.conf.routing[r].hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
|
|
453
|
+
let requestPort = (local.req.headers.port||local.req.headers[':port']);
|
|
454
|
+
if (
|
|
455
|
+
!/^(80|443)$/.test(requestPort)
|
|
456
|
+
&& !new RegExp(requestPort+'$').test(local.options.conf.routing[r].hostname)
|
|
457
|
+
) {
|
|
458
|
+
local.options.conf.routing[r].hostname += ':'+ requestPort
|
|
459
|
+
}
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
local.options.conf.routing[r].host = ctx.config.envConf.routing[r].host;
|
|
463
|
+
local.options.conf.routing[r].hostname = ctx.config.envConf.routing[r].hostname;
|
|
464
|
+
}
|
|
465
|
+
ctx.config.envConf._isRoutingUpdateNeeded = false;
|
|
346
466
|
|
|
347
|
-
|
|
467
|
+
}
|
|
348
468
|
set('page.environment.routing', encodeRFC5987ValueChars(JSON.stringify(routing))); // export for GFF
|
|
349
469
|
//reverseRouting
|
|
350
470
|
var reverseRouting = local.options.conf.reverseRouting = ctx.config.envConf.reverseRouting; // all routes
|
|
@@ -354,9 +474,8 @@ function SuperController(options) {
|
|
|
354
474
|
set('page.environment.forms', encodeRFC5987ValueChars(JSON.stringify(forms))); // export for GFF
|
|
355
475
|
set('page.forms', options.conf.content.forms);
|
|
356
476
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
set('page.environment.webroot', options.conf.server.webroot);
|
|
477
|
+
|
|
478
|
+
|
|
360
479
|
set('page.environment.bundle', options.conf.bundle);
|
|
361
480
|
set('page.environment.project', options.conf.projectName);
|
|
362
481
|
set('page.environment.protocol', options.conf.server.protocol);
|
|
@@ -426,7 +545,7 @@ function SuperController(options) {
|
|
|
426
545
|
// user locale
|
|
427
546
|
options.conf.locale = new Collection(userLocales).findOne({ short: userCountryCode }) || {};
|
|
428
547
|
|
|
429
|
-
//
|
|
548
|
+
// current date
|
|
430
549
|
if ( typeof(options.conf.locale) == 'undefined' || !options.conf.locale ) {
|
|
431
550
|
options.conf.locale = {}
|
|
432
551
|
}
|
|
@@ -437,11 +556,6 @@ function SuperController(options) {
|
|
|
437
556
|
set('page.view.lang', userCulture);
|
|
438
557
|
}
|
|
439
558
|
|
|
440
|
-
if ( !getContext('isProxyHost') ) {
|
|
441
|
-
var isProxyHost = ( typeof(req.headers.host) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers.host != local.options.conf.hostname || typeof(req.headers[':authority']) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname ) ? true : false;
|
|
442
|
-
setContext('isProxyHost', isProxyHost);
|
|
443
|
-
isProxyHost = null;
|
|
444
|
-
}
|
|
445
559
|
|
|
446
560
|
//TODO - detect when to use swig
|
|
447
561
|
var dir = null;
|
|
@@ -451,7 +565,7 @@ function SuperController(options) {
|
|
|
451
565
|
var swigOptions = {
|
|
452
566
|
autoescape : ( typeof(local.options.autoescape) != 'undefined') ? local.options.autoescape : false,
|
|
453
567
|
// `memory` is no working yet ... advanced rendering setup required
|
|
454
|
-
// cache : (local.options.
|
|
568
|
+
// cache : (local.options.isCacheless) ? false : 'memory'
|
|
455
569
|
cache : false
|
|
456
570
|
};
|
|
457
571
|
if (dir) {
|
|
@@ -839,12 +953,28 @@ function SuperController(options) {
|
|
|
839
953
|
return;
|
|
840
954
|
}
|
|
841
955
|
|
|
956
|
+
var localRequestPort = local.req.headers.port || local.req.headers[':port'];
|
|
842
957
|
var isProxyHost = (
|
|
843
958
|
typeof(local.req.headers.host) != 'undefined'
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
959
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
960
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
961
|
+
&& localOptions.conf.server.scheme +'://'+ local.req.headers.host+':'+ localRequestPort != localOptions.conf.hostname.replace(/\:\d+$/, '') +':'+ localOptions.conf.server.port
|
|
962
|
+
||
|
|
963
|
+
typeof(local.req.headers[':authority']) != 'undefined'
|
|
964
|
+
&& localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname
|
|
965
|
+
||
|
|
966
|
+
typeof(local.req.headers.host) != 'undefined'
|
|
967
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
968
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
969
|
+
&& local.req.headers.host == localOptions.conf.host
|
|
970
|
+
||
|
|
971
|
+
typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
|
|
972
|
+
&& /^true$/i.test(local.req.headers['x-nginx-proxy'])
|
|
973
|
+
||
|
|
974
|
+
typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
|
|
847
975
|
) ? true : false;
|
|
976
|
+
|
|
977
|
+
|
|
848
978
|
// setup swig default filters
|
|
849
979
|
var filters = SwigFilters({
|
|
850
980
|
options : JSON.clone(localOptions),
|
|
@@ -883,6 +1013,7 @@ function SuperController(options) {
|
|
|
883
1013
|
, XHRData = null
|
|
884
1014
|
, XHRView = null
|
|
885
1015
|
, isDeferModeEnabled = null
|
|
1016
|
+
, hasExternalsPlugins = null
|
|
886
1017
|
, viewInfos = null
|
|
887
1018
|
, filename = null
|
|
888
1019
|
, isWithSwigLayout = null
|
|
@@ -898,7 +1029,9 @@ function SuperController(options) {
|
|
|
898
1029
|
if (isWithoutLayout) {
|
|
899
1030
|
data.page.view.layout = layoutPath;
|
|
900
1031
|
}
|
|
901
|
-
}
|
|
1032
|
+
}
|
|
1033
|
+
// without layout case
|
|
1034
|
+
else {
|
|
902
1035
|
|
|
903
1036
|
// by default
|
|
904
1037
|
layoutPath = localOptions.template.layout;
|
|
@@ -926,10 +1059,8 @@ function SuperController(options) {
|
|
|
926
1059
|
self.throwError(err);
|
|
927
1060
|
return;
|
|
928
1061
|
}
|
|
929
|
-
|
|
930
1062
|
}
|
|
931
1063
|
|
|
932
|
-
|
|
933
1064
|
var isLoadingPartial = false;
|
|
934
1065
|
try {
|
|
935
1066
|
assets = {assets:"${assets}"};
|
|
@@ -1023,6 +1154,7 @@ function SuperController(options) {
|
|
|
1023
1154
|
// }
|
|
1024
1155
|
|
|
1025
1156
|
isDeferModeEnabled = localOptions.template.javascriptsDeferEnabled || localOptions.conf.content.templates._common.javascriptsDeferEnabled || false;
|
|
1157
|
+
hasExternalsPlugins = (localOptions.template.externalPlugins.length > 0) ? true : false;
|
|
1026
1158
|
|
|
1027
1159
|
// iframe case - without HTML TAG
|
|
1028
1160
|
if (!self.isXMLRequest() && !/\<html/.test(layout) ) {
|
|
@@ -1092,8 +1224,8 @@ function SuperController(options) {
|
|
|
1092
1224
|
+ '{%- set userDataInspector.view.scripts = "ignored-by-toolbar" -%}'
|
|
1093
1225
|
+ '{%- set userDataInspector.view.stylesheets = "ignored-by-toolbar" -%}'
|
|
1094
1226
|
+ '{%- set userDataInspector.view.assets = '+ JSON.stringify(assets) +' -%}'
|
|
1095
|
-
+ '{%- include "'+ getPath('gina').core +'/asset/plugin/dist/vendor/gina/html/toolbar.html" with { gina: ginaDataInspector, user: userDataInspector } -%}'// jshint ignore:line
|
|
1096
1227
|
+ '{# END Gina Toolbar #}'
|
|
1228
|
+
+ '{%- include "'+ getPath('gina').core +'/asset/plugin/dist/vendor/gina/html/toolbar.html" with { gina: ginaDataInspector, user: userDataInspector } -%}'// jshint ignore:line
|
|
1097
1229
|
;
|
|
1098
1230
|
|
|
1099
1231
|
|
|
@@ -1124,10 +1256,18 @@ function SuperController(options) {
|
|
|
1124
1256
|
if (isLoadingPartial) {
|
|
1125
1257
|
layout += '\t{{ page.view.scripts }}';
|
|
1126
1258
|
} else {
|
|
1259
|
+
// placed in the HEAD
|
|
1127
1260
|
if ( isDeferModeEnabled ) {
|
|
1128
1261
|
layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
|
|
1129
|
-
}
|
|
1262
|
+
}
|
|
1263
|
+
// placed in the BODY
|
|
1264
|
+
else {
|
|
1130
1265
|
layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
|
|
1266
|
+
if (hasExternalsPlugins) {
|
|
1267
|
+
for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
|
|
1268
|
+
layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1131
1271
|
}
|
|
1132
1272
|
}
|
|
1133
1273
|
|
|
@@ -1173,6 +1313,11 @@ function SuperController(options) {
|
|
|
1173
1313
|
// layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
|
|
1174
1314
|
// } else { // placed in the BODY
|
|
1175
1315
|
// layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
|
|
1316
|
+
// if (hasExternalsPlugins) {
|
|
1317
|
+
// for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
|
|
1318
|
+
// layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
|
|
1319
|
+
// }
|
|
1320
|
+
// }
|
|
1176
1321
|
// }
|
|
1177
1322
|
// }
|
|
1178
1323
|
|
|
@@ -1189,11 +1334,18 @@ function SuperController(options) {
|
|
|
1189
1334
|
layout += '\t'+ localOptions.template.ginaLoader +'\n';
|
|
1190
1335
|
}
|
|
1191
1336
|
} else {
|
|
1337
|
+
// placed in the HEAD
|
|
1192
1338
|
if ( isDeferModeEnabled && /\<\/head\>/i.test(layout) ) { // placed in the HEAD
|
|
1193
1339
|
layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
|
|
1194
|
-
|
|
1195
|
-
|
|
1340
|
+
}
|
|
1341
|
+
// placed in the BODY
|
|
1342
|
+
else {
|
|
1196
1343
|
layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
|
|
1344
|
+
if (hasExternalsPlugins) {
|
|
1345
|
+
for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
|
|
1346
|
+
layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1197
1349
|
}
|
|
1198
1350
|
// ginaLoader cannot be deferred
|
|
1199
1351
|
if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
|
|
@@ -1295,6 +1447,40 @@ function SuperController(options) {
|
|
|
1295
1447
|
) {
|
|
1296
1448
|
layout = layout.replace('{"assets":"${assets}"}', assets );
|
|
1297
1449
|
}
|
|
1450
|
+
|
|
1451
|
+
if ( !self.isCacheless() ) {
|
|
1452
|
+
var links = local.options.template.h2Links;
|
|
1453
|
+
for (let l in localOptions.template.assets) {
|
|
1454
|
+
let link = localOptions.template.assets[l]
|
|
1455
|
+
if (
|
|
1456
|
+
/^_/.test(l)
|
|
1457
|
+
|| typeof(link.as) == 'undefined'
|
|
1458
|
+
|| typeof(link.as) != 'undefined'
|
|
1459
|
+
&& link.as != 'null'
|
|
1460
|
+
&& !link.isAvailable
|
|
1461
|
+
|| !link.as
|
|
1462
|
+
) {
|
|
1463
|
+
// ignoring
|
|
1464
|
+
continue;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
links += '<'+ l +'>; as='+ link.as +'; '
|
|
1468
|
+
if ( link.imagesrcset) {
|
|
1469
|
+
links += 'imagesrcset='+ link.imagesrcset +'; ';
|
|
1470
|
+
}
|
|
1471
|
+
if ( link.imagesizes) {
|
|
1472
|
+
links += 'imagesizes='+ link.imagesizes +'; ';
|
|
1473
|
+
}
|
|
1474
|
+
links += 'rel=preload,'
|
|
1475
|
+
|
|
1476
|
+
}
|
|
1477
|
+
if ( /\,$/.test(links) ) {
|
|
1478
|
+
links = links.substring(0, links.length-1);
|
|
1479
|
+
}
|
|
1480
|
+
local.res.setHeader('link', links);
|
|
1481
|
+
links = null;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1298
1484
|
assets = null;
|
|
1299
1485
|
|
|
1300
1486
|
} catch (err) {
|
|
@@ -1425,7 +1611,6 @@ function SuperController(options) {
|
|
|
1425
1611
|
}
|
|
1426
1612
|
}
|
|
1427
1613
|
|
|
1428
|
-
|
|
1429
1614
|
// Internet Explorer override
|
|
1430
1615
|
if ( /msie/i.test(request.headers['user-agent']) ) {
|
|
1431
1616
|
response.setHeader('content-type', 'text/plain' + '; charset='+ local.options.conf.encoding)
|
|
@@ -1433,58 +1618,57 @@ function SuperController(options) {
|
|
|
1433
1618
|
response.setHeader('content-type', local.options.conf.server.coreConfiguration.mime['json'] + '; charset='+ local.options.conf.encoding)
|
|
1434
1619
|
}
|
|
1435
1620
|
|
|
1436
|
-
|
|
1437
|
-
console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
if ( local.options.isXMLRequest && self.isWithCredentials() ) {
|
|
1441
|
-
|
|
1442
|
-
// content length must be the right size !
|
|
1443
|
-
var len = Buffer.byteLength(data, 'utf8') || 0;
|
|
1444
|
-
if ( !headersSent(response) ) {
|
|
1445
|
-
response.setHeader("content-length", len);
|
|
1446
|
-
}
|
|
1621
|
+
console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
|
|
1447
1622
|
|
|
1448
|
-
response.write(data);
|
|
1449
1623
|
|
|
1450
|
-
|
|
1451
|
-
setTimeout(function () {
|
|
1452
|
-
response.end();
|
|
1453
|
-
try {
|
|
1454
|
-
response.headersSent = true;
|
|
1455
|
-
} catch(err) {
|
|
1456
|
-
// Ignoring warning
|
|
1457
|
-
//console.warn(err);
|
|
1458
|
-
}
|
|
1624
|
+
if ( local.options.isXMLRequest && self.isWithCredentials() ) {
|
|
1459
1625
|
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1626
|
+
// content length must be the right size !
|
|
1627
|
+
var len = Buffer.byteLength(data, 'utf8') || 0;
|
|
1628
|
+
if ( !headersSent(response) ) {
|
|
1629
|
+
response.setHeader("content-length", len);
|
|
1630
|
+
}
|
|
1463
1631
|
|
|
1464
|
-
|
|
1465
|
-
}, 200);
|
|
1632
|
+
response.write(data);
|
|
1466
1633
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
// normal case
|
|
1471
|
-
response.end(JSON.stringify(jsonObj));
|
|
1472
|
-
if (!headersSent(response)) {
|
|
1634
|
+
// required to close connection
|
|
1635
|
+
setTimeout(function () {
|
|
1636
|
+
response.end();
|
|
1473
1637
|
try {
|
|
1474
1638
|
response.headersSent = true;
|
|
1475
1639
|
} catch(err) {
|
|
1476
1640
|
// Ignoring warning
|
|
1477
1641
|
//console.warn(err);
|
|
1478
1642
|
}
|
|
1643
|
+
|
|
1644
|
+
if ( next ) {
|
|
1645
|
+
next()
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
freeMemory([jsonObj, data, request, response, next]);
|
|
1649
|
+
}, 200);
|
|
1650
|
+
|
|
1651
|
+
// force completion
|
|
1652
|
+
return
|
|
1653
|
+
}
|
|
1654
|
+
// normal case
|
|
1655
|
+
response.end(JSON.stringify(jsonObj));
|
|
1656
|
+
if (!headersSent(response)) {
|
|
1657
|
+
try {
|
|
1658
|
+
response.headersSent = true;
|
|
1659
|
+
} catch(err) {
|
|
1660
|
+
// Ignoring warning
|
|
1661
|
+
//console.warn(err);
|
|
1479
1662
|
}
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1663
|
+
}
|
|
1664
|
+
if ( next ) {
|
|
1665
|
+
return next()
|
|
1666
|
+
}
|
|
1483
1667
|
|
|
1484
|
-
|
|
1668
|
+
freeMemory([jsonObj, data, request, response, next]);
|
|
1669
|
+
|
|
1670
|
+
return;
|
|
1485
1671
|
|
|
1486
|
-
return;
|
|
1487
|
-
// }
|
|
1488
1672
|
} catch (err) {
|
|
1489
1673
|
return self.throwError(response, 500, err);
|
|
1490
1674
|
}
|
|
@@ -1577,7 +1761,7 @@ function SuperController(options) {
|
|
|
1577
1761
|
|
|
1578
1762
|
++_count;
|
|
1579
1763
|
if (k == len-1) {
|
|
1580
|
-
str = str.
|
|
1764
|
+
str = str.substring(0, str.length-1);
|
|
1581
1765
|
str += "\"_content_\"";
|
|
1582
1766
|
for (let c = 0; c<_count; ++c) {
|
|
1583
1767
|
str += "}"
|
|
@@ -1619,22 +1803,35 @@ function SuperController(options) {
|
|
|
1619
1803
|
var authority = ( typeof(local.req.headers['x-forwarded-proto']) != 'undefined' ) ? local.req.headers['x-forwarded-proto'] : local.options.conf.server.scheme;
|
|
1620
1804
|
authority += '://'+ local.req.headers.host;
|
|
1621
1805
|
var useWebroot = false;
|
|
1622
|
-
if (
|
|
1806
|
+
if (
|
|
1807
|
+
!/^\/$/.test(local.options.conf.server.webroot)
|
|
1808
|
+
&& local.options.conf.server.webroot.length > 0
|
|
1809
|
+
// && local.options.conf.hostname.replace(/\:\d+$/, '') == authority
|
|
1810
|
+
) {
|
|
1623
1811
|
useWebroot = true
|
|
1624
1812
|
}
|
|
1625
1813
|
authority = null;
|
|
1626
1814
|
|
|
1627
1815
|
var reURL = new RegExp('^'+ local.options.conf.server.webroot);
|
|
1628
1816
|
|
|
1629
|
-
var cssStr
|
|
1630
|
-
|
|
1817
|
+
var cssStr = ''
|
|
1818
|
+
, jsStr = ''
|
|
1819
|
+
;
|
|
1631
1820
|
//Get css
|
|
1632
1821
|
if( viewConf.stylesheets ) {
|
|
1633
|
-
cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL)
|
|
1822
|
+
// cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL);
|
|
1823
|
+
// Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
|
|
1824
|
+
var cssColl = new Collection(viewConf.stylesheets).orderBy({route: 'asc'})
|
|
1825
|
+
cssStr = getNodeRes('css', cssColl, useWebroot, reURL);
|
|
1826
|
+
cssColl = null;
|
|
1634
1827
|
}
|
|
1635
1828
|
//Get js
|
|
1636
1829
|
if( viewConf.javascripts ) {
|
|
1637
|
-
jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL)
|
|
1830
|
+
// jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL);
|
|
1831
|
+
// Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
|
|
1832
|
+
var jsColl = new Collection(viewConf.javascripts).orderBy({route: 'asc'})
|
|
1833
|
+
jsStr = getNodeRes('js', jsColl, useWebroot, reURL);
|
|
1834
|
+
jsColl = null;
|
|
1638
1835
|
}
|
|
1639
1836
|
|
|
1640
1837
|
set('page.view.stylesheets', cssStr);
|
|
@@ -1651,7 +1848,8 @@ function SuperController(options) {
|
|
|
1651
1848
|
* @param {string} type
|
|
1652
1849
|
* @param {string} resStr
|
|
1653
1850
|
* @param {array} resArr
|
|
1654
|
-
* @param {
|
|
1851
|
+
* @param {boolean} useWebroot
|
|
1852
|
+
* @param {object} reURL - RegExp for webroot
|
|
1655
1853
|
*
|
|
1656
1854
|
* @returns {object} content
|
|
1657
1855
|
*
|
|
@@ -1663,29 +1861,69 @@ function SuperController(options) {
|
|
|
1663
1861
|
, rLen = resArr.length
|
|
1664
1862
|
, obj = null
|
|
1665
1863
|
, str = ''
|
|
1864
|
+
, isProxyHost = getContext('isProxyHost')
|
|
1666
1865
|
, requestHost = ( /http\/2/.test(local.options.conf.server.protocol) )
|
|
1667
1866
|
? local.req.headers[':host']
|
|
1668
1867
|
: local.req.headers.host
|
|
1669
1868
|
, hostname = ( typeof(requestHost) != 'undefined' && local.options.conf.host != requestHost)
|
|
1670
|
-
? local.options.conf.server.scheme +'://'+ requestHost
|
|
1869
|
+
? local.options.conf.server.scheme +'://'+ requestHost
|
|
1671
1870
|
: local.options.conf.hostname
|
|
1871
|
+
, scheme = hostname.match(/^(https|http)/)[0]
|
|
1672
1872
|
;
|
|
1873
|
+
var requestPort = (local.req.headers.port||local.req.headers[':port']);
|
|
1874
|
+
var hostPort = local.options.conf.hostname.match(/(\:d+\/|\:\d+)$/);
|
|
1875
|
+
hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : local.options.conf.port[local.options.conf.server.protocol][local.options.conf.server.scheme];
|
|
1876
|
+
// Linking bundle B from bundle A wihtout proxy
|
|
1877
|
+
var isSpecialCase = (
|
|
1878
|
+
getContext('bundle') != local.options.conf.bundle
|
|
1879
|
+
&& requestPort != hostPort
|
|
1880
|
+
&& local.req.headers[':host'] != process.gina.PROXY_HOST
|
|
1881
|
+
) ? true : false;
|
|
1882
|
+
|
|
1883
|
+
if (isSpecialCase) {
|
|
1884
|
+
hostname = local.options.conf.hostname
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
|
|
1888
|
+
if (
|
|
1889
|
+
isProxyHost
|
|
1890
|
+
&& !isSpecialCase
|
|
1891
|
+
) {
|
|
1892
|
+
|
|
1893
|
+
hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']||process.gina.PROXY_HOST);
|
|
1894
|
+
|
|
1895
|
+
if (
|
|
1896
|
+
!/^(80|443)$/.test(requestPort)
|
|
1897
|
+
&& !new RegExp(requestPort+'$').test(hostname)
|
|
1898
|
+
) {
|
|
1899
|
+
hostname += ':'+ requestPort;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1673
1903
|
switch(type){
|
|
1674
1904
|
case 'css':
|
|
1675
1905
|
for (; r < rLen; ++r) {
|
|
1676
1906
|
obj = resArr[r];
|
|
1677
1907
|
if (useWebroot && !reURL.test(obj.url) ) {
|
|
1678
|
-
obj.url = local.options.conf.server.webroot + obj.url.
|
|
1908
|
+
obj.url = local.options.conf.server.webroot + obj.url.substring(1);
|
|
1909
|
+
}
|
|
1910
|
+
// HTTP2 Push via Link
|
|
1911
|
+
if (
|
|
1912
|
+
/http\/2/.test(local.options.conf.server.protocol)
|
|
1913
|
+
&& !self.isCacheless()
|
|
1914
|
+
) {
|
|
1915
|
+
local.options.template.h2Links += '<'+ obj.url +'>; as=style; rel=preload,'
|
|
1679
1916
|
}
|
|
1680
1917
|
// TODO - add support for cdn
|
|
1681
1918
|
if (!/\:\/\//.test(obj.url) ) {
|
|
1682
1919
|
obj.url = hostname + obj.url;
|
|
1683
1920
|
}
|
|
1684
1921
|
|
|
1685
|
-
if (obj.media)
|
|
1922
|
+
if (obj.media) {
|
|
1686
1923
|
str += '\n\t\t<link href="'+ obj.url +'" media="'+ obj.media +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
|
|
1687
|
-
else
|
|
1924
|
+
} else {
|
|
1688
1925
|
str += '\n\t\t<link href="'+ obj.url +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
|
|
1926
|
+
}
|
|
1689
1927
|
}
|
|
1690
1928
|
break;
|
|
1691
1929
|
|
|
@@ -1695,13 +1933,34 @@ function SuperController(options) {
|
|
|
1695
1933
|
for (; r < rLen; ++r) {
|
|
1696
1934
|
obj = resArr[r];
|
|
1697
1935
|
if (useWebroot && !reURL.test(obj.url) ) {
|
|
1698
|
-
obj.url = local.options.conf.server.webroot + obj.url.
|
|
1936
|
+
obj.url = local.options.conf.server.webroot + obj.url.substring(1);
|
|
1937
|
+
}
|
|
1938
|
+
// HTTP2 Push via Link
|
|
1939
|
+
if (
|
|
1940
|
+
/http\/2/.test(local.options.conf.server.protocol)
|
|
1941
|
+
&& !self.isCacheless()
|
|
1942
|
+
) {
|
|
1943
|
+
local.options.template.h2Links += '<'+ obj.url +'>; as=script; rel=preload,'
|
|
1699
1944
|
}
|
|
1700
1945
|
// TODO - add support for cdn
|
|
1701
1946
|
if (!/\:\/\//.test(obj.url) ) {
|
|
1702
1947
|
obj.url = hostname + obj.url;
|
|
1703
1948
|
}
|
|
1704
|
-
|
|
1949
|
+
|
|
1950
|
+
|
|
1951
|
+
if ( /\/jquery\.(.*)\.(min\.js|js)$/i.test(obj.url) ) {
|
|
1952
|
+
console.warn('jQuery Plugin found in templates.json !\nIf you want to load it before [gina.min.js], you should declare it at the top of your handler using requireJS or add property "isExternalPlugin: true" in your templates.json, under: '+ (obj.route || local.req.routing.rule) +' .');
|
|
1953
|
+
}
|
|
1954
|
+
// Allow jQuery & other external plugins to be loaded in the HEAD section before gina
|
|
1955
|
+
if (
|
|
1956
|
+
obj.isExternalPlugin
|
|
1957
|
+
) {
|
|
1958
|
+
local.options.template.externalPlugins.splice(1, 0, '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>');
|
|
1959
|
+
}
|
|
1960
|
+
else {
|
|
1961
|
+
// normal case
|
|
1962
|
+
str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>';
|
|
1963
|
+
}
|
|
1705
1964
|
}
|
|
1706
1965
|
break;
|
|
1707
1966
|
}
|
|
@@ -1797,7 +2056,7 @@ function SuperController(options) {
|
|
|
1797
2056
|
|
|
1798
2057
|
if (
|
|
1799
2058
|
staticProps.isStaticFilename && staticsArr.indexOf(url) > -1
|
|
1800
|
-
|| staticProps.isStaticFilename && staticsArr.indexOf( url.replace(url.
|
|
2059
|
+
|| staticProps.isStaticFilename && staticsArr.indexOf( url.replace(url.substring(url.lastIndexOf('/')+1), '') ) > -1
|
|
1801
2060
|
|| staticProps.isStaticFilename && staticsArr.indexOf(staticProps.firstLevel) > -1
|
|
1802
2061
|
) {
|
|
1803
2062
|
staticProps = null;
|
|
@@ -1895,9 +2154,9 @@ function SuperController(options) {
|
|
|
1895
2154
|
// ignoreWebRoot = false
|
|
1896
2155
|
// } else
|
|
1897
2156
|
if (typeof(res) === 'string' || typeof(res) === 'number' || typeof(res) === 'boolean') {
|
|
1898
|
-
if (
|
|
2157
|
+
if ( /^(true|1)$/i.test(res) ) {
|
|
1899
2158
|
ignoreWebRoot = true
|
|
1900
|
-
} else if (
|
|
2159
|
+
} else if ( /^(false|0)$/i.test(res) ) {
|
|
1901
2160
|
ignoreWebRoot = false
|
|
1902
2161
|
} else {
|
|
1903
2162
|
res = local.res;
|
|
@@ -1918,13 +2177,13 @@ function SuperController(options) {
|
|
|
1918
2177
|
|
|
1919
2178
|
}
|
|
1920
2179
|
|
|
1921
|
-
if ( req.
|
|
1922
|
-
// if (wroot.
|
|
1923
|
-
// wroot = wroot.
|
|
2180
|
+
if ( req.substring(0,1) === '/') { // is relative (not checking if the URI is defined in the routing.json)
|
|
2181
|
+
// if (wroot.substring(wroot.length-1,1) == '/') {
|
|
2182
|
+
// wroot = wroot.substring(wroot.length-1,1).replace('/', '')
|
|
1924
2183
|
// }
|
|
1925
2184
|
|
|
1926
2185
|
if ( /^\//.test(req) && !ignoreWebRoot )
|
|
1927
|
-
req = req.
|
|
2186
|
+
req = req.substring(1);
|
|
1928
2187
|
|
|
1929
2188
|
rte = ( ignoreWebRoot != null && ignoreWebRoot ) ? req : wroot + req;
|
|
1930
2189
|
// cleaning url in case of ?param=value
|
|
@@ -2015,11 +2274,32 @@ function SuperController(options) {
|
|
|
2015
2274
|
|
|
2016
2275
|
if ( !self.forward404Unless(condition, req, res) ) { // forward to 404 if bad route
|
|
2017
2276
|
|
|
2018
|
-
var
|
|
2019
|
-
var
|
|
2277
|
+
var localRequestPort = local.req.headers.port || local.req.headers[':port'];
|
|
2278
|
+
var isProxyHost = (
|
|
2279
|
+
typeof(local.req.headers.host) != 'undefined'
|
|
2280
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
2281
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
2282
|
+
&& local.options.conf.server.scheme +'://'+ local.req.headers.host +':'+ localRequestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
|
|
2283
|
+
||
|
|
2284
|
+
typeof(local.req.headers[':authority']) != 'undefined'
|
|
2285
|
+
&& local.options.conf.server.scheme +'://'+ local.req.headers[':authority'] != local.options.conf.hostname
|
|
2286
|
+
||
|
|
2287
|
+
typeof(local.req.headers.host) != 'undefined'
|
|
2288
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
2289
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
2290
|
+
&& req.headers.host == local.options.conf.host
|
|
2291
|
+
||
|
|
2292
|
+
typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
|
|
2293
|
+
&& /^true$/i.test(local.req.headers['x-nginx-proxy'])
|
|
2294
|
+
||
|
|
2295
|
+
typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
|
|
2296
|
+
) ? true : false;
|
|
2297
|
+
|
|
2298
|
+
// var isProxyHost = getContext('isProxyHost');
|
|
2299
|
+
var hostname = (isProxyHost)
|
|
2300
|
+
? process.gina.PROXY_HOSTNAME
|
|
2301
|
+
: ctx.config.envConf[bundle][env].hostname;
|
|
2020
2302
|
|
|
2021
|
-
// if ( !/\:\d+$/.test(req.headers.host) )
|
|
2022
|
-
// hostname = hostname.replace(/\:\d+$/, '');
|
|
2023
2303
|
|
|
2024
2304
|
if (route) { // will go with route first
|
|
2025
2305
|
|
|
@@ -2078,7 +2358,7 @@ function SuperController(options) {
|
|
|
2078
2358
|
originalMethod && !/GET/i.test(originalMethod)
|
|
2079
2359
|
) { // trying to redirect using the wrong method ?
|
|
2080
2360
|
|
|
2081
|
-
console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\
|
|
2361
|
+
console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\nDon\'t panic :)\nSwitching request method to `GET` method instead.\n').message);
|
|
2082
2362
|
method = local.req.method = self.setRequestMethod('GET', conf);
|
|
2083
2363
|
code = 303;
|
|
2084
2364
|
}
|
|
@@ -2326,7 +2606,7 @@ function SuperController(options) {
|
|
|
2326
2606
|
|
|
2327
2607
|
if ( /\:\/\//.test(url) ) {
|
|
2328
2608
|
scheme = url.match(/^\w+\:/)[0];
|
|
2329
|
-
scheme = scheme.
|
|
2609
|
+
scheme = scheme.substring(0, scheme.length-1);
|
|
2330
2610
|
|
|
2331
2611
|
if ( !/^http/.test(scheme) ) {
|
|
2332
2612
|
self.throwError(local.res, 500, new Error('[ '+ scheme +' ] Scheme not supported. Ref.: `http` or `https` only'));
|
|
@@ -2344,7 +2624,7 @@ function SuperController(options) {
|
|
|
2344
2624
|
//defining port
|
|
2345
2625
|
var port = url.match(/\:\d+\//) || null;
|
|
2346
2626
|
if ( port != null ) {
|
|
2347
|
-
port = port[0].
|
|
2627
|
+
port = port[0].substring(1, port[0].length-2);
|
|
2348
2628
|
requestOptions.port = ~~port;
|
|
2349
2629
|
}
|
|
2350
2630
|
|
|
@@ -2376,7 +2656,7 @@ function SuperController(options) {
|
|
|
2376
2656
|
opt.contentDisposition += '; filename=' + filename;
|
|
2377
2657
|
}
|
|
2378
2658
|
|
|
2379
|
-
var ext = filename.match(/\.\w+$/)[0].
|
|
2659
|
+
var ext = filename.match(/\.\w+$/)[0].substring(1)
|
|
2380
2660
|
, contentType = null
|
|
2381
2661
|
, tmp = _(GINA_TMPDIR +'/'+ filename, true)
|
|
2382
2662
|
;
|
|
@@ -2659,7 +2939,8 @@ function SuperController(options) {
|
|
|
2659
2939
|
) {
|
|
2660
2940
|
return false
|
|
2661
2941
|
}
|
|
2662
|
-
|
|
2942
|
+
// by default
|
|
2943
|
+
self.isProcessingError = false;
|
|
2663
2944
|
|
|
2664
2945
|
var queryData = {}
|
|
2665
2946
|
, defaultOptions = local.query.options
|
|
@@ -2669,14 +2950,14 @@ function SuperController(options) {
|
|
|
2669
2950
|
|
|
2670
2951
|
// options must be used as a copy in case of multiple calls of self.query(options, ...)
|
|
2671
2952
|
options = merge(JSON.clone(options), defaultOptions);
|
|
2672
|
-
// options = merge(options, defaultOptions);
|
|
2673
2953
|
|
|
2674
|
-
for (
|
|
2954
|
+
for (let o in options) {//cleaning
|
|
2675
2955
|
if ( typeof(options[o]) == 'undefined' || options[o] == undefined) {
|
|
2676
2956
|
delete options[o]
|
|
2677
2957
|
}
|
|
2678
2958
|
}
|
|
2679
2959
|
|
|
2960
|
+
|
|
2680
2961
|
if (self.isCacheless() || self.isLocalScope() ) {
|
|
2681
2962
|
options.rejectUnauthorized = false;
|
|
2682
2963
|
}
|
|
@@ -2745,14 +3026,17 @@ function SuperController(options) {
|
|
|
2745
3026
|
if ( local.req != null && typeof(local.req.ginaHeaders) != 'undefined' ) {
|
|
2746
3027
|
// gina form headers
|
|
2747
3028
|
for (let h in local.req.ginaHeaders.form) {
|
|
2748
|
-
let k = h.
|
|
3029
|
+
let k = h.substring(0,1).toUpperCase() + h.substring(1);
|
|
2749
3030
|
options.headers['X-Gina-Form-' + k ] = local.req.ginaHeaders.form[h];
|
|
2750
3031
|
}
|
|
2751
3032
|
}
|
|
2752
3033
|
|
|
2753
|
-
var ctx
|
|
2754
|
-
, protocol
|
|
2755
|
-
, scheme
|
|
3034
|
+
var ctx = getContext()
|
|
3035
|
+
, protocol = null
|
|
3036
|
+
, scheme = null
|
|
3037
|
+
, isProxyHost = getContext('isProxyHost')
|
|
3038
|
+
, bundle = null
|
|
3039
|
+
, webroot = options.webroot || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.webroot;// bundle servers's webroot by default
|
|
2756
3040
|
;
|
|
2757
3041
|
// cleanup options.path
|
|
2758
3042
|
if (/\:\/\//.test(options.path)) {
|
|
@@ -2769,11 +3053,16 @@ function SuperController(options) {
|
|
|
2769
3053
|
.replace(':'+port, '');
|
|
2770
3054
|
}
|
|
2771
3055
|
|
|
3056
|
+
// if ( typeof(options.protocol) == 'undefined' ) {
|
|
3057
|
+
// options.protocol = ctx.gina.config.envConf[ctx.bundle][ctx.env].server.protocol;
|
|
3058
|
+
// }
|
|
3059
|
+
|
|
2772
3060
|
// retrieve protocol & scheme: if empty, take the bundles protocol
|
|
2773
3061
|
protocol = options.protocol || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.protocol;// bundle servers's protocol by default
|
|
2774
3062
|
protocol = protocol.match(/[.a-z 0-9]+/ig)[0];
|
|
2775
3063
|
scheme = options.scheme || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.scheme;// bundle servers's scheme by default
|
|
2776
3064
|
scheme = scheme.match(/[a-z 0-9]+/ig)[0];
|
|
3065
|
+
|
|
2777
3066
|
// retrieve credentials
|
|
2778
3067
|
if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
|
|
2779
3068
|
options.ca = ctx.gina.config.envConf[ctx.bundle][ctx.env].server.credentials.ca;
|
|
@@ -2782,24 +3071,18 @@ function SuperController(options) {
|
|
|
2782
3071
|
//retrieving dynamic host, hostname & port
|
|
2783
3072
|
if ( /\@/.test(options.hostname) ) {
|
|
2784
3073
|
|
|
2785
|
-
|
|
2786
|
-
|
|
3074
|
+
bundle = ( options.hostname.replace(/(.*)\:\/\//, '') ).split(/\@/)[0];
|
|
2787
3075
|
// No shorcut possible because conf.hostname might differ from user inputs
|
|
2788
3076
|
options.host = ctx.gina.config.envConf[bundle][ctx.env].host.replace(/(.*)\:\/\//, '').replace(/\:\d+/, '');
|
|
2789
3077
|
options.hostname = ctx.gina.config.envConf[bundle][ctx.env].hostname;
|
|
2790
3078
|
options.port = ctx.gina.config.envConf[bundle][ctx.env].server.port;
|
|
2791
|
-
|
|
2792
|
-
options.protocol = ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
|
|
3079
|
+
options.protocol = options.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
|
|
2793
3080
|
options.scheme = ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
|
|
2794
3081
|
|
|
2795
3082
|
// retrieve credentials
|
|
2796
3083
|
if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
|
|
2797
3084
|
options.ca = ctx.gina.config.envConf[bundle][ctx.env].server.credentials.ca;
|
|
2798
3085
|
}
|
|
2799
|
-
|
|
2800
|
-
// might be != from the bundle requesting
|
|
2801
|
-
//options.protocol = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
|
|
2802
|
-
//options.scheme = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.scheme || ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
|
|
2803
3086
|
}
|
|
2804
3087
|
|
|
2805
3088
|
if ( typeof(options.protocol) == 'undefined' ) {
|
|
@@ -2813,8 +3096,22 @@ function SuperController(options) {
|
|
|
2813
3096
|
|
|
2814
3097
|
|
|
2815
3098
|
// reformating scheme
|
|
2816
|
-
if( !/\:$/.test(options.scheme) )
|
|
3099
|
+
if( !/\:$/.test(options.scheme) ) {
|
|
2817
3100
|
options.scheme += ':';
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
if (isProxyHost) {
|
|
3104
|
+
// X-Forwarded-Host
|
|
3105
|
+
options.headers['x-forwarded-host'] = process.gina.PROXY_HOST;
|
|
3106
|
+
// X-Forwarded-Proto
|
|
3107
|
+
options.headers['x-forwarded-proto'] = process.gina.PROXY_SCHEME;
|
|
3108
|
+
}
|
|
3109
|
+
|
|
3110
|
+
if ( ctx.gina.config.envConf[ctx.bundle][ctx.env].server.resolvers.length > 0 ) {
|
|
3111
|
+
var resolversColl = new Collection(ctx.gina.config.envConf[ctx.bundle][ctx.env].server.resolvers);
|
|
3112
|
+
options.nameservers = resolversColl.findOne({ scope: process.env.NODE_SCOPE}).nameservers;
|
|
3113
|
+
resolversColl = null;
|
|
3114
|
+
}
|
|
2818
3115
|
|
|
2819
3116
|
try {
|
|
2820
3117
|
options.queryData = queryData;
|
|
@@ -2826,32 +3123,197 @@ function SuperController(options) {
|
|
|
2826
3123
|
|
|
2827
3124
|
browser = require(''+ httpLib);
|
|
2828
3125
|
|
|
3126
|
+
bundle = null;
|
|
3127
|
+
|
|
3128
|
+
// return handleCurlRequest(options, callback);
|
|
3129
|
+
|
|
2829
3130
|
if ( /http2/.test(httpLib) ) {
|
|
2830
3131
|
return handleHTTP2ClientRequest(browser, options, callback);
|
|
2831
3132
|
} else {
|
|
2832
3133
|
return handleHTTP1ClientRequest(browser, options, callback);
|
|
2833
3134
|
}
|
|
2834
3135
|
|
|
2835
|
-
|
|
2836
3136
|
} catch(err) {
|
|
2837
3137
|
if (callback) {
|
|
2838
3138
|
return callback(err)
|
|
2839
3139
|
}
|
|
2840
3140
|
self.emit('query#complete', err)
|
|
2841
3141
|
}
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
var handleCurlRequest = async function(opt, callback) {
|
|
3145
|
+
|
|
3146
|
+
|
|
3147
|
+
var body = null;
|
|
3148
|
+
// https://docs.couchbase.com/server/current/n1ql-rest-query/index.html#Request
|
|
3149
|
+
var cmd = [
|
|
3150
|
+
'$(which curl)'
|
|
3151
|
+
];
|
|
3152
|
+
|
|
3153
|
+
if (!opt.rejectUnauthorized) {
|
|
3154
|
+
// (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers
|
|
3155
|
+
// same as --insecure
|
|
3156
|
+
cmd.splice(1,0,'-k');
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
// method
|
|
3160
|
+
if ( !/get/i.test(opt.method) ) {
|
|
3161
|
+
cmd.splice(1,0,'-X '+ opt.method.toUpperCase() );
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3164
|
+
|
|
3165
|
+
if ( /(post|put)/i.test(opt.method) && opt.queryData.length > 0) {
|
|
3166
|
+
cmd.push('-d '+ opt.queryData );
|
|
3167
|
+
body = Buffer.from(opt.queryData);
|
|
3168
|
+
opt.headers['content-length'] = body.length;
|
|
3169
|
+
} else if (
|
|
3170
|
+
/get/i.test(opt.method)
|
|
3171
|
+
&& typeof(opt.headers['content-length']) != 'undefined'
|
|
3172
|
+
) {
|
|
3173
|
+
delete opt.headers['content-length'];
|
|
3174
|
+
}
|
|
3175
|
+
|
|
3176
|
+
if ( opt.headers.count() > 0) {
|
|
3177
|
+
for (let h in opt.headers) {
|
|
3178
|
+
cmd.splice(1,0,'-H "'+ h +': '+ opt.headers[h] +'"');
|
|
3179
|
+
}
|
|
3180
|
+
}
|
|
3181
|
+
|
|
3182
|
+
// resolvers
|
|
3183
|
+
if (opt.nameservers) {
|
|
3184
|
+
resolver.setServers(opt.nameservers);
|
|
3185
|
+
await resolver
|
|
3186
|
+
.resolve4(opt.host)
|
|
3187
|
+
.catch( function onResolverErr(e) {
|
|
3188
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3189
|
+
var msg = 'Could not resolve with these `settings.server.resolvers`:\n'+ opt.nameservers.toString() +'\n' + e.stack+ '\nController Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r';
|
|
3190
|
+
var exception = new Error(msg);
|
|
3191
|
+
exception.status = 500;
|
|
3192
|
+
return self.throwError(exception);
|
|
3193
|
+
})
|
|
3194
|
+
.then( function onResolved(ips) {
|
|
3195
|
+
if ( typeof(ips) == 'undefined' || !Array.isArray(ips) || !ips.length ) {
|
|
3196
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3197
|
+
var e = new Error('`Unable to resolve ${opt.host}`');
|
|
3198
|
+
var msg = 'Please check`settings.server.resolvers`:\n'+ opt.nameservers.toString() +'\n'+ e.stack + 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r';
|
|
3199
|
+
var exception = new Error(msg);
|
|
3200
|
+
exception.status = 500;
|
|
3201
|
+
return self.throwError(exception);
|
|
3202
|
+
}
|
|
3203
|
+
for (let i=0, len=ips.length; i<len; i++) {
|
|
3204
|
+
// e.g.: --resolve www.example.com:443:127.0.0.1
|
|
3205
|
+
cmd.push('--resolve '+ opt.host +':'+ opt.port +':'+ ips[i]);
|
|
3206
|
+
}
|
|
3207
|
+
});
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
|
|
3211
|
+
|
|
3212
|
+
|
|
3213
|
+
cmd.push('-v "'+ opt.hostname + opt.path +'"');
|
|
3214
|
+
|
|
3215
|
+
// Default maxBuffer is 200KB (=> 1024 * 200)
|
|
3216
|
+
// Setting it to 10MB - preventing: stdout maxBuffer length exceeded
|
|
3217
|
+
var maxBuffer = (1024 * 1024 * 10);
|
|
3218
|
+
exec(cmd.join(' '), { maxBuffer: maxBuffer }, function onResult(err, dataStr, infos) {
|
|
3219
|
+
var error = null;
|
|
3220
|
+
if (err) {
|
|
3221
|
+
try {
|
|
3222
|
+
// by default
|
|
3223
|
+
error = new Error('[ CONTROLLER ][ CURL#query ] request aborted\n'+ err.stack);
|
|
3224
|
+
if (
|
|
3225
|
+
typeof(err.message) != 'undefined'
|
|
3226
|
+
&& /Failed to connect/i.test(err.message)
|
|
3227
|
+
) {
|
|
3228
|
+
var port = getContext('gina').ports[opt.protocol][opt.scheme.replace(/\:/, '')][ opt.port ];
|
|
3229
|
+
error.accessPoint = port;
|
|
3230
|
+
error.message = 'Could not connect to [ ' + error.accessPoint + ' ].\nThe `'+port.split(/\@/)[0]+'` bundle is offline or unreachable.\n';
|
|
3231
|
+
}
|
|
3232
|
+
console.error(error.stack);
|
|
3233
|
+
if ( typeof(callback) != 'undefined' ) {
|
|
3234
|
+
callback(error)
|
|
3235
|
+
} else {
|
|
3236
|
+
self.emit('query#complete', error)
|
|
3237
|
+
}
|
|
3238
|
+
} catch (e) {
|
|
3239
|
+
// console.error(e.stack);
|
|
3240
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3241
|
+
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3242
|
+
var exception = new Error(msg);
|
|
3243
|
+
exception.status = 500;
|
|
3244
|
+
self.throwError(exception);
|
|
3245
|
+
}
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
2842
3248
|
|
|
3249
|
+
|
|
3250
|
+
try {
|
|
3251
|
+
let data = JSON.parse(dataStr);
|
|
3252
|
+
if ( typeof(data) == 'undefined' ) {
|
|
3253
|
+
data = {}
|
|
3254
|
+
}
|
|
3255
|
+
if ( typeof(callback) != 'undefined' ) {
|
|
3256
|
+
callback(err, data)
|
|
3257
|
+
} else {
|
|
3258
|
+
self.emit('query#complete', err, data)
|
|
3259
|
+
}
|
|
3260
|
+
} catch (e) {
|
|
3261
|
+
// _err.stack = '[ CONTROLLER ][ CURL#query ] onCallbackError: '+ e.stack;
|
|
3262
|
+
// console.error(e.stack);
|
|
3263
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3264
|
+
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3265
|
+
var exception = new Error(msg);
|
|
3266
|
+
exception.status = 500;
|
|
3267
|
+
self.throwError(exception);
|
|
3268
|
+
return;
|
|
3269
|
+
}
|
|
3270
|
+
});
|
|
2843
3271
|
}
|
|
2844
3272
|
|
|
3273
|
+
var handleHTTP1ClientRequestv2 = function (browser, options, callback) {
|
|
3274
|
+
var agent = new browser.Agent({ keepAlive: true });
|
|
3275
|
+
var options = {
|
|
3276
|
+
host: options.host,
|
|
3277
|
+
port: options.port,
|
|
3278
|
+
path: options.path,
|
|
3279
|
+
method: 'GET',
|
|
3280
|
+
agent: agent
|
|
3281
|
+
};
|
|
3282
|
+
|
|
3283
|
+
var req = browser.request(options, function(res) {
|
|
3284
|
+
var str = "";
|
|
3285
|
+
var err = false;
|
|
3286
|
+
res.on('data', function (chunk) {
|
|
3287
|
+
str += chunk;
|
|
3288
|
+
});
|
|
3289
|
+
res.on('end', function () {
|
|
3290
|
+
// done
|
|
3291
|
+
return callback( err, data );
|
|
3292
|
+
});
|
|
3293
|
+
});
|
|
3294
|
+
req.write('');
|
|
3295
|
+
req.end();
|
|
3296
|
+
req.on('error', function(error) {
|
|
3297
|
+
err = error
|
|
3298
|
+
});
|
|
3299
|
+
};
|
|
3300
|
+
|
|
2845
3301
|
var handleHTTP1ClientRequest = function(browser, options, callback) {
|
|
2846
3302
|
|
|
2847
3303
|
var altOpt = JSON.clone(options);
|
|
3304
|
+
// var credentials = self.getConfig('settings').server.credentials;
|
|
3305
|
+
// options.ca = credentials.ca;
|
|
3306
|
+
// options.encKey = credentials.privateKey;
|
|
3307
|
+
// options.encCert = credentials.certificate;
|
|
3308
|
+
|
|
2848
3309
|
|
|
2849
3310
|
altOpt.protocol = options.scheme;
|
|
2850
3311
|
altOpt.hostname = options.host;
|
|
2851
3312
|
altOpt.port = options.port;
|
|
3313
|
+
altOpt.maxSockets = options.maxSockets || 1;
|
|
2852
3314
|
if ( typeof(altOpt.encKey) != 'undefined' ) {
|
|
2853
3315
|
try {
|
|
2854
|
-
altOpt.encKey = fs.readFileSync(
|
|
3316
|
+
altOpt.encKey = fs.readFileSync(altOpt.encKey);
|
|
2855
3317
|
} catch(err) {
|
|
2856
3318
|
self.emit('query#complete', err);
|
|
2857
3319
|
}
|
|
@@ -2862,7 +3324,7 @@ function SuperController(options) {
|
|
|
2862
3324
|
|
|
2863
3325
|
if ( typeof(altOpt.encCert) != 'undefined' ) {
|
|
2864
3326
|
try {
|
|
2865
|
-
altOpt.encCert = fs.readFileSync(
|
|
3327
|
+
altOpt.encCert = fs.readFileSync(altOpt.encCert);
|
|
2866
3328
|
} catch(err) {
|
|
2867
3329
|
self.emit('query#complete', err);
|
|
2868
3330
|
}
|
|
@@ -2871,6 +3333,11 @@ function SuperController(options) {
|
|
|
2871
3333
|
console.warn('[ CONTROLLER ][ HTTP/1.0#query ] options.encCert not found !');
|
|
2872
3334
|
}
|
|
2873
3335
|
|
|
3336
|
+
|
|
3337
|
+
delete altOpt.ca;
|
|
3338
|
+
delete altOpt.encKey;
|
|
3339
|
+
delete altOpt.encCert;
|
|
3340
|
+
|
|
2874
3341
|
altOpt.agent = new browser.Agent(altOpt);
|
|
2875
3342
|
|
|
2876
3343
|
var req = browser.request(altOpt, function(res) {
|
|
@@ -2930,7 +3397,7 @@ function SuperController(options) {
|
|
|
2930
3397
|
return;
|
|
2931
3398
|
}
|
|
2932
3399
|
} catch (e) {
|
|
2933
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3400
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
2934
3401
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
2935
3402
|
var exception = new Error(msg);
|
|
2936
3403
|
exception.status = 500;
|
|
@@ -3024,7 +3491,7 @@ function SuperController(options) {
|
|
|
3024
3491
|
cb(err, data)
|
|
3025
3492
|
}
|
|
3026
3493
|
} catch (e) {
|
|
3027
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3494
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3028
3495
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3029
3496
|
var exception = new Error(msg);
|
|
3030
3497
|
exception.status = 500;
|
|
@@ -3101,7 +3568,6 @@ function SuperController(options) {
|
|
|
3101
3568
|
delete options.queryData;
|
|
3102
3569
|
|
|
3103
3570
|
|
|
3104
|
-
|
|
3105
3571
|
const client = browser.connect(options.hostname, options);
|
|
3106
3572
|
|
|
3107
3573
|
|
|
@@ -3289,7 +3755,7 @@ function SuperController(options) {
|
|
|
3289
3755
|
}
|
|
3290
3756
|
|
|
3291
3757
|
} catch (e) {
|
|
3292
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3758
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3293
3759
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3294
3760
|
var exception = new Error(msg);
|
|
3295
3761
|
exception.status = 500;
|
|
@@ -3367,7 +3833,7 @@ function SuperController(options) {
|
|
|
3367
3833
|
cb(err, data)
|
|
3368
3834
|
}
|
|
3369
3835
|
} catch (e) {
|
|
3370
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3836
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3371
3837
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3372
3838
|
var exception = new Error(msg);
|
|
3373
3839
|
exception.status = 500;
|
|
@@ -3502,11 +3968,11 @@ function SuperController(options) {
|
|
|
3502
3968
|
project = route.param.project;
|
|
3503
3969
|
} // TODO - add support for project pointer : getContext('gina').projects[project]
|
|
3504
3970
|
if (/\@(.*)$/.test(route.param.url)) {
|
|
3505
|
-
var targetedBundle = route.param.url.
|
|
3971
|
+
var targetedBundle = route.param.url.substring(route.param.url.lastIndexOf('@')+1);
|
|
3506
3972
|
hostname = targetedBundle +'@'+ project;
|
|
3507
3973
|
port = hostname;
|
|
3508
3974
|
var webroot = getContext('gina').config.envConf[targetedBundle][local.options.conf.env].server.webroot;
|
|
3509
|
-
path = (/\/$/.test(webroot)) ? webroot.
|
|
3975
|
+
path = (/\/$/.test(webroot)) ? webroot.substring(0, webroot.length-1) : webroot;
|
|
3510
3976
|
} else {
|
|
3511
3977
|
hostname = route.param.hostname;
|
|
3512
3978
|
port = route.param.port;
|
|
@@ -3560,24 +4026,28 @@ function SuperController(options) {
|
|
|
3560
4026
|
*
|
|
3561
4027
|
* */
|
|
3562
4028
|
this.getConfig = function(name) {
|
|
4029
|
+
var tmp = null;
|
|
3563
4030
|
if ( typeof(name) != 'undefined' ) {
|
|
3564
4031
|
try {
|
|
3565
|
-
//
|
|
3566
|
-
|
|
3567
|
-
//config = Object.freeze(local.options.conf.content[name]);
|
|
3568
|
-
//Object.seal(local.options.conf.content[name]);
|
|
3569
|
-
//Object.freeze(local.options.conf.content[name]);
|
|
3570
|
-
// if ( self.isCacheless() ) {
|
|
3571
|
-
// }
|
|
3572
|
-
return JSON.clone(local.options.conf.content[name]);
|
|
4032
|
+
// Needs to be read only
|
|
4033
|
+
tmp = JSON.clone(local.options.conf.content[name]);
|
|
3573
4034
|
} catch (err) {
|
|
3574
4035
|
return undefined;
|
|
3575
4036
|
}
|
|
3576
4037
|
} else {
|
|
3577
|
-
|
|
3578
|
-
// return JSON.parse(config)
|
|
3579
|
-
return JSON.clone(local.options.conf);
|
|
4038
|
+
tmp = JSON.clone(local.options.conf);
|
|
3580
4039
|
}
|
|
4040
|
+
|
|
4041
|
+
if (
|
|
4042
|
+
getContext('isProxyHost')
|
|
4043
|
+
&& typeof(tmp.hostname) != 'undefined'
|
|
4044
|
+
) {
|
|
4045
|
+
tmp.hostname = process.gina.PROXY_HOSTNAME;
|
|
4046
|
+
tmp.host = process.gina.PROXY_HOST;
|
|
4047
|
+
// tmp.hostname = getContext('gina').config.envConf._proxyHostname
|
|
4048
|
+
// tmp.host = tmp.hostname.replace(/^(https|http)\:\/\//, '');
|
|
4049
|
+
}
|
|
4050
|
+
return tmp;
|
|
3581
4051
|
}
|
|
3582
4052
|
|
|
3583
4053
|
/**
|
|
@@ -4002,7 +4472,7 @@ function SuperController(options) {
|
|
|
4002
4472
|
//instance: self.serverInstance,
|
|
4003
4473
|
//template: (routeHasViews) ? bundleConf.content.templates[templateName] : undefined,
|
|
4004
4474
|
//isUsingTemplate: local.isUsingTemplate,
|
|
4005
|
-
//
|
|
4475
|
+
//isCacheless: isCacheless,
|
|
4006
4476
|
path: null //, // user custom path : namespace should be ignored | left blank
|
|
4007
4477
|
//assets: {}
|
|
4008
4478
|
};
|
|
@@ -4228,11 +4698,11 @@ function SuperController(options) {
|
|
|
4228
4698
|
, ext = null
|
|
4229
4699
|
, isHtmlContent = false
|
|
4230
4700
|
, hasCustomErrorFile = false
|
|
4231
|
-
, eCode = code.toString().
|
|
4701
|
+
, eCode = code.toString().substring(0,1) + 'xx'
|
|
4232
4702
|
;
|
|
4233
|
-
var extArr = url.
|
|
4703
|
+
var extArr = url.substring(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/);
|
|
4234
4704
|
if (extArr) {
|
|
4235
|
-
ext = extArr[0].
|
|
4705
|
+
ext = extArr[0].substring(1);
|
|
4236
4706
|
}
|
|
4237
4707
|
if ( !ext || /^(html|htm)$/i.test(ext) ) {
|
|
4238
4708
|
isHtmlContent = true;
|
|
@@ -4306,8 +4776,7 @@ function SuperController(options) {
|
|
|
4306
4776
|
|
|
4307
4777
|
local.req.routing = routeObj;
|
|
4308
4778
|
local.req.params.errorObject = errorObject;
|
|
4309
|
-
self.renderCustomError(local.req, res, local.next);
|
|
4310
|
-
return;
|
|
4779
|
+
return self.renderCustomError(local.req, res, local.next);
|
|
4311
4780
|
}
|
|
4312
4781
|
|
|
4313
4782
|
}
|
|
@@ -4390,7 +4859,7 @@ function SuperController(options) {
|
|
|
4390
4859
|
return next();
|
|
4391
4860
|
}
|
|
4392
4861
|
|
|
4393
|
-
if ( /http\/2/.test(protocol) ) {
|
|
4862
|
+
if ( stream && /http\/2/.test(protocol) ) {
|
|
4394
4863
|
return stream.end();
|
|
4395
4864
|
}
|
|
4396
4865
|
|