@bitblit/ratchet-epsilon-common 4.0.99-alpha → 4.0.103-alpha
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/bin/cli.js +10 -0
- package/{dist/types → lib}/background/background-dynamo-log-table-handler.d.ts +3 -3
- package/{dist/es → lib}/background/background-dynamo-log-table-handler.js +6 -2
- package/{dist/types → lib}/background/background-execution-event.d.ts +1 -1
- package/{dist/types → lib}/background/background-execution-listener.d.ts +1 -1
- package/{dist/types → lib}/background/background-handler.d.ts +5 -9
- package/{dist/es → lib}/background/background-handler.js +15 -7
- package/{dist/types → lib}/background/background-http-adapter-handler.d.ts +7 -11
- package/{dist/es → lib}/background/background-http-adapter-handler.js +13 -8
- package/{dist/types → lib}/background/background-queue-response-internal.d.ts +1 -1
- package/{dist/types → lib}/background/background-validator.d.ts +5 -8
- package/{dist/es → lib}/background/background-validator.js +5 -3
- package/{dist/es → lib}/background/epsilon-background-process-error.js +6 -1
- package/{dist/types → lib}/background/internal-background-entry.d.ts +1 -1
- package/{dist/types → lib}/background/manager/abstract-background-manager.d.ts +3 -10
- package/{dist/es → lib}/background/manager/abstract-background-manager.js +5 -4
- package/{dist/types → lib}/background/manager/aws-sqs-sns-background-manager.d.ts +4 -11
- package/{dist/es → lib}/background/manager/aws-sqs-sns-background-manager.js +9 -5
- package/{dist/types → lib}/background/manager/background-manager-like.d.ts +2 -9
- package/lib/background/manager/background-manager.spec.js +73 -0
- package/{dist/types → lib}/background/manager/single-thread-local-background-manager.d.ts +3 -10
- package/{dist/es → lib}/background/manager/single-thread-local-background-manager.js +6 -6
- package/{dist/types → lib}/background/s3-background-transaction-logger.d.ts +2 -2
- package/{dist/es → lib}/background/s3-background-transaction-logger.js +6 -3
- package/{dist/types → lib}/build/ratchet-epsilon-common-info.d.ts +1 -1
- package/{dist/types → lib}/built-in/background/echo-processor.d.ts +2 -2
- package/{dist/es → lib}/built-in/background/echo-processor.js +4 -3
- package/{dist/types → lib}/built-in/background/log-and-enqueue-echo-processor.d.ts +2 -2
- package/{dist/es → lib}/built-in/background/log-and-enqueue-echo-processor.js +2 -2
- package/{dist/types → lib}/built-in/background/log-message-background-error-processor.d.ts +2 -2
- package/{dist/es → lib}/built-in/background/log-message-background-error-processor.js +1 -1
- package/{dist/types → lib}/built-in/background/no-op-processor.d.ts +2 -2
- package/{dist/es → lib}/built-in/background/no-op-processor.js +1 -1
- package/{dist/types → lib}/built-in/background/retry-processor.d.ts +2 -2
- package/{dist/es → lib}/built-in/background/retry-processor.js +8 -4
- package/{dist/types → lib}/built-in/background/sample-delay-processor.d.ts +2 -2
- package/{dist/es → lib}/built-in/background/sample-delay-processor.js +2 -1
- package/{dist/types → lib}/built-in/background/sample-input-validated-processor.d.ts +3 -3
- package/{dist/es → lib}/built-in/background/sample-input-validated-processor.js +1 -1
- package/{dist/es → lib}/built-in/built-in-trace-id-generators.js +2 -2
- package/{dist/types → lib}/built-in/daemon/daemon-authorizer-function.d.ts +2 -2
- package/{dist/types → lib}/built-in/daemon/daemon-config.d.ts +2 -2
- package/{dist/types → lib}/built-in/daemon/daemon-group-selection-function.d.ts +1 -1
- package/{dist/types → lib}/built-in/daemon/daemon-handler.d.ts +6 -12
- package/{dist/es → lib}/built-in/daemon/daemon-handler.js +9 -8
- package/lib/built-in/daemon/daemon-process-state-list.d.ts +5 -0
- package/{dist/types → lib}/built-in/http/apollo-filter.d.ts +2 -2
- package/{dist/es → lib}/built-in/http/apollo-filter.js +6 -5
- package/{dist/types → lib}/built-in/http/built-in-auth-filters.d.ts +3 -3
- package/{dist/es → lib}/built-in/http/built-in-auth-filters.js +5 -5
- package/{dist/types → lib}/built-in/http/built-in-authorizers.d.ts +2 -2
- package/{dist/es → lib}/built-in/http/built-in-authorizers.js +1 -1
- package/{dist/types → lib}/built-in/http/built-in-filters.d.ts +2 -2
- package/{dist/es → lib}/built-in/http/built-in-filters.js +9 -9
- package/{dist/types → lib}/built-in/http/built-in-handlers.d.ts +2 -2
- package/{dist/es → lib}/built-in/http/built-in-handlers.js +10 -10
- package/{dist/types → lib}/built-in/http/log-level-manipulation-filter.d.ts +1 -4
- package/{dist/es → lib}/built-in/http/log-level-manipulation-filter.js +2 -2
- package/{dist/types → lib}/built-in/http/run-handler-as-filter.d.ts +5 -5
- package/{dist/es → lib}/built-in/http/run-handler-as-filter.js +8 -8
- package/lib/built-in/http/run-handler-as-filter.spec.js +40 -0
- package/{dist/types → lib}/cli-bootstrap/ratchet-cli-handler.d.ts +2 -2
- package/{dist/es → lib}/cli-bootstrap/ratchet-cli-handler.js +6 -6
- package/lib/cli-bootstrap/run-background-process-from-command-line.d.ts +3 -0
- package/{dist/es → lib}/cli-bootstrap/run-background-process-from-command-line.js +2 -2
- package/{dist/types → lib}/config/background/background-config.d.ts +4 -4
- package/{dist/types → lib}/config/background/background-error-processor.d.ts +1 -1
- package/{dist/types → lib}/config/background/background-processor.d.ts +1 -1
- package/{dist/types → lib}/config/background/background-transaction-log.d.ts +1 -1
- package/{dist/types → lib}/config/background/background-transaction-logger.d.ts +1 -1
- package/lib/config/cron/cron-background-entry.d.ts +6 -0
- package/{dist/types → lib}/config/cron/cron-config.d.ts +1 -1
- package/{dist/types → lib}/config/dynamo-db-config.d.ts +1 -1
- package/{dist/types → lib}/config/epsilon-config.d.ts +8 -8
- package/{dist/types → lib}/config/epsilon-logger-config.d.ts +3 -2
- package/{dist/types → lib}/config/http/authorizer-function.d.ts +3 -3
- package/{dist/types → lib}/config/http/extended-api-gateway-event.d.ts +1 -1
- package/{dist/types → lib}/config/http/filter-chain-context.d.ts +4 -4
- package/{dist/types → lib}/config/http/filter-function.d.ts +1 -1
- package/{dist/types → lib}/config/http/handler-function.d.ts +1 -1
- package/{dist/types → lib}/config/http/http-config.d.ts +5 -5
- package/{dist/types → lib}/config/http/http-processing-config.d.ts +2 -2
- package/{dist/types → lib}/config/http/mapped-http-processing-config.d.ts +1 -1
- package/{dist/types → lib}/config/inter-api/inter-api-config.d.ts +2 -2
- package/lib/config/inter-api/inter-api-process-mapping.d.ts +6 -0
- package/{dist/types → lib}/config/open-api/open-api-document.d.ts +2 -2
- package/{dist/types → lib}/config/s3-config.d.ts +1 -1
- package/{dist/types → lib}/config/sns-config.d.ts +1 -1
- package/{dist/es → lib}/epsilon-build-properties.js +1 -1
- package/{dist/types → lib}/epsilon-constants.d.ts +1 -1
- package/{dist/es → lib}/epsilon-constants.js +14 -13
- package/{dist/types → lib}/epsilon-global-handler.d.ts +3 -6
- package/{dist/es → lib}/epsilon-global-handler.js +29 -24
- package/{dist/types → lib}/epsilon-instance.d.ts +6 -11
- package/lib/epsilon-logging-extension-processor.d.ts +6 -0
- package/{dist/es → lib}/epsilon-logging-extension-processor.js +1 -1
- package/{dist/types → lib}/http/auth/api-gateway-adapter-authentication-handler.d.ts +0 -10
- package/{dist/es → lib}/http/auth/api-gateway-adapter-authentication-handler.js +4 -3
- package/{dist/types → lib}/http/auth/auth0-web-token-manipulator.d.ts +2 -2
- package/{dist/es → lib}/http/auth/auth0-web-token-manipulator.js +6 -1
- package/{dist/types → lib}/http/auth/basic-auth-token.d.ts +0 -3
- package/{dist/types → lib}/http/auth/google-web-token-manipulator.d.ts +2 -2
- package/{dist/es → lib}/http/auth/google-web-token-manipulator.js +6 -3
- package/lib/http/auth/google-web-token-manipulator.spec.js +10 -0
- package/{dist/types → lib}/http/auth/jwt-ratchet-local-web-token-manipulator.d.ts +3 -5
- package/{dist/es → lib}/http/auth/jwt-ratchet-local-web-token-manipulator.js +5 -3
- package/{dist/types → lib}/http/auth/local-web-token-manipulator.d.ts +4 -5
- package/{dist/es → lib}/http/auth/local-web-token-manipulator.js +9 -5
- package/lib/http/auth/local-web-token-manipulator.spec.js +24 -0
- package/{dist/types → lib}/http/auth/web-token-manipulator.d.ts +1 -4
- package/{dist/types → lib}/http/error/bad-gateway.d.ts +1 -1
- package/{dist/es → lib}/http/error/bad-gateway.js +2 -2
- package/{dist/types → lib}/http/error/bad-request-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/bad-request-error.js +2 -2
- package/{dist/types → lib}/http/error/conflict-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/conflict-error.js +2 -2
- package/{dist/es → lib}/http/error/epsilon-http-error.js +9 -3
- package/lib/http/error/epsilon-http-error.spec.js +11 -0
- package/{dist/types → lib}/http/error/forbidden-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/forbidden-error.js +2 -2
- package/{dist/types → lib}/http/error/gateway-timeout.d.ts +1 -1
- package/{dist/es → lib}/http/error/gateway-timeout.js +2 -2
- package/{dist/types → lib}/http/error/method-not-allowed-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/method-not-allowed-error.js +2 -2
- package/{dist/types → lib}/http/error/misconfigured-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/misconfigured-error.js +2 -2
- package/{dist/types → lib}/http/error/not-found-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/not-found-error.js +2 -2
- package/{dist/types → lib}/http/error/not-implemented.d.ts +1 -1
- package/{dist/es → lib}/http/error/not-implemented.js +2 -2
- package/{dist/types → lib}/http/error/request-timeout-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/request-timeout-error.js +2 -2
- package/{dist/types → lib}/http/error/service-unavailable.d.ts +1 -1
- package/{dist/es → lib}/http/error/service-unavailable.js +2 -2
- package/{dist/types → lib}/http/error/too-many-requests-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/too-many-requests-error.js +2 -2
- package/{dist/types → lib}/http/error/unauthorized-error.d.ts +1 -1
- package/{dist/es → lib}/http/error/unauthorized-error.js +2 -2
- package/{dist/types → lib}/http/event-util.d.ts +3 -25
- package/{dist/es → lib}/http/event-util.js +9 -8
- package/lib/http/event-util.spec.js +157 -0
- package/{dist/types → lib}/http/response-util.d.ts +2 -2
- package/{dist/es → lib}/http/response-util.js +2 -2
- package/lib/http/response-util.spec.d.ts +1 -0
- package/lib/http/response-util.spec.js +88 -0
- package/lib/http/route/epsilon-router.d.ts +8 -0
- package/lib/http/route/epsilon-router.js +1 -0
- package/lib/http/route/extended-auth-response-context.js +1 -0
- package/{dist/types → lib}/http/route/route-mapping.d.ts +3 -3
- package/lib/http/route/route-mapping.js +1 -0
- package/lib/http/route/route-validator-config.js +1 -0
- package/{dist/types → lib}/http/route/router-util.d.ts +9 -12
- package/{dist/es → lib}/http/route/router-util.js +10 -10
- package/lib/http/route/router-util.spec.d.ts +1 -0
- package/lib/http/route/router-util.spec.js +23 -0
- package/{dist/types → lib}/http/web-handler.d.ts +4 -7
- package/{dist/es → lib}/http/web-handler.js +11 -10
- package/lib/http/web-handler.spec.d.ts +1 -0
- package/lib/http/web-handler.spec.js +32 -0
- package/{dist/types → lib}/http/web-v2-handler.d.ts +2 -5
- package/{dist/es → lib}/http/web-v2-handler.js +3 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/inter-api/inter-api-entry.js +1 -0
- package/{dist/types → lib}/inter-api/inter-api-util.d.ts +3 -3
- package/{dist/es → lib}/inter-api/inter-api-util.js +6 -5
- package/lib/inter-api/inter-api-util.spec.d.ts +1 -0
- package/lib/inter-api/inter-api-util.spec.js +61 -0
- package/{dist/types → lib}/inter-api-manager.d.ts +2 -5
- package/{dist/es → lib}/inter-api-manager.js +5 -3
- package/{dist/types → lib}/lambda-event-handler/cron-epsilon-lambda-event-handler.d.ts +5 -5
- package/{dist/es → lib}/lambda-event-handler/cron-epsilon-lambda-event-handler.js +5 -4
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.d.ts +1 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.js +50 -0
- package/{dist/types → lib}/lambda-event-handler/dynamo-epsilon-lambda-event-handler.d.ts +2 -2
- package/{dist/es → lib}/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js +4 -3
- package/{dist/types → lib}/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.d.ts +2 -2
- package/{dist/es → lib}/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js +4 -3
- package/{dist/types → lib}/lambda-event-handler/inter-api-epsilon-lambda-event-handler.d.ts +2 -2
- package/{dist/es → lib}/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js +2 -1
- package/{dist/types → lib}/lambda-event-handler/s3-epsilon-lambda-event-handler.d.ts +2 -2
- package/{dist/es → lib}/lambda-event-handler/s3-epsilon-lambda-event-handler.js +4 -3
- package/{dist/types → lib}/local-container-server.d.ts +1 -4
- package/{dist/es → lib}/local-container-server.js +8 -4
- package/lib/local-server-cert.js +67 -0
- package/{dist/types → lib}/local-server.d.ts +2 -5
- package/{dist/es → lib}/local-server.js +11 -8
- package/lib/open-api-util/open-api-doc-modifications.js +1 -0
- package/{dist/types → lib}/open-api-util/open-api-doc-modifier.d.ts +1 -4
- package/{dist/es → lib}/open-api-util/open-api-doc-modifier.js +2 -1
- package/lib/open-api-util/open-api-doc-modifier.spec.d.ts +1 -0
- package/lib/open-api-util/open-api-doc-modifier.spec.js +16 -0
- package/{dist/es → lib}/open-api-util/yaml-combiner.js +2 -2
- package/lib/open-api-util/yaml-combiner.spec.d.ts +1 -0
- package/lib/open-api-util/yaml-combiner.spec.js +22 -0
- package/{dist/types → lib}/sample/sample-server-components.d.ts +2 -2
- package/{dist/es → lib}/sample/sample-server-components.js +25 -24
- package/lib/sample/sample-server-static-files.js +593 -0
- package/{dist/types → lib}/sample/test-error-server.d.ts +1 -4
- package/{dist/es → lib}/sample/test-error-server.js +4 -2
- package/{dist/types → lib}/util/context-util.d.ts +3 -3
- package/{dist/es → lib}/util/context-util.js +11 -5
- package/{dist/types → lib}/util/cron-util.d.ts +2 -2
- package/{dist/es → lib}/util/cron-util.js +3 -3
- package/lib/util/cron-util.spec.d.ts +1 -0
- package/lib/util/cron-util.spec.js +124 -0
- package/{dist/types → lib}/util/epsilon-config-parser.d.ts +6 -6
- package/{dist/es → lib}/util/epsilon-config-parser.js +9 -9
- package/package.json +16 -19
- package/dist/cjs/background/background-dynamo-log-table-handler.js +0 -38
- package/dist/cjs/background/background-entry.js +0 -2
- package/dist/cjs/background/background-execution-event-type.js +0 -11
- package/dist/cjs/background/background-execution-event.js +0 -2
- package/dist/cjs/background/background-execution-listener.js +0 -2
- package/dist/cjs/background/background-handler.js +0 -269
- package/dist/cjs/background/background-http-adapter-handler.js +0 -127
- package/dist/cjs/background/background-meta-response-internal.js +0 -2
- package/dist/cjs/background/background-process-handling.js +0 -8
- package/dist/cjs/background/background-process-log-table-entry.js +0 -2
- package/dist/cjs/background/background-queue-response-internal.js +0 -2
- package/dist/cjs/background/background-validator.js +0 -88
- package/dist/cjs/background/epsilon-background-process-error.js +0 -93
- package/dist/cjs/background/internal-background-entry.js +0 -2
- package/dist/cjs/background/manager/abstract-background-manager.js +0 -92
- package/dist/cjs/background/manager/aws-sqs-sns-background-manager.js +0 -153
- package/dist/cjs/background/manager/background-manager-like.js +0 -2
- package/dist/cjs/background/manager/single-thread-local-background-manager.js +0 -49
- package/dist/cjs/background/s3-background-transaction-logger.js +0 -54
- package/dist/cjs/build/ratchet-epsilon-common-info.js +0 -18
- package/dist/cjs/built-in/background/echo-processor.js +0 -18
- package/dist/cjs/built-in/background/log-and-enqueue-echo-processor.js +0 -16
- package/dist/cjs/built-in/background/log-message-background-error-processor.js +0 -10
- package/dist/cjs/built-in/background/no-op-processor.js +0 -13
- package/dist/cjs/built-in/background/retry-processor.js +0 -41
- package/dist/cjs/built-in/background/sample-delay-processor.js +0 -16
- package/dist/cjs/built-in/background/sample-input-validated-processor-data.js +0 -2
- package/dist/cjs/built-in/background/sample-input-validated-processor.js +0 -16
- package/dist/cjs/built-in/built-in-trace-id-generators.js +0 -25
- package/dist/cjs/built-in/daemon/daemon-authorizer-function.js +0 -2
- package/dist/cjs/built-in/daemon/daemon-config.js +0 -2
- package/dist/cjs/built-in/daemon/daemon-group-selection-function.js +0 -2
- package/dist/cjs/built-in/daemon/daemon-handler.js +0 -62
- package/dist/cjs/built-in/daemon/daemon-process-state-list.js +0 -2
- package/dist/cjs/built-in/http/apollo-filter.js +0 -63
- package/dist/cjs/built-in/http/built-in-auth-filters.js +0 -115
- package/dist/cjs/built-in/http/built-in-authorizers.js +0 -43
- package/dist/cjs/built-in/http/built-in-filters.js +0 -222
- package/dist/cjs/built-in/http/built-in-handlers.js +0 -73
- package/dist/cjs/built-in/http/log-level-manipulation-filter.js +0 -20
- package/dist/cjs/built-in/http/run-handler-as-filter.js +0 -64
- package/dist/cjs/cli-bootstrap/ratchet-cli-handler.js +0 -24
- package/dist/cjs/cli-bootstrap/run-background-process-from-command-line.js +0 -26
- package/dist/cjs/config/background/background-aws-config.js +0 -2
- package/dist/cjs/config/background/background-config.js +0 -2
- package/dist/cjs/config/background/background-error-processor.js +0 -2
- package/dist/cjs/config/background/background-processor.js +0 -2
- package/dist/cjs/config/background/background-transaction-log.js +0 -2
- package/dist/cjs/config/background/background-transaction-logger.js +0 -2
- package/dist/cjs/config/cron/abstract-cron-entry.js +0 -2
- package/dist/cjs/config/cron/cron-background-entry.js +0 -2
- package/dist/cjs/config/cron/cron-config.js +0 -2
- package/dist/cjs/config/dynamo-db-config.js +0 -2
- package/dist/cjs/config/epsilon-config.js +0 -2
- package/dist/cjs/config/epsilon-lambda-event-handler.js +0 -2
- package/dist/cjs/config/epsilon-logger-config.js +0 -2
- package/dist/cjs/config/generic-aws-event-handler-function.js +0 -2
- package/dist/cjs/config/http/authorizer-function.js +0 -2
- package/dist/cjs/config/http/epsilon-authorization-context.js +0 -2
- package/dist/cjs/config/http/extended-api-gateway-event.js +0 -2
- package/dist/cjs/config/http/filter-chain-context.js +0 -2
- package/dist/cjs/config/http/filter-function.js +0 -2
- package/dist/cjs/config/http/handler-function.js +0 -2
- package/dist/cjs/config/http/http-config.js +0 -2
- package/dist/cjs/config/http/http-processing-config.js +0 -2
- package/dist/cjs/config/http/mapped-http-processing-config.js +0 -2
- package/dist/cjs/config/http/null-returned-object-handling.js +0 -9
- package/dist/cjs/config/inter-api/inter-api-aws-config.js +0 -2
- package/dist/cjs/config/inter-api/inter-api-config.js +0 -2
- package/dist/cjs/config/inter-api/inter-api-process-mapping.js +0 -2
- package/dist/cjs/config/logging-trace-id-generator.js +0 -2
- package/dist/cjs/config/open-api/open-api-document-components.js +0 -2
- package/dist/cjs/config/open-api/open-api-document-path.js +0 -2
- package/dist/cjs/config/open-api/open-api-document.js +0 -2
- package/dist/cjs/config/s3-config.js +0 -2
- package/dist/cjs/config/sns-config.js +0 -2
- package/dist/cjs/epsilon-build-properties.js +0 -28
- package/dist/cjs/epsilon-constants.js +0 -49
- package/dist/cjs/epsilon-global-handler.js +0 -155
- package/dist/cjs/epsilon-instance.js +0 -2
- package/dist/cjs/epsilon-logging-extension-processor.js +0 -19
- package/dist/cjs/http/auth/api-gateway-adapter-authentication-handler.js +0 -75
- package/dist/cjs/http/auth/auth0-web-token-manipulator.js +0 -62
- package/dist/cjs/http/auth/basic-auth-token.js +0 -2
- package/dist/cjs/http/auth/google-web-token-manipulator.js +0 -72
- package/dist/cjs/http/auth/jwt-ratchet-local-web-token-manipulator.js +0 -29
- package/dist/cjs/http/auth/local-web-token-manipulator.js +0 -74
- package/dist/cjs/http/auth/web-token-manipulator.js +0 -2
- package/dist/cjs/http/error/bad-gateway.js +0 -12
- package/dist/cjs/http/error/bad-request-error.js +0 -12
- package/dist/cjs/http/error/conflict-error.js +0 -12
- package/dist/cjs/http/error/epsilon-http-error.js +0 -132
- package/dist/cjs/http/error/forbidden-error.js +0 -12
- package/dist/cjs/http/error/gateway-timeout.js +0 -12
- package/dist/cjs/http/error/method-not-allowed-error.js +0 -12
- package/dist/cjs/http/error/misconfigured-error.js +0 -12
- package/dist/cjs/http/error/not-found-error.js +0 -12
- package/dist/cjs/http/error/not-implemented.js +0 -12
- package/dist/cjs/http/error/request-timeout-error.js +0 -12
- package/dist/cjs/http/error/service-unavailable.js +0 -12
- package/dist/cjs/http/error/too-many-requests-error.js +0 -12
- package/dist/cjs/http/error/unauthorized-error.js +0 -12
- package/dist/cjs/http/event-util.js +0 -180
- package/dist/cjs/http/response-util.js +0 -146
- package/dist/cjs/http/route/epsilon-router.js +0 -2
- package/dist/cjs/http/route/extended-auth-response-context.js +0 -2
- package/dist/cjs/http/route/route-mapping.js +0 -2
- package/dist/cjs/http/route/route-validator-config.js +0 -2
- package/dist/cjs/http/route/router-util.js +0 -238
- package/dist/cjs/http/web-handler.js +0 -122
- package/dist/cjs/http/web-v2-handler.js +0 -25
- package/dist/cjs/index.js +0 -135
- package/dist/cjs/inter-api/inter-api-entry.js +0 -2
- package/dist/cjs/inter-api/inter-api-util.js +0 -62
- package/dist/cjs/inter-api-manager.js +0 -67
- package/dist/cjs/lambda-event-handler/cron-epsilon-lambda-event-handler.js +0 -76
- package/dist/cjs/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js +0 -36
- package/dist/cjs/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js +0 -32
- package/dist/cjs/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js +0 -26
- package/dist/cjs/lambda-event-handler/s3-epsilon-lambda-event-handler.js +0 -44
- package/dist/cjs/local-container-server.js +0 -77
- package/dist/cjs/local-server-cert.js +0 -71
- package/dist/cjs/local-server.js +0 -164
- package/dist/cjs/open-api-util/open-api-doc-modifications.js +0 -2
- package/dist/cjs/open-api-util/open-api-doc-modifier.js +0 -83
- package/dist/cjs/open-api-util/yaml-combiner.js +0 -32
- package/dist/cjs/sample/sample-server-components.js +0 -188
- package/dist/cjs/sample/sample-server-static-files.js +0 -597
- package/dist/cjs/sample/test-error-server.js +0 -47
- package/dist/cjs/util/aws-util.js +0 -69
- package/dist/cjs/util/context-util.js +0 -104
- package/dist/cjs/util/cron-util.js +0 -72
- package/dist/cjs/util/epsilon-config-parser.js +0 -71
- package/dist/es/index.js +0 -132
- package/dist/es/local-server-cert.js +0 -67
- package/dist/es/sample/sample-server-static-files.js +0 -593
- package/dist/tsconfig.cjs.tsbuildinfo +0 -1
- package/dist/tsconfig.es.tsbuildinfo +0 -1
- package/dist/tsconfig.types.tsbuildinfo +0 -1
- package/dist/types/built-in/daemon/daemon-process-state-list.d.ts +0 -8
- package/dist/types/cli-bootstrap/run-background-process-from-command-line.d.ts +0 -12
- package/dist/types/config/cron/cron-background-entry.d.ts +0 -15
- package/dist/types/config/inter-api/inter-api-process-mapping.d.ts +0 -11
- package/dist/types/epsilon-logging-extension-processor.d.ts +0 -5
- package/dist/types/http/route/epsilon-router.d.ts +0 -8
- package/dist/types/index.d.ts +0 -135
- package/includes/cli.js +0 -12
- /package/{dist/types → lib}/background/background-entry.d.ts +0 -0
- /package/{dist/es → lib}/background/background-entry.js +0 -0
- /package/{dist/types → lib}/background/background-execution-event-type.d.ts +0 -0
- /package/{dist/es → lib}/background/background-execution-event-type.js +0 -0
- /package/{dist/es → lib}/background/background-execution-event.js +0 -0
- /package/{dist/es → lib}/background/background-execution-listener.js +0 -0
- /package/{dist/types → lib}/background/background-meta-response-internal.d.ts +0 -0
- /package/{dist/es → lib}/background/background-meta-response-internal.js +0 -0
- /package/{dist/types → lib}/background/background-process-handling.d.ts +0 -0
- /package/{dist/es → lib}/background/background-process-handling.js +0 -0
- /package/{dist/types → lib}/background/background-process-log-table-entry.d.ts +0 -0
- /package/{dist/es → lib}/background/background-process-log-table-entry.js +0 -0
- /package/{dist/es → lib}/background/background-queue-response-internal.js +0 -0
- /package/{dist/types → lib}/background/epsilon-background-process-error.d.ts +0 -0
- /package/{dist/es → lib}/background/internal-background-entry.js +0 -0
- /package/{dist/es → lib}/background/manager/background-manager-like.js +0 -0
- /package/{dist/es/built-in/background/sample-input-validated-processor-data.js → lib/background/manager/background-manager.spec.d.ts} +0 -0
- /package/{dist/es → lib}/build/ratchet-epsilon-common-info.js +0 -0
- /package/{dist/types → lib}/built-in/background/sample-input-validated-processor-data.d.ts +0 -0
- /package/{dist/es/built-in/daemon/daemon-authorizer-function.js → lib/built-in/background/sample-input-validated-processor-data.js} +0 -0
- /package/{dist/types → lib}/built-in/built-in-trace-id-generators.d.ts +0 -0
- /package/{dist/es/built-in/daemon/daemon-config.js → lib/built-in/daemon/daemon-authorizer-function.js} +0 -0
- /package/{dist/es/built-in/daemon/daemon-group-selection-function.js → lib/built-in/daemon/daemon-config.js} +0 -0
- /package/{dist/es/built-in/daemon/daemon-process-state-list.js → lib/built-in/daemon/daemon-group-selection-function.js} +0 -0
- /package/{dist/es/config/background/background-aws-config.js → lib/built-in/daemon/daemon-process-state-list.js} +0 -0
- /package/{dist/es/config/background/background-config.js → lib/built-in/http/run-handler-as-filter.spec.d.ts} +0 -0
- /package/{dist/types → lib}/config/background/background-aws-config.d.ts +0 -0
- /package/{dist/es/config/background/background-error-processor.js → lib/config/background/background-aws-config.js} +0 -0
- /package/{dist/es/config/background/background-processor.js → lib/config/background/background-config.js} +0 -0
- /package/{dist/es/config/background/background-transaction-log.js → lib/config/background/background-error-processor.js} +0 -0
- /package/{dist/es/config/background/background-transaction-logger.js → lib/config/background/background-processor.js} +0 -0
- /package/{dist/es/config/cron/abstract-cron-entry.js → lib/config/background/background-transaction-log.js} +0 -0
- /package/{dist/es/config/cron/cron-background-entry.js → lib/config/background/background-transaction-logger.js} +0 -0
- /package/{dist/types → lib}/config/cron/abstract-cron-entry.d.ts +0 -0
- /package/{dist/es/config/cron/cron-config.js → lib/config/cron/abstract-cron-entry.js} +0 -0
- /package/{dist/es/config/dynamo-db-config.js → lib/config/cron/cron-background-entry.js} +0 -0
- /package/{dist/es/config/epsilon-config.js → lib/config/cron/cron-config.js} +0 -0
- /package/{dist/es/config/epsilon-lambda-event-handler.js → lib/config/dynamo-db-config.js} +0 -0
- /package/{dist/es/config/epsilon-logger-config.js → lib/config/epsilon-config.js} +0 -0
- /package/{dist/types → lib}/config/epsilon-lambda-event-handler.d.ts +0 -0
- /package/{dist/es/config/generic-aws-event-handler-function.js → lib/config/epsilon-lambda-event-handler.js} +0 -0
- /package/{dist/es/config/http/authorizer-function.js → lib/config/epsilon-logger-config.js} +0 -0
- /package/{dist/types → lib}/config/generic-aws-event-handler-function.d.ts +0 -0
- /package/{dist/es/config/http/epsilon-authorization-context.js → lib/config/generic-aws-event-handler-function.js} +0 -0
- /package/{dist/es/config/http/extended-api-gateway-event.js → lib/config/http/authorizer-function.js} +0 -0
- /package/{dist/types → lib}/config/http/epsilon-authorization-context.d.ts +0 -0
- /package/{dist/es/config/http/filter-chain-context.js → lib/config/http/epsilon-authorization-context.js} +0 -0
- /package/{dist/es/config/http/filter-function.js → lib/config/http/extended-api-gateway-event.js} +0 -0
- /package/{dist/es/config/http/handler-function.js → lib/config/http/filter-chain-context.js} +0 -0
- /package/{dist/es/config/http/http-config.js → lib/config/http/filter-function.js} +0 -0
- /package/{dist/es/config/http/http-processing-config.js → lib/config/http/handler-function.js} +0 -0
- /package/{dist/es/config/http/mapped-http-processing-config.js → lib/config/http/http-config.js} +0 -0
- /package/{dist/es/config/inter-api/inter-api-aws-config.js → lib/config/http/http-processing-config.js} +0 -0
- /package/{dist/es/config/inter-api/inter-api-config.js → lib/config/http/mapped-http-processing-config.js} +0 -0
- /package/{dist/types → lib}/config/http/null-returned-object-handling.d.ts +0 -0
- /package/{dist/es → lib}/config/http/null-returned-object-handling.js +0 -0
- /package/{dist/types → lib}/config/inter-api/inter-api-aws-config.d.ts +0 -0
- /package/{dist/es/config/inter-api/inter-api-process-mapping.js → lib/config/inter-api/inter-api-aws-config.js} +0 -0
- /package/{dist/es/config/logging-trace-id-generator.js → lib/config/inter-api/inter-api-config.js} +0 -0
- /package/{dist/es/config/open-api/open-api-document-components.js → lib/config/inter-api/inter-api-process-mapping.js} +0 -0
- /package/{dist/types → lib}/config/logging-trace-id-generator.d.ts +0 -0
- /package/{dist/es/config/open-api/open-api-document-path.js → lib/config/logging-trace-id-generator.js} +0 -0
- /package/{dist/types → lib}/config/open-api/open-api-document-components.d.ts +0 -0
- /package/{dist/es/config/open-api/open-api-document.js → lib/config/open-api/open-api-document-components.js} +0 -0
- /package/{dist/types → lib}/config/open-api/open-api-document-path.d.ts +0 -0
- /package/{dist/es/config/s3-config.js → lib/config/open-api/open-api-document-path.js} +0 -0
- /package/{dist/es/config/sns-config.js → lib/config/open-api/open-api-document.js} +0 -0
- /package/{dist/es/epsilon-instance.js → lib/config/s3-config.js} +0 -0
- /package/{dist/es/http/auth/basic-auth-token.js → lib/config/sns-config.js} +0 -0
- /package/{dist/types → lib}/epsilon-build-properties.d.ts +0 -0
- /package/{dist/es/http/auth/web-token-manipulator.js → lib/epsilon-instance.js} +0 -0
- /package/{dist/es/http/route/epsilon-router.js → lib/http/auth/basic-auth-token.js} +0 -0
- /package/{dist/es/http/route/extended-auth-response-context.js → lib/http/auth/google-web-token-manipulator.spec.d.ts} +0 -0
- /package/{dist/es/http/route/route-mapping.js → lib/http/auth/local-web-token-manipulator.spec.d.ts} +0 -0
- /package/{dist/es/http/route/route-validator-config.js → lib/http/auth/web-token-manipulator.js} +0 -0
- /package/{dist/types → lib}/http/error/epsilon-http-error.d.ts +0 -0
- /package/{dist/es/inter-api/inter-api-entry.js → lib/http/error/epsilon-http-error.spec.d.ts} +0 -0
- /package/{dist/es/open-api-util/open-api-doc-modifications.js → lib/http/event-util.spec.d.ts} +0 -0
- /package/{dist/types → lib}/http/route/extended-auth-response-context.d.ts +0 -0
- /package/{dist/types → lib}/http/route/route-validator-config.d.ts +0 -0
- /package/{dist/types → lib}/inter-api/inter-api-entry.d.ts +0 -0
- /package/{dist/types → lib}/local-server-cert.d.ts +0 -0
- /package/{dist/types → lib}/open-api-util/open-api-doc-modifications.d.ts +0 -0
- /package/{dist/types → lib}/open-api-util/yaml-combiner.d.ts +0 -0
- /package/{dist/types → lib}/sample/sample-server-static-files.d.ts +0 -0
- /package/{dist/types → lib}/util/aws-util.d.ts +0 -0
- /package/{dist/es → lib}/util/aws-util.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EpsilonGlobalHandler } from './epsilon-global-handler';
|
|
1
|
+
import { EpsilonGlobalHandler } from './epsilon-global-handler.js';
|
|
2
2
|
export declare class EpsilonConstants {
|
|
3
3
|
static readonly EPSILON_FINDER_DYNAMIC_IMPORT_PATH_ENV_NAME = "EPSILON_FINDER_DYNAMIC_IMPORT_PATH";
|
|
4
4
|
static readonly EPSILON_FINDER_FUNCTION_NAME_ENV_NAME = "EPSILON_FINDER_FUNCTION_NAME";
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { Logger } from '@bitblit/ratchet-common';
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/lib/logger/logger.js';
|
|
2
|
+
import { EsmRatchet } from '@bitblit/ratchet-common/lib/lang/esm-ratchet.js';
|
|
2
3
|
export class EpsilonConstants {
|
|
3
|
-
|
|
4
|
+
static EPSILON_FINDER_DYNAMIC_IMPORT_PATH_ENV_NAME = 'EPSILON_FINDER_DYNAMIC_IMPORT_PATH';
|
|
5
|
+
static EPSILON_FINDER_FUNCTION_NAME_ENV_NAME = 'EPSILON_FINDER_FUNCTION_NAME';
|
|
6
|
+
static DEFAULT_EPSILON_FINDER_DYNAMIC_IMPORT_PATH = 'epsilon-global-handler-provider.js';
|
|
7
|
+
static DEFAULT_EPSILON_FINDER_FUNCTION_NAME = 'findEpsilonGlobalHandler';
|
|
8
|
+
static AUTH_HEADER_PREFIX = 'Bearer ';
|
|
9
|
+
static AUTH_HEADER_NAME = 'Authorization';
|
|
10
|
+
static BACKGROUND_SQS_TYPE_FIELD = 'BACKGROUND_TYPE';
|
|
11
|
+
static BACKGROUND_SNS_START_MARKER = 'BACKGROUND_START_MARKER';
|
|
12
|
+
static BACKGROUND_SNS_IMMEDIATE_RUN_FLAG = 'BACKGROUND_IMMEDIATE_RUN_FLAG';
|
|
13
|
+
static INTER_API_SNS_EVENT = 'EPSILON_INTER_API_EVENT';
|
|
4
14
|
static load(filePath, className) {
|
|
5
|
-
Logger.info('Searching for %s : %s : %s', filePath, className,
|
|
15
|
+
Logger.info('Searching for %s : %s : %s', filePath, className, EsmRatchet.fetchDirName());
|
|
6
16
|
let rval = null;
|
|
7
17
|
const val = require(filePath);
|
|
8
18
|
if (val) {
|
|
@@ -32,14 +42,5 @@ export class EpsilonConstants {
|
|
|
32
42
|
}
|
|
33
43
|
return rval;
|
|
34
44
|
}
|
|
45
|
+
constructor() { }
|
|
35
46
|
}
|
|
36
|
-
EpsilonConstants.EPSILON_FINDER_DYNAMIC_IMPORT_PATH_ENV_NAME = 'EPSILON_FINDER_DYNAMIC_IMPORT_PATH';
|
|
37
|
-
EpsilonConstants.EPSILON_FINDER_FUNCTION_NAME_ENV_NAME = 'EPSILON_FINDER_FUNCTION_NAME';
|
|
38
|
-
EpsilonConstants.DEFAULT_EPSILON_FINDER_DYNAMIC_IMPORT_PATH = 'epsilon-global-handler-provider.js';
|
|
39
|
-
EpsilonConstants.DEFAULT_EPSILON_FINDER_FUNCTION_NAME = 'findEpsilonGlobalHandler';
|
|
40
|
-
EpsilonConstants.AUTH_HEADER_PREFIX = 'Bearer ';
|
|
41
|
-
EpsilonConstants.AUTH_HEADER_NAME = 'Authorization';
|
|
42
|
-
EpsilonConstants.BACKGROUND_SQS_TYPE_FIELD = 'BACKGROUND_TYPE';
|
|
43
|
-
EpsilonConstants.BACKGROUND_SNS_START_MARKER = 'BACKGROUND_START_MARKER';
|
|
44
|
-
EpsilonConstants.BACKGROUND_SNS_IMMEDIATE_RUN_FLAG = 'BACKGROUND_IMMEDIATE_RUN_FLAG';
|
|
45
|
-
EpsilonConstants.INTER_API_SNS_EVENT = 'EPSILON_INTER_API_EVENT';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { Context, ProxyResult } from 'aws-lambda';
|
|
2
|
-
import { BackgroundEntry } from './background/background-entry';
|
|
3
|
-
import { EpsilonInstance } from './epsilon-instance';
|
|
4
|
-
import { LoggerOptions } from '@bitblit/ratchet-common';
|
|
5
|
-
/**
|
|
6
|
-
* This class functions as the adapter from a default Lambda function to the handlers exposed via Epsilon
|
|
7
|
-
*/
|
|
2
|
+
import { BackgroundEntry } from './background/background-entry.js';
|
|
3
|
+
import { EpsilonInstance } from './epsilon-instance.js';
|
|
4
|
+
import { LoggerOptions } from '@bitblit/ratchet-common/lib/logger/logger-options.js';
|
|
8
5
|
export declare class EpsilonGlobalHandler {
|
|
9
6
|
private _epsilon;
|
|
10
7
|
private static LOGGER_CONFIGURED;
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import { Logger } from '@bitblit/ratchet-common';
|
|
2
|
-
import { EventUtil } from './http/event-util';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/lib/logger/logger.js';
|
|
2
|
+
import { EventUtil } from './http/event-util.js';
|
|
3
|
+
import { ErrorRatchet } from '@bitblit/ratchet-common/lib/lang/error-ratchet.js';
|
|
4
|
+
import { LoggerLevelName } from '@bitblit/ratchet-common/lib/logger/logger-level-name.js';
|
|
5
|
+
import { LogMessageFormatType } from '@bitblit/ratchet-common/lib/logger/log-message-format-type.js';
|
|
6
|
+
import { PromiseRatchet } from '@bitblit/ratchet-common/lib/lang/promise-ratchet.js';
|
|
7
|
+
import { TimeoutToken } from '@bitblit/ratchet-common/lib/lang/timeout-token.js';
|
|
8
|
+
import { ResponseUtil } from './http/response-util.js';
|
|
9
|
+
import { EpsilonHttpError } from './http/error/epsilon-http-error.js';
|
|
10
|
+
import { RequestTimeoutError } from './http/error/request-timeout-error.js';
|
|
11
|
+
import { ContextUtil } from './util/context-util.js';
|
|
12
|
+
import { WebV2Handler } from './http/web-v2-handler.js';
|
|
13
|
+
import { InterApiEpsilonLambdaEventHandler } from './lambda-event-handler/inter-api-epsilon-lambda-event-handler.js';
|
|
14
|
+
import { GenericSnsEpsilonLambdaEventHandler } from './lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js';
|
|
15
|
+
import { CronEpsilonLambdaEventHandler } from './lambda-event-handler/cron-epsilon-lambda-event-handler.js';
|
|
16
|
+
import { S3EpsilonLambdaEventHandler } from './lambda-event-handler/s3-epsilon-lambda-event-handler.js';
|
|
17
|
+
import { DynamoEpsilonLambdaEventHandler } from './lambda-event-handler/dynamo-epsilon-lambda-event-handler.js';
|
|
18
|
+
import { EpsilonLoggingExtensionProcessor } from './epsilon-logging-extension-processor.js';
|
|
19
|
+
import { LoggerOutputFunction } from '@bitblit/ratchet-common/lib/logger/logger-output-function.js';
|
|
17
20
|
export class EpsilonGlobalHandler {
|
|
21
|
+
_epsilon;
|
|
22
|
+
static LOGGER_CONFIGURED = false;
|
|
23
|
+
static GLOBAL_INSTANCE_PROVIDER;
|
|
24
|
+
static set globalInstanceProvider(input) {
|
|
25
|
+
EpsilonGlobalHandler.GLOBAL_INSTANCE_PROVIDER = input;
|
|
26
|
+
}
|
|
27
|
+
static get globalInstanceProvider() {
|
|
28
|
+
return EpsilonGlobalHandler.GLOBAL_INSTANCE_PROVIDER;
|
|
29
|
+
}
|
|
30
|
+
handlers = null;
|
|
18
31
|
constructor(_epsilon) {
|
|
19
32
|
this._epsilon = _epsilon;
|
|
20
|
-
this.handlers = null;
|
|
21
33
|
if (!EpsilonGlobalHandler.LOGGER_CONFIGURED) {
|
|
22
34
|
EpsilonGlobalHandler.configureDefaultLogger();
|
|
23
35
|
Logger.info('EpsilonLoggingConfiguration:Default logger configured');
|
|
@@ -36,12 +48,6 @@ export class EpsilonGlobalHandler {
|
|
|
36
48
|
new DynamoEpsilonLambdaEventHandler(this._epsilon),
|
|
37
49
|
];
|
|
38
50
|
}
|
|
39
|
-
static set globalInstanceProvider(input) {
|
|
40
|
-
EpsilonGlobalHandler.GLOBAL_INSTANCE_PROVIDER = input;
|
|
41
|
-
}
|
|
42
|
-
static get globalInstanceProvider() {
|
|
43
|
-
return EpsilonGlobalHandler.GLOBAL_INSTANCE_PROVIDER;
|
|
44
|
-
}
|
|
45
51
|
static configureDefaultLogger(overrides) {
|
|
46
52
|
const output = overrides ? Object.assign({}, overrides) : {};
|
|
47
53
|
output.initialLevel = output.initialLevel ?? LoggerLevelName.info;
|
|
@@ -146,4 +152,3 @@ export class EpsilonGlobalHandler {
|
|
|
146
152
|
return rval;
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
|
-
EpsilonGlobalHandler.LOGGER_CONFIGURED = false;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { EpsilonConfig } from './config/epsilon-config';
|
|
2
|
-
import { WebHandler } from './http/web-handler';
|
|
3
|
-
import { BackgroundHandler } from './background/background-handler';
|
|
4
|
-
import { OpenApiDocument } from './config/open-api/open-api-document';
|
|
5
|
-
import { ModelValidator } from '@bitblit/ratchet-misc';
|
|
6
|
-
import { BackgroundManagerLike } from './background/manager/background-manager-like';
|
|
7
|
-
/**
|
|
8
|
-
* This interface just wraps up everything that gets created by the config parsing process so that
|
|
9
|
-
* I can hand it in a neat package to EpsilonGlobalHandler, rather than passing in a bunch of
|
|
10
|
-
* params on the constructor
|
|
11
|
-
*/
|
|
1
|
+
import { EpsilonConfig } from './config/epsilon-config.js';
|
|
2
|
+
import { WebHandler } from './http/web-handler.js';
|
|
3
|
+
import { BackgroundHandler } from './background/background-handler.js';
|
|
4
|
+
import { OpenApiDocument } from './config/open-api/open-api-document.js';
|
|
5
|
+
import { ModelValidator } from '@bitblit/ratchet-misc/lib/model-validator/model-validator.js';
|
|
6
|
+
import { BackgroundManagerLike } from './background/manager/background-manager-like.js';
|
|
12
7
|
export interface EpsilonInstance {
|
|
13
8
|
config: EpsilonConfig;
|
|
14
9
|
parsedOpenApiDoc: OpenApiDocument;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LogMessage } from '@bitblit/ratchet-common/lib/logger/log-message.js';
|
|
2
|
+
import { LogMessageProcessor } from '@bitblit/ratchet-common/lib/logger/log-message-processor.js';
|
|
3
|
+
export declare class EpsilonLoggingExtensionProcessor implements LogMessageProcessor {
|
|
4
|
+
process(msg: LogMessage): LogMessage;
|
|
5
|
+
label(): string;
|
|
6
|
+
}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { Callback, Context, CustomAuthorizerEvent } from 'aws-lambda';
|
|
2
|
-
/**
|
|
3
|
-
* This class is to simplify if the user wants to use a AWS Gateway authorizer in conjunction with Epsilon
|
|
4
|
-
*/
|
|
5
2
|
export declare class ApiGatewayAdapterAuthenticationHandler {
|
|
6
3
|
private webTokenManipulator;
|
|
7
4
|
constructor(issuer: string, encryptionKeys: string);
|
|
8
|
-
/**
|
|
9
|
-
* This is the default authorizer - parses the incoming JWT token and sticks it
|
|
10
|
-
* into context (or blocks if none/invalid found)
|
|
11
|
-
* @param event
|
|
12
|
-
* @param {Context} context
|
|
13
|
-
* @param {Callback} callback
|
|
14
|
-
*/
|
|
15
5
|
lambdaHandler(event: CustomAuthorizerEvent, context: Context, callback: Callback): void;
|
|
16
6
|
private createPolicy;
|
|
17
7
|
static extractTokenStringFromAuthorizerEvent(event: CustomAuthorizerEvent): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Logger } from '@bitblit/ratchet-common';
|
|
2
|
-
import { LocalWebTokenManipulator } from './local-web-token-manipulator';
|
|
3
|
-
import { EpsilonConstants } from '../../epsilon-constants';
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/lib/logger/logger.js';
|
|
2
|
+
import { LocalWebTokenManipulator } from './local-web-token-manipulator.js';
|
|
3
|
+
import { EpsilonConstants } from '../../epsilon-constants.js';
|
|
4
4
|
export class ApiGatewayAdapterAuthenticationHandler {
|
|
5
|
+
webTokenManipulator;
|
|
5
6
|
constructor(issuer, encryptionKeys) {
|
|
6
7
|
this.webTokenManipulator = new LocalWebTokenManipulator([encryptionKeys], issuer);
|
|
7
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JwtTokenBase } from '@bitblit/ratchet-common';
|
|
2
|
-
import { WebTokenManipulator } from './web-token-manipulator';
|
|
1
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/lib/jwt/jwt-token-base.js';
|
|
2
|
+
import { WebTokenManipulator } from './web-token-manipulator.js';
|
|
3
3
|
export declare class Auth0WebTokenManipulator implements WebTokenManipulator<JwtTokenBase> {
|
|
4
4
|
private clientId;
|
|
5
5
|
private jwksUri;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { Logger
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/lib/logger/logger.js';
|
|
2
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lib/lang/string-ratchet.js';
|
|
2
3
|
import jwt from 'jsonwebtoken';
|
|
3
4
|
import jwks from 'jwks-rsa';
|
|
4
5
|
export class Auth0WebTokenManipulator {
|
|
6
|
+
clientId;
|
|
7
|
+
jwksUri;
|
|
8
|
+
issuer;
|
|
9
|
+
jwksClient;
|
|
5
10
|
constructor(clientId, jwksUri, issuer) {
|
|
6
11
|
this.clientId = clientId;
|
|
7
12
|
this.jwksUri = jwksUri;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WebTokenManipulator } from './web-token-manipulator';
|
|
2
|
-
import { JwtTokenBase } from '@bitblit/ratchet-common';
|
|
1
|
+
import { WebTokenManipulator } from './web-token-manipulator.js';
|
|
2
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/lib/jwt/jwt-token-base.js';
|
|
3
3
|
export declare class GoogleWebTokenManipulator implements WebTokenManipulator<JwtTokenBase> {
|
|
4
4
|
private clientId;
|
|
5
5
|
private static readonly GOOGLE_DISCOVERY_DOCUMENT;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Logger } from '@bitblit/ratchet-common';
|
|
2
|
-
import { StringRatchet } from '@bitblit/ratchet-common';
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/lib/logger/logger.js';
|
|
2
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lib/lang/string-ratchet.js';
|
|
3
3
|
import jwt from 'jsonwebtoken';
|
|
4
4
|
import jwks from 'jwks-rsa';
|
|
5
5
|
import fetch from 'cross-fetch';
|
|
6
6
|
export class GoogleWebTokenManipulator {
|
|
7
|
+
clientId;
|
|
8
|
+
static GOOGLE_DISCOVERY_DOCUMENT = 'https://accounts.google.com/.well-known/openid-configuration';
|
|
9
|
+
cacheGoogleDiscoveryDocument;
|
|
10
|
+
jwksClient;
|
|
7
11
|
constructor(clientId) {
|
|
8
12
|
this.clientId = clientId;
|
|
9
13
|
}
|
|
@@ -64,4 +68,3 @@ export class GoogleWebTokenManipulator {
|
|
|
64
68
|
return this.cacheGoogleDiscoveryDocument;
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
|
-
GoogleWebTokenManipulator.GOOGLE_DISCOVERY_DOCUMENT = 'https://accounts.google.com/.well-known/openid-configuration';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GoogleWebTokenManipulator } from './google-web-token-manipulator.js';
|
|
2
|
+
describe('#googleWebTokenManipulator', function () {
|
|
3
|
+
xit('should extract a token', async () => {
|
|
4
|
+
const token = 'TOKEN_HERE';
|
|
5
|
+
const clientId = 'CLIENT_HERE';
|
|
6
|
+
const svc = new GoogleWebTokenManipulator(clientId);
|
|
7
|
+
const res = await svc.parseAndValidateGoogleToken(token, false);
|
|
8
|
+
expect(res).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { WebTokenManipulator } from './web-token-manipulator';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
* Service for handling jwt tokens
|
|
5
|
-
*/
|
|
1
|
+
import { WebTokenManipulator } from './web-token-manipulator.js';
|
|
2
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/lib/jwt/jwt-token-base.js';
|
|
3
|
+
import { JwtRatchetLike } from '@bitblit/ratchet-common/lib/jwt/jwt-ratchet-like.js';
|
|
6
4
|
export declare class JwtRatchetLocalWebTokenManipulator<T extends JwtTokenBase> implements WebTokenManipulator<T> {
|
|
7
5
|
private _jwtRatchet;
|
|
8
6
|
private _issuer;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { StringRatchet } from '@bitblit/ratchet-common';
|
|
2
|
-
import { RequireRatchet } from '@bitblit/ratchet-common';
|
|
3
|
-
import { ExpiredJwtHandling } from '@bitblit/ratchet-common';
|
|
1
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lib/lang/string-ratchet.js';
|
|
2
|
+
import { RequireRatchet } from '@bitblit/ratchet-common/lib/lang/require-ratchet.js';
|
|
3
|
+
import { ExpiredJwtHandling } from '@bitblit/ratchet-common/lib/jwt/expired-jwt-handling.js';
|
|
4
4
|
export class JwtRatchetLocalWebTokenManipulator {
|
|
5
|
+
_jwtRatchet;
|
|
6
|
+
_issuer;
|
|
5
7
|
constructor(_jwtRatchet, _issuer) {
|
|
6
8
|
this._jwtRatchet = _jwtRatchet;
|
|
7
9
|
this._issuer = _issuer;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { WebTokenManipulator } from './web-token-manipulator';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
1
|
+
import { WebTokenManipulator } from './web-token-manipulator.js';
|
|
2
|
+
import { LoggerLevelName } from '@bitblit/ratchet-common/lib/logger/logger-level-name.js';
|
|
3
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/lib/jwt/jwt-token-base.js';
|
|
4
|
+
import { JwtRatchet } from '@bitblit/ratchet-common/lib/jwt/jwt-ratchet.js';
|
|
6
5
|
export declare class LocalWebTokenManipulator<T extends JwtTokenBase> implements WebTokenManipulator<T> {
|
|
7
6
|
private encryptionKeys;
|
|
8
7
|
private issuer;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Logger } from '@bitblit/ratchet-common';
|
|
2
|
-
import { UnauthorizedError } from '../error/unauthorized-error';
|
|
3
|
-
import { StringRatchet } from '@bitblit/ratchet-common';
|
|
4
|
-
import { RequireRatchet } from '@bitblit/ratchet-common';
|
|
5
|
-
import {
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/lib/logger/logger.js';
|
|
2
|
+
import { UnauthorizedError } from '../error/unauthorized-error.js';
|
|
3
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lib/lang/string-ratchet.js';
|
|
4
|
+
import { RequireRatchet } from '@bitblit/ratchet-common/lib/lang/require-ratchet.js';
|
|
5
|
+
import { JwtRatchet } from '@bitblit/ratchet-common/lib/jwt/jwt-ratchet.js';
|
|
6
|
+
import { ExpiredJwtHandling } from '@bitblit/ratchet-common/lib/jwt/expired-jwt-handling.js';
|
|
6
7
|
export class LocalWebTokenManipulator {
|
|
8
|
+
encryptionKeys;
|
|
9
|
+
issuer;
|
|
10
|
+
_ratchet;
|
|
7
11
|
constructor(encryptionKeys, issuer) {
|
|
8
12
|
this.encryptionKeys = encryptionKeys;
|
|
9
13
|
this.issuer = issuer;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LocalWebTokenManipulator } from './local-web-token-manipulator.js';
|
|
2
|
+
import { Logger } from '@bitblit/ratchet-common/lib/logger/logger.js';
|
|
3
|
+
import { LoggerLevelName } from '@bitblit/ratchet-common/lib/logger/logger-level-name.js';
|
|
4
|
+
describe('#localWebTokenManipulator', function () {
|
|
5
|
+
it('should round trip a JWT token', async () => {
|
|
6
|
+
const svc = new LocalWebTokenManipulator(['1234567890'], 'test')
|
|
7
|
+
.withParseFailureLogLevel(LoggerLevelName.info)
|
|
8
|
+
.withExtraDecryptionKeys(['abcdefabcdef'])
|
|
9
|
+
.withOldKeyUseLogLevel(LoggerLevelName.info);
|
|
10
|
+
const testUser = {
|
|
11
|
+
data1: 'test',
|
|
12
|
+
data2: 15,
|
|
13
|
+
};
|
|
14
|
+
const token = await svc.createJWTStringAsync('test123@test.com', testUser);
|
|
15
|
+
Logger.info('Generated token : %s', token);
|
|
16
|
+
expect(token).toBeTruthy();
|
|
17
|
+
const outputUser = await svc.parseAndValidateJWTStringAsync(token);
|
|
18
|
+
Logger.info('Got result : %j', outputUser);
|
|
19
|
+
expect(outputUser).toBeTruthy();
|
|
20
|
+
expect(outputUser.user).toBeTruthy();
|
|
21
|
+
expect(outputUser.user['data1']).toEqual(testUser.data1);
|
|
22
|
+
expect(outputUser.user['data2']).toEqual(testUser.data2);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Service for handling auth tokens
|
|
3
|
-
*/
|
|
4
|
-
import { JwtTokenBase } from '@bitblit/ratchet-common';
|
|
1
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common/lib/jwt/jwt-token-base.js';
|
|
5
2
|
export interface WebTokenManipulator<T extends JwtTokenBase> {
|
|
6
3
|
extractTokenFromAuthorizationHeader(header: string): Promise<T>;
|
|
7
4
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class BadGateway extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 502;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(BadGateway.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
BadGateway.HTTP_CODE = 502;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class BadRequestError extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 400;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(BadRequestError.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
BadRequestError.HTTP_CODE = 400;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class ConflictError extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 409;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(ConflictError.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
ConflictError.HTTP_CODE = 409;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import util from 'util';
|
|
2
|
-
import { NumberRatchet } from '@bitblit/ratchet-common';
|
|
2
|
+
import { NumberRatchet } from '@bitblit/ratchet-common/lib/lang/number-ratchet.js';
|
|
3
3
|
export class EpsilonHttpError extends Error {
|
|
4
|
+
static EPSILON_HTTP_ERROR_FLAG_KEY = '__epsilonHttpErrorFlag';
|
|
5
|
+
_httpStatusCode = 500;
|
|
6
|
+
_errors;
|
|
7
|
+
_detailErrorCode;
|
|
8
|
+
_endUserErrors;
|
|
9
|
+
_details;
|
|
10
|
+
_requestId;
|
|
11
|
+
_wrappedError;
|
|
4
12
|
constructor(...errors) {
|
|
5
13
|
super(EpsilonHttpError.combineErrorStringsWithDefault(errors));
|
|
6
|
-
this._httpStatusCode = 500;
|
|
7
14
|
Object.setPrototypeOf(this, EpsilonHttpError.prototype);
|
|
8
15
|
this._errors = errors;
|
|
9
16
|
this[EpsilonHttpError.EPSILON_HTTP_ERROR_FLAG_KEY] = true;
|
|
@@ -124,4 +131,3 @@ export class EpsilonHttpError extends Error {
|
|
|
124
131
|
return EpsilonHttpError.errorIsX0x(err, 5);
|
|
125
132
|
}
|
|
126
133
|
}
|
|
127
|
-
EpsilonHttpError.EPSILON_HTTP_ERROR_FLAG_KEY = '__epsilonHttpErrorFlag';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
|
+
describe('#epsilonHttpError', function () {
|
|
3
|
+
it('chould check if the error is a given class', async () => {
|
|
4
|
+
const testError = new EpsilonHttpError('test').withHttpStatusCode(404);
|
|
5
|
+
const nonHttpError = new Error('Not HTTP');
|
|
6
|
+
expect(EpsilonHttpError.errorIs40x(testError)).toBeTruthy();
|
|
7
|
+
expect(EpsilonHttpError.errorIs50x(testError)).toBeFalsy();
|
|
8
|
+
expect(EpsilonHttpError.errorIs40x(nonHttpError)).toBeFalsy();
|
|
9
|
+
expect(EpsilonHttpError.errorIs50x(testError)).toBeFalsy();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class ForbiddenError extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 403;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(ForbiddenError.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
ForbiddenError.HTTP_CODE = 403;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class GatewayTimeout extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 504;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(GatewayTimeout.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
GatewayTimeout.HTTP_CODE = 504;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export declare class MethodNotAllowedError<T = void> extends EpsilonHttpError<T> {
|
|
3
3
|
static readonly HTTP_CODE: number;
|
|
4
4
|
constructor(...errors: string[]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class MethodNotAllowedError extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 405;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(MethodNotAllowedError.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
MethodNotAllowedError.HTTP_CODE = 405;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export declare class MisconfiguredError<T = void> extends EpsilonHttpError<T> {
|
|
3
3
|
static readonly HTTP_CODE: number;
|
|
4
4
|
constructor(...errors: string[]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class MisconfiguredError extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 500;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(MisconfiguredError.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
MisconfiguredError.HTTP_CODE = 500;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class NotFoundError extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 404;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(NotFoundError.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
NotFoundError.HTTP_CODE = 404;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class NotImplemented extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 501;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(NotImplemented.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
NotImplemented.HTTP_CODE = 501;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export declare class RequestTimeoutError<T = void> extends EpsilonHttpError<T> {
|
|
3
3
|
static readonly HTTP_CODE: number;
|
|
4
4
|
constructor(...errors: string[]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export class RequestTimeoutError extends EpsilonHttpError {
|
|
3
|
+
static HTTP_CODE = 500;
|
|
3
4
|
constructor(...errors) {
|
|
4
5
|
super(...errors);
|
|
5
6
|
this.withHttpStatusCode(RequestTimeoutError.HTTP_CODE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
RequestTimeoutError.HTTP_CODE = 500;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EpsilonHttpError } from './epsilon-http-error';
|
|
1
|
+
import { EpsilonHttpError } from './epsilon-http-error.js';
|
|
2
2
|
export declare class ServiceUnavailable<T = void> extends EpsilonHttpError<T> {
|
|
3
3
|
static readonly HTTP_CODE: number;
|
|
4
4
|
constructor(...errors: string[]);
|