@bitblit/ratchet-epsilon-common 4.0.98-alpha → 4.0.102-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/dist/{types/background → background}/background-dynamo-log-table-handler.d.ts +3 -3
- package/dist/{es/background → background}/background-dynamo-log-table-handler.js +6 -2
- package/dist/{types/background → background}/background-execution-event.d.ts +1 -1
- package/dist/{types/background → background}/background-execution-listener.d.ts +1 -1
- package/dist/{types/background → background}/background-handler.d.ts +5 -9
- package/dist/{es/background → background}/background-handler.js +15 -7
- package/dist/{types/background → background}/background-http-adapter-handler.d.ts +7 -11
- package/dist/{es/background → background}/background-http-adapter-handler.js +13 -8
- package/dist/{types/background → background}/background-queue-response-internal.d.ts +1 -1
- package/dist/{types/background → background}/background-validator.d.ts +5 -8
- package/dist/{es/background → background}/background-validator.js +5 -3
- package/dist/{es/background → background}/epsilon-background-process-error.js +6 -1
- package/dist/{types/background → background}/internal-background-entry.d.ts +1 -1
- package/dist/{types/background → background}/manager/abstract-background-manager.d.ts +3 -10
- package/dist/{es/background → background}/manager/abstract-background-manager.js +5 -4
- package/dist/{types/background → background}/manager/aws-sqs-sns-background-manager.d.ts +4 -11
- package/dist/{es/background → background}/manager/aws-sqs-sns-background-manager.js +9 -5
- package/dist/{types/background → background}/manager/background-manager-like.d.ts +2 -9
- package/dist/background/manager/background-manager.spec.js +73 -0
- package/dist/{types/background → background}/manager/single-thread-local-background-manager.d.ts +3 -10
- package/dist/{es/background → background}/manager/single-thread-local-background-manager.js +3 -3
- package/dist/{types/background → background}/s3-background-transaction-logger.d.ts +2 -2
- package/dist/{es/background → background}/s3-background-transaction-logger.js +6 -3
- package/dist/{types/build → build}/ratchet-epsilon-common-info.d.ts +1 -1
- package/dist/{types/built-in → built-in}/background/echo-processor.d.ts +2 -2
- package/dist/{es/built-in → built-in}/background/echo-processor.js +4 -3
- package/dist/{types/built-in → built-in}/background/log-and-enqueue-echo-processor.d.ts +2 -2
- package/dist/{es/built-in → built-in}/background/log-and-enqueue-echo-processor.js +2 -2
- package/dist/{types/built-in → built-in}/background/log-message-background-error-processor.d.ts +2 -2
- package/dist/{es/built-in → built-in}/background/log-message-background-error-processor.js +1 -1
- package/dist/{types/built-in → built-in}/background/no-op-processor.d.ts +2 -2
- package/dist/{es/built-in → built-in}/background/no-op-processor.js +1 -1
- package/dist/{types/built-in → built-in}/background/retry-processor.d.ts +2 -2
- package/dist/{es/built-in → built-in}/background/retry-processor.js +8 -4
- package/dist/{types/built-in → built-in}/background/sample-delay-processor.d.ts +2 -2
- package/dist/{es/built-in → built-in}/background/sample-delay-processor.js +2 -1
- package/dist/{types/built-in → built-in}/background/sample-input-validated-processor.d.ts +3 -3
- package/dist/{es/built-in → built-in}/background/sample-input-validated-processor.js +1 -1
- package/dist/{es/built-in → built-in}/built-in-trace-id-generators.js +2 -2
- package/dist/{types/built-in → built-in}/daemon/daemon-authorizer-function.d.ts +2 -2
- package/dist/{types/built-in → built-in}/daemon/daemon-config.d.ts +2 -2
- package/dist/{types/built-in → built-in}/daemon/daemon-group-selection-function.d.ts +1 -1
- package/dist/{types/built-in → built-in}/daemon/daemon-handler.d.ts +6 -12
- package/dist/{es/built-in → built-in}/daemon/daemon-handler.js +9 -8
- package/dist/built-in/daemon/daemon-process-state-list.d.ts +5 -0
- package/dist/{types/built-in → built-in}/http/apollo-filter.d.ts +2 -2
- package/dist/{es/built-in → built-in}/http/apollo-filter.js +6 -5
- package/dist/{types/built-in → built-in}/http/built-in-auth-filters.d.ts +3 -3
- package/dist/{es/built-in → built-in}/http/built-in-auth-filters.js +5 -5
- package/dist/{types/built-in → built-in}/http/built-in-authorizers.d.ts +2 -2
- package/dist/{es/built-in → built-in}/http/built-in-authorizers.js +1 -1
- package/dist/{types/built-in → built-in}/http/built-in-filters.d.ts +2 -2
- package/dist/{es/built-in → built-in}/http/built-in-filters.js +9 -9
- package/dist/{types/built-in → built-in}/http/built-in-handlers.d.ts +2 -2
- package/dist/{es/built-in → built-in}/http/built-in-handlers.js +10 -10
- package/dist/{types/built-in → built-in}/http/log-level-manipulation-filter.d.ts +1 -4
- package/dist/{es/built-in → built-in}/http/log-level-manipulation-filter.js +2 -2
- package/dist/{types/built-in → built-in}/http/run-handler-as-filter.d.ts +5 -5
- package/dist/{es/built-in → built-in}/http/run-handler-as-filter.js +8 -8
- package/dist/built-in/http/run-handler-as-filter.spec.js +40 -0
- package/dist/{types/cli-bootstrap → cli-bootstrap}/ratchet-cli-handler.d.ts +2 -2
- package/dist/{es/cli-bootstrap → cli-bootstrap}/ratchet-cli-handler.js +6 -6
- package/dist/cli-bootstrap/run-background-process-from-command-line.d.ts +3 -0
- package/dist/{es/cli-bootstrap → cli-bootstrap}/run-background-process-from-command-line.js +2 -2
- package/dist/{types/config → config}/background/background-config.d.ts +4 -4
- package/dist/{types/config → config}/background/background-error-processor.d.ts +1 -1
- package/dist/{types/config → config}/background/background-processor.d.ts +1 -1
- package/dist/{types/config → config}/background/background-transaction-log.d.ts +1 -1
- package/dist/{types/config → config}/background/background-transaction-logger.d.ts +1 -1
- package/dist/config/cron/cron-background-entry.d.ts +6 -0
- package/dist/{types/config → config}/cron/cron-config.d.ts +1 -1
- package/dist/{types/config → config}/dynamo-db-config.d.ts +1 -1
- package/dist/{types/config → config}/epsilon-config.d.ts +8 -8
- package/dist/{types/config → config}/epsilon-logger-config.d.ts +3 -2
- package/dist/{types/config → config}/http/authorizer-function.d.ts +3 -3
- package/dist/{types/config → config}/http/extended-api-gateway-event.d.ts +1 -1
- package/dist/{types/config → config}/http/filter-chain-context.d.ts +4 -4
- package/dist/{types/config → config}/http/filter-function.d.ts +1 -1
- package/dist/{types/config → config}/http/handler-function.d.ts +1 -1
- package/dist/{types/config → config}/http/http-config.d.ts +5 -5
- package/dist/{types/config → config}/http/http-processing-config.d.ts +2 -2
- package/dist/{types/config → config}/http/mapped-http-processing-config.d.ts +1 -1
- package/dist/{types/config → config}/inter-api/inter-api-config.d.ts +2 -2
- package/dist/config/inter-api/inter-api-process-mapping.d.ts +6 -0
- package/dist/{types/config → config}/open-api/open-api-document.d.ts +2 -2
- package/dist/{types/config → config}/s3-config.d.ts +1 -1
- package/dist/{types/config → config}/sns-config.d.ts +1 -1
- package/dist/{es/epsilon-build-properties.js → epsilon-build-properties.js} +1 -1
- package/dist/{types/epsilon-constants.d.ts → epsilon-constants.d.ts} +1 -1
- package/dist/{es/epsilon-constants.js → epsilon-constants.js} +13 -12
- package/dist/{types/epsilon-global-handler.d.ts → epsilon-global-handler.d.ts} +3 -6
- package/dist/{es/epsilon-global-handler.js → epsilon-global-handler.js} +23 -18
- package/dist/{types/epsilon-instance.d.ts → epsilon-instance.d.ts} +6 -11
- package/dist/epsilon-logging-extension-processor.d.ts +6 -0
- package/dist/{es/epsilon-logging-extension-processor.js → epsilon-logging-extension-processor.js} +1 -1
- package/dist/{types/http → http}/auth/api-gateway-adapter-authentication-handler.d.ts +0 -10
- package/dist/{es/http → http}/auth/api-gateway-adapter-authentication-handler.js +4 -3
- package/dist/{types/http → http}/auth/auth0-web-token-manipulator.d.ts +2 -2
- package/dist/{es/http → http}/auth/auth0-web-token-manipulator.js +6 -1
- package/dist/{types/http → http}/auth/basic-auth-token.d.ts +0 -3
- package/dist/{types/http → http}/auth/google-web-token-manipulator.d.ts +2 -2
- package/dist/{es/http → http}/auth/google-web-token-manipulator.js +6 -3
- package/dist/http/auth/google-web-token-manipulator.spec.js +10 -0
- package/dist/{types/http → http}/auth/jwt-ratchet-local-web-token-manipulator.d.ts +3 -5
- package/dist/{es/http → http}/auth/jwt-ratchet-local-web-token-manipulator.js +5 -3
- package/dist/{types/http → http}/auth/local-web-token-manipulator.d.ts +4 -5
- package/dist/{es/http → http}/auth/local-web-token-manipulator.js +9 -5
- package/dist/http/auth/local-web-token-manipulator.spec.js +24 -0
- package/dist/{types/http → http}/auth/web-token-manipulator.d.ts +1 -4
- package/dist/{types/http → http}/error/bad-gateway.d.ts +1 -1
- package/dist/{es/http → http}/error/bad-gateway.js +2 -2
- package/dist/{types/http → http}/error/bad-request-error.d.ts +1 -1
- package/dist/{es/http → http}/error/bad-request-error.js +2 -2
- package/dist/{types/http → http}/error/conflict-error.d.ts +1 -1
- package/dist/{es/http → http}/error/conflict-error.js +2 -2
- package/dist/{es/http → http}/error/epsilon-http-error.js +9 -3
- package/dist/http/error/epsilon-http-error.spec.js +11 -0
- package/dist/{types/http → http}/error/forbidden-error.d.ts +1 -1
- package/dist/{es/http → http}/error/forbidden-error.js +2 -2
- package/dist/{types/http → http}/error/gateway-timeout.d.ts +1 -1
- package/dist/{es/http → http}/error/gateway-timeout.js +2 -2
- package/dist/{types/http → http}/error/method-not-allowed-error.d.ts +1 -1
- package/dist/{es/http → http}/error/method-not-allowed-error.js +2 -2
- package/dist/{types/http → http}/error/misconfigured-error.d.ts +1 -1
- package/dist/{es/http → http}/error/misconfigured-error.js +2 -2
- package/dist/{types/http → http}/error/not-found-error.d.ts +1 -1
- package/dist/{es/http → http}/error/not-found-error.js +2 -2
- package/dist/{types/http → http}/error/not-implemented.d.ts +1 -1
- package/dist/{es/http → http}/error/not-implemented.js +2 -2
- package/dist/{types/http → http}/error/request-timeout-error.d.ts +1 -1
- package/dist/{es/http → http}/error/request-timeout-error.js +2 -2
- package/dist/{types/http → http}/error/service-unavailable.d.ts +1 -1
- package/dist/{es/http → http}/error/service-unavailable.js +2 -2
- package/dist/{types/http → http}/error/too-many-requests-error.d.ts +1 -1
- package/dist/{es/http → http}/error/too-many-requests-error.js +2 -2
- package/dist/{types/http → http}/error/unauthorized-error.d.ts +1 -1
- package/dist/{es/http → http}/error/unauthorized-error.js +2 -2
- package/dist/{types/http → http}/event-util.d.ts +3 -25
- package/dist/{es/http → http}/event-util.js +9 -8
- package/dist/http/event-util.spec.js +157 -0
- package/dist/{types/http → http}/response-util.d.ts +2 -2
- package/dist/{es/http → http}/response-util.js +2 -2
- package/dist/http/response-util.spec.d.ts +1 -0
- package/dist/http/response-util.spec.js +88 -0
- package/dist/http/route/epsilon-router.d.ts +8 -0
- package/dist/http/route/epsilon-router.js +1 -0
- package/dist/http/route/extended-auth-response-context.js +1 -0
- package/dist/{types/http → http}/route/route-mapping.d.ts +3 -3
- package/dist/http/route/route-mapping.js +1 -0
- package/dist/http/route/route-validator-config.js +1 -0
- package/dist/{types/http → http}/route/router-util.d.ts +9 -12
- package/dist/{es/http → http}/route/router-util.js +10 -10
- package/dist/http/route/router-util.spec.d.ts +1 -0
- package/dist/http/route/router-util.spec.js +23 -0
- package/dist/{types/http → http}/web-handler.d.ts +4 -7
- package/dist/{es/http → http}/web-handler.js +11 -10
- package/dist/http/web-handler.spec.d.ts +1 -0
- package/dist/http/web-handler.spec.js +32 -0
- package/dist/{types/http → http}/web-v2-handler.d.ts +2 -5
- package/dist/{es/http → http}/web-v2-handler.js +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/inter-api/inter-api-entry.js +1 -0
- package/dist/{types/inter-api → inter-api}/inter-api-util.d.ts +3 -3
- package/dist/{es/inter-api → inter-api}/inter-api-util.js +6 -5
- package/dist/inter-api/inter-api-util.spec.d.ts +1 -0
- package/dist/inter-api/inter-api-util.spec.js +61 -0
- package/dist/{types/inter-api-manager.d.ts → inter-api-manager.d.ts} +2 -5
- package/dist/{es/inter-api-manager.js → inter-api-manager.js} +5 -3
- package/dist/{types/lambda-event-handler → lambda-event-handler}/cron-epsilon-lambda-event-handler.d.ts +5 -5
- package/dist/{es/lambda-event-handler → lambda-event-handler}/cron-epsilon-lambda-event-handler.js +5 -4
- package/dist/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.d.ts +1 -0
- package/dist/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.js +50 -0
- package/dist/{types/lambda-event-handler → lambda-event-handler}/dynamo-epsilon-lambda-event-handler.d.ts +2 -2
- package/dist/{es/lambda-event-handler → lambda-event-handler}/dynamo-epsilon-lambda-event-handler.js +4 -3
- package/dist/{types/lambda-event-handler → lambda-event-handler}/generic-sns-epsilon-lambda-event-handler.d.ts +2 -2
- package/dist/{es/lambda-event-handler → lambda-event-handler}/generic-sns-epsilon-lambda-event-handler.js +4 -3
- package/dist/{types/lambda-event-handler → lambda-event-handler}/inter-api-epsilon-lambda-event-handler.d.ts +2 -2
- package/dist/{es/lambda-event-handler → lambda-event-handler}/inter-api-epsilon-lambda-event-handler.js +2 -1
- package/dist/{types/lambda-event-handler → lambda-event-handler}/s3-epsilon-lambda-event-handler.d.ts +2 -2
- package/dist/{es/lambda-event-handler → lambda-event-handler}/s3-epsilon-lambda-event-handler.js +4 -3
- package/dist/{types/local-container-server.d.ts → local-container-server.d.ts} +1 -4
- package/dist/{es/local-container-server.js → local-container-server.js} +8 -4
- package/dist/local-server-cert.js +67 -0
- package/dist/{types/local-server.d.ts → local-server.d.ts} +2 -5
- package/dist/{es/local-server.js → local-server.js} +11 -8
- package/dist/open-api-util/open-api-doc-modifications.js +1 -0
- package/dist/{types/open-api-util → open-api-util}/open-api-doc-modifier.d.ts +1 -4
- package/dist/{es/open-api-util → open-api-util}/open-api-doc-modifier.js +2 -1
- package/dist/open-api-util/open-api-doc-modifier.spec.d.ts +1 -0
- package/dist/open-api-util/open-api-doc-modifier.spec.js +16 -0
- package/dist/{es/open-api-util → open-api-util}/yaml-combiner.js +2 -2
- package/dist/open-api-util/yaml-combiner.spec.d.ts +1 -0
- package/dist/open-api-util/yaml-combiner.spec.js +22 -0
- package/dist/{types/sample → sample}/sample-server-components.d.ts +2 -2
- package/dist/{es/sample → sample}/sample-server-components.js +25 -24
- package/dist/sample/sample-server-static-files.js +593 -0
- package/dist/{types/sample → sample}/test-error-server.d.ts +1 -4
- package/dist/{es/sample → sample}/test-error-server.js +4 -2
- package/dist/{types/util → util}/context-util.d.ts +3 -3
- package/dist/{es/util → util}/context-util.js +11 -5
- package/dist/{types/util → util}/cron-util.d.ts +2 -2
- package/dist/{es/util → util}/cron-util.js +3 -3
- package/dist/util/cron-util.spec.d.ts +1 -0
- package/dist/util/cron-util.spec.js +124 -0
- package/dist/{types/util → util}/epsilon-config-parser.d.ts +6 -6
- package/dist/{es/util → util}/epsilon-config-parser.js +9 -9
- package/includes/cli.js +8 -10
- 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/dist/{types/background → background}/background-entry.d.ts +0 -0
- /package/dist/{es/background → background}/background-entry.js +0 -0
- /package/dist/{types/background → background}/background-execution-event-type.d.ts +0 -0
- /package/dist/{es/background → background}/background-execution-event-type.js +0 -0
- /package/dist/{es/background → background}/background-execution-event.js +0 -0
- /package/dist/{es/background → background}/background-execution-listener.js +0 -0
- /package/dist/{types/background → background}/background-meta-response-internal.d.ts +0 -0
- /package/dist/{es/background → background}/background-meta-response-internal.js +0 -0
- /package/dist/{types/background → background}/background-process-handling.d.ts +0 -0
- /package/dist/{es/background → background}/background-process-handling.js +0 -0
- /package/dist/{types/background → background}/background-process-log-table-entry.d.ts +0 -0
- /package/dist/{es/background → background}/background-process-log-table-entry.js +0 -0
- /package/dist/{es/background → background}/background-queue-response-internal.js +0 -0
- /package/dist/{types/background → background}/epsilon-background-process-error.d.ts +0 -0
- /package/dist/{es/background → background}/internal-background-entry.js +0 -0
- /package/dist/{es/background → background}/manager/background-manager-like.js +0 -0
- /package/dist/{es/built-in/background/sample-input-validated-processor-data.js → background/manager/background-manager.spec.d.ts} +0 -0
- /package/dist/{es/build → build}/ratchet-epsilon-common-info.js +0 -0
- /package/dist/{types/built-in → built-in}/background/sample-input-validated-processor-data.d.ts +0 -0
- /package/dist/{es/built-in/daemon/daemon-authorizer-function.js → built-in/background/sample-input-validated-processor-data.js} +0 -0
- /package/dist/{types/built-in → built-in}/built-in-trace-id-generators.d.ts +0 -0
- /package/dist/{es/built-in/daemon/daemon-config.js → built-in/daemon/daemon-authorizer-function.js} +0 -0
- /package/dist/{es/built-in/daemon/daemon-group-selection-function.js → built-in/daemon/daemon-config.js} +0 -0
- /package/dist/{es/built-in/daemon/daemon-process-state-list.js → built-in/daemon/daemon-group-selection-function.js} +0 -0
- /package/dist/{es/config/background/background-aws-config.js → built-in/daemon/daemon-process-state-list.js} +0 -0
- /package/dist/{es/config/background/background-config.js → built-in/http/run-handler-as-filter.spec.d.ts} +0 -0
- /package/dist/{types/config → config}/background/background-aws-config.d.ts +0 -0
- /package/dist/{es/config/background/background-error-processor.js → config/background/background-aws-config.js} +0 -0
- /package/dist/{es/config/background/background-processor.js → config/background/background-config.js} +0 -0
- /package/dist/{es/config/background/background-transaction-log.js → config/background/background-error-processor.js} +0 -0
- /package/dist/{es/config/background/background-transaction-logger.js → config/background/background-processor.js} +0 -0
- /package/dist/{es/config/cron/abstract-cron-entry.js → config/background/background-transaction-log.js} +0 -0
- /package/dist/{es/config/cron/cron-background-entry.js → config/background/background-transaction-logger.js} +0 -0
- /package/dist/{types/config → config}/cron/abstract-cron-entry.d.ts +0 -0
- /package/dist/{es/config/cron/cron-config.js → config/cron/abstract-cron-entry.js} +0 -0
- /package/dist/{es/config/dynamo-db-config.js → config/cron/cron-background-entry.js} +0 -0
- /package/dist/{es/config/epsilon-config.js → config/cron/cron-config.js} +0 -0
- /package/dist/{es/config/epsilon-lambda-event-handler.js → config/dynamo-db-config.js} +0 -0
- /package/dist/{es/config/epsilon-logger-config.js → config/epsilon-config.js} +0 -0
- /package/dist/{types/config → config}/epsilon-lambda-event-handler.d.ts +0 -0
- /package/dist/{es/config/generic-aws-event-handler-function.js → config/epsilon-lambda-event-handler.js} +0 -0
- /package/dist/{es/config/http/authorizer-function.js → config/epsilon-logger-config.js} +0 -0
- /package/dist/{types/config → config}/generic-aws-event-handler-function.d.ts +0 -0
- /package/dist/{es/config/http/epsilon-authorization-context.js → config/generic-aws-event-handler-function.js} +0 -0
- /package/dist/{es/config/http/extended-api-gateway-event.js → config/http/authorizer-function.js} +0 -0
- /package/dist/{types/config → config}/http/epsilon-authorization-context.d.ts +0 -0
- /package/dist/{es/config/http/filter-chain-context.js → config/http/epsilon-authorization-context.js} +0 -0
- /package/dist/{es/config/http/filter-function.js → config/http/extended-api-gateway-event.js} +0 -0
- /package/dist/{es/config/http/handler-function.js → config/http/filter-chain-context.js} +0 -0
- /package/dist/{es/config/http/http-config.js → config/http/filter-function.js} +0 -0
- /package/dist/{es/config/http/http-processing-config.js → config/http/handler-function.js} +0 -0
- /package/dist/{es/config/http/mapped-http-processing-config.js → config/http/http-config.js} +0 -0
- /package/dist/{es/config/inter-api/inter-api-aws-config.js → config/http/http-processing-config.js} +0 -0
- /package/dist/{es/config/inter-api/inter-api-config.js → config/http/mapped-http-processing-config.js} +0 -0
- /package/dist/{types/config → config}/http/null-returned-object-handling.d.ts +0 -0
- /package/dist/{es/config → config}/http/null-returned-object-handling.js +0 -0
- /package/dist/{types/config → config}/inter-api/inter-api-aws-config.d.ts +0 -0
- /package/dist/{es/config/inter-api/inter-api-process-mapping.js → config/inter-api/inter-api-aws-config.js} +0 -0
- /package/dist/{es/config/logging-trace-id-generator.js → config/inter-api/inter-api-config.js} +0 -0
- /package/dist/{es/config/open-api/open-api-document-components.js → config/inter-api/inter-api-process-mapping.js} +0 -0
- /package/dist/{types/config → config}/logging-trace-id-generator.d.ts +0 -0
- /package/dist/{es/config/open-api/open-api-document-path.js → config/logging-trace-id-generator.js} +0 -0
- /package/dist/{types/config → config}/open-api/open-api-document-components.d.ts +0 -0
- /package/dist/{es/config/open-api/open-api-document.js → config/open-api/open-api-document-components.js} +0 -0
- /package/dist/{types/config → config}/open-api/open-api-document-path.d.ts +0 -0
- /package/dist/{es/config/s3-config.js → config/open-api/open-api-document-path.js} +0 -0
- /package/dist/{es/config/sns-config.js → config/open-api/open-api-document.js} +0 -0
- /package/dist/{es/epsilon-instance.js → config/s3-config.js} +0 -0
- /package/dist/{es/http/auth/basic-auth-token.js → config/sns-config.js} +0 -0
- /package/dist/{types/epsilon-build-properties.d.ts → epsilon-build-properties.d.ts} +0 -0
- /package/dist/{es/http/auth/web-token-manipulator.js → epsilon-instance.js} +0 -0
- /package/dist/{es/http/route/epsilon-router.js → http/auth/basic-auth-token.js} +0 -0
- /package/dist/{es/http/route/extended-auth-response-context.js → http/auth/google-web-token-manipulator.spec.d.ts} +0 -0
- /package/dist/{es/http/route/route-mapping.js → http/auth/local-web-token-manipulator.spec.d.ts} +0 -0
- /package/dist/{es/http/route/route-validator-config.js → http/auth/web-token-manipulator.js} +0 -0
- /package/dist/{types/http → http}/error/epsilon-http-error.d.ts +0 -0
- /package/dist/{es/inter-api/inter-api-entry.js → http/error/epsilon-http-error.spec.d.ts} +0 -0
- /package/dist/{es/open-api-util/open-api-doc-modifications.js → http/event-util.spec.d.ts} +0 -0
- /package/dist/{types/http → http}/route/extended-auth-response-context.d.ts +0 -0
- /package/dist/{types/http → http}/route/route-validator-config.d.ts +0 -0
- /package/dist/{types/inter-api → inter-api}/inter-api-entry.d.ts +0 -0
- /package/dist/{types/local-server-cert.d.ts → local-server-cert.d.ts} +0 -0
- /package/dist/{types/open-api-util → open-api-util}/open-api-doc-modifications.d.ts +0 -0
- /package/dist/{types/open-api-util → open-api-util}/yaml-combiner.d.ts +0 -0
- /package/dist/{types/sample → sample}/sample-server-static-files.d.ts +0 -0
- /package/dist/{types/util → util}/aws-util.d.ts +0 -0
- /package/dist/{es/util → util}/aws-util.js +0 -0
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RouterUtil = void 0;
|
|
4
|
-
const misconfigured_error_1 = require("../error/misconfigured-error");
|
|
5
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
6
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
7
|
-
const null_returned_object_handling_1 = require("../../config/http/null-returned-object-handling");
|
|
8
|
-
const built_in_filters_1 = require("../../built-in/http/built-in-filters");
|
|
9
|
-
const built_in_handlers_1 = require("../../built-in/http/built-in-handlers");
|
|
10
|
-
const built_in_auth_filters_1 = require("../../built-in/http/built-in-auth-filters");
|
|
11
|
-
const log_level_manipulation_filter_1 = require("../../built-in/http/log-level-manipulation-filter");
|
|
12
|
-
class RouterUtil {
|
|
13
|
-
constructor() { }
|
|
14
|
-
static defaultAuthenticationHeaderParsingEpsilonPreFilters(webTokenManipulator) {
|
|
15
|
-
return [
|
|
16
|
-
(fCtx) => built_in_auth_filters_1.BuiltInAuthFilters.parseAuthorizationHeader(fCtx, webTokenManipulator),
|
|
17
|
-
(fCtx) => built_in_auth_filters_1.BuiltInAuthFilters.applyOpenApiAuthorization(fCtx),
|
|
18
|
-
].concat(RouterUtil.defaultEpsilonPreFilters());
|
|
19
|
-
}
|
|
20
|
-
static defaultEpsilonPreFilters() {
|
|
21
|
-
return [
|
|
22
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.autoRespondToOptionsRequestWithCors(fCtx),
|
|
23
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.ensureEventMaps(fCtx),
|
|
24
|
-
(fCtx) => log_level_manipulation_filter_1.LogLevelManipulationFilter.setLogLevelForTransaction(fCtx),
|
|
25
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.parseJsonBodyToObject(fCtx),
|
|
26
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.fixStillEncodedQueryParams(fCtx),
|
|
27
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.uriDecodeQueryParams(fCtx),
|
|
28
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.disallowStringNullAsPathParameter(fCtx),
|
|
29
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.disallowStringNullAsQueryStringParameter(fCtx),
|
|
30
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.validateInboundBody(fCtx),
|
|
31
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.validateInboundQueryParams(fCtx),
|
|
32
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.validateInboundQueryParams(fCtx),
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
static defaultEpsilonPostFilters() {
|
|
36
|
-
return [
|
|
37
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.validateOutboundResponse(fCtx),
|
|
38
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.addAWSRequestIdHeader(fCtx),
|
|
39
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.addAllowReflectionCORSHeaders(fCtx),
|
|
40
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.applyGzipIfPossible(fCtx),
|
|
41
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.checkMaximumLambdaBodySize(fCtx),
|
|
42
|
-
(fCtx) => log_level_manipulation_filter_1.LogLevelManipulationFilter.clearLogLevelForTransaction(fCtx),
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
|
-
static defaultEpsilonErrorFilters() {
|
|
46
|
-
return [
|
|
47
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.addAWSRequestIdHeader(fCtx),
|
|
48
|
-
(fCtx) => built_in_filters_1.BuiltInFilters.addAllowReflectionCORSHeaders(fCtx),
|
|
49
|
-
(fCtx) => log_level_manipulation_filter_1.LogLevelManipulationFilter.clearLogLevelForTransaction(fCtx),
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
static defaultHttpMetaProcessingConfigWithAuthenticationHeaderParsing(webTokenManipulator) {
|
|
53
|
-
const defaults = {
|
|
54
|
-
configName: 'EpsilonDefaultHttpMetaProcessingConfig',
|
|
55
|
-
timeoutMS: 30000,
|
|
56
|
-
overrideAuthorizerName: null,
|
|
57
|
-
preFilters: RouterUtil.defaultAuthenticationHeaderParsingEpsilonPreFilters(webTokenManipulator),
|
|
58
|
-
postFilters: RouterUtil.defaultEpsilonPostFilters(),
|
|
59
|
-
errorFilters: RouterUtil.defaultEpsilonErrorFilters(),
|
|
60
|
-
nullReturnedObjectHandling: null_returned_object_handling_1.NullReturnedObjectHandling.Return404NotFoundResponse,
|
|
61
|
-
};
|
|
62
|
-
return defaults;
|
|
63
|
-
}
|
|
64
|
-
static defaultHttpMetaProcessingConfig() {
|
|
65
|
-
const defaults = {
|
|
66
|
-
configName: 'EpsilonDefaultHttpMetaProcessingConfig',
|
|
67
|
-
timeoutMS: 30000,
|
|
68
|
-
overrideAuthorizerName: null,
|
|
69
|
-
preFilters: RouterUtil.defaultEpsilonPreFilters(),
|
|
70
|
-
postFilters: RouterUtil.defaultEpsilonPostFilters(),
|
|
71
|
-
errorFilters: RouterUtil.defaultEpsilonErrorFilters(),
|
|
72
|
-
nullReturnedObjectHandling: null_returned_object_handling_1.NullReturnedObjectHandling.Return404NotFoundResponse,
|
|
73
|
-
};
|
|
74
|
-
return defaults;
|
|
75
|
-
}
|
|
76
|
-
static assignDefaultsOnHttpConfig(cfg) {
|
|
77
|
-
const defaults = {
|
|
78
|
-
handlers: new Map(),
|
|
79
|
-
authorizers: new Map(),
|
|
80
|
-
defaultMetaHandling: this.defaultHttpMetaProcessingConfig(),
|
|
81
|
-
staticContentRoutes: {},
|
|
82
|
-
prefixesToStripBeforeRouteMatch: [],
|
|
83
|
-
filterHandledRouteMatches: ['options .*'],
|
|
84
|
-
};
|
|
85
|
-
const rval = Object.assign({}, defaults, cfg || {});
|
|
86
|
-
return rval;
|
|
87
|
-
}
|
|
88
|
-
static findApplicableMeta(httpConfig, method, path) {
|
|
89
|
-
let rval = null;
|
|
90
|
-
if (httpConfig === null || httpConfig === void 0 ? void 0 : httpConfig.overrideMetaHandling) {
|
|
91
|
-
for (let i = 0; i < httpConfig.overrideMetaHandling.length && !rval; i++) {
|
|
92
|
-
const test = httpConfig.overrideMetaHandling[i];
|
|
93
|
-
if (!test.methods ||
|
|
94
|
-
test.methods.length === 0 ||
|
|
95
|
-
test.methods.map((s) => s.toLocaleLowerCase()).includes(method.toLocaleLowerCase())) {
|
|
96
|
-
const matches = !!path.match(test.pathRegex);
|
|
97
|
-
if ((matches && !test.invertPathMatching) || (!matches && test.invertPathMatching)) {
|
|
98
|
-
rval = test.config;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (!rval) {
|
|
104
|
-
rval = httpConfig.defaultMetaHandling || RouterUtil.defaultHttpMetaProcessingConfig();
|
|
105
|
-
}
|
|
106
|
-
return rval;
|
|
107
|
-
}
|
|
108
|
-
static openApiYamlToRouterConfig(httpConfig, openApiDoc, modelValidator, backgroundHttpAdapterHandler) {
|
|
109
|
-
var _a;
|
|
110
|
-
if (!openApiDoc || !httpConfig) {
|
|
111
|
-
throw new misconfigured_error_1.MisconfiguredError('Cannot configure, missing either yaml or cfg');
|
|
112
|
-
}
|
|
113
|
-
const rval = {
|
|
114
|
-
routes: [],
|
|
115
|
-
openApiModelValidator: modelValidator,
|
|
116
|
-
config: RouterUtil.assignDefaultsOnHttpConfig(httpConfig),
|
|
117
|
-
};
|
|
118
|
-
if ((_a = openApiDoc === null || openApiDoc === void 0 ? void 0 : openApiDoc.components) === null || _a === void 0 ? void 0 : _a.securitySchemes) {
|
|
119
|
-
Object.keys(openApiDoc.components.securitySchemes).forEach((sk) => {
|
|
120
|
-
if (!rval.config.authorizers || !rval.config.authorizers.get(sk)) {
|
|
121
|
-
throw new misconfigured_error_1.MisconfiguredError().withFormattedErrorMessage('Doc requires authorizer %s but not found in map', sk);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
const missingPaths = [];
|
|
126
|
-
const filterHandledPathMatches = httpConfig.filterHandledRouteMatches || [];
|
|
127
|
-
if (openApiDoc === null || openApiDoc === void 0 ? void 0 : openApiDoc.paths) {
|
|
128
|
-
Object.keys(openApiDoc.paths).forEach((path) => {
|
|
129
|
-
Object.keys(openApiDoc.paths[path]).forEach((method) => {
|
|
130
|
-
const convertedPath = RouterUtil.openApiPathToRouteParserPath(path);
|
|
131
|
-
const finder = method + ' ' + path;
|
|
132
|
-
const applicableMeta = RouterUtil.findApplicableMeta(httpConfig, method, path);
|
|
133
|
-
const entry = openApiDoc.paths[path][method];
|
|
134
|
-
const isBackgroundEndpoint = path.startsWith(backgroundHttpAdapterHandler.httpSubmissionPath);
|
|
135
|
-
const isBackgroundMetaEndpoint = path === backgroundHttpAdapterHandler.httpMetaEndpoint;
|
|
136
|
-
const isBackgroundStatusEndpoint = path === backgroundHttpAdapterHandler.httpStatusPath;
|
|
137
|
-
if (isBackgroundEndpoint) {
|
|
138
|
-
rval.config.handlers.set(finder, (evt, ctx) => backgroundHttpAdapterHandler.handleBackgroundSubmission(evt, ctx));
|
|
139
|
-
}
|
|
140
|
-
if (isBackgroundMetaEndpoint) {
|
|
141
|
-
rval.config.handlers.set(finder, (evt, ctx) => backgroundHttpAdapterHandler.handleBackgroundMetaRequest(evt, ctx));
|
|
142
|
-
}
|
|
143
|
-
if (isBackgroundStatusEndpoint) {
|
|
144
|
-
rval.config.handlers.set(finder, (evt, ctx) => backgroundHttpAdapterHandler.handleBackgroundStatusRequest(evt, ctx));
|
|
145
|
-
}
|
|
146
|
-
if (!rval.config.handlers || !rval.config.handlers.get(finder)) {
|
|
147
|
-
const match = filterHandledPathMatches.find((reg) => finder.match(reg));
|
|
148
|
-
if (match) {
|
|
149
|
-
ratchet_common_1.Logger.debug('Adding filter-handled handler for %s', finder);
|
|
150
|
-
rval.config.handlers.set(finder, (evt) => built_in_handlers_1.BuiltInHandlers.expectedHandledByFilter(evt));
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
missingPaths.push(finder);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (entry && entry['security'] && entry['security'].length > 1) {
|
|
157
|
-
throw new misconfigured_error_1.MisconfiguredError('Epsilon does not currently support multiple security (path was ' + finder + ')');
|
|
158
|
-
}
|
|
159
|
-
const authorizerName = entry['security'] && entry['security'].length == 1 ? Object.keys(entry['security'][0])[0] : null;
|
|
160
|
-
const newRoute = {
|
|
161
|
-
path: convertedPath,
|
|
162
|
-
method: method,
|
|
163
|
-
function: rval.config.handlers.get(finder),
|
|
164
|
-
authorizerName: applicableMeta.overrideAuthorizerName || authorizerName,
|
|
165
|
-
metaProcessingConfig: applicableMeta,
|
|
166
|
-
validation: null,
|
|
167
|
-
outboundValidation: null,
|
|
168
|
-
};
|
|
169
|
-
if (entry['requestBody'] &&
|
|
170
|
-
entry['requestBody']['content'] &&
|
|
171
|
-
entry['requestBody']['content']['application/json'] &&
|
|
172
|
-
entry['requestBody']['content']['application/json']['schema']) {
|
|
173
|
-
const schema = entry['requestBody']['content'];
|
|
174
|
-
ratchet_common_1.Logger.silly('Applying schema %j to %s', schema, finder);
|
|
175
|
-
const modelName = this.findAndValidateModelName(method, path, schema, rval.config.overrideModelValidator || rval.openApiModelValidator);
|
|
176
|
-
const required = ratchet_common_2.BooleanRatchet.parseBool(entry['requestBody']['required']);
|
|
177
|
-
const validation = {
|
|
178
|
-
extraPropertiesAllowed: true,
|
|
179
|
-
emptyAllowed: !required,
|
|
180
|
-
modelName: modelName,
|
|
181
|
-
};
|
|
182
|
-
newRoute.validation = validation;
|
|
183
|
-
}
|
|
184
|
-
if (entry['responses'] &&
|
|
185
|
-
entry['responses']['200'] &&
|
|
186
|
-
entry['responses']['200']['content'] &&
|
|
187
|
-
entry['responses']['200']['content']['application/json'] &&
|
|
188
|
-
entry['responses']['200']['content']['application/json']['schema']) {
|
|
189
|
-
const schema = entry['responses']['200']['content'];
|
|
190
|
-
ratchet_common_1.Logger.silly('Applying schema %j to %s', schema, finder);
|
|
191
|
-
const modelName = this.findAndValidateModelName(method, path, schema, rval.config.overrideModelValidator || rval.openApiModelValidator);
|
|
192
|
-
const validation = {
|
|
193
|
-
extraPropertiesAllowed: false,
|
|
194
|
-
emptyAllowed: false,
|
|
195
|
-
modelName: modelName,
|
|
196
|
-
};
|
|
197
|
-
newRoute.outboundValidation = validation;
|
|
198
|
-
}
|
|
199
|
-
rval.routes.push(newRoute);
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
if (missingPaths.length > 0) {
|
|
204
|
-
throw new misconfigured_error_1.MisconfiguredError().withFormattedErrorMessage('Missing expected handlers : %j', missingPaths);
|
|
205
|
-
}
|
|
206
|
-
return rval;
|
|
207
|
-
}
|
|
208
|
-
static findAndValidateModelName(method, path, schema, modelValidator) {
|
|
209
|
-
let rval = undefined;
|
|
210
|
-
const schemaPath = schema['application/json']['schema']['$ref'];
|
|
211
|
-
const inlinePath = schema['application/json']['schema']['type'];
|
|
212
|
-
if (schemaPath) {
|
|
213
|
-
rval = schemaPath.substring(schemaPath.lastIndexOf('/') + 1);
|
|
214
|
-
if (!modelValidator.fetchModel(rval)) {
|
|
215
|
-
throw new misconfigured_error_1.MisconfiguredError(`Path ${method} ${path} refers to schema ${rval} but its not in the schema section`);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
else if (inlinePath) {
|
|
219
|
-
rval = `${method}-${path}-requestBodyModel`;
|
|
220
|
-
const model = schema['application/json']['schema'];
|
|
221
|
-
modelValidator.addModel(rval, model);
|
|
222
|
-
}
|
|
223
|
-
return rval;
|
|
224
|
-
}
|
|
225
|
-
static openApiPathToRouteParserPath(input) {
|
|
226
|
-
let rval = input;
|
|
227
|
-
if (rval) {
|
|
228
|
-
let sIdx = rval.indexOf('{');
|
|
229
|
-
while (sIdx > -1) {
|
|
230
|
-
const eIdx = rval.indexOf('}');
|
|
231
|
-
rval = rval.substring(0, sIdx) + ':' + rval.substring(sIdx + 1, eIdx) + rval.substring(eIdx + 1);
|
|
232
|
-
sIdx = rval.indexOf('{');
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return rval;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
exports.RouterUtil = RouterUtil;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebHandler = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
6
|
-
const route_parser_1 = tslib_1.__importDefault(require("route-parser"));
|
|
7
|
-
const response_util_1 = require("./response-util");
|
|
8
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
9
|
-
const epsilon_http_error_1 = require("./error/epsilon-http-error");
|
|
10
|
-
const built_in_filters_1 = require("../built-in/http/built-in-filters");
|
|
11
|
-
const run_handler_as_filter_1 = require("../built-in/http/run-handler-as-filter");
|
|
12
|
-
const context_util_1 = require("../util/context-util");
|
|
13
|
-
const ratchet_common_3 = require("@bitblit/ratchet-common");
|
|
14
|
-
const ratchet_aws_1 = require("@bitblit/ratchet-aws");
|
|
15
|
-
class WebHandler {
|
|
16
|
-
constructor(routerConfig) {
|
|
17
|
-
this.routerConfig = routerConfig;
|
|
18
|
-
ratchet_common_2.RequireRatchet.notNullOrUndefined(routerConfig);
|
|
19
|
-
}
|
|
20
|
-
get router() {
|
|
21
|
-
return this.routerConfig;
|
|
22
|
-
}
|
|
23
|
-
extractLabel(evt, context) {
|
|
24
|
-
return 'WEB:' + ratchet_common_3.StringRatchet.trimToEmpty(evt.httpMethod).toUpperCase() + ':' + evt.path;
|
|
25
|
-
}
|
|
26
|
-
handlesEvent(evt) {
|
|
27
|
-
return ratchet_aws_1.LambdaEventDetector.isValidApiGatewayEvent(evt);
|
|
28
|
-
}
|
|
29
|
-
async processEvent(event, context) {
|
|
30
|
-
if (!this.routerConfig) {
|
|
31
|
-
throw new Error('Router config not found');
|
|
32
|
-
}
|
|
33
|
-
const asExtended = Object.assign({}, { parsedBody: null, authorization: null, convertedFromV2Event: false }, event);
|
|
34
|
-
const rval = await this.openApiLambdaHandler(asExtended, context);
|
|
35
|
-
context_util_1.ContextUtil.addTraceToProxyResult(rval);
|
|
36
|
-
ratchet_common_1.Logger.updateTracePrefix(null);
|
|
37
|
-
return rval;
|
|
38
|
-
}
|
|
39
|
-
async openApiLambdaHandler(evt, context) {
|
|
40
|
-
var _a;
|
|
41
|
-
const rm = this.findBestMatchingRoute(evt);
|
|
42
|
-
const procConfig = ((_a = rm === null || rm === void 0 ? void 0 : rm.mapping) === null || _a === void 0 ? void 0 : _a.metaProcessingConfig)
|
|
43
|
-
? rm.mapping.metaProcessingConfig
|
|
44
|
-
: this.routerConfig.config.defaultMetaHandling;
|
|
45
|
-
const fCtx = {
|
|
46
|
-
event: evt,
|
|
47
|
-
context: context,
|
|
48
|
-
result: null,
|
|
49
|
-
rawResult: null,
|
|
50
|
-
routeAndParse: rm,
|
|
51
|
-
modelValidator: this.routerConfig.config.overrideModelValidator || this.routerConfig.openApiModelValidator,
|
|
52
|
-
authenticators: this.routerConfig.config.authorizers,
|
|
53
|
-
};
|
|
54
|
-
try {
|
|
55
|
-
let filterChain = Object.assign([], procConfig.preFilters || []);
|
|
56
|
-
run_handler_as_filter_1.RunHandlerAsFilter.addRunHandlerAsFilterToList(filterChain, rm);
|
|
57
|
-
filterChain = filterChain.concat(procConfig.postFilters || []);
|
|
58
|
-
await built_in_filters_1.BuiltInFilters.combineFilters(fCtx, filterChain);
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
const wrapper = epsilon_http_error_1.EpsilonHttpError.wrapError(err);
|
|
62
|
-
fCtx.result = response_util_1.ResponseUtil.errorResponse(wrapper);
|
|
63
|
-
try {
|
|
64
|
-
await built_in_filters_1.BuiltInFilters.combineFilters(fCtx, procConfig.errorFilters);
|
|
65
|
-
}
|
|
66
|
-
catch (convErr) {
|
|
67
|
-
ratchet_common_1.Logger.error('REALLY BAD - FAILED WHILE PROCESSING ERROR FILTERS : %s', convErr);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return fCtx.result;
|
|
71
|
-
}
|
|
72
|
-
findBestMatchingRoute(event) {
|
|
73
|
-
let rval = null;
|
|
74
|
-
const cleanPath = this.cleanPath(event);
|
|
75
|
-
const methodLower = event.httpMethod.toLowerCase();
|
|
76
|
-
const matchRoutes = this.routerConfig.routes
|
|
77
|
-
.map((r) => {
|
|
78
|
-
let rval = null;
|
|
79
|
-
if (r.method && r.method.toLowerCase() === methodLower) {
|
|
80
|
-
const routeParser = new route_parser_1.default(r.path);
|
|
81
|
-
const parsed = routeParser.match(cleanPath);
|
|
82
|
-
if (parsed !== false) {
|
|
83
|
-
rval = {
|
|
84
|
-
mapping: r,
|
|
85
|
-
route: routeParser,
|
|
86
|
-
parsed: parsed,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return rval;
|
|
91
|
-
})
|
|
92
|
-
.filter((r) => r != null);
|
|
93
|
-
matchRoutes.sort((a, b) => {
|
|
94
|
-
return Object.keys(a.parsed).length - Object.keys(b.parsed).length;
|
|
95
|
-
});
|
|
96
|
-
rval = matchRoutes && matchRoutes.length > 0 ? matchRoutes[0] : null;
|
|
97
|
-
if (!rval) {
|
|
98
|
-
ratchet_common_1.Logger.debug('Failed to find handler for %s (cleaned path was %s, strip prefixes were %j)', event.path, cleanPath, this.routerConfig.config.prefixesToStripBeforeRouteMatch);
|
|
99
|
-
}
|
|
100
|
-
return rval;
|
|
101
|
-
}
|
|
102
|
-
cleanPath(event) {
|
|
103
|
-
let rval = event.path;
|
|
104
|
-
while (rval.startsWith('/')) {
|
|
105
|
-
rval = rval.substring(1);
|
|
106
|
-
}
|
|
107
|
-
if (this.routerConfig.config.prefixesToStripBeforeRouteMatch) {
|
|
108
|
-
this.routerConfig.config.prefixesToStripBeforeRouteMatch.forEach((prefix) => {
|
|
109
|
-
if (rval.toLowerCase().startsWith(prefix.toLowerCase() + '/')) {
|
|
110
|
-
rval = rval.substring(prefix.length);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
while (rval.startsWith('/')) {
|
|
115
|
-
rval = rval.substring(1);
|
|
116
|
-
}
|
|
117
|
-
rval = '/' + rval;
|
|
118
|
-
return rval;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
exports.WebHandler = WebHandler;
|
|
122
|
-
WebHandler.MAXIMUM_LAMBDA_BODY_SIZE_BYTES = 1024 * 1024 * 5 - 1024 * 100;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebV2Handler = void 0;
|
|
4
|
-
const aws_util_1 = require("../util/aws-util");
|
|
5
|
-
const ratchet_aws_1 = require("@bitblit/ratchet-aws");
|
|
6
|
-
class WebV2Handler {
|
|
7
|
-
constructor(webHandler) {
|
|
8
|
-
this.webHandler = webHandler;
|
|
9
|
-
}
|
|
10
|
-
extractLabel(evt, context) {
|
|
11
|
-
let rval = this.webHandler.extractLabel(aws_util_1.AwsUtil.apiGatewayV2ToApiGatewayV1(evt), context);
|
|
12
|
-
rval = rval.replace('WEB:', 'WEB2:');
|
|
13
|
-
return rval;
|
|
14
|
-
}
|
|
15
|
-
handlesEvent(evt) {
|
|
16
|
-
return ratchet_aws_1.LambdaEventDetector.isValidApiGatewayV2WithRequestContextEvent(evt);
|
|
17
|
-
}
|
|
18
|
-
async processEvent(evt, context) {
|
|
19
|
-
const conv = aws_util_1.AwsUtil.apiGatewayV2ToApiGatewayV1(evt);
|
|
20
|
-
const asExtended = Object.assign({}, { parsedBody: null, authorization: null, convertedFromV2Event: true }, conv);
|
|
21
|
-
const rval = await this.webHandler.openApiLambdaHandler(asExtended, context);
|
|
22
|
-
return rval;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.WebV2Handler = WebV2Handler;
|
package/dist/cjs/index.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./epsilon-build-properties"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./epsilon-constants"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./epsilon-global-handler"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./epsilon-instance"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./epsilon-logging-extension-processor"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./inter-api-manager"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./local-container-server"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./local-server-cert"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./local-server"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./background/background-dynamo-log-table-handler"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./background/background-entry"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./background/background-execution-event-type"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./background/background-execution-event"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./background/background-execution-listener"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./background/background-handler"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./background/background-http-adapter-handler"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./background/background-meta-response-internal"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./background/background-process-handling"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./background/background-process-log-table-entry"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./background/background-queue-response-internal"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./background/background-validator"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./background/epsilon-background-process-error"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./background/internal-background-entry"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./background/s3-background-transaction-logger"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./background/manager/abstract-background-manager"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./background/manager/aws-sqs-sns-background-manager"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./background/manager/background-manager-like"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./background/manager/single-thread-local-background-manager"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./build/ratchet-epsilon-common-info"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./built-in/built-in-trace-id-generators"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./built-in/background/echo-processor"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./built-in/background/log-and-enqueue-echo-processor"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./built-in/background/log-message-background-error-processor"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./built-in/background/no-op-processor"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./built-in/background/retry-processor"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./built-in/background/sample-delay-processor"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./built-in/background/sample-input-validated-processor-data"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./built-in/background/sample-input-validated-processor"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./built-in/daemon/daemon-authorizer-function"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./built-in/daemon/daemon-config"), exports);
|
|
44
|
-
tslib_1.__exportStar(require("./built-in/daemon/daemon-group-selection-function"), exports);
|
|
45
|
-
tslib_1.__exportStar(require("./built-in/daemon/daemon-handler"), exports);
|
|
46
|
-
tslib_1.__exportStar(require("./built-in/daemon/daemon-process-state-list"), exports);
|
|
47
|
-
tslib_1.__exportStar(require("./built-in/http/apollo-filter"), exports);
|
|
48
|
-
tslib_1.__exportStar(require("./built-in/http/built-in-auth-filters"), exports);
|
|
49
|
-
tslib_1.__exportStar(require("./built-in/http/built-in-authorizers"), exports);
|
|
50
|
-
tslib_1.__exportStar(require("./built-in/http/built-in-filters"), exports);
|
|
51
|
-
tslib_1.__exportStar(require("./built-in/http/built-in-handlers"), exports);
|
|
52
|
-
tslib_1.__exportStar(require("./built-in/http/log-level-manipulation-filter"), exports);
|
|
53
|
-
tslib_1.__exportStar(require("./built-in/http/run-handler-as-filter"), exports);
|
|
54
|
-
tslib_1.__exportStar(require("./cli-bootstrap/ratchet-cli-handler"), exports);
|
|
55
|
-
tslib_1.__exportStar(require("./cli-bootstrap/run-background-process-from-command-line"), exports);
|
|
56
|
-
tslib_1.__exportStar(require("./config/dynamo-db-config"), exports);
|
|
57
|
-
tslib_1.__exportStar(require("./config/epsilon-config"), exports);
|
|
58
|
-
tslib_1.__exportStar(require("./config/epsilon-lambda-event-handler"), exports);
|
|
59
|
-
tslib_1.__exportStar(require("./config/epsilon-logger-config"), exports);
|
|
60
|
-
tslib_1.__exportStar(require("./config/generic-aws-event-handler-function"), exports);
|
|
61
|
-
tslib_1.__exportStar(require("./config/logging-trace-id-generator"), exports);
|
|
62
|
-
tslib_1.__exportStar(require("./config/s3-config"), exports);
|
|
63
|
-
tslib_1.__exportStar(require("./config/sns-config"), exports);
|
|
64
|
-
tslib_1.__exportStar(require("./config/background/background-aws-config"), exports);
|
|
65
|
-
tslib_1.__exportStar(require("./config/background/background-config"), exports);
|
|
66
|
-
tslib_1.__exportStar(require("./config/background/background-error-processor"), exports);
|
|
67
|
-
tslib_1.__exportStar(require("./config/background/background-processor"), exports);
|
|
68
|
-
tslib_1.__exportStar(require("./config/background/background-transaction-log"), exports);
|
|
69
|
-
tslib_1.__exportStar(require("./config/background/background-transaction-logger"), exports);
|
|
70
|
-
tslib_1.__exportStar(require("./config/cron/abstract-cron-entry"), exports);
|
|
71
|
-
tslib_1.__exportStar(require("./config/cron/cron-background-entry"), exports);
|
|
72
|
-
tslib_1.__exportStar(require("./config/cron/cron-config"), exports);
|
|
73
|
-
tslib_1.__exportStar(require("./config/http/authorizer-function"), exports);
|
|
74
|
-
tslib_1.__exportStar(require("./config/http/epsilon-authorization-context"), exports);
|
|
75
|
-
tslib_1.__exportStar(require("./config/http/extended-api-gateway-event"), exports);
|
|
76
|
-
tslib_1.__exportStar(require("./config/http/filter-chain-context"), exports);
|
|
77
|
-
tslib_1.__exportStar(require("./config/http/filter-function"), exports);
|
|
78
|
-
tslib_1.__exportStar(require("./config/http/handler-function"), exports);
|
|
79
|
-
tslib_1.__exportStar(require("./config/http/http-config"), exports);
|
|
80
|
-
tslib_1.__exportStar(require("./config/http/http-processing-config"), exports);
|
|
81
|
-
tslib_1.__exportStar(require("./config/http/mapped-http-processing-config"), exports);
|
|
82
|
-
tslib_1.__exportStar(require("./config/http/null-returned-object-handling"), exports);
|
|
83
|
-
tslib_1.__exportStar(require("./config/inter-api/inter-api-aws-config"), exports);
|
|
84
|
-
tslib_1.__exportStar(require("./config/inter-api/inter-api-config"), exports);
|
|
85
|
-
tslib_1.__exportStar(require("./config/inter-api/inter-api-process-mapping"), exports);
|
|
86
|
-
tslib_1.__exportStar(require("./config/open-api/open-api-document-components"), exports);
|
|
87
|
-
tslib_1.__exportStar(require("./config/open-api/open-api-document-path"), exports);
|
|
88
|
-
tslib_1.__exportStar(require("./config/open-api/open-api-document"), exports);
|
|
89
|
-
tslib_1.__exportStar(require("./http/event-util"), exports);
|
|
90
|
-
tslib_1.__exportStar(require("./http/response-util"), exports);
|
|
91
|
-
tslib_1.__exportStar(require("./http/web-handler"), exports);
|
|
92
|
-
tslib_1.__exportStar(require("./http/web-v2-handler"), exports);
|
|
93
|
-
tslib_1.__exportStar(require("./http/auth/api-gateway-adapter-authentication-handler"), exports);
|
|
94
|
-
tslib_1.__exportStar(require("./http/auth/auth0-web-token-manipulator"), exports);
|
|
95
|
-
tslib_1.__exportStar(require("./http/auth/basic-auth-token"), exports);
|
|
96
|
-
tslib_1.__exportStar(require("./http/auth/google-web-token-manipulator"), exports);
|
|
97
|
-
tslib_1.__exportStar(require("./http/auth/jwt-ratchet-local-web-token-manipulator"), exports);
|
|
98
|
-
tslib_1.__exportStar(require("./http/auth/local-web-token-manipulator"), exports);
|
|
99
|
-
tslib_1.__exportStar(require("./http/auth/web-token-manipulator"), exports);
|
|
100
|
-
tslib_1.__exportStar(require("./http/error/bad-gateway"), exports);
|
|
101
|
-
tslib_1.__exportStar(require("./http/error/bad-request-error"), exports);
|
|
102
|
-
tslib_1.__exportStar(require("./http/error/conflict-error"), exports);
|
|
103
|
-
tslib_1.__exportStar(require("./http/error/epsilon-http-error"), exports);
|
|
104
|
-
tslib_1.__exportStar(require("./http/error/forbidden-error"), exports);
|
|
105
|
-
tslib_1.__exportStar(require("./http/error/gateway-timeout"), exports);
|
|
106
|
-
tslib_1.__exportStar(require("./http/error/method-not-allowed-error"), exports);
|
|
107
|
-
tslib_1.__exportStar(require("./http/error/misconfigured-error"), exports);
|
|
108
|
-
tslib_1.__exportStar(require("./http/error/not-found-error"), exports);
|
|
109
|
-
tslib_1.__exportStar(require("./http/error/not-implemented"), exports);
|
|
110
|
-
tslib_1.__exportStar(require("./http/error/request-timeout-error"), exports);
|
|
111
|
-
tslib_1.__exportStar(require("./http/error/service-unavailable"), exports);
|
|
112
|
-
tslib_1.__exportStar(require("./http/error/too-many-requests-error"), exports);
|
|
113
|
-
tslib_1.__exportStar(require("./http/error/unauthorized-error"), exports);
|
|
114
|
-
tslib_1.__exportStar(require("./http/route/epsilon-router"), exports);
|
|
115
|
-
tslib_1.__exportStar(require("./http/route/extended-auth-response-context"), exports);
|
|
116
|
-
tslib_1.__exportStar(require("./http/route/route-mapping"), exports);
|
|
117
|
-
tslib_1.__exportStar(require("./http/route/route-validator-config"), exports);
|
|
118
|
-
tslib_1.__exportStar(require("./http/route/router-util"), exports);
|
|
119
|
-
tslib_1.__exportStar(require("./inter-api/inter-api-entry"), exports);
|
|
120
|
-
tslib_1.__exportStar(require("./inter-api/inter-api-util"), exports);
|
|
121
|
-
tslib_1.__exportStar(require("./lambda-event-handler/cron-epsilon-lambda-event-handler"), exports);
|
|
122
|
-
tslib_1.__exportStar(require("./lambda-event-handler/dynamo-epsilon-lambda-event-handler"), exports);
|
|
123
|
-
tslib_1.__exportStar(require("./lambda-event-handler/generic-sns-epsilon-lambda-event-handler"), exports);
|
|
124
|
-
tslib_1.__exportStar(require("./lambda-event-handler/inter-api-epsilon-lambda-event-handler"), exports);
|
|
125
|
-
tslib_1.__exportStar(require("./lambda-event-handler/s3-epsilon-lambda-event-handler"), exports);
|
|
126
|
-
tslib_1.__exportStar(require("./open-api-util/open-api-doc-modifications"), exports);
|
|
127
|
-
tslib_1.__exportStar(require("./open-api-util/open-api-doc-modifier"), exports);
|
|
128
|
-
tslib_1.__exportStar(require("./open-api-util/yaml-combiner"), exports);
|
|
129
|
-
tslib_1.__exportStar(require("./sample/sample-server-components"), exports);
|
|
130
|
-
tslib_1.__exportStar(require("./sample/sample-server-static-files"), exports);
|
|
131
|
-
tslib_1.__exportStar(require("./sample/test-error-server"), exports);
|
|
132
|
-
tslib_1.__exportStar(require("./util/aws-util"), exports);
|
|
133
|
-
tslib_1.__exportStar(require("./util/context-util"), exports);
|
|
134
|
-
tslib_1.__exportStar(require("./util/cron-util"), exports);
|
|
135
|
-
tslib_1.__exportStar(require("./util/epsilon-config-parser"), exports);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InterApiUtil = void 0;
|
|
4
|
-
const ratchet_aws_1 = require("@bitblit/ratchet-aws");
|
|
5
|
-
const epsilon_constants_1 = require("../epsilon-constants");
|
|
6
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
7
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
8
|
-
const context_util_1 = require("../util/context-util");
|
|
9
|
-
class InterApiUtil {
|
|
10
|
-
static isInterApiSnsEvent(event) {
|
|
11
|
-
return !!InterApiUtil.extractEntryFromEvent(event);
|
|
12
|
-
}
|
|
13
|
-
static extractEntryFromEvent(evt) {
|
|
14
|
-
let rval = null;
|
|
15
|
-
if (!!evt) {
|
|
16
|
-
if (ratchet_aws_1.LambdaEventDetector.isSingleSnsEvent(evt)) {
|
|
17
|
-
const cast = evt;
|
|
18
|
-
const msg = cast.Records[0].Sns.Message;
|
|
19
|
-
if (!!ratchet_common_2.StringRatchet.trimToNull(msg)) {
|
|
20
|
-
const parsed = JSON.parse(msg);
|
|
21
|
-
if (!!parsed && parsed['type'] === epsilon_constants_1.EpsilonConstants.INTER_API_SNS_EVENT) {
|
|
22
|
-
rval = parsed['interApiEvent'];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return rval;
|
|
28
|
-
}
|
|
29
|
-
static async processInterApiEvent(evt, cfg, mgr) {
|
|
30
|
-
let rval = [];
|
|
31
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined(evt, 'InterApiEntry');
|
|
32
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined(mgr, 'BackgroundManager');
|
|
33
|
-
const interApiEntry = InterApiUtil.extractEntryFromEvent(evt);
|
|
34
|
-
context_util_1.ContextUtil.setOverrideTraceFromInterApiEntry(interApiEntry);
|
|
35
|
-
ratchet_common_2.Logger.info('Processing inter-api event : %j', evt);
|
|
36
|
-
const backgroundEntries = [];
|
|
37
|
-
cfg.processMappings.forEach((map) => {
|
|
38
|
-
if (!map.disabled && interApiEntry.source.match(map.sourceRegex) && interApiEntry.type.match(map.typeRegex)) {
|
|
39
|
-
map.backgroundProcessTypes.forEach((taskName) => {
|
|
40
|
-
const entry = mgr.createEntry(taskName, interApiEntry.data);
|
|
41
|
-
backgroundEntries.push(entry);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
if (backgroundEntries.length > 0) {
|
|
46
|
-
ratchet_common_2.Logger.info('Adding %d entries to queue', backgroundEntries.length);
|
|
47
|
-
rval = await mgr.addEntriesToQueue(backgroundEntries, true);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
ratchet_common_2.Logger.info('No entries mapped for this event');
|
|
51
|
-
}
|
|
52
|
-
return rval;
|
|
53
|
-
}
|
|
54
|
-
static addTraceToInterApiEntry(ent) {
|
|
55
|
-
if (ent) {
|
|
56
|
-
ent.traceId = ent.traceId || context_util_1.ContextUtil.currentTraceId();
|
|
57
|
-
ent.traceDepth = ent.traceDepth || context_util_1.ContextUtil.currentTraceDepth() + 1;
|
|
58
|
-
}
|
|
59
|
-
return ent;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.InterApiUtil = InterApiUtil;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InterApiManager = void 0;
|
|
4
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
5
|
-
const epsilon_constants_1 = require("./epsilon-constants");
|
|
6
|
-
const inter_api_util_1 = require("./inter-api/inter-api-util");
|
|
7
|
-
const client_sns_1 = require("@aws-sdk/client-sns");
|
|
8
|
-
class InterApiManager {
|
|
9
|
-
constructor(_aws, _sns) {
|
|
10
|
-
this._aws = _aws;
|
|
11
|
-
this._sns = _sns;
|
|
12
|
-
}
|
|
13
|
-
get config() {
|
|
14
|
-
return this._aws;
|
|
15
|
-
}
|
|
16
|
-
get sns() {
|
|
17
|
-
return this._sns;
|
|
18
|
-
}
|
|
19
|
-
createEntry(type, data) {
|
|
20
|
-
const rval = {
|
|
21
|
-
source: this._aws.source,
|
|
22
|
-
type: type,
|
|
23
|
-
data: data,
|
|
24
|
-
};
|
|
25
|
-
return rval;
|
|
26
|
-
}
|
|
27
|
-
async fireInterApiEventByParts(type, data) {
|
|
28
|
-
const entry = this.createEntry(type, data);
|
|
29
|
-
const rval = await this.fireInterApiEvent(entry);
|
|
30
|
-
return rval;
|
|
31
|
-
}
|
|
32
|
-
async fireInterApiEvent(entry) {
|
|
33
|
-
let rval = null;
|
|
34
|
-
if (this.config.localMode) {
|
|
35
|
-
ratchet_common_1.Logger.info('Fire inter-api event ignored because running locally (was %j)', entry);
|
|
36
|
-
rval = 'INTER-API-IGNORED';
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
try {
|
|
40
|
-
ratchet_common_1.Logger.info('Firing inter-api event (remote) : %j ', entry);
|
|
41
|
-
const toWrite = {
|
|
42
|
-
type: epsilon_constants_1.EpsilonConstants.INTER_API_SNS_EVENT,
|
|
43
|
-
interApiEvent: inter_api_util_1.InterApiUtil.addTraceToInterApiEntry(entry),
|
|
44
|
-
};
|
|
45
|
-
const msg = JSON.stringify(toWrite);
|
|
46
|
-
const snsId = await this.writeMessageToSnsTopic(msg);
|
|
47
|
-
ratchet_common_1.Logger.debug('Inter-api Wrote message : %s to SNS : %s', rval, msg, snsId);
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
ratchet_common_1.Logger.error('Failed to fireImmediateProcessRequest : %s', err, err);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return rval;
|
|
54
|
-
}
|
|
55
|
-
async writeMessageToSnsTopic(message) {
|
|
56
|
-
let rval = null;
|
|
57
|
-
const params = {
|
|
58
|
-
Message: message,
|
|
59
|
-
TopicArn: this._aws.snsArn,
|
|
60
|
-
};
|
|
61
|
-
ratchet_common_1.Logger.debug('Writing message to SNS topic : j', params);
|
|
62
|
-
const result = await this.sns.send(new client_sns_1.PublishCommand(params));
|
|
63
|
-
rval = result.MessageId;
|
|
64
|
-
return rval;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.InterApiManager = InterApiManager;
|