@webda/core 4.0.0-beta.1 → 4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +252 -0
- package/lib/application/application.d.ts +437 -0
- package/lib/application/application.d.ts.map +1 -0
- package/lib/application/application.js +792 -0
- package/lib/application/application.js.map +1 -0
- package/lib/application/hooks.d.ts +34 -0
- package/lib/application/hooks.d.ts.map +1 -0
- package/lib/application/hooks.js +57 -0
- package/lib/application/hooks.js.map +1 -0
- package/lib/application/iapplication.d.ts +43 -0
- package/lib/application/iapplication.d.ts.map +1 -0
- package/lib/application/iapplication.js +2 -0
- package/lib/application/iapplication.js.map +1 -0
- package/lib/application/iconfiguration.d.ts +176 -0
- package/lib/application/iconfiguration.d.ts.map +1 -0
- package/lib/application/iconfiguration.js +8 -0
- package/lib/application/iconfiguration.js.map +1 -0
- package/lib/application/runner.d.ts +8 -0
- package/lib/application/runner.d.ts.map +1 -0
- package/lib/application/runner.js +26 -0
- package/lib/application/runner.js.map +1 -0
- package/lib/application/unpackedapplication.d.ts +104 -0
- package/lib/application/unpackedapplication.d.ts.map +1 -0
- package/lib/application/unpackedapplication.js +492 -0
- package/lib/application/unpackedapplication.js.map +1 -0
- package/lib/bin/cli-phase.d.ts +28 -0
- package/lib/bin/cli-phase.d.ts.map +1 -0
- package/lib/bin/cli-phase.js +44 -0
- package/lib/bin/cli-phase.js.map +1 -0
- package/lib/bin/cli.d.ts +161 -0
- package/lib/bin/cli.d.ts.map +1 -0
- package/lib/bin/cli.js +828 -0
- package/lib/bin/cli.js.map +1 -0
- package/lib/bin/launcher.d.ts +3 -0
- package/lib/bin/launcher.d.ts.map +1 -0
- package/lib/bin/launcher.js +50 -0
- package/lib/bin/launcher.js.map +1 -0
- package/lib/cache/cache.d.ts +33 -0
- package/lib/cache/cache.d.ts.map +1 -0
- package/lib/cache/cache.js +8 -0
- package/lib/cache/cache.js.map +1 -0
- package/lib/{services/configuration.d.ts → configurations/configuration.service.d.ts} +58 -49
- package/lib/configurations/configuration.service.d.ts.map +1 -0
- package/lib/configurations/configuration.service.js +248 -0
- package/lib/configurations/configuration.service.js.map +1 -0
- package/lib/configurations/fileconfiguration.service.d.ts +30 -0
- package/lib/configurations/fileconfiguration.service.d.ts.map +1 -0
- package/lib/configurations/fileconfiguration.service.js +65 -0
- package/lib/configurations/fileconfiguration.service.js.map +1 -0
- package/lib/configurations/kubernetesconfiguration.service.d.ts +43 -0
- package/lib/configurations/kubernetesconfiguration.service.d.ts.map +1 -0
- package/lib/configurations/kubernetesconfiguration.service.js +83 -0
- package/lib/configurations/kubernetesconfiguration.service.js.map +1 -0
- package/lib/contexts/execution.d.ts +33 -0
- package/lib/contexts/execution.d.ts.map +1 -0
- package/lib/contexts/execution.js +73 -0
- package/lib/contexts/execution.js.map +1 -0
- package/lib/contexts/globalcontext.d.ts +29 -0
- package/lib/contexts/globalcontext.d.ts.map +1 -0
- package/lib/contexts/globalcontext.js +38 -0
- package/lib/contexts/globalcontext.js.map +1 -0
- package/lib/{utils → contexts}/httpcontext.d.ts +45 -19
- package/lib/contexts/httpcontext.d.ts.map +1 -0
- package/lib/{utils → contexts}/httpcontext.js +102 -34
- package/lib/contexts/httpcontext.js.map +1 -0
- package/lib/contexts/icontext.d.ts +236 -0
- package/lib/contexts/icontext.d.ts.map +1 -0
- package/lib/contexts/icontext.js +230 -0
- package/lib/contexts/icontext.js.map +1 -0
- package/lib/contexts/operationcontext.d.ts +179 -0
- package/lib/contexts/operationcontext.d.ts.map +1 -0
- package/lib/contexts/operationcontext.js +358 -0
- package/lib/contexts/operationcontext.js.map +1 -0
- package/lib/contexts/simplecontext.d.ts +31 -0
- package/lib/contexts/simplecontext.d.ts.map +1 -0
- package/lib/contexts/simplecontext.js +45 -0
- package/lib/contexts/simplecontext.js.map +1 -0
- package/lib/contexts/webcontext.d.ts +218 -0
- package/lib/contexts/webcontext.d.ts.map +1 -0
- package/lib/contexts/webcontext.js +389 -0
- package/lib/contexts/webcontext.js.map +1 -0
- package/lib/core/authorizer.d.ts +23 -0
- package/lib/core/authorizer.d.ts.map +1 -0
- package/lib/core/authorizer.js +17 -0
- package/lib/core/authorizer.js.map +1 -0
- package/lib/core/core.d.ts +225 -0
- package/lib/core/core.d.ts.map +1 -0
- package/lib/core/core.js +576 -0
- package/lib/core/core.js.map +1 -0
- package/lib/core/hooks.d.ts +72 -0
- package/lib/core/hooks.d.ts.map +1 -0
- package/lib/core/hooks.js +73 -0
- package/lib/core/hooks.js.map +1 -0
- package/lib/core/icore.d.ts +249 -0
- package/lib/core/icore.d.ts.map +1 -0
- package/lib/core/icore.js +15 -0
- package/lib/core/icore.js.map +1 -0
- package/lib/core/instancestorage.d.ts +61 -0
- package/lib/core/instancestorage.d.ts.map +1 -0
- package/lib/core/instancestorage.js +75 -0
- package/lib/core/instancestorage.js.map +1 -0
- package/lib/core/operations.d.ts +181 -0
- package/lib/core/operations.d.ts.map +1 -0
- package/lib/core/operations.js +559 -0
- package/lib/core/operations.js.map +1 -0
- package/lib/errors/errors.d.ts +126 -0
- package/lib/errors/errors.d.ts.map +1 -0
- package/lib/errors/errors.js +165 -0
- package/lib/errors/errors.js.map +1 -0
- package/lib/events/asynceventemitter.d.ts +159 -0
- package/lib/events/asynceventemitter.d.ts.map +1 -0
- package/lib/events/asynceventemitter.js +152 -0
- package/lib/events/asynceventemitter.js.map +1 -0
- package/lib/events/events.d.ts +112 -0
- package/lib/events/events.d.ts.map +1 -0
- package/lib/events/events.js +45 -0
- package/lib/events/events.js.map +1 -0
- package/lib/index.d.ts +84 -51
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +82 -59
- package/lib/index.js.map +1 -1
- package/lib/loggers/console.service.d.ts +24 -0
- package/lib/loggers/console.service.d.ts.map +1 -0
- package/lib/loggers/console.service.js +30 -0
- package/lib/loggers/console.service.js.map +1 -0
- package/lib/loggers/file.service.d.ts +25 -0
- package/lib/loggers/file.service.d.ts.map +1 -0
- package/lib/loggers/file.service.js +33 -0
- package/lib/loggers/file.service.js.map +1 -0
- package/lib/loggers/hooks.d.ts +20 -0
- package/lib/loggers/hooks.d.ts.map +1 -0
- package/lib/loggers/hooks.js +40 -0
- package/lib/loggers/hooks.js.map +1 -0
- package/lib/loggers/ilogger.d.ts +76 -0
- package/lib/loggers/ilogger.d.ts.map +1 -0
- package/lib/loggers/ilogger.js +108 -0
- package/lib/loggers/ilogger.js.map +1 -0
- package/lib/loggers/logger.d.ts +13 -0
- package/lib/loggers/logger.d.ts.map +1 -0
- package/lib/loggers/logger.js +18 -0
- package/lib/loggers/logger.js.map +1 -0
- package/lib/loggers/memory.service.d.ts +18 -0
- package/lib/loggers/memory.service.d.ts.map +1 -0
- package/lib/loggers/memory.service.js +21 -0
- package/lib/loggers/memory.service.js.map +1 -0
- package/lib/loggers/params.d.ts +47 -0
- package/lib/loggers/params.d.ts.map +1 -0
- package/lib/loggers/params.js +56 -0
- package/lib/loggers/params.js.map +1 -0
- package/lib/metrics/metrics.d.ts +25 -0
- package/lib/metrics/metrics.d.ts.map +1 -0
- package/lib/metrics/metrics.js +51 -0
- package/lib/metrics/metrics.js.map +1 -0
- package/lib/models/aclmodel.d.ts +21 -77
- package/lib/models/aclmodel.d.ts.map +1 -0
- package/lib/models/aclmodel.js +27 -204
- package/lib/models/aclmodel.js.map +1 -1
- package/lib/models/coremodel.model.d.ts +5 -0
- package/lib/models/coremodel.model.d.ts.map +1 -0
- package/lib/models/coremodel.model.js +5 -0
- package/lib/models/coremodel.model.js.map +1 -0
- package/lib/models/decorator.d.ts +63 -0
- package/lib/models/decorator.d.ts.map +1 -0
- package/lib/models/decorator.js +63 -0
- package/lib/models/decorator.js.map +1 -0
- package/lib/models/deployment.d.ts +2 -1
- package/lib/models/deployment.d.ts.map +1 -0
- package/lib/models/ident.model.d.ts +89 -0
- package/lib/models/ident.model.d.ts.map +1 -0
- package/lib/models/ident.model.js +115 -0
- package/lib/models/ident.model.js.map +1 -0
- package/lib/models/ownermodel.model.d.ts +68 -0
- package/lib/models/ownermodel.model.d.ts.map +1 -0
- package/lib/models/ownermodel.model.js +112 -0
- package/lib/models/ownermodel.model.js.map +1 -0
- package/lib/models/registry.model.d.ts +76 -0
- package/lib/models/registry.model.d.ts.map +1 -0
- package/lib/models/registry.model.js +104 -0
- package/lib/models/registry.model.js.map +1 -0
- package/lib/models/rolemodel.model.d.ts +28 -0
- package/lib/models/rolemodel.model.d.ts.map +1 -0
- package/lib/models/rolemodel.model.js +53 -0
- package/lib/models/rolemodel.model.js.map +1 -0
- package/lib/models/simpleuser.model.d.ts +78 -0
- package/lib/models/simpleuser.model.d.ts.map +1 -0
- package/lib/models/simpleuser.model.js +123 -0
- package/lib/models/simpleuser.model.js.map +1 -0
- package/lib/models/types.d.ts +113 -0
- package/lib/models/types.d.ts.map +1 -0
- package/lib/models/types.js +2 -0
- package/lib/models/types.js.map +1 -0
- package/lib/models/user.model.d.ts +103 -0
- package/lib/models/user.model.d.ts.map +1 -0
- package/lib/models/user.model.js +125 -0
- package/lib/models/user.model.js.map +1 -0
- package/lib/queues/memoryqueue.service.d.ts +72 -0
- package/lib/queues/memoryqueue.service.d.ts.map +1 -0
- package/lib/queues/memoryqueue.service.js +136 -0
- package/lib/queues/memoryqueue.service.js.map +1 -0
- package/lib/queues/pubsubservice.d.ts +9 -6
- package/lib/queues/pubsubservice.d.ts.map +1 -0
- package/lib/queues/pubsubservice.js +5 -4
- package/lib/queues/pubsubservice.js.map +1 -1
- package/lib/queues/queueservice.d.ts +10 -11
- package/lib/queues/queueservice.d.ts.map +1 -0
- package/lib/queues/queueservice.js +48 -20
- package/lib/queues/queueservice.js.map +1 -1
- package/lib/rest/hooks.d.ts +8 -0
- package/lib/rest/hooks.d.ts.map +1 -0
- package/lib/rest/hooks.js +10 -0
- package/lib/rest/hooks.js.map +1 -0
- package/lib/rest/irest.d.ts +212 -0
- package/lib/rest/irest.d.ts.map +1 -0
- package/lib/rest/irest.js +39 -0
- package/lib/rest/irest.js.map +1 -0
- package/lib/rest/originfilter.d.ts +38 -0
- package/lib/rest/originfilter.d.ts.map +1 -0
- package/lib/rest/originfilter.js +61 -0
- package/lib/rest/originfilter.js.map +1 -0
- package/lib/rest/restoperationstransport.service.d.ts +193 -0
- package/lib/rest/restoperationstransport.service.d.ts.map +1 -0
- package/lib/rest/restoperationstransport.service.js +780 -0
- package/lib/rest/restoperationstransport.service.js.map +1 -0
- package/lib/rest/router.service.d.ts +244 -0
- package/lib/rest/router.service.d.ts.map +1 -0
- package/lib/rest/router.service.js +843 -0
- package/lib/rest/router.service.js.map +1 -0
- package/lib/schemas/hooks.d.ts +48 -0
- package/lib/schemas/hooks.d.ts.map +1 -0
- package/lib/schemas/hooks.js +152 -0
- package/lib/schemas/hooks.js.map +1 -0
- package/lib/services/audit.model.d.ts +208 -0
- package/lib/services/audit.model.d.ts.map +1 -0
- package/lib/services/audit.model.js +431 -0
- package/lib/services/audit.model.js.map +1 -0
- package/lib/services/{authentication.d.ts → authentication.service.d.ts} +140 -58
- package/lib/services/authentication.service.d.ts.map +1 -0
- package/lib/services/authentication.service.js +932 -0
- package/lib/services/authentication.service.js.map +1 -0
- package/lib/services/binary.service.d.ts +808 -0
- package/lib/services/binary.service.d.ts.map +1 -0
- package/lib/services/binary.service.js +1365 -0
- package/lib/services/binary.service.js.map +1 -0
- package/lib/services/cloudbinary.d.ts +19 -13
- package/lib/services/cloudbinary.d.ts.map +1 -0
- package/lib/services/cloudbinary.js +24 -18
- package/lib/services/cloudbinary.js.map +1 -1
- package/lib/services/command.d.ts +118 -0
- package/lib/services/command.d.ts.map +1 -0
- package/lib/services/command.js +97 -0
- package/lib/services/command.js.map +1 -0
- package/lib/services/cron.service.d.ts +142 -0
- package/lib/services/cron.service.d.ts.map +1 -0
- package/lib/services/cron.service.js +291 -0
- package/lib/services/cron.service.js.map +1 -0
- package/lib/services/{cryptoservice.d.ts → cryptoservice.service.d.ts} +77 -142
- package/lib/services/cryptoservice.service.d.ts.map +1 -0
- package/lib/services/cryptoservice.service.js +527 -0
- package/lib/services/cryptoservice.service.js.map +1 -0
- package/lib/services/debugmailer.service.d.ts +49 -0
- package/lib/services/debugmailer.service.d.ts.map +1 -0
- package/lib/services/debugmailer.service.js +66 -0
- package/lib/services/debugmailer.service.js.map +1 -0
- package/lib/services/domainservice.service.d.ts +203 -0
- package/lib/services/domainservice.service.d.ts.map +1 -0
- package/lib/services/domainservice.service.js +600 -0
- package/lib/services/domainservice.service.js.map +1 -0
- package/lib/services/httpserver.service.d.ts +248 -0
- package/lib/services/httpserver.service.d.ts.map +1 -0
- package/lib/services/httpserver.service.js +673 -0
- package/lib/services/httpserver.service.js.map +1 -0
- package/lib/services/iauthentication.d.ts +9 -0
- package/lib/services/iauthentication.d.ts.map +1 -0
- package/lib/services/iauthentication.js +2 -0
- package/lib/services/iauthentication.js.map +1 -0
- package/lib/services/icryptoservice.d.ts +127 -0
- package/lib/services/icryptoservice.d.ts.map +1 -0
- package/lib/services/icryptoservice.js +68 -0
- package/lib/services/icryptoservice.js.map +1 -0
- package/lib/services/imailer.d.ts +17 -0
- package/lib/services/imailer.d.ts.map +1 -0
- package/lib/services/imailer.js +2 -0
- package/lib/services/imailer.js.map +1 -0
- package/lib/services/iservice.d.ts +104 -0
- package/lib/services/iservice.d.ts.map +1 -0
- package/lib/services/iservice.js +63 -0
- package/lib/services/iservice.js.map +1 -0
- package/lib/services/mailer.service.d.ts +220 -0
- package/lib/services/mailer.service.d.ts.map +1 -0
- package/lib/services/mailer.service.js +251 -0
- package/lib/services/mailer.service.js.map +1 -0
- package/lib/services/{notificationservice.d.ts → notificationservice.service.d.ts} +10 -10
- package/lib/services/notificationservice.service.d.ts.map +1 -0
- package/lib/services/{notificationservice.js → notificationservice.service.js} +24 -12
- package/lib/services/notificationservice.service.js.map +1 -0
- package/lib/services/oauth.d.ts +58 -31
- package/lib/services/oauth.d.ts.map +1 -0
- package/lib/services/oauth.js +365 -251
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/operationstransport.d.ts +65 -0
- package/lib/services/operationstransport.d.ts.map +1 -0
- package/lib/services/operationstransport.js +103 -0
- package/lib/services/operationstransport.js.map +1 -0
- package/lib/services/{prometheus.d.ts → prometheus.service.d.ts} +13 -11
- package/lib/services/prometheus.service.d.ts.map +1 -0
- package/lib/services/prometheus.service.js +203 -0
- package/lib/services/prometheus.service.js.map +1 -0
- package/lib/services/resource.service.d.ts +121 -0
- package/lib/services/resource.service.d.ts.map +1 -0
- package/lib/services/resource.service.js +301 -0
- package/lib/services/resource.service.js.map +1 -0
- package/lib/services/service.d.ts +88 -189
- package/lib/services/service.d.ts.map +1 -0
- package/lib/services/service.js +407 -432
- package/lib/services/service.js.map +1 -1
- package/lib/services/servicecommands.d.ts +99 -0
- package/lib/services/servicecommands.d.ts.map +1 -0
- package/lib/services/servicecommands.js +165 -0
- package/lib/services/servicecommands.js.map +1 -0
- package/lib/services/serviceparameters.d.ts +33 -0
- package/lib/services/serviceparameters.d.ts.map +1 -0
- package/lib/services/serviceparameters.js +79 -0
- package/lib/services/serviceparameters.js.map +1 -0
- package/lib/{utils → session}/cookie.d.ts +32 -18
- package/lib/session/cookie.d.ts.map +1 -0
- package/lib/{utils → session}/cookie.js +76 -23
- package/lib/session/cookie.js.map +1 -0
- package/lib/session/manager.model.d.ts +71 -0
- package/lib/session/manager.model.d.ts.map +1 -0
- package/lib/session/manager.model.js +155 -0
- package/lib/session/manager.model.js.map +1 -0
- package/lib/session/session.d.ts +57 -0
- package/lib/session/session.d.ts.map +1 -0
- package/lib/session/session.js +126 -0
- package/lib/session/session.js.map +1 -0
- package/lib/stores/istore.d.ts +99 -0
- package/lib/stores/istore.d.ts.map +1 -0
- package/lib/stores/istore.js +26 -0
- package/lib/stores/istore.js.map +1 -0
- package/lib/stores/memory.service.d.ts +114 -0
- package/lib/stores/memory.service.d.ts.map +1 -0
- package/lib/stores/memory.service.js +343 -0
- package/lib/stores/memory.service.js.map +1 -0
- package/lib/stores/store.d.ts +127 -768
- package/lib/stores/store.d.ts.map +1 -0
- package/lib/stores/store.js +258 -1718
- package/lib/stores/store.js.map +1 -1
- package/lib/templates/templates.d.ts +39 -0
- package/lib/templates/templates.d.ts.map +1 -0
- package/lib/templates/templates.js +92 -0
- package/lib/templates/templates.js.map +1 -0
- package/lib/test/application.d.ts +174 -0
- package/lib/test/application.d.ts.map +1 -0
- package/lib/test/application.js +288 -0
- package/lib/test/application.js.map +1 -0
- package/lib/test/asyncstorage.d.ts +16 -0
- package/lib/test/asyncstorage.d.ts.map +1 -0
- package/lib/test/asyncstorage.js +32 -0
- package/lib/test/asyncstorage.js.map +1 -0
- package/lib/test/core.d.ts +63 -0
- package/lib/test/core.d.ts.map +1 -0
- package/lib/test/core.js +190 -0
- package/lib/test/core.js.map +1 -0
- package/lib/test/index.d.ts +7 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +8 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/internal.d.ts +34 -0
- package/lib/test/internal.d.ts.map +1 -0
- package/lib/test/internal.js +156 -0
- package/lib/test/internal.js.map +1 -0
- package/lib/test/objects.d.ts +318 -0
- package/lib/test/objects.d.ts.map +1 -0
- package/lib/test/objects.js +443 -0
- package/lib/test/objects.js.map +1 -0
- package/lib/utils/abstractdeployer.d.ts +5 -2
- package/lib/utils/abstractdeployer.d.ts.map +1 -0
- package/lib/utils/abstractdeployer.js +3 -0
- package/lib/utils/abstractdeployer.js.map +1 -1
- package/package.json +85 -56
- package/test/cachedapp/webda.config.json +1 -5
- package/test/config-cached.json +1 -5
- package/test/config.json +6 -99
- package/test/data/.env +1 -0
- package/test/my-cnf.json +9 -0
- package/webda.module.json +3462 -2231
- package/lib/application.d.ts +0 -876
- package/lib/application.js +0 -741
- package/lib/application.js.map +0 -1
- package/lib/application.spec.d.ts +0 -1
- package/lib/application.spec.js +0 -234
- package/lib/application.spec.js.map +0 -1
- package/lib/core.d.ts +0 -740
- package/lib/core.js +0 -1310
- package/lib/core.js.map +0 -1
- package/lib/core.spec.d.ts +0 -1
- package/lib/core.spec.js +0 -761
- package/lib/core.spec.js.map +0 -1
- package/lib/errors.d.ts +0 -65
- package/lib/errors.js +0 -113
- package/lib/errors.js.map +0 -1
- package/lib/errors.spec.d.ts +0 -1
- package/lib/errors.spec.js +0 -33
- package/lib/errors.spec.js.map +0 -1
- package/lib/models/aclmodel.spec.d.ts +0 -1
- package/lib/models/aclmodel.spec.js +0 -187
- package/lib/models/aclmodel.spec.js.map +0 -1
- package/lib/models/coremodel.d.ts +0 -887
- package/lib/models/coremodel.js +0 -1208
- package/lib/models/coremodel.js.map +0 -1
- package/lib/models/coremodel.spec.d.ts +0 -1
- package/lib/models/coremodel.spec.js +0 -462
- package/lib/models/coremodel.spec.js.map +0 -1
- package/lib/models/ident.d.ts +0 -53
- package/lib/models/ident.js +0 -40
- package/lib/models/ident.js.map +0 -1
- package/lib/models/ident.spec.d.ts +0 -1
- package/lib/models/ident.spec.js +0 -43
- package/lib/models/ident.spec.js.map +0 -1
- package/lib/models/ownermodel.d.ts +0 -50
- package/lib/models/ownermodel.js +0 -65
- package/lib/models/ownermodel.js.map +0 -1
- package/lib/models/ownermodel.spec.d.ts +0 -1
- package/lib/models/ownermodel.spec.js +0 -191
- package/lib/models/ownermodel.spec.js.map +0 -1
- package/lib/models/relations.d.ts +0 -181
- package/lib/models/relations.js +0 -157
- package/lib/models/relations.js.map +0 -1
- package/lib/models/relations.spec.d.ts +0 -12
- package/lib/models/relations.spec.js +0 -224
- package/lib/models/relations.spec.js.map +0 -1
- package/lib/models/rolemodel.d.ts +0 -10
- package/lib/models/rolemodel.js +0 -35
- package/lib/models/rolemodel.js.map +0 -1
- package/lib/models/rolemodel.spec.d.ts +0 -1
- package/lib/models/rolemodel.spec.js +0 -86
- package/lib/models/rolemodel.spec.js.map +0 -1
- package/lib/models/user.d.ts +0 -100
- package/lib/models/user.js +0 -157
- package/lib/models/user.js.map +0 -1
- package/lib/models/user.spec.d.ts +0 -1
- package/lib/models/user.spec.js +0 -88
- package/lib/models/user.spec.js.map +0 -1
- package/lib/queues/filequeue.d.ts +0 -58
- package/lib/queues/filequeue.js +0 -131
- package/lib/queues/filequeue.js.map +0 -1
- package/lib/queues/filequeue.spec.d.ts +0 -1
- package/lib/queues/filequeue.spec.js +0 -78
- package/lib/queues/filequeue.spec.js.map +0 -1
- package/lib/queues/memoryqueue.d.ts +0 -45
- package/lib/queues/memoryqueue.js +0 -81
- package/lib/queues/memoryqueue.js.map +0 -1
- package/lib/queues/memoryqueue.spec.d.ts +0 -1
- package/lib/queues/memoryqueue.spec.js +0 -192
- package/lib/queues/memoryqueue.spec.js.map +0 -1
- package/lib/queues/queue.spec.d.ts +0 -5
- package/lib/queues/queue.spec.js +0 -55
- package/lib/queues/queue.spec.js.map +0 -1
- package/lib/router.d.ts +0 -172
- package/lib/router.js +0 -419
- package/lib/router.js.map +0 -1
- package/lib/router.spec.d.ts +0 -1
- package/lib/router.spec.js +0 -229
- package/lib/router.spec.js.map +0 -1
- package/lib/services/asyncevents.d.ts +0 -151
- package/lib/services/asyncevents.js +0 -217
- package/lib/services/asyncevents.js.map +0 -1
- package/lib/services/asyncevents.spec.d.ts +0 -1
- package/lib/services/asyncevents.spec.js +0 -118
- package/lib/services/asyncevents.spec.js.map +0 -1
- package/lib/services/authentication.js +0 -772
- package/lib/services/authentication.js.map +0 -1
- package/lib/services/authentication.spec.d.ts +0 -1
- package/lib/services/authentication.spec.js +0 -458
- package/lib/services/authentication.spec.js.map +0 -1
- package/lib/services/binary.d.ts +0 -549
- package/lib/services/binary.js +0 -986
- package/lib/services/binary.js.map +0 -1
- package/lib/services/binary.spec.d.ts +0 -44
- package/lib/services/binary.spec.js +0 -438
- package/lib/services/binary.spec.js.map +0 -1
- package/lib/services/cloudbinary.spec.d.ts +0 -13
- package/lib/services/cloudbinary.spec.js +0 -192
- package/lib/services/cloudbinary.spec.js.map +0 -1
- package/lib/services/configuration.js +0 -178
- package/lib/services/configuration.js.map +0 -1
- package/lib/services/configuration.spec.d.ts +0 -1
- package/lib/services/configuration.spec.js +0 -87
- package/lib/services/configuration.spec.js.map +0 -1
- package/lib/services/cron.d.ts +0 -73
- package/lib/services/cron.js +0 -141
- package/lib/services/cron.js.map +0 -1
- package/lib/services/cron.spec.d.ts +0 -1
- package/lib/services/cron.spec.js +0 -76
- package/lib/services/cron.spec.js.map +0 -1
- package/lib/services/cryptoservice.js +0 -434
- package/lib/services/cryptoservice.js.map +0 -1
- package/lib/services/cryptoservice.spec.d.ts +0 -1
- package/lib/services/cryptoservice.spec.js +0 -177
- package/lib/services/cryptoservice.spec.js.map +0 -1
- package/lib/services/debugmailer.d.ts +0 -36
- package/lib/services/debugmailer.js +0 -52
- package/lib/services/debugmailer.js.map +0 -1
- package/lib/services/debugmailer.spec.d.ts +0 -1
- package/lib/services/debugmailer.spec.js +0 -29
- package/lib/services/debugmailer.spec.js.map +0 -1
- package/lib/services/domainservice.d.ts +0 -152
- package/lib/services/domainservice.js +0 -881
- package/lib/services/domainservice.js.map +0 -1
- package/lib/services/domainservice.spec.d.ts +0 -1
- package/lib/services/domainservice.spec.js +0 -401
- package/lib/services/domainservice.spec.js.map +0 -1
- package/lib/services/filebinary.d.ts +0 -133
- package/lib/services/filebinary.js +0 -371
- package/lib/services/filebinary.js.map +0 -1
- package/lib/services/filebinary.spec.d.ts +0 -21
- package/lib/services/filebinary.spec.js +0 -415
- package/lib/services/filebinary.spec.js.map +0 -1
- package/lib/services/fileconfiguration.d.ts +0 -22
- package/lib/services/fileconfiguration.js +0 -48
- package/lib/services/fileconfiguration.js.map +0 -1
- package/lib/services/fileconfiguration.spec.d.ts +0 -1
- package/lib/services/fileconfiguration.spec.js +0 -177
- package/lib/services/fileconfiguration.spec.js.map +0 -1
- package/lib/services/invitationservice.d.ts +0 -222
- package/lib/services/invitationservice.js +0 -526
- package/lib/services/invitationservice.js.map +0 -1
- package/lib/services/invitationservice.spec.d.ts +0 -1
- package/lib/services/invitationservice.spec.js +0 -516
- package/lib/services/invitationservice.spec.js.map +0 -1
- package/lib/services/kubernetesconfiguration.d.ts +0 -26
- package/lib/services/kubernetesconfiguration.js +0 -54
- package/lib/services/kubernetesconfiguration.js.map +0 -1
- package/lib/services/kubernetesconfiguration.spec.d.ts +0 -1
- package/lib/services/kubernetesconfiguration.spec.js +0 -147
- package/lib/services/kubernetesconfiguration.spec.js.map +0 -1
- package/lib/services/mailer.d.ts +0 -165
- package/lib/services/mailer.js +0 -176
- package/lib/services/mailer.js.map +0 -1
- package/lib/services/mailer.spec.d.ts +0 -1
- package/lib/services/mailer.spec.js +0 -144
- package/lib/services/mailer.spec.js.map +0 -1
- package/lib/services/notificationservice.js.map +0 -1
- package/lib/services/notificationservice.spec.d.ts +0 -1
- package/lib/services/notificationservice.spec.js +0 -78
- package/lib/services/notificationservice.spec.js.map +0 -1
- package/lib/services/oauth.spec.d.ts +0 -1
- package/lib/services/oauth.spec.js +0 -184
- package/lib/services/oauth.spec.js.map +0 -1
- package/lib/services/prometheus.js +0 -160
- package/lib/services/prometheus.js.map +0 -1
- package/lib/services/prometheus.spec.d.ts +0 -1
- package/lib/services/prometheus.spec.js +0 -57
- package/lib/services/prometheus.spec.js.map +0 -1
- package/lib/services/resource.d.ts +0 -87
- package/lib/services/resource.js +0 -156
- package/lib/services/resource.js.map +0 -1
- package/lib/services/resource.spec.d.ts +0 -1
- package/lib/services/resource.spec.js +0 -122
- package/lib/services/resource.spec.js.map +0 -1
- package/lib/services/service.spec.d.ts +0 -1
- package/lib/services/service.spec.js +0 -268
- package/lib/services/service.spec.js.map +0 -1
- package/lib/stores/aggregator.d.ts +0 -41
- package/lib/stores/aggregator.js +0 -80
- package/lib/stores/aggregator.js.map +0 -1
- package/lib/stores/aliasstore.d.ts +0 -108
- package/lib/stores/aliasstore.js +0 -168
- package/lib/stores/aliasstore.js.map +0 -1
- package/lib/stores/aliasstore.spec.d.ts +0 -11
- package/lib/stores/aliasstore.spec.js +0 -89
- package/lib/stores/aliasstore.spec.js.map +0 -1
- package/lib/stores/file.d.ts +0 -107
- package/lib/stores/file.js +0 -188
- package/lib/stores/file.js.map +0 -1
- package/lib/stores/file.spec.d.ts +0 -19
- package/lib/stores/file.spec.js +0 -232
- package/lib/stores/file.spec.js.map +0 -1
- package/lib/stores/mapper.d.ts +0 -149
- package/lib/stores/mapper.js +0 -293
- package/lib/stores/mapper.js.map +0 -1
- package/lib/stores/mapper.spec.d.ts +0 -1
- package/lib/stores/mapper.spec.js +0 -160
- package/lib/stores/mapper.spec.js.map +0 -1
- package/lib/stores/memory.d.ts +0 -151
- package/lib/stores/memory.js +0 -371
- package/lib/stores/memory.js.map +0 -1
- package/lib/stores/memory.spec.d.ts +0 -20
- package/lib/stores/memory.spec.js +0 -328
- package/lib/stores/memory.spec.js.map +0 -1
- package/lib/stores/modelmapper.d.ts +0 -61
- package/lib/stores/modelmapper.js +0 -199
- package/lib/stores/modelmapper.js.map +0 -1
- package/lib/stores/store.spec.d.ts +0 -65
- package/lib/stores/store.spec.js +0 -906
- package/lib/stores/store.spec.js.map +0 -1
- package/lib/test.d.ts +0 -162
- package/lib/test.js +0 -399
- package/lib/test.js.map +0 -1
- package/lib/unpackedapplication.d.ts +0 -76
- package/lib/unpackedapplication.js +0 -299
- package/lib/unpackedapplication.js.map +0 -1
- package/lib/utils/abstractdeployer.spec.d.ts +0 -1
- package/lib/utils/abstractdeployer.spec.js +0 -21
- package/lib/utils/abstractdeployer.spec.js.map +0 -1
- package/lib/utils/case.d.ts +0 -7
- package/lib/utils/case.js +0 -43
- package/lib/utils/case.js.map +0 -1
- package/lib/utils/case.spec.d.ts +0 -1
- package/lib/utils/case.spec.js +0 -50
- package/lib/utils/case.spec.js.map +0 -1
- package/lib/utils/context.d.ts +0 -462
- package/lib/utils/context.js +0 -732
- package/lib/utils/context.js.map +0 -1
- package/lib/utils/context.spec.d.ts +0 -9
- package/lib/utils/context.spec.js +0 -372
- package/lib/utils/context.spec.js.map +0 -1
- package/lib/utils/cookie.js.map +0 -1
- package/lib/utils/cookie.spec.d.ts +0 -1
- package/lib/utils/cookie.spec.js +0 -78
- package/lib/utils/cookie.spec.js.map +0 -1
- package/lib/utils/esm.d.ts +0 -13
- package/lib/utils/esm.js +0 -19
- package/lib/utils/esm.js.map +0 -1
- package/lib/utils/httpcontext.js.map +0 -1
- package/lib/utils/httpcontext.spec.d.ts +0 -4
- package/lib/utils/httpcontext.spec.js +0 -77
- package/lib/utils/httpcontext.spec.js.map +0 -1
- package/lib/utils/logger.d.ts +0 -91
- package/lib/utils/logger.js +0 -121
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/logger.spec.d.ts +0 -1
- package/lib/utils/logger.spec.js +0 -48
- package/lib/utils/logger.spec.js.map +0 -1
- package/lib/utils/serializers.d.ts +0 -161
- package/lib/utils/serializers.js +0 -420
- package/lib/utils/serializers.js.map +0 -1
- package/lib/utils/serializers.spec.d.ts +0 -1
- package/lib/utils/serializers.spec.js +0 -313
- package/lib/utils/serializers.spec.js.map +0 -1
- package/lib/utils/session.d.ts +0 -126
- package/lib/utils/session.js +0 -166
- package/lib/utils/session.js.map +0 -1
- package/lib/utils/session.spec.d.ts +0 -1
- package/lib/utils/session.spec.js +0 -71
- package/lib/utils/session.spec.js.map +0 -1
- package/lib/utils/throttler.d.ts +0 -102
- package/lib/utils/throttler.js +0 -168
- package/lib/utils/throttler.js.map +0 -1
- package/lib/utils/throttler.spec.d.ts +0 -1
- package/lib/utils/throttler.spec.js +0 -55
- package/lib/utils/throttler.spec.js.map +0 -1
- package/lib/utils/waiter.d.ts +0 -93
- package/lib/utils/waiter.js +0 -148
- package/lib/utils/waiter.js.map +0 -1
- package/lib/utils/waiter.spec.d.ts +0 -1
- package/lib/utils/waiter.spec.js +0 -98
- package/lib/utils/waiter.spec.js.map +0 -1
- package/test/config-file-missing-file-no-default.json +0 -44
- package/test/config-file-missing-file.json +0 -55
- package/test/config-file-no-reload.json +0 -69
- package/test/config-file-reload.json +0 -68
- package/test/config-invitation.json +0 -63
- package/test/config-kube-reload.json +0 -68
- package/test/config-reload.json +0 -66
- package/test/config.old.json +0 -152
- package/test/jsonutils/mdocs.yaml +0 -56
- package/test/jsonutils/test.json +0 -3
- package/test/jsonutils/test.yml +0 -5
- package/test/moddas/annotatedservice.js +0 -23
- package/test/moddas/debugmailer.js +0 -13
- package/test/moddas/fakeservice.js +0 -4
- package/test/moddas/voidstore.js +0 -66
- package/test/models/ident.js +0 -36
- package/test/models/task.js +0 -42
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { createCipheriv, createDecipheriv, createHash, createHmac, generateKeyPairSync, randomBytes } from "crypto";
|
|
36
|
+
import jwt from "jsonwebtoken";
|
|
37
|
+
import { pem2jwk } from "pem-jwk";
|
|
38
|
+
import * as util from "util";
|
|
39
|
+
import { JSONUtils } from "@webda/utils";
|
|
40
|
+
import { getMachineId, useCore, useService } from "../core/hooks.js";
|
|
41
|
+
import { useLog } from "../loggers/hooks.js";
|
|
42
|
+
import { Service } from "./service.js";
|
|
43
|
+
import { Route } from "../rest/irest.js";
|
|
44
|
+
import { useRegistry } from "../models/registry.model.js";
|
|
45
|
+
/** Wraps a secret string value, masking it in logs and inspect output */
|
|
46
|
+
export class SecretString {
|
|
47
|
+
str;
|
|
48
|
+
encrypter;
|
|
49
|
+
/** Create a new SecretString
|
|
50
|
+
* @param str - the secret value
|
|
51
|
+
* @param encrypter - the encrypter service name
|
|
52
|
+
*/
|
|
53
|
+
constructor(str, encrypter) {
|
|
54
|
+
this.str = str;
|
|
55
|
+
this.encrypter = encrypter;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Extract the plain string value, warning if the string is not encrypted
|
|
59
|
+
* @param value - the value to set
|
|
60
|
+
* @param path - the path
|
|
61
|
+
* @returns the result string
|
|
62
|
+
*/
|
|
63
|
+
static from(value, path) {
|
|
64
|
+
if (value instanceof SecretString) {
|
|
65
|
+
return value.getValue();
|
|
66
|
+
}
|
|
67
|
+
useLog("WARN", "A secret string is not encrypted", value);
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the underlying secret value
|
|
72
|
+
* @returns the result string
|
|
73
|
+
*/
|
|
74
|
+
getValue() {
|
|
75
|
+
return this.str;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Return a masked representation to prevent secret leakage
|
|
79
|
+
* @returns the result string
|
|
80
|
+
*/
|
|
81
|
+
toString() {
|
|
82
|
+
return "********";
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Custom inspect handler to mask the secret in Node.js util.inspect
|
|
86
|
+
* @param depth - the depth level
|
|
87
|
+
* @param options - the options
|
|
88
|
+
* @param inspect - the inspect function
|
|
89
|
+
* @returns the result
|
|
90
|
+
*/
|
|
91
|
+
[util.inspect.custom](depth, options, inspect) {
|
|
92
|
+
return "********";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @WebdaModda
|
|
97
|
+
*/
|
|
98
|
+
let CryptoService = (() => {
|
|
99
|
+
let _classSuper = Service;
|
|
100
|
+
let _instanceExtraInitializers = [];
|
|
101
|
+
let _serveJWKS_decorators;
|
|
102
|
+
return class CryptoService extends _classSuper {
|
|
103
|
+
static {
|
|
104
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
105
|
+
_serveJWKS_decorators = [Route(".", ["GET"], {
|
|
106
|
+
description: "Serve JWKS keys",
|
|
107
|
+
get: {
|
|
108
|
+
operationId: "getJWKS"
|
|
109
|
+
}
|
|
110
|
+
})];
|
|
111
|
+
__esDecorate(this, null, _serveJWKS_decorators, { kind: "method", name: "serveJWKS", static: false, private: false, access: { has: obj => "serveJWKS" in obj, get: obj => obj.serveJWKS }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
112
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
113
|
+
}
|
|
114
|
+
static encrypters = {};
|
|
115
|
+
/**
|
|
116
|
+
* Register an encrypter for configuration
|
|
117
|
+
* @param name - the name to use
|
|
118
|
+
* @param encrypter - the encrypter implementation
|
|
119
|
+
* @param encrypter.encrypt - the encrypter.encrypt
|
|
120
|
+
* @param encrypter.decrypt - the encrypter.decrypt
|
|
121
|
+
*/
|
|
122
|
+
static registerEncrypter(name, encrypter) {
|
|
123
|
+
if (CryptoService.encrypters[name]) {
|
|
124
|
+
console.error("Encrypter", name, "already registered");
|
|
125
|
+
}
|
|
126
|
+
CryptoService.encrypters[name] = encrypter;
|
|
127
|
+
}
|
|
128
|
+
currentSymetricKey = __runInitializers(this, _instanceExtraInitializers);
|
|
129
|
+
currentAsymetricKey;
|
|
130
|
+
current;
|
|
131
|
+
age;
|
|
132
|
+
keys;
|
|
133
|
+
/**
|
|
134
|
+
* JWKS cache
|
|
135
|
+
*/
|
|
136
|
+
jwks = {};
|
|
137
|
+
/**
|
|
138
|
+
* @override
|
|
139
|
+
*/
|
|
140
|
+
async init() {
|
|
141
|
+
await super.init();
|
|
142
|
+
CryptoService.encrypters["self"] = this;
|
|
143
|
+
// Load keys
|
|
144
|
+
if (this.parameters.autoCreate && !(await this.load())) {
|
|
145
|
+
await this.rotate();
|
|
146
|
+
}
|
|
147
|
+
return this;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
*
|
|
151
|
+
* @param context - the execution context
|
|
152
|
+
*/
|
|
153
|
+
async serveJWKS(context) {
|
|
154
|
+
context.write({
|
|
155
|
+
keys: Object.keys(this.keys).map(k => {
|
|
156
|
+
if (!this.jwks[k]) {
|
|
157
|
+
/*
|
|
158
|
+
when Node >= 16
|
|
159
|
+
this.jwks[k] = createPublicKey(this.keys[k].publicKey).export({ format: "jwk" });
|
|
160
|
+
and remove pem-jwk
|
|
161
|
+
*/
|
|
162
|
+
this.jwks[k] = pem2jwk(this.keys[k].publicKey);
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
kty: "RSA",
|
|
166
|
+
kid: k,
|
|
167
|
+
n: this.jwks[k].n,
|
|
168
|
+
e: this.jwks[k].e
|
|
169
|
+
};
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Load keys from registry
|
|
175
|
+
* @returns true if the condition is met
|
|
176
|
+
*/
|
|
177
|
+
async load() {
|
|
178
|
+
let load;
|
|
179
|
+
try {
|
|
180
|
+
load = await useRegistry().get("keys");
|
|
181
|
+
}
|
|
182
|
+
catch (err) { }
|
|
183
|
+
if (!load || !load.current) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
this.keys = {};
|
|
187
|
+
Object.keys(load)
|
|
188
|
+
.filter(k => k.startsWith("key_"))
|
|
189
|
+
.forEach(k => {
|
|
190
|
+
this.keys[k.substring(4)] = load[k];
|
|
191
|
+
});
|
|
192
|
+
this.current = load.current.startsWith("init-") ? undefined : load.current;
|
|
193
|
+
this.age = parseInt(this.current, 36);
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Generate asymetric key
|
|
198
|
+
* @returns the result
|
|
199
|
+
*/
|
|
200
|
+
generateAsymetricKeys() {
|
|
201
|
+
const { publicKey, privateKey } = generateKeyPairSync(
|
|
202
|
+
// @ts-ignore
|
|
203
|
+
this.parameters.asymetricType, this.parameters.asymetricOptions);
|
|
204
|
+
return { publicKey: publicKey, privateKey: privateKey };
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Generate symetric key
|
|
208
|
+
* @returns the result string
|
|
209
|
+
*/
|
|
210
|
+
generateSymetricKey() {
|
|
211
|
+
return randomBytes(this.parameters.symetricKeyLength / 8).toString("base64");
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Return current key set
|
|
215
|
+
* @returns the result
|
|
216
|
+
*/
|
|
217
|
+
async getCurrentKeys() {
|
|
218
|
+
if (!this.keys || !this.current || !this.keys[this.current]) {
|
|
219
|
+
let msg = "";
|
|
220
|
+
if (!this.keys) {
|
|
221
|
+
msg = ": No keys";
|
|
222
|
+
}
|
|
223
|
+
else if (!this.current) {
|
|
224
|
+
msg = ": No current key";
|
|
225
|
+
}
|
|
226
|
+
else if (!this.keys[this.current]) {
|
|
227
|
+
msg = ": Current key does not match";
|
|
228
|
+
msg += " (current=" + this.current + ", keys=[" + Object.keys(this.keys).join(",") + "])";
|
|
229
|
+
}
|
|
230
|
+
throw new Error("CryptoService not initialized" + msg);
|
|
231
|
+
}
|
|
232
|
+
return { keys: this.keys[this.current], id: this.current };
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Retrieve a HMAC for a string
|
|
236
|
+
* @param data - the data to process
|
|
237
|
+
* @param keyId to use
|
|
238
|
+
* @returns the result string
|
|
239
|
+
*/
|
|
240
|
+
async hmac(data, keyId) {
|
|
241
|
+
if (typeof data !== "string") {
|
|
242
|
+
data = JSONUtils.stringify(data);
|
|
243
|
+
}
|
|
244
|
+
const key = keyId ? { id: keyId, keys: this.keys[keyId] } : await this.getCurrentKeys();
|
|
245
|
+
return key.id + "." + createHmac("sha256", key.keys.symetric).update(data).digest("hex");
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Verify a HMAC for a string
|
|
249
|
+
* @param data - the data to process
|
|
250
|
+
* @param hmac - the HMAC instance
|
|
251
|
+
* @returns true if the condition is met
|
|
252
|
+
*/
|
|
253
|
+
async hmacVerify(data, hmac) {
|
|
254
|
+
if (typeof data !== "string") {
|
|
255
|
+
data = JSONUtils.stringify(data);
|
|
256
|
+
}
|
|
257
|
+
const [keyId, mac] = hmac.split(".");
|
|
258
|
+
if (!(await this.checkKey(keyId))) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
return createHmac("sha256", this.keys[keyId].symetric).update(data).digest("hex") === mac;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* JWT token generation
|
|
265
|
+
* @param data - the data to process
|
|
266
|
+
* @param options - the options
|
|
267
|
+
* @returns the result string
|
|
268
|
+
*/
|
|
269
|
+
async jwtSign(data, options) {
|
|
270
|
+
const res = { ...this.parameters.jwt, ...options };
|
|
271
|
+
let key = res.secretOrPublicKey;
|
|
272
|
+
// Default to our current private key
|
|
273
|
+
if (!res.secretOrPublicKey) {
|
|
274
|
+
const keyInfo = await this.getCurrentKeys();
|
|
275
|
+
// Depending on the algo fallback to the right key
|
|
276
|
+
if (res.algorithm.startsWith("HS")) {
|
|
277
|
+
key = keyInfo.keys.symetric;
|
|
278
|
+
res.keyid = "S" + keyInfo.id;
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
key = keyInfo.keys.privateKey;
|
|
282
|
+
res.keyid = "A" + keyInfo.id;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
delete res.secretOrPublicKey;
|
|
286
|
+
return jwt.sign(data, key, res);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
*
|
|
290
|
+
* @param keyId - the key identifier
|
|
291
|
+
* @returns true if the condition is met
|
|
292
|
+
*/
|
|
293
|
+
async checkKey(keyId) {
|
|
294
|
+
if (!this.keys[keyId]) {
|
|
295
|
+
// Key is more recent than current one so try to reload
|
|
296
|
+
if (parseInt(keyId, 36) > this.age) {
|
|
297
|
+
await this.load();
|
|
298
|
+
}
|
|
299
|
+
// Key is still not found
|
|
300
|
+
if (!this.keys[keyId]) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Get JWT key based on kid
|
|
308
|
+
* @param header - the JWT header
|
|
309
|
+
* @param callback - the callback function
|
|
310
|
+
*/
|
|
311
|
+
async getJWTKey(header, callback) {
|
|
312
|
+
if (!header.kid) {
|
|
313
|
+
callback(new Error("Unknown key"));
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const keyId = header.kid.substring(1);
|
|
317
|
+
if (!(await this.checkKey(keyId))) {
|
|
318
|
+
callback(new Error("Unknown key"));
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
// Check first letter that define Symetric or Asymetric
|
|
322
|
+
if (header.kid.startsWith("S")) {
|
|
323
|
+
callback(null, this.keys[keyId].symetric);
|
|
324
|
+
}
|
|
325
|
+
else if (header.kid.startsWith("A")) {
|
|
326
|
+
callback(null, this.keys[keyId].publicKey);
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
callback(new Error("Unknown key"));
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* JWT token verification
|
|
334
|
+
* @param token - the token
|
|
335
|
+
* @param options - the options
|
|
336
|
+
* @returns the result
|
|
337
|
+
*/
|
|
338
|
+
async jwtVerify(token, options) {
|
|
339
|
+
return new Promise((resolve, reject) => {
|
|
340
|
+
jwt.verify(token, options?.secretOrPublicKey || this.getJWTKey.bind(this), {
|
|
341
|
+
...options,
|
|
342
|
+
secretOrPublicKey: undefined
|
|
343
|
+
}, (err, result) => {
|
|
344
|
+
if (err) {
|
|
345
|
+
reject(err);
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
resolve(result);
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Encrypt data
|
|
355
|
+
* @param data - the data to process
|
|
356
|
+
* @returns the result string
|
|
357
|
+
*/
|
|
358
|
+
async encrypt(data) {
|
|
359
|
+
const key = await this.getCurrentKeys();
|
|
360
|
+
// Initialization Vector
|
|
361
|
+
const iv = randomBytes(16);
|
|
362
|
+
const symKey = new Uint8Array(Buffer.from(key.keys.symetric, "base64"));
|
|
363
|
+
const cipher = createCipheriv(this.parameters.symetricCipher, symKey, new Uint8Array(iv));
|
|
364
|
+
const updated = cipher.update(new Uint8Array(Buffer.from(JSON.stringify(data))));
|
|
365
|
+
const final = cipher.final();
|
|
366
|
+
const encrypted = Buffer.concat([new Uint8Array(iv), new Uint8Array(updated), new Uint8Array(final)]).toString("base64");
|
|
367
|
+
return this.jwtSign(encrypted, {
|
|
368
|
+
keyid: `S${key.id}`,
|
|
369
|
+
secretOrPublicKey: key.keys.symetric
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Parse the JWT header section
|
|
374
|
+
* @param token - the token
|
|
375
|
+
* @returns the result
|
|
376
|
+
*/
|
|
377
|
+
getJWTHeader(token) {
|
|
378
|
+
return JSON.parse(Buffer.from(token.split(".")[0], "base64").toString());
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Encrypt configuration
|
|
382
|
+
* @param data - the data to process
|
|
383
|
+
* @returns the result
|
|
384
|
+
*/
|
|
385
|
+
static async encryptConfiguration(data) {
|
|
386
|
+
if (data instanceof Object) {
|
|
387
|
+
for (const i in data) {
|
|
388
|
+
data[i] = await CryptoService.encryptConfiguration(data[i]);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
else if (typeof data === "string") {
|
|
392
|
+
if (data.startsWith("encrypt:") || data.startsWith("sencrypt:")) {
|
|
393
|
+
let str = data.substring(data.indexOf(":") + 1);
|
|
394
|
+
const type = str.substring(0, str.indexOf(":"));
|
|
395
|
+
str = str.substring(str.indexOf(":") + 1);
|
|
396
|
+
if (!CryptoService.encrypters[type]) {
|
|
397
|
+
throw new Error("Unknown encrypter " + type);
|
|
398
|
+
}
|
|
399
|
+
if (data.startsWith("s")) {
|
|
400
|
+
data = `scrypt:${type}:` + (await CryptoService.encrypters[type].encrypt(str));
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
data = `crypt:${type}:` + (await CryptoService.encrypters[type].encrypt(str));
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return data;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
*
|
|
411
|
+
* @param data - the data to process
|
|
412
|
+
* @returns the result
|
|
413
|
+
*/
|
|
414
|
+
static async decryptConfiguration(data) {
|
|
415
|
+
if (data instanceof Object) {
|
|
416
|
+
for (const i in data) {
|
|
417
|
+
data[i] = await CryptoService.decryptConfiguration(data[i]);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
else if (typeof data === "string") {
|
|
421
|
+
if (data.startsWith("crypt:") || data.startsWith("scrypt:")) {
|
|
422
|
+
let str = data.substring(data.indexOf(":") + 1);
|
|
423
|
+
const type = str.substring(0, str.indexOf(":"));
|
|
424
|
+
str = str.substring(str.indexOf(":") + 1);
|
|
425
|
+
if (!CryptoService.encrypters[type]) {
|
|
426
|
+
throw new Error("Unknown encrypter " + type);
|
|
427
|
+
}
|
|
428
|
+
// We keep the ability to map to a simple string for incompatible module
|
|
429
|
+
if (data.startsWith("scrypt:")) {
|
|
430
|
+
return await CryptoService.encrypters[type].decrypt(str);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
return new SecretString(await CryptoService.encrypters[type].decrypt(str), type);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return data;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Decrypt data
|
|
441
|
+
* @param token - the token
|
|
442
|
+
* @returns the result
|
|
443
|
+
*/
|
|
444
|
+
async decrypt(token) {
|
|
445
|
+
const input = Buffer.from(await this.jwtVerify(token), "base64");
|
|
446
|
+
const header = this.getJWTHeader(token);
|
|
447
|
+
const iv = input.subarray(0, 16);
|
|
448
|
+
const decipher = createDecipheriv(this.parameters.symetricCipher, new Uint8Array(Buffer.from(this.keys[header.kid.substring(1)].symetric, "base64")), new Uint8Array(iv));
|
|
449
|
+
return JSON.parse(decipher.update(new Uint8Array(input.subarray(16))).toString() + decipher.final().toString());
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Get next id
|
|
453
|
+
* @returns the result
|
|
454
|
+
*/
|
|
455
|
+
getNextId() {
|
|
456
|
+
// Should be good for years as 8char
|
|
457
|
+
const age = Math.floor(Date.now() / 1000);
|
|
458
|
+
return { age, id: age.toString(36) };
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Rotate keys
|
|
462
|
+
*/
|
|
463
|
+
async rotate() {
|
|
464
|
+
const { age, id } = this.getNextId();
|
|
465
|
+
const registry = useRegistry();
|
|
466
|
+
const next = {
|
|
467
|
+
current: id,
|
|
468
|
+
rotationInstance: useCore().getInstanceId()
|
|
469
|
+
};
|
|
470
|
+
next[`key_${id}`] = {
|
|
471
|
+
...this.generateAsymetricKeys(),
|
|
472
|
+
symetric: this.generateSymetricKey()
|
|
473
|
+
};
|
|
474
|
+
if (!(await registry.exists("keys"))) {
|
|
475
|
+
this.current = `init-${useCore().getInstanceId()}`;
|
|
476
|
+
await registry.put("keys", { current: this.current });
|
|
477
|
+
}
|
|
478
|
+
try {
|
|
479
|
+
await registry.patch("keys", next, "current", this.current);
|
|
480
|
+
this.keys ??= {};
|
|
481
|
+
this.keys[id] = next[`key_${id}`];
|
|
482
|
+
this.current = id;
|
|
483
|
+
this.age = age;
|
|
484
|
+
}
|
|
485
|
+
catch (err) {
|
|
486
|
+
useLog("TRACE", "Failed to rotate keys", err);
|
|
487
|
+
// Reload as something else has modified
|
|
488
|
+
await this.load();
|
|
489
|
+
await this.getCurrentKeys();
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
})();
|
|
494
|
+
export { CryptoService };
|
|
495
|
+
/**
|
|
496
|
+
* Encrypt data with local machine id
|
|
497
|
+
*/
|
|
498
|
+
CryptoService.registerEncrypter("local", {
|
|
499
|
+
encrypt: async (data) => {
|
|
500
|
+
// Initialization Vector
|
|
501
|
+
const iv = randomBytes(16);
|
|
502
|
+
const key = createHash("sha256").update(getMachineId()).digest();
|
|
503
|
+
const cipher = createCipheriv("aes-256-ctr", new Uint8Array(key), new Uint8Array(iv));
|
|
504
|
+
const updated = cipher.update(new Uint8Array(Buffer.from(data)));
|
|
505
|
+
const final = cipher.final();
|
|
506
|
+
return Buffer.concat([new Uint8Array(iv), new Uint8Array(updated), new Uint8Array(final)]).toString("base64");
|
|
507
|
+
},
|
|
508
|
+
decrypt: async (data) => {
|
|
509
|
+
const input = Buffer.from(data, "base64");
|
|
510
|
+
const iv = input.subarray(0, 16);
|
|
511
|
+
const key = createHash("sha256").update(getMachineId()).digest();
|
|
512
|
+
const decipher = createDecipheriv("aes-256-ctr", new Uint8Array(key), new Uint8Array(iv));
|
|
513
|
+
return decipher.update(new Uint8Array(input.subarray(16))).toString() + decipher.final().toString();
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
export default CryptoService;
|
|
517
|
+
/**
|
|
518
|
+
* Return the CryptoService
|
|
519
|
+
*
|
|
520
|
+
* As it is a service, it can be used with the useService hook
|
|
521
|
+
*
|
|
522
|
+
* @returns the result
|
|
523
|
+
*/
|
|
524
|
+
export function useCrypto() {
|
|
525
|
+
return useService("CryptoService");
|
|
526
|
+
}
|
|
527
|
+
//# sourceMappingURL=cryptoservice.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cryptoservice.service.js","sourceRoot":"","sources":["../../src/services/cryptoservice.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACpH,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU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ACjC,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACjE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,aAAa,EAAE,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1F,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;IACtG,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AbstractMailer } from "./mailer.service.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fake Service to help debug mail expedition
|
|
4
|
+
* @WebdaModda
|
|
5
|
+
*/
|
|
6
|
+
export declare class DebugMailer extends AbstractMailer {
|
|
7
|
+
sent: any[];
|
|
8
|
+
/**
|
|
9
|
+
* Create the default configuration
|
|
10
|
+
* @param params - the service parameters
|
|
11
|
+
* @returns the result
|
|
12
|
+
*/
|
|
13
|
+
static createConfiguration(params: any): any;
|
|
14
|
+
/**
|
|
15
|
+
* Return parameters unchanged
|
|
16
|
+
* @param params - the service parameters
|
|
17
|
+
* @returns the result
|
|
18
|
+
*/
|
|
19
|
+
static filterParameters(params: any): any;
|
|
20
|
+
/**
|
|
21
|
+
* Fakely send a message saving it to memory to test later on
|
|
22
|
+
*
|
|
23
|
+
* @param options - the options
|
|
24
|
+
* @param callback - the callback function
|
|
25
|
+
* @param _callback - the callback function
|
|
26
|
+
*/
|
|
27
|
+
send(options: any, _callback?: any): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Just send a new Error exception
|
|
30
|
+
*/
|
|
31
|
+
error(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Check if the email template exists
|
|
34
|
+
*
|
|
35
|
+
* @param name - the name to use
|
|
36
|
+
* @param _name - the name to use
|
|
37
|
+
* @returns true if the condition is met
|
|
38
|
+
*/
|
|
39
|
+
hasNotification(_name: string): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Just send a new Error exception as async
|
|
42
|
+
*/
|
|
43
|
+
errorAsync(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Empty async method
|
|
46
|
+
*/
|
|
47
|
+
async(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=debugmailer.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugmailer.service.d.ts","sourceRoot":"","sources":["../../src/services/debugmailer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;GAGG;AACH,qBAAa,WAAY,SAAQ,cAAc;IAC7C,IAAI,EAAE,GAAG,EAAE,CAAM;IAEjB;;;;OAIG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAE3C;IACD;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAExC;IACD;;;;;;OAMG;IACG,IAAI,CAAC,OAAO,KAAA,EAAE,SAAS,MAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxD;IAED;;OAEG;IACH,KAAK,SAEJ;IAED;;;;;;OAMG;IACG,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGrD;IAED;;OAEG;IACG,UAAU,kBAEf;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ServiceParameters } from "./serviceparameters.js";
|
|
2
|
+
import { AbstractMailer } from "./mailer.service.js";
|
|
3
|
+
/**
|
|
4
|
+
* Fake Service to help debug mail expedition
|
|
5
|
+
* @WebdaModda
|
|
6
|
+
*/
|
|
7
|
+
export class DebugMailer extends AbstractMailer {
|
|
8
|
+
sent = [];
|
|
9
|
+
/**
|
|
10
|
+
* Create the default configuration
|
|
11
|
+
* @param params - the service parameters
|
|
12
|
+
* @returns the result
|
|
13
|
+
*/
|
|
14
|
+
static createConfiguration(params) {
|
|
15
|
+
return new ServiceParameters().load(params);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Return parameters unchanged
|
|
19
|
+
* @param params - the service parameters
|
|
20
|
+
* @returns the result
|
|
21
|
+
*/
|
|
22
|
+
static filterParameters(params) {
|
|
23
|
+
return params;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fakely send a message saving it to memory to test later on
|
|
27
|
+
*
|
|
28
|
+
* @param options - the options
|
|
29
|
+
* @param callback - the callback function
|
|
30
|
+
* @param _callback - the callback function
|
|
31
|
+
*/
|
|
32
|
+
async send(options, _callback = undefined) {
|
|
33
|
+
this.log("DEBUG", "Send a fake email", options);
|
|
34
|
+
this.sent.push(options);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Just send a new Error exception
|
|
38
|
+
*/
|
|
39
|
+
error() {
|
|
40
|
+
throw new Error("FakeError");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if the email template exists
|
|
44
|
+
*
|
|
45
|
+
* @param name - the name to use
|
|
46
|
+
* @param _name - the name to use
|
|
47
|
+
* @returns true if the condition is met
|
|
48
|
+
*/
|
|
49
|
+
async hasNotification(_name) {
|
|
50
|
+
// Load template
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Just send a new Error exception as async
|
|
55
|
+
*/
|
|
56
|
+
async errorAsync() {
|
|
57
|
+
throw new Error("FakeError");
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Empty async method
|
|
61
|
+
*/
|
|
62
|
+
async async() {
|
|
63
|
+
// Empty on purpose
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=debugmailer.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugmailer.service.js","sourceRoot":"","sources":["../../src/services/debugmailer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,cAAc;IAC7C,IAAI,GAAU,EAAE,CAAC;IAEjB;;;;OAIG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAW;QACpC,OAAO,IAAI,iBAAiB,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IACD;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAW;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS;QACvC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK;QACH,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,eAAe,CAAC,KAAa;QACjC,gBAAgB;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,mBAAmB;IACrB,CAAC;CACF"}
|