jimpex 7.0.2 → 9.0.0
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/CHANGELOG.md +93 -0
- package/LICENSE +1 -1
- package/README.md +447 -435
- package/dist/app/index.d.mts +14 -0
- package/dist/app/index.d.ts +14 -0
- package/dist/app/index.js +23 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/jimpex.d.mts +14 -0
- package/dist/app/jimpex.d.ts +14 -0
- package/dist/app/jimpex.js +665 -0
- package/dist/app/jimpex.js.map +1 -0
- package/dist/controllers/common/config.d.mts +79 -0
- package/dist/controllers/common/config.d.ts +79 -0
- package/dist/controllers/common/config.js +107 -0
- package/dist/controllers/common/config.js.map +1 -0
- package/dist/controllers/common/health.d.mts +83 -0
- package/dist/controllers/common/health.d.ts +83 -0
- package/dist/controllers/common/health.js +115 -0
- package/dist/controllers/common/health.js.map +1 -0
- package/dist/controllers/common/index.d.mts +21 -0
- package/dist/controllers/common/index.d.ts +21 -0
- package/dist/controllers/common/index.js +27 -0
- package/dist/controllers/common/index.js.map +1 -0
- package/dist/controllers/common/statics.d.mts +215 -0
- package/dist/controllers/common/statics.d.ts +215 -0
- package/dist/controllers/common/statics.js +253 -0
- package/dist/controllers/common/statics.js.map +1 -0
- package/dist/controllers/index.d.mts +24 -0
- package/dist/controllers/index.d.ts +24 -0
- package/dist/controllers/index.js +25 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/controllers/utils/gateway.d.mts +725 -0
- package/dist/controllers/utils/gateway.d.ts +725 -0
- package/dist/controllers/utils/gateway.js +577 -0
- package/dist/controllers/utils/gateway.js.map +1 -0
- package/dist/controllers/utils/index.d.mts +17 -0
- package/dist/controllers/utils/index.d.ts +17 -0
- package/dist/controllers/utils/index.js +23 -0
- package/dist/controllers/utils/index.js.map +1 -0
- package/dist/esm/app/index.js +2 -0
- package/dist/esm/app/index.js.map +1 -0
- package/dist/esm/app/jimpex.js +636 -0
- package/dist/esm/app/jimpex.js.map +1 -0
- package/dist/esm/chunk-2B2CG5KL.js +11 -0
- package/dist/esm/chunk-2B2CG5KL.js.map +1 -0
- package/dist/esm/controllers/common/config.js +80 -0
- package/dist/esm/controllers/common/config.js.map +1 -0
- package/dist/esm/controllers/common/health.js +88 -0
- package/dist/esm/controllers/common/health.js.map +1 -0
- package/dist/esm/controllers/common/index.js +4 -0
- package/dist/esm/controllers/common/index.js.map +1 -0
- package/dist/esm/controllers/common/statics.js +220 -0
- package/dist/esm/controllers/common/statics.js.map +1 -0
- package/dist/esm/controllers/index.js +3 -0
- package/dist/esm/controllers/index.js.map +1 -0
- package/dist/esm/controllers/utils/gateway.js +556 -0
- package/dist/esm/controllers/utils/gateway.js.map +1 -0
- package/dist/esm/controllers/utils/index.js +2 -0
- package/dist/esm/controllers/utils/index.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/middlewares/common/errorHandler.js +116 -0
- package/dist/esm/middlewares/common/errorHandler.js.map +1 -0
- package/dist/esm/middlewares/common/forceHTTPS.js +53 -0
- package/dist/esm/middlewares/common/forceHTTPS.js.map +1 -0
- package/dist/esm/middlewares/common/hsts.js +74 -0
- package/dist/esm/middlewares/common/hsts.js.map +1 -0
- package/dist/esm/middlewares/common/index.js +4 -0
- package/dist/esm/middlewares/common/index.js.map +1 -0
- package/dist/esm/middlewares/html/fastHTML.js +158 -0
- package/dist/esm/middlewares/html/fastHTML.js.map +1 -0
- package/dist/esm/middlewares/html/index.js +3 -0
- package/dist/esm/middlewares/html/index.js.map +1 -0
- package/dist/esm/middlewares/html/showHTML.js +100 -0
- package/dist/esm/middlewares/html/showHTML.js.map +1 -0
- package/dist/esm/middlewares/index.js +4 -0
- package/dist/esm/middlewares/index.js.map +1 -0
- package/dist/esm/middlewares/utils/index.js +2 -0
- package/dist/esm/middlewares/utils/index.js.map +1 -0
- package/dist/esm/middlewares/utils/versionValidator.js +135 -0
- package/dist/esm/middlewares/utils/versionValidator.js.map +1 -0
- package/dist/esm/services/common/appError.js +98 -0
- package/dist/esm/services/common/appError.js.map +1 -0
- package/dist/esm/services/common/httpError.js +28 -0
- package/dist/esm/services/common/httpError.js.map +1 -0
- package/dist/esm/services/common/index.js +17 -0
- package/dist/esm/services/common/index.js.map +1 -0
- package/dist/esm/services/common/sendFile.js +27 -0
- package/dist/esm/services/common/sendFile.js.map +1 -0
- package/dist/esm/services/frontend/frontendFs.js +66 -0
- package/dist/esm/services/frontend/frontendFs.js.map +1 -0
- package/dist/esm/services/frontend/index.js +11 -0
- package/dist/esm/services/frontend/index.js.map +1 -0
- package/dist/esm/services/html/htmlGenerator.js +194 -0
- package/dist/esm/services/html/htmlGenerator.js.map +1 -0
- package/dist/esm/services/html/index.js +11 -0
- package/dist/esm/services/html/index.js.map +1 -0
- package/dist/esm/services/http/apiClient.js +97 -0
- package/dist/esm/services/http/apiClient.js.map +1 -0
- package/dist/esm/services/http/http.js +174 -0
- package/dist/esm/services/http/http.js.map +1 -0
- package/dist/esm/services/http/index.js +17 -0
- package/dist/esm/services/http/index.js.map +1 -0
- package/dist/esm/services/http/responsesBuilder.js +152 -0
- package/dist/esm/services/http/responsesBuilder.js.map +1 -0
- package/dist/esm/services/index.js +6 -0
- package/dist/esm/services/index.js.map +1 -0
- package/dist/esm/services/utils/ensureBearerToken.js +94 -0
- package/dist/esm/services/utils/ensureBearerToken.js.map +1 -0
- package/dist/esm/services/utils/index.js +11 -0
- package/dist/esm/services/utils/index.js.map +1 -0
- package/dist/esm/types/events.js +1 -0
- package/dist/esm/types/events.js.map +1 -0
- package/dist/esm/types/express.js +1 -0
- package/dist/esm/types/express.js.map +1 -0
- package/dist/esm/types/http.js +1 -0
- package/dist/esm/types/http.js.map +1 -0
- package/dist/esm/types/index.js +7 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/options.js +1 -0
- package/dist/esm/types/options.js.map +1 -0
- package/dist/esm/types/utils.js +1 -0
- package/dist/esm/types/utils.js.map +1 -0
- package/dist/esm/types/wootils.js +1 -0
- package/dist/esm/types/wootils.js.map +1 -0
- package/dist/esm/utils/fns/index.js +5 -0
- package/dist/esm/utils/fns/index.js.map +1 -0
- package/dist/esm/utils/fns/others.js +6 -0
- package/dist/esm/utils/fns/others.js.map +1 -0
- package/dist/esm/utils/fns/routes.js +25 -0
- package/dist/esm/utils/fns/routes.js.map +1 -0
- package/dist/esm/utils/fns/statuses.js +6 -0
- package/dist/esm/utils/fns/statuses.js.map +1 -0
- package/dist/esm/utils/fns/text.js +6 -0
- package/dist/esm/utils/fns/text.js.map +1 -0
- package/dist/esm/utils/index.js +3 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/wrappers.js +41 -0
- package/dist/esm/utils/wrappers.js.map +1 -0
- package/dist/index-b2a04c78.d.ts +1282 -0
- package/dist/index-efeb437e.d.ts +1282 -0
- package/dist/index.d.mts +46 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/middlewares/common/errorHandler.d.mts +132 -0
- package/dist/middlewares/common/errorHandler.d.ts +132 -0
- package/dist/middlewares/common/errorHandler.js +143 -0
- package/dist/middlewares/common/errorHandler.js.map +1 -0
- package/dist/middlewares/common/forceHTTPS.d.mts +69 -0
- package/dist/middlewares/common/forceHTTPS.d.ts +69 -0
- package/dist/middlewares/common/forceHTTPS.js +80 -0
- package/dist/middlewares/common/forceHTTPS.js.map +1 -0
- package/dist/middlewares/common/hsts.d.mts +110 -0
- package/dist/middlewares/common/hsts.d.ts +110 -0
- package/dist/middlewares/common/hsts.js +101 -0
- package/dist/middlewares/common/hsts.js.map +1 -0
- package/dist/middlewares/common/index.d.mts +22 -0
- package/dist/middlewares/common/index.d.ts +22 -0
- package/dist/middlewares/common/index.js +27 -0
- package/dist/middlewares/common/index.js.map +1 -0
- package/dist/middlewares/html/fastHTML.d.mts +180 -0
- package/dist/middlewares/html/fastHTML.d.ts +180 -0
- package/dist/middlewares/html/fastHTML.js +185 -0
- package/dist/middlewares/html/fastHTML.js.map +1 -0
- package/dist/middlewares/html/index.d.mts +21 -0
- package/dist/middlewares/html/index.d.ts +21 -0
- package/dist/middlewares/html/index.js +25 -0
- package/dist/middlewares/html/index.js.map +1 -0
- package/dist/middlewares/html/showHTML.d.mts +127 -0
- package/dist/middlewares/html/showHTML.d.ts +127 -0
- package/dist/middlewares/html/showHTML.js +127 -0
- package/dist/middlewares/html/showHTML.js.map +1 -0
- package/dist/middlewares/index.d.mts +30 -0
- package/dist/middlewares/index.d.ts +30 -0
- package/dist/middlewares/index.js +27 -0
- package/dist/middlewares/index.js.map +1 -0
- package/dist/middlewares/utils/index.d.mts +20 -0
- package/dist/middlewares/utils/index.d.ts +20 -0
- package/dist/middlewares/utils/index.js +23 -0
- package/dist/middlewares/utils/index.js.map +1 -0
- package/dist/middlewares/utils/versionValidator.d.mts +215 -0
- package/dist/middlewares/utils/versionValidator.d.ts +215 -0
- package/dist/middlewares/utils/versionValidator.js +162 -0
- package/dist/middlewares/utils/versionValidator.js.map +1 -0
- package/dist/services/common/appError.d.mts +139 -0
- package/dist/services/common/appError.d.ts +139 -0
- package/dist/services/common/appError.js +126 -0
- package/dist/services/common/appError.js.map +1 -0
- package/dist/services/common/httpError.d.mts +80 -0
- package/dist/services/common/httpError.d.ts +80 -0
- package/dist/services/common/httpError.js +53 -0
- package/dist/services/common/httpError.js.map +1 -0
- package/dist/services/common/index.d.mts +47 -0
- package/dist/services/common/index.d.ts +47 -0
- package/dist/services/common/index.js +44 -0
- package/dist/services/common/index.js.map +1 -0
- package/dist/services/common/sendFile.d.mts +102 -0
- package/dist/services/common/sendFile.d.ts +102 -0
- package/dist/services/common/sendFile.js +51 -0
- package/dist/services/common/sendFile.js.map +1 -0
- package/dist/services/frontend/frontendFs.d.mts +96 -0
- package/dist/services/frontend/frontendFs.d.ts +96 -0
- package/dist/services/frontend/frontendFs.js +103 -0
- package/dist/services/frontend/frontendFs.js.map +1 -0
- package/dist/services/frontend/index.d.mts +40 -0
- package/dist/services/frontend/index.d.ts +40 -0
- package/dist/services/frontend/index.js +36 -0
- package/dist/services/frontend/index.js.map +1 -0
- package/dist/services/html/htmlGenerator.d.mts +237 -0
- package/dist/services/html/htmlGenerator.d.ts +237 -0
- package/dist/services/html/htmlGenerator.js +221 -0
- package/dist/services/html/htmlGenerator.js.map +1 -0
- package/dist/services/html/index.d.mts +43 -0
- package/dist/services/html/index.d.ts +43 -0
- package/dist/services/html/index.js +36 -0
- package/dist/services/html/index.js.map +1 -0
- package/dist/services/http/apiClient.d.mts +170 -0
- package/dist/services/http/apiClient.d.ts +170 -0
- package/dist/services/http/apiClient.js +122 -0
- package/dist/services/http/apiClient.js.map +1 -0
- package/dist/services/http/http.d.mts +176 -0
- package/dist/services/http/http.d.ts +176 -0
- package/dist/services/http/http.js +211 -0
- package/dist/services/http/http.js.map +1 -0
- package/dist/services/http/index.d.mts +51 -0
- package/dist/services/http/index.d.ts +51 -0
- package/dist/services/http/index.js +44 -0
- package/dist/services/http/index.js.map +1 -0
- package/dist/services/http/responsesBuilder.d.mts +179 -0
- package/dist/services/http/responsesBuilder.d.ts +179 -0
- package/dist/services/http/responsesBuilder.js +179 -0
- package/dist/services/http/responsesBuilder.js.map +1 -0
- package/dist/services/index.d.mts +33 -0
- package/dist/services/index.d.ts +33 -0
- package/dist/services/index.js +31 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/utils/ensureBearerToken.d.mts +158 -0
- package/dist/services/utils/ensureBearerToken.d.ts +158 -0
- package/dist/services/utils/ensureBearerToken.js +121 -0
- package/dist/services/utils/ensureBearerToken.js.map +1 -0
- package/dist/services/utils/index.d.mts +44 -0
- package/dist/services/utils/index.d.ts +44 -0
- package/dist/services/utils/index.js +36 -0
- package/dist/services/utils/index.js.map +1 -0
- package/dist/types/events.d.mts +14 -0
- package/dist/types/events.d.ts +14 -0
- package/dist/types/events.js +17 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/express.d.mts +10 -0
- package/dist/types/express.d.ts +10 -0
- package/dist/types/express.js +17 -0
- package/dist/types/express.js.map +1 -0
- package/dist/types/http.d.mts +79 -0
- package/dist/types/http.d.ts +79 -0
- package/dist/types/http.js +17 -0
- package/dist/types/http.js.map +1 -0
- package/dist/types/index.d.mts +14 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.js +33 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/options.d.mts +14 -0
- package/dist/types/options.d.ts +14 -0
- package/dist/types/options.js +17 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/utils.d.mts +48 -0
- package/dist/types/utils.d.ts +48 -0
- package/dist/types/utils.js +17 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/types/wootils.d.mts +4 -0
- package/dist/types/wootils.d.ts +4 -0
- package/dist/types/wootils.js +17 -0
- package/dist/types/wootils.js.map +1 -0
- package/dist/utils/fns/index.d.mts +5 -0
- package/dist/utils/fns/index.d.ts +5 -0
- package/dist/utils/fns/index.js +29 -0
- package/dist/utils/fns/index.js.map +1 -0
- package/dist/utils/fns/others.d.mts +17 -0
- package/dist/utils/fns/others.d.ts +17 -0
- package/dist/utils/fns/others.js +29 -0
- package/dist/utils/fns/others.js.map +1 -0
- package/dist/utils/fns/routes.d.mts +39 -0
- package/dist/utils/fns/routes.d.ts +39 -0
- package/dist/utils/fns/routes.js +51 -0
- package/dist/utils/fns/routes.js.map +1 -0
- package/dist/utils/fns/statuses.d.mts +45 -0
- package/dist/utils/fns/statuses.d.ts +45 -0
- package/dist/utils/fns/statuses.js +39 -0
- package/dist/utils/fns/statuses.js.map +1 -0
- package/dist/utils/fns/text.d.mts +9 -0
- package/dist/utils/fns/text.d.ts +9 -0
- package/dist/utils/fns/text.js +29 -0
- package/dist/utils/fns/text.js.map +1 -0
- package/dist/utils/index.d.mts +19 -0
- package/dist/utils/index.d.ts +19 -0
- package/dist/utils/index.js +25 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/wrappers.d.mts +14 -0
- package/dist/utils/wrappers.d.ts +14 -0
- package/dist/utils/wrappers.js +68 -0
- package/dist/utils/wrappers.js.map +1 -0
- package/examples/basic/404.html +12 -0
- package/examples/basic/README.md +30 -0
- package/examples/basic/app.ts +18 -0
- package/examples/basic/controller.ts +45 -0
- package/examples/basic/index.ts +19 -0
- package/examples/basic/middleware.ts +13 -0
- package/examples/basic/service.ts +11 -0
- package/package.json +60 -39
- package/src/app/index.ts +1 -0
- package/src/app/jimpex.ts +743 -0
- package/src/controllers/common/config.ts +115 -0
- package/src/controllers/common/health.ts +128 -0
- package/src/controllers/common/index.ts +3 -0
- package/src/controllers/common/statics.ts +380 -0
- package/src/controllers/index.ts +2 -0
- package/src/controllers/utils/gateway.ts +1186 -0
- package/src/controllers/utils/index.ts +1 -0
- package/src/index.ts +6 -0
- package/src/middlewares/common/errorHandler.ts +203 -0
- package/src/middlewares/common/forceHTTPS.ts +83 -0
- package/src/middlewares/common/hsts.ts +135 -0
- package/src/middlewares/common/index.ts +3 -0
- package/src/middlewares/html/fastHTML.ts +255 -0
- package/src/middlewares/html/index.ts +2 -0
- package/src/middlewares/html/showHTML.ts +165 -0
- package/src/middlewares/index.ts +3 -0
- package/src/middlewares/utils/index.ts +1 -0
- package/src/middlewares/utils/versionValidator.ts +289 -0
- package/src/services/common/appError.ts +158 -0
- package/src/services/common/httpError.ts +74 -0
- package/src/services/common/index.ts +29 -0
- package/src/services/common/sendFile.ts +106 -0
- package/src/services/frontend/frontendFs.ts +101 -0
- package/src/services/frontend/index.ts +21 -0
- package/src/services/html/htmlGenerator.ts +356 -0
- package/src/services/html/index.ts +21 -0
- package/src/services/http/apiClient.ts +221 -0
- package/src/services/http/http.ts +286 -0
- package/src/services/http/index.ts +29 -0
- package/src/services/http/responsesBuilder.ts +265 -0
- package/src/services/index.ts +5 -0
- package/src/services/utils/ensureBearerToken.ts +202 -0
- package/src/services/utils/index.ts +21 -0
- package/src/types/events.ts +303 -0
- package/src/types/express.ts +21 -0
- package/src/types/http.ts +77 -0
- package/src/types/index.ts +6 -0
- package/src/types/options.ts +248 -0
- package/src/types/utils.ts +52 -0
- package/src/types/wootils.ts +4 -0
- package/src/utils/fns/index.ts +4 -0
- package/src/utils/fns/others.ts +15 -0
- package/src/utils/fns/routes.ts +64 -0
- package/src/utils/fns/statuses.ts +44 -0
- package/src/utils/fns/text.ts +8 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/wrappers.ts +537 -0
- package/tsconfig.json +5 -8
- package/tsup.config.ts +10 -0
- package/src/app/index.js +0 -692
- package/src/constants/eventNames.js +0 -48
- package/src/constants/index.js +0 -7
- package/src/controllers/common/configuration.js +0 -116
- package/src/controllers/common/health.js +0 -79
- package/src/controllers/common/index.js +0 -7
- package/src/controllers/common/statics.js +0 -336
- package/src/controllers/index.js +0 -9
- package/src/controllers/utils/gateway.js +0 -1039
- package/src/controllers/utils/index.js +0 -3
- package/src/index.js +0 -30
- package/src/middlewares/common/errorHandler.js +0 -185
- package/src/middlewares/common/forceHTTPS.js +0 -80
- package/src/middlewares/common/hsts.js +0 -122
- package/src/middlewares/common/index.js +0 -7
- package/src/middlewares/html/fastHTML.js +0 -298
- package/src/middlewares/html/index.js +0 -5
- package/src/middlewares/html/showHTML.js +0 -167
- package/src/middlewares/index.js +0 -11
- package/src/middlewares/utils/index.js +0 -3
- package/src/middlewares/utils/versionValidator.js +0 -261
- package/src/services/common/appError.js +0 -136
- package/src/services/common/httpError.js +0 -60
- package/src/services/common/index.js +0 -25
- package/src/services/common/sendFile.js +0 -68
- package/src/services/frontend/frontendFs.js +0 -85
- package/src/services/frontend/index.js +0 -17
- package/src/services/html/htmlGenerator.js +0 -391
- package/src/services/html/index.js +0 -17
- package/src/services/http/apiClient.js +0 -148
- package/src/services/http/http.js +0 -256
- package/src/services/http/index.js +0 -25
- package/src/services/http/responsesBuilder.js +0 -193
- package/src/services/index.js +0 -15
- package/src/services/utils/ensureBearerToken.js +0 -147
- package/src/services/utils/index.js +0 -19
- package/src/types.js +0 -377
- package/src/utils/functions.js +0 -78
- package/src/utils/wrappers.js +0 -131
- package/types/app/index.d.ts +0 -417
- package/types/constants/eventNames.d.ts +0 -93
- package/types/constants/index.d.ts +0 -2
- package/types/controllers/common/configuration.d.ts +0 -71
- package/types/controllers/common/health.d.ts +0 -55
- package/types/controllers/common/index.d.ts +0 -4
- package/types/controllers/common/statics.d.ts +0 -271
- package/types/controllers/index.d.ts +0 -3
- package/types/controllers/utils/gateway.d.ts +0 -947
- package/types/controllers/utils/index.d.ts +0 -2
- package/types/index.d.ts +0 -15
- package/types/middlewares/common/errorHandler.d.ts +0 -143
- package/types/middlewares/common/forceHTTPS.d.ts +0 -64
- package/types/middlewares/common/hsts.d.ts +0 -111
- package/types/middlewares/common/index.d.ts +0 -4
- package/types/middlewares/html/fastHTML.d.ts +0 -238
- package/types/middlewares/html/index.d.ts +0 -3
- package/types/middlewares/html/showHTML.d.ts +0 -128
- package/types/middlewares/index.d.ts +0 -4
- package/types/middlewares/utils/index.d.ts +0 -2
- package/types/middlewares/utils/versionValidator.d.ts +0 -247
- package/types/services/common/appError.d.ts +0 -89
- package/types/services/common/httpError.d.ts +0 -37
- package/types/services/common/index.d.ts +0 -18
- package/types/services/common/sendFile.d.ts +0 -56
- package/types/services/frontend/frontendFs.d.ts +0 -72
- package/types/services/frontend/index.d.ts +0 -3
- package/types/services/html/htmlGenerator.d.ts +0 -298
- package/types/services/html/index.d.ts +0 -3
- package/types/services/http/apiClient.d.ts +0 -141
- package/types/services/http/http.d.ts +0 -159
- package/types/services/http/index.d.ts +0 -18
- package/types/services/http/responsesBuilder.d.ts +0 -140
- package/types/services/index.d.ts +0 -6
- package/types/services/utils/ensureBearerToken.d.ts +0 -137
- package/types/services/utils/index.d.ts +0 -16
- package/types/types.d.ts +0 -280
- package/types/utils/functions.d.ts +0 -55
- package/types/utils/wrappers.d.ts +0 -127
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import * as _homer0_jimple from '@homer0/jimple';
|
|
2
|
+
import { J as Jimpex } from '../../index-b2a04c78.js';
|
|
3
|
+
import { SimpleLogger } from '@homer0/simple-logger';
|
|
4
|
+
import { SimpleConfig } from '@homer0/simple-config';
|
|
5
|
+
import { FrontendFs } from '../frontend/frontendFs.js';
|
|
6
|
+
import { DeferredPromise } from '@homer0/deferred';
|
|
7
|
+
import '../../types/express.js';
|
|
8
|
+
import 'express';
|
|
9
|
+
import '../../types/http.js';
|
|
10
|
+
import 'https';
|
|
11
|
+
import 'http';
|
|
12
|
+
import 'spdy';
|
|
13
|
+
import 'node-fetch';
|
|
14
|
+
import '../../types/utils.js';
|
|
15
|
+
import '@homer0/path-utils';
|
|
16
|
+
import '@homer0/events-hub';
|
|
17
|
+
import 'fs/promises';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The options to customize a {@link HTMLGenerator} instance.
|
|
21
|
+
*
|
|
22
|
+
* @group Services/HTMLGenerator
|
|
23
|
+
*/
|
|
24
|
+
type HTMLGeneratorOptions = {
|
|
25
|
+
/**
|
|
26
|
+
* The name of the file it should use as template.
|
|
27
|
+
*
|
|
28
|
+
* @default 'index.tpl.html'
|
|
29
|
+
*/
|
|
30
|
+
template: string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the generated file.
|
|
33
|
+
*
|
|
34
|
+
* @default 'index.html'
|
|
35
|
+
*/
|
|
36
|
+
file: string;
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, it won't log messages on the terminal when generating the file.
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
silent: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether or not to delete the tempalte after generating the file.
|
|
45
|
+
*
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
deleteTemplateAfter: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The placeholder string where the information will be written.
|
|
51
|
+
*
|
|
52
|
+
* @default /\{\{appConfi(?:guration)?\}\}/
|
|
53
|
+
*/
|
|
54
|
+
replacePlaceholder: string | RegExp;
|
|
55
|
+
/**
|
|
56
|
+
* A regular expression for dynamic placeholders that will be replaced by values when
|
|
57
|
+
* the file is generated.
|
|
58
|
+
*
|
|
59
|
+
* @default /\{\{(.*?)\}\}/gi
|
|
60
|
+
*/
|
|
61
|
+
placeholderExpression: RegExp;
|
|
62
|
+
/**
|
|
63
|
+
* The name of the variable that will have the information on the file.
|
|
64
|
+
*
|
|
65
|
+
* @default 'appConfig'
|
|
66
|
+
*/
|
|
67
|
+
variableName: string;
|
|
68
|
+
/**
|
|
69
|
+
* A list of settings from the app configuration that will be used as the information to
|
|
70
|
+
* inject on the file.
|
|
71
|
+
*
|
|
72
|
+
* @default ['features', 'version', 'postMessagesPrefix']
|
|
73
|
+
*/
|
|
74
|
+
configKeys: string[];
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* An external service that can be used to provide the values the generator will replace
|
|
78
|
+
* in the template.
|
|
79
|
+
*
|
|
80
|
+
* @group Services/HTMLGenerator
|
|
81
|
+
*/
|
|
82
|
+
type HTMLGeneratorValuesService = {
|
|
83
|
+
/**
|
|
84
|
+
* A function that will be called to get the values to replace in the template.
|
|
85
|
+
*
|
|
86
|
+
* @param options The service customization options.
|
|
87
|
+
*/
|
|
88
|
+
getValues: (options: HTMLGeneratorOptions) => Promise<Record<string, unknown>>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The options to construct a {@link HTMLGenerator}.
|
|
92
|
+
*
|
|
93
|
+
* @group Services/HTMLGenerator
|
|
94
|
+
*/
|
|
95
|
+
type HTMLGeneratorConstructorOptions = Partial<HTMLGeneratorOptions> & {
|
|
96
|
+
/**
|
|
97
|
+
* A dictionary with the dependencies to inject.
|
|
98
|
+
*/
|
|
99
|
+
inject: {
|
|
100
|
+
config: SimpleConfig;
|
|
101
|
+
logger: SimpleLogger;
|
|
102
|
+
frontendFs: FrontendFs;
|
|
103
|
+
/**
|
|
104
|
+
* A service that can provide the values to replace in the template. If specified, the
|
|
105
|
+
* values from `configKeys` will be ignored.
|
|
106
|
+
*/
|
|
107
|
+
valuesService?: HTMLGeneratorValuesService;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Custom options for the provider that will register an instance of {@link HTMLGenerator}
|
|
112
|
+
* as a service.
|
|
113
|
+
*
|
|
114
|
+
* @group Services/HTMLGenerator
|
|
115
|
+
*/
|
|
116
|
+
type HTMLGeneratorProviderOptions = Partial<HTMLGeneratorOptions> & {
|
|
117
|
+
/**
|
|
118
|
+
* The name that will be used to register the service on the container. This is to allow
|
|
119
|
+
* multiple "instances" of the service to be created.
|
|
120
|
+
*
|
|
121
|
+
* @default 'htmlGenerator'
|
|
122
|
+
*/
|
|
123
|
+
serviceName?: string;
|
|
124
|
+
/**
|
|
125
|
+
* The name of a service that the generator will use in order to read the values that
|
|
126
|
+
* will be replaced on the template. If the service is available, the values from
|
|
127
|
+
* `configKeys` will be ignored.
|
|
128
|
+
*
|
|
129
|
+
* @default 'htmlGeneratorValues'
|
|
130
|
+
*/
|
|
131
|
+
valuesServiceName?: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* This is a utility service that generates an HTML file with custom information when the
|
|
135
|
+
* application is started.
|
|
136
|
+
*
|
|
137
|
+
* @group Services
|
|
138
|
+
* @group Services/HTMLGenerator
|
|
139
|
+
*/
|
|
140
|
+
declare class HTMLGenerator {
|
|
141
|
+
/**
|
|
142
|
+
* The service customization options.
|
|
143
|
+
*/
|
|
144
|
+
protected readonly _options: HTMLGeneratorOptions;
|
|
145
|
+
/**
|
|
146
|
+
* The application configuration service, to get the settings specified by the
|
|
147
|
+
* `configKeys` option.
|
|
148
|
+
*/
|
|
149
|
+
protected readonly _config: SimpleConfig;
|
|
150
|
+
/**
|
|
151
|
+
* The service that logs messages on the terminal, in case the `silent` option is `false`.
|
|
152
|
+
*/
|
|
153
|
+
protected readonly _logger: SimpleLogger;
|
|
154
|
+
/**
|
|
155
|
+
* The service that interacts with the filesystem.
|
|
156
|
+
*/
|
|
157
|
+
protected readonly _frontendFs: FrontendFs;
|
|
158
|
+
/**
|
|
159
|
+
* A service that can provide values to be replaced in the template.
|
|
160
|
+
*/
|
|
161
|
+
protected readonly _valuesService?: HTMLGeneratorValuesService;
|
|
162
|
+
/**
|
|
163
|
+
* Whether or not the file was already generated.
|
|
164
|
+
*/
|
|
165
|
+
protected _fileReady: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* A deferred promise to return when another service asks if the file has been
|
|
168
|
+
* generated. Once this sevice finishes generating the file, the promise will be
|
|
169
|
+
* resolved for all implementations that hold a reference to this deferred.
|
|
170
|
+
*/
|
|
171
|
+
protected _fileDeferred?: DeferredPromise<void>;
|
|
172
|
+
/**
|
|
173
|
+
* @param options The options to construct the class.
|
|
174
|
+
* @throws If `valuesService` is specified but it doesn't have a `getValues`
|
|
175
|
+
* method.
|
|
176
|
+
*/
|
|
177
|
+
constructor({ inject: { config, logger, frontendFs, valuesService }, ...options }: HTMLGeneratorConstructorOptions);
|
|
178
|
+
/**
|
|
179
|
+
* Gets a promise that will be resolved when the file has been generated.
|
|
180
|
+
*/
|
|
181
|
+
whenReady(): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Generates the HTML file.
|
|
184
|
+
*/
|
|
185
|
+
generateHTML(): Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Gets the customization options.
|
|
188
|
+
*/
|
|
189
|
+
get options(): Readonly<HTMLGeneratorOptions>;
|
|
190
|
+
/**
|
|
191
|
+
* Helper method to get the values that will be replaced in the template. If a "values
|
|
192
|
+
* service" was specified in the constructor, it will get the values from there,
|
|
193
|
+
* otherwise, it will use the `configKeys` option to get the values from the
|
|
194
|
+
* application configuration.
|
|
195
|
+
*/
|
|
196
|
+
protected _getValues(): Promise<Record<string, unknown>>;
|
|
197
|
+
/**
|
|
198
|
+
* Processes the HTML template by replacing the placeholders with the actual values.
|
|
199
|
+
*
|
|
200
|
+
* @param template The template for the HTML file.
|
|
201
|
+
* @param values The values dictionary that should be replaced in the template.
|
|
202
|
+
*/
|
|
203
|
+
protected _processHTML(template: string, values: Record<string, unknown>): string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* The service provider that once registered on the container will set an instance of
|
|
207
|
+
* {@link HTMLGenerator} as the `htmlGenerator` service. it will also hook itself to the
|
|
208
|
+
* `after-start` event of the application in order to trigger the generator of the HTML
|
|
209
|
+
* file.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
*
|
|
213
|
+
* <caption>Basic usage</caption>
|
|
214
|
+
*
|
|
215
|
+
* // Register it on the container
|
|
216
|
+
* container.register(htmlGeneratorProvider);
|
|
217
|
+
* // Getting access to the service instance
|
|
218
|
+
* const htmlGenerator = container.get<HTMLGenerator>('htmlGenerator');
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
*
|
|
222
|
+
* <caption>Using with custom options</caption>
|
|
223
|
+
*
|
|
224
|
+
* container.register(
|
|
225
|
+
* htmlGeneratorProvider({
|
|
226
|
+
* serviceName: 'myHtmlGenerator',
|
|
227
|
+
* valuesServiceName: 'myValuesService',
|
|
228
|
+
* template: 'my-template.tpl.html',
|
|
229
|
+
* }),
|
|
230
|
+
* );
|
|
231
|
+
*
|
|
232
|
+
* @group Providers
|
|
233
|
+
* @group Services/HTMLGenerator
|
|
234
|
+
*/
|
|
235
|
+
declare const htmlGeneratorProvider: _homer0_jimple.ResourceCreator<"provider", "register", (options?: HTMLGeneratorProviderOptions) => (app: Jimpex) => void, _homer0_jimple.ProviderRegisterFn<Jimpex>>;
|
|
236
|
+
|
|
237
|
+
export { HTMLGenerator, HTMLGeneratorConstructorOptions, HTMLGeneratorOptions, HTMLGeneratorProviderOptions, HTMLGeneratorValuesService, htmlGeneratorProvider };
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
var htmlGenerator_exports = {};
|
|
25
|
+
__export(htmlGenerator_exports, {
|
|
26
|
+
HTMLGenerator: () => HTMLGenerator,
|
|
27
|
+
htmlGeneratorProvider: () => htmlGeneratorProvider
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(htmlGenerator_exports);
|
|
30
|
+
var import_object_utils = require("@homer0/object-utils");
|
|
31
|
+
var import_deep_assign = require("@homer0/deep-assign");
|
|
32
|
+
var import_deferred = require("@homer0/deferred");
|
|
33
|
+
var import_utils = require("../../utils");
|
|
34
|
+
class HTMLGenerator {
|
|
35
|
+
/**
|
|
36
|
+
* @param options The options to construct the class.
|
|
37
|
+
* @throws If `valuesService` is specified but it doesn't have a `getValues`
|
|
38
|
+
* method.
|
|
39
|
+
*/
|
|
40
|
+
constructor({
|
|
41
|
+
inject: { config, logger, frontendFs, valuesService },
|
|
42
|
+
...options
|
|
43
|
+
}) {
|
|
44
|
+
/**
|
|
45
|
+
* The service customization options.
|
|
46
|
+
*/
|
|
47
|
+
__publicField(this, "_options");
|
|
48
|
+
/**
|
|
49
|
+
* The application configuration service, to get the settings specified by the
|
|
50
|
+
* `configKeys` option.
|
|
51
|
+
*/
|
|
52
|
+
__publicField(this, "_config");
|
|
53
|
+
/**
|
|
54
|
+
* The service that logs messages on the terminal, in case the `silent` option is `false`.
|
|
55
|
+
*/
|
|
56
|
+
__publicField(this, "_logger");
|
|
57
|
+
/**
|
|
58
|
+
* The service that interacts with the filesystem.
|
|
59
|
+
*/
|
|
60
|
+
__publicField(this, "_frontendFs");
|
|
61
|
+
/**
|
|
62
|
+
* A service that can provide values to be replaced in the template.
|
|
63
|
+
*/
|
|
64
|
+
__publicField(this, "_valuesService");
|
|
65
|
+
/**
|
|
66
|
+
* Whether or not the file was already generated.
|
|
67
|
+
*/
|
|
68
|
+
__publicField(this, "_fileReady", false);
|
|
69
|
+
/**
|
|
70
|
+
* A deferred promise to return when another service asks if the file has been
|
|
71
|
+
* generated. Once this sevice finishes generating the file, the promise will be
|
|
72
|
+
* resolved for all implementations that hold a reference to this deferred.
|
|
73
|
+
*/
|
|
74
|
+
__publicField(this, "_fileDeferred");
|
|
75
|
+
this._config = config;
|
|
76
|
+
this._logger = logger;
|
|
77
|
+
this._frontendFs = frontendFs;
|
|
78
|
+
this._valuesService = valuesService;
|
|
79
|
+
this._options = (0, import_deep_assign.deepAssignWithOverwrite)(
|
|
80
|
+
{
|
|
81
|
+
template: "index.tpl.html",
|
|
82
|
+
file: "index.html",
|
|
83
|
+
silent: false,
|
|
84
|
+
deleteTemplateAfter: true,
|
|
85
|
+
replacePlaceholder: /\{\{appConfig(?:uration)?\}\}/,
|
|
86
|
+
placeholderExpression: /\{\{(.*?)\}\}/gi,
|
|
87
|
+
variableName: "appConfig",
|
|
88
|
+
configKeys: ["features", "version", "postMessagesPrefix"]
|
|
89
|
+
},
|
|
90
|
+
options
|
|
91
|
+
);
|
|
92
|
+
if (this._valuesService && typeof this._valuesService.getValues !== "function") {
|
|
93
|
+
throw new Error("The HTMLGenerator values service must have a `getValues` method");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Gets a promise that will be resolved when the file has been generated.
|
|
98
|
+
*/
|
|
99
|
+
whenReady() {
|
|
100
|
+
return this._fileDeferred ? this._fileDeferred.promise : Promise.resolve();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Generates the HTML file.
|
|
104
|
+
*/
|
|
105
|
+
async generateHTML() {
|
|
106
|
+
if (this._fileReady)
|
|
107
|
+
return void 0;
|
|
108
|
+
if (this._fileDeferred)
|
|
109
|
+
return this._fileDeferred.promise;
|
|
110
|
+
this._fileDeferred = (0, import_deferred.deferred)();
|
|
111
|
+
const { template, deleteTemplateAfter, file, silent } = this._options;
|
|
112
|
+
try {
|
|
113
|
+
const templateContents = await this._frontendFs.read(template);
|
|
114
|
+
const values = await this._getValues();
|
|
115
|
+
const html = this._processHTML(templateContents, values);
|
|
116
|
+
await this._frontendFs.write(file, html);
|
|
117
|
+
if (!silent) {
|
|
118
|
+
this._logger.success(`The HTML file was successfully generated (${file})`);
|
|
119
|
+
}
|
|
120
|
+
if (deleteTemplateAfter) {
|
|
121
|
+
await this._frontendFs.delete(template);
|
|
122
|
+
if (!silent) {
|
|
123
|
+
this._logger.info(`The HTML template was successfully removed (${template})`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
this._fileReady = true;
|
|
127
|
+
this._fileDeferred.resolve();
|
|
128
|
+
this._fileDeferred = void 0;
|
|
129
|
+
return void 0;
|
|
130
|
+
} catch (error) {
|
|
131
|
+
this._fileDeferred.reject(error);
|
|
132
|
+
this._fileDeferred = void 0;
|
|
133
|
+
if (!silent) {
|
|
134
|
+
this._logger.error("There was an error while generating the HTML");
|
|
135
|
+
}
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Gets the customization options.
|
|
141
|
+
*/
|
|
142
|
+
get options() {
|
|
143
|
+
return (0, import_deep_assign.deepAssignWithOverwrite)({}, this._options);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Helper method to get the values that will be replaced in the template. If a "values
|
|
147
|
+
* service" was specified in the constructor, it will get the values from there,
|
|
148
|
+
* otherwise, it will use the `configKeys` option to get the values from the
|
|
149
|
+
* application configuration.
|
|
150
|
+
*/
|
|
151
|
+
_getValues() {
|
|
152
|
+
if (this._valuesService) {
|
|
153
|
+
return this._valuesService.getValues(this._options);
|
|
154
|
+
}
|
|
155
|
+
const { configKeys } = this._options;
|
|
156
|
+
if (configKeys && configKeys.length) {
|
|
157
|
+
return Promise.resolve(this._config.get(configKeys));
|
|
158
|
+
}
|
|
159
|
+
return Promise.resolve({});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Processes the HTML template by replacing the placeholders with the actual values.
|
|
163
|
+
*
|
|
164
|
+
* @param template The template for the HTML file.
|
|
165
|
+
* @param values The values dictionary that should be replaced in the template.
|
|
166
|
+
*/
|
|
167
|
+
_processHTML(template, values) {
|
|
168
|
+
const { replacePlaceholder, placeholderExpression, variableName } = this._options;
|
|
169
|
+
const htmlObject = JSON.stringify(values);
|
|
170
|
+
let code = template.replace(
|
|
171
|
+
replacePlaceholder,
|
|
172
|
+
`window.${variableName} = ${htmlObject}`
|
|
173
|
+
);
|
|
174
|
+
const matches = [];
|
|
175
|
+
let match = placeholderExpression.exec(code);
|
|
176
|
+
while (match) {
|
|
177
|
+
const [string, value] = match;
|
|
178
|
+
if (string && value) {
|
|
179
|
+
matches.push({
|
|
180
|
+
string,
|
|
181
|
+
value
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
match = placeholderExpression.exec(code);
|
|
185
|
+
}
|
|
186
|
+
matches.forEach((info) => {
|
|
187
|
+
code = code.replace(info.string, String((0, import_object_utils.get)(values, info.value)));
|
|
188
|
+
});
|
|
189
|
+
return code;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const htmlGeneratorProvider = (0, import_utils.providerCreator)(
|
|
193
|
+
(options = {}) => (app) => {
|
|
194
|
+
const {
|
|
195
|
+
serviceName = "htmlGenerator",
|
|
196
|
+
valuesServiceName = "htmlGeneratorValues",
|
|
197
|
+
...rest
|
|
198
|
+
} = options;
|
|
199
|
+
app.set(
|
|
200
|
+
serviceName,
|
|
201
|
+
() => new HTMLGenerator({
|
|
202
|
+
inject: {
|
|
203
|
+
config: app.get("config"),
|
|
204
|
+
logger: app.get("logger"),
|
|
205
|
+
frontendFs: app.get("frontendFs"),
|
|
206
|
+
valuesService: app.try(valuesServiceName)
|
|
207
|
+
},
|
|
208
|
+
...rest
|
|
209
|
+
})
|
|
210
|
+
);
|
|
211
|
+
app.once("afterStart", () => {
|
|
212
|
+
app.get(serviceName).generateHTML();
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
217
|
+
0 && (module.exports = {
|
|
218
|
+
HTMLGenerator,
|
|
219
|
+
htmlGeneratorProvider
|
|
220
|
+
});
|
|
221
|
+
//# sourceMappingURL=htmlGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/services/html/htmlGenerator.ts"],"sourcesContent":["import { get } from '@homer0/object-utils';\nimport { deepAssignWithOverwrite } from '@homer0/deep-assign';\nimport { deferred, type DeferredPromise } from '@homer0/deferred';\nimport { providerCreator } from '../../utils';\nimport type { Config, Logger } from '../../types';\nimport type { FrontendFs } from '../frontend';\n/**\n * The options to customize a {@link HTMLGenerator} instance.\n *\n * @group Services/HTMLGenerator\n */\nexport type HTMLGeneratorOptions = {\n /**\n * The name of the file it should use as template.\n *\n * @default 'index.tpl.html'\n */\n template: string;\n /**\n * The name of the generated file.\n *\n * @default 'index.html'\n */\n file: string;\n /**\n * If `true`, it won't log messages on the terminal when generating the file.\n *\n * @default false\n */\n silent: boolean;\n /**\n * Whether or not to delete the tempalte after generating the file.\n *\n * @default true\n */\n deleteTemplateAfter: boolean;\n /**\n * The placeholder string where the information will be written.\n *\n * @default /\\{\\{appConfi(?:guration)?\\}\\}/\n */\n replacePlaceholder: string | RegExp;\n /**\n * A regular expression for dynamic placeholders that will be replaced by values when\n * the file is generated.\n *\n * @default /\\{\\{(.*?)\\}\\}/gi\n */\n placeholderExpression: RegExp;\n /**\n * The name of the variable that will have the information on the file.\n *\n * @default 'appConfig'\n */\n variableName: string;\n /**\n * A list of settings from the app configuration that will be used as the information to\n * inject on the file.\n *\n * @default ['features', 'version', 'postMessagesPrefix']\n */\n configKeys: string[];\n};\n/**\n * An external service that can be used to provide the values the generator will replace\n * in the template.\n *\n * @group Services/HTMLGenerator\n */\nexport type HTMLGeneratorValuesService = {\n /**\n * A function that will be called to get the values to replace in the template.\n *\n * @param options The service customization options.\n */\n getValues: (options: HTMLGeneratorOptions) => Promise<Record<string, unknown>>;\n};\n/**\n * The options to construct a {@link HTMLGenerator}.\n *\n * @group Services/HTMLGenerator\n */\nexport type HTMLGeneratorConstructorOptions = Partial<HTMLGeneratorOptions> & {\n /**\n * A dictionary with the dependencies to inject.\n */\n inject: {\n config: Config;\n logger: Logger;\n frontendFs: FrontendFs;\n /**\n * A service that can provide the values to replace in the template. If specified, the\n * values from `configKeys` will be ignored.\n */\n valuesService?: HTMLGeneratorValuesService;\n };\n};\n/**\n * Custom options for the provider that will register an instance of {@link HTMLGenerator}\n * as a service.\n *\n * @group Services/HTMLGenerator\n */\nexport type HTMLGeneratorProviderOptions = Partial<HTMLGeneratorOptions> & {\n /**\n * The name that will be used to register the service on the container. This is to allow\n * multiple \"instances\" of the service to be created.\n *\n * @default 'htmlGenerator'\n */\n serviceName?: string;\n /**\n * The name of a service that the generator will use in order to read the values that\n * will be replaced on the template. If the service is available, the values from\n * `configKeys` will be ignored.\n *\n * @default 'htmlGeneratorValues'\n */\n valuesServiceName?: string;\n};\n/**\n * This is a utility service that generates an HTML file with custom information when the\n * application is started.\n *\n * @group Services\n * @group Services/HTMLGenerator\n */\nexport class HTMLGenerator {\n /**\n * The service customization options.\n */\n protected readonly _options: HTMLGeneratorOptions;\n /**\n * The application configuration service, to get the settings specified by the\n * `configKeys` option.\n */\n protected readonly _config: Config;\n /**\n * The service that logs messages on the terminal, in case the `silent` option is `false`.\n */\n protected readonly _logger: Logger;\n /**\n * The service that interacts with the filesystem.\n */\n protected readonly _frontendFs: FrontendFs;\n /**\n * A service that can provide values to be replaced in the template.\n */\n protected readonly _valuesService?: HTMLGeneratorValuesService;\n /**\n * Whether or not the file was already generated.\n */\n protected _fileReady: boolean = false;\n /**\n * A deferred promise to return when another service asks if the file has been\n * generated. Once this sevice finishes generating the file, the promise will be\n * resolved for all implementations that hold a reference to this deferred.\n */\n protected _fileDeferred?: DeferredPromise<void>;\n /**\n * @param options The options to construct the class.\n * @throws If `valuesService` is specified but it doesn't have a `getValues`\n * method.\n */\n constructor({\n inject: { config, logger, frontendFs, valuesService },\n ...options\n }: HTMLGeneratorConstructorOptions) {\n this._config = config;\n this._logger = logger;\n this._frontendFs = frontendFs;\n this._valuesService = valuesService;\n this._options = deepAssignWithOverwrite(\n {\n template: 'index.tpl.html',\n file: 'index.html',\n silent: false,\n deleteTemplateAfter: true,\n replacePlaceholder: /\\{\\{appConfig(?:uration)?\\}\\}/,\n placeholderExpression: /\\{\\{(.*?)\\}\\}/gi,\n variableName: 'appConfig',\n configKeys: ['features', 'version', 'postMessagesPrefix'],\n },\n options,\n );\n\n if (this._valuesService && typeof this._valuesService.getValues !== 'function') {\n throw new Error('The HTMLGenerator values service must have a `getValues` method');\n }\n }\n /**\n * Gets a promise that will be resolved when the file has been generated.\n */\n whenReady(): Promise<void> {\n return this._fileDeferred ? this._fileDeferred.promise : Promise.resolve();\n }\n /**\n * Generates the HTML file.\n */\n async generateHTML(): Promise<void> {\n // The file is already generated, and since this is async, return the promise.\n if (this._fileReady) return undefined;\n // If the file is not ready, but the deferred exists, return the reference to the promise.\n if (this._fileDeferred) return this._fileDeferred.promise;\n // Create the deferred promise.\n this._fileDeferred = deferred<void>();\n const { template, deleteTemplateAfter, file, silent } = this._options;\n try {\n // Get the template.\n const templateContents = await this._frontendFs.read(template);\n // Get the values to replace.\n const values = await this._getValues();\n // Replace/process the template.\n const html = this._processHTML(templateContents, values);\n // Write it in the filesystem.\n await this._frontendFs.write(file, html);\n if (!silent) {\n this._logger.success(`The HTML file was successfully generated (${file})`);\n }\n // Delete the template, if specified by the options.\n if (deleteTemplateAfter) {\n await this._frontendFs.delete(template);\n if (!silent) {\n this._logger.info(`The HTML template was successfully removed (${template})`);\n }\n }\n\n // Switch the flag, resolve the deferred promise, and delete it.\n this._fileReady = true;\n this._fileDeferred!.resolve();\n this._fileDeferred = undefined;\n return undefined;\n } catch (error) {\n this._fileDeferred!.reject(error);\n this._fileDeferred = undefined;\n if (!silent) {\n this._logger.error('There was an error while generating the HTML');\n }\n throw error;\n }\n }\n /**\n * Gets the customization options.\n */\n get options(): Readonly<HTMLGeneratorOptions> {\n return deepAssignWithOverwrite({}, this._options);\n }\n /**\n * Helper method to get the values that will be replaced in the template. If a \"values\n * service\" was specified in the constructor, it will get the values from there,\n * otherwise, it will use the `configKeys` option to get the values from the\n * application configuration.\n */\n protected _getValues(): Promise<Record<string, unknown>> {\n if (this._valuesService) {\n return this._valuesService.getValues(this._options);\n }\n\n const { configKeys } = this._options;\n if (configKeys && configKeys.length) {\n return Promise.resolve(this._config.get(configKeys));\n }\n\n return Promise.resolve({});\n }\n /**\n * Processes the HTML template by replacing the placeholders with the actual values.\n *\n * @param template The template for the HTML file.\n * @param values The values dictionary that should be replaced in the template.\n */\n protected _processHTML(template: string, values: Record<string, unknown>) {\n const { replacePlaceholder, placeholderExpression, variableName } = this._options;\n const htmlObject = JSON.stringify(values);\n let code = template.replace(\n replacePlaceholder,\n `window.${variableName} = ${htmlObject}`,\n );\n const matches: Array<{ string: string; value: string }> = [];\n let match = placeholderExpression.exec(code);\n while (match) {\n const [string, value] = match;\n if (string && value) {\n matches.push({\n string,\n value,\n });\n }\n\n match = placeholderExpression.exec(code);\n }\n\n matches.forEach((info) => {\n code = code.replace(info.string, String(get(values, info.value)));\n });\n\n return code;\n }\n}\n/**\n * The service provider that once registered on the container will set an instance of\n * {@link HTMLGenerator} as the `htmlGenerator` service. it will also hook itself to the\n * `after-start` event of the application in order to trigger the generator of the HTML\n * file.\n *\n * @example\n *\n * <caption>Basic usage</caption>\n *\n * // Register it on the container\n * container.register(htmlGeneratorProvider);\n * // Getting access to the service instance\n * const htmlGenerator = container.get<HTMLGenerator>('htmlGenerator');\n *\n * @example\n *\n * <caption>Using with custom options</caption>\n *\n * container.register(\n * htmlGeneratorProvider({\n * serviceName: 'myHtmlGenerator',\n * valuesServiceName: 'myValuesService',\n * template: 'my-template.tpl.html',\n * }),\n * );\n *\n * @group Providers\n * @group Services/HTMLGenerator\n */\nexport const htmlGeneratorProvider = providerCreator(\n (options: HTMLGeneratorProviderOptions = {}) =>\n (app) => {\n const {\n serviceName = 'htmlGenerator',\n valuesServiceName = 'htmlGeneratorValues',\n ...rest\n } = options;\n app.set(\n serviceName,\n () =>\n new HTMLGenerator({\n inject: {\n config: app.get('config'),\n logger: app.get('logger'),\n frontendFs: app.get('frontendFs'),\n valuesService: app.try(valuesServiceName),\n },\n ...rest,\n }),\n );\n\n app.once('afterStart', () => {\n app.get<HTMLGenerator>(serviceName).generateHTML();\n });\n },\n);\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as _homer0_jimple from '@homer0/jimple';
|
|
2
|
+
import { J as Jimpex } from '../../index-efeb437e.js';
|
|
3
|
+
import { HTMLGeneratorProviderOptions } from './htmlGenerator.mjs';
|
|
4
|
+
export { HTMLGenerator, HTMLGeneratorConstructorOptions, HTMLGeneratorOptions, HTMLGeneratorValuesService, htmlGeneratorProvider } from './htmlGenerator.mjs';
|
|
5
|
+
import '../../types/express.mjs';
|
|
6
|
+
import 'express';
|
|
7
|
+
import '../../types/http.mjs';
|
|
8
|
+
import 'https';
|
|
9
|
+
import 'http';
|
|
10
|
+
import 'spdy';
|
|
11
|
+
import 'node-fetch';
|
|
12
|
+
import '../../types/utils.mjs';
|
|
13
|
+
import '@homer0/path-utils';
|
|
14
|
+
import '@homer0/simple-logger';
|
|
15
|
+
import '@homer0/simple-config';
|
|
16
|
+
import '@homer0/events-hub';
|
|
17
|
+
import '../frontend/frontendFs.mjs';
|
|
18
|
+
import 'fs/promises';
|
|
19
|
+
import '@homer0/deferred';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Registers all the HTML services on the container.
|
|
23
|
+
*
|
|
24
|
+
* - {@link HTMLGenerator | htmlGenerator}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
*
|
|
28
|
+
* // Register the collection on the container
|
|
29
|
+
* container.register(htmlServicesProvider);
|
|
30
|
+
* // Getting access to one the services instance
|
|
31
|
+
* const htmlGenerator = container.get<HTMLGenerator>('htmlGenerator');
|
|
32
|
+
*
|
|
33
|
+
* @group Providers
|
|
34
|
+
*/
|
|
35
|
+
declare const htmlServicesProvider: {
|
|
36
|
+
htmlGeneratorProvider: _homer0_jimple.ResourceCreator<"provider", "register", (options?: HTMLGeneratorProviderOptions) => (app: Jimpex) => void, _homer0_jimple.ProviderRegisterFn<Jimpex>>;
|
|
37
|
+
} & Record<string, _homer0_jimple.Resource<"provider", "register", _homer0_jimple.ProviderRegisterFn<Jimpex>>> & {
|
|
38
|
+
provider: true;
|
|
39
|
+
} & {
|
|
40
|
+
register: _homer0_jimple.ProviderRegisterFn<Jimpex>;
|
|
41
|
+
} & Record<string, unknown>;
|
|
42
|
+
|
|
43
|
+
export { HTMLGeneratorProviderOptions, htmlServicesProvider };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as _homer0_jimple from '@homer0/jimple';
|
|
2
|
+
import { J as Jimpex } from '../../index-b2a04c78.js';
|
|
3
|
+
import { HTMLGeneratorProviderOptions } from './htmlGenerator.js';
|
|
4
|
+
export { HTMLGenerator, HTMLGeneratorConstructorOptions, HTMLGeneratorOptions, HTMLGeneratorValuesService, htmlGeneratorProvider } from './htmlGenerator.js';
|
|
5
|
+
import '../../types/express.js';
|
|
6
|
+
import 'express';
|
|
7
|
+
import '../../types/http.js';
|
|
8
|
+
import 'https';
|
|
9
|
+
import 'http';
|
|
10
|
+
import 'spdy';
|
|
11
|
+
import 'node-fetch';
|
|
12
|
+
import '../../types/utils.js';
|
|
13
|
+
import '@homer0/path-utils';
|
|
14
|
+
import '@homer0/simple-logger';
|
|
15
|
+
import '@homer0/simple-config';
|
|
16
|
+
import '@homer0/events-hub';
|
|
17
|
+
import '../frontend/frontendFs.js';
|
|
18
|
+
import 'fs/promises';
|
|
19
|
+
import '@homer0/deferred';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Registers all the HTML services on the container.
|
|
23
|
+
*
|
|
24
|
+
* - {@link HTMLGenerator | htmlGenerator}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
*
|
|
28
|
+
* // Register the collection on the container
|
|
29
|
+
* container.register(htmlServicesProvider);
|
|
30
|
+
* // Getting access to one the services instance
|
|
31
|
+
* const htmlGenerator = container.get<HTMLGenerator>('htmlGenerator');
|
|
32
|
+
*
|
|
33
|
+
* @group Providers
|
|
34
|
+
*/
|
|
35
|
+
declare const htmlServicesProvider: {
|
|
36
|
+
htmlGeneratorProvider: _homer0_jimple.ResourceCreator<"provider", "register", (options?: HTMLGeneratorProviderOptions) => (app: Jimpex) => void, _homer0_jimple.ProviderRegisterFn<Jimpex>>;
|
|
37
|
+
} & Record<string, _homer0_jimple.Resource<"provider", "register", _homer0_jimple.ProviderRegisterFn<Jimpex>>> & {
|
|
38
|
+
provider: true;
|
|
39
|
+
} & {
|
|
40
|
+
register: _homer0_jimple.ProviderRegisterFn<Jimpex>;
|
|
41
|
+
} & Record<string, unknown>;
|
|
42
|
+
|
|
43
|
+
export { HTMLGeneratorProviderOptions, htmlServicesProvider };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var html_exports = {};
|
|
21
|
+
__export(html_exports, {
|
|
22
|
+
htmlServicesProvider: () => htmlServicesProvider
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(html_exports);
|
|
25
|
+
var import_utils = require("../../utils");
|
|
26
|
+
var import_htmlGenerator = require("./htmlGenerator");
|
|
27
|
+
__reExport(html_exports, require("./htmlGenerator"), module.exports);
|
|
28
|
+
const htmlServicesProvider = (0, import_utils.providers)({
|
|
29
|
+
htmlGeneratorProvider: import_htmlGenerator.htmlGeneratorProvider
|
|
30
|
+
});
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
htmlServicesProvider,
|
|
34
|
+
...require("./htmlGenerator")
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/services/html/index.ts"],"sourcesContent":["import { providers } from '../../utils';\nimport { htmlGeneratorProvider } from './htmlGenerator';\n/**\n * Registers all the HTML services on the container.\n *\n * - {@link HTMLGenerator | htmlGenerator}\n *\n * @example\n *\n * // Register the collection on the container\n * container.register(htmlServicesProvider);\n * // Getting access to one the services instance\n * const htmlGenerator = container.get<HTMLGenerator>('htmlGenerator');\n *\n * @group Providers\n */\nexport const htmlServicesProvider = providers({\n htmlGeneratorProvider,\n});\n\nexport * from './htmlGenerator';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAC1B,2BAAsC;AAmBtC,yBAAc,4BApBd;AAgBO,MAAM,2BAAuB,wBAAU;AAAA,EAC5C;AACF,CAAC;","names":[]}
|