@bitblit/ratchet-epsilon-common 4.0.99-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 +6 -6
- 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} +14 -13
- 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} +29 -24
- 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 +12 -15
- 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,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EpsilonHttpError = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const util_1 = tslib_1.__importDefault(require("util"));
|
|
6
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
7
|
-
class EpsilonHttpError extends Error {
|
|
8
|
-
constructor(...errors) {
|
|
9
|
-
super(EpsilonHttpError.combineErrorStringsWithDefault(errors));
|
|
10
|
-
this._httpStatusCode = 500;
|
|
11
|
-
Object.setPrototypeOf(this, EpsilonHttpError.prototype);
|
|
12
|
-
this._errors = errors;
|
|
13
|
-
this[EpsilonHttpError.EPSILON_HTTP_ERROR_FLAG_KEY] = true;
|
|
14
|
-
}
|
|
15
|
-
static combineErrorStringsWithDefault(errors, defMessage = 'Internal Server Error') {
|
|
16
|
-
return errors && errors.length > 0 ? errors.join(',') : defMessage;
|
|
17
|
-
}
|
|
18
|
-
setFormattedErrorMessage(format, ...input) {
|
|
19
|
-
const msg = util_1.default.format(format, ...input);
|
|
20
|
-
this.errors = [msg];
|
|
21
|
-
}
|
|
22
|
-
withFormattedErrorMessage(format, ...input) {
|
|
23
|
-
this.setFormattedErrorMessage(format, ...input);
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
withHttpStatusCode(httpStatusCode) {
|
|
27
|
-
this.httpStatusCode = httpStatusCode;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
withErrors(errors) {
|
|
31
|
-
this.errors = errors;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
withDetailErrorCode(detailErrorCode) {
|
|
35
|
-
this._detailErrorCode = detailErrorCode;
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
withEndUserErrors(endUserErrors) {
|
|
39
|
-
this._endUserErrors = endUserErrors;
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
withDetails(details) {
|
|
43
|
-
this._details = details;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
withRequestId(requestId) {
|
|
47
|
-
this._requestId = requestId;
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
withWrappedError(err) {
|
|
51
|
-
this._wrappedError = err;
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
isWrappedError() {
|
|
55
|
-
return !!this._wrappedError;
|
|
56
|
-
}
|
|
57
|
-
static wrapError(err) {
|
|
58
|
-
let rval = null;
|
|
59
|
-
if (EpsilonHttpError.objectIsEpsilonHttpError(err)) {
|
|
60
|
-
rval = err;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
rval = new EpsilonHttpError(err.message).withWrappedError(err).withHttpStatusCode(500);
|
|
64
|
-
}
|
|
65
|
-
return rval;
|
|
66
|
-
}
|
|
67
|
-
static objectIsEpsilonHttpError(obj) {
|
|
68
|
-
return obj && obj['__epsilonHttpErrorFlag'] === true;
|
|
69
|
-
}
|
|
70
|
-
get httpStatusCode() {
|
|
71
|
-
return this._httpStatusCode;
|
|
72
|
-
}
|
|
73
|
-
get errors() {
|
|
74
|
-
return this._errors;
|
|
75
|
-
}
|
|
76
|
-
get detailErrorCode() {
|
|
77
|
-
return this._detailErrorCode;
|
|
78
|
-
}
|
|
79
|
-
get endUserErrors() {
|
|
80
|
-
return this._endUserErrors;
|
|
81
|
-
}
|
|
82
|
-
get details() {
|
|
83
|
-
return this._details;
|
|
84
|
-
}
|
|
85
|
-
get requestId() {
|
|
86
|
-
return this._requestId;
|
|
87
|
-
}
|
|
88
|
-
get wrappedError() {
|
|
89
|
-
return this._wrappedError;
|
|
90
|
-
}
|
|
91
|
-
set httpStatusCode(value) {
|
|
92
|
-
this._httpStatusCode = value || 500;
|
|
93
|
-
}
|
|
94
|
-
set errors(value) {
|
|
95
|
-
this._errors = value || ['Internal Server Error'];
|
|
96
|
-
this.message = EpsilonHttpError.combineErrorStringsWithDefault(this._errors);
|
|
97
|
-
}
|
|
98
|
-
set detailErrorCode(value) {
|
|
99
|
-
this._detailErrorCode = value;
|
|
100
|
-
}
|
|
101
|
-
set endUserErrors(value) {
|
|
102
|
-
this._endUserErrors = value;
|
|
103
|
-
}
|
|
104
|
-
set details(value) {
|
|
105
|
-
this._details = value;
|
|
106
|
-
}
|
|
107
|
-
set requestId(value) {
|
|
108
|
-
this._requestId = value || 'MISSING';
|
|
109
|
-
}
|
|
110
|
-
set wrappedError(value) {
|
|
111
|
-
this._wrappedError = value;
|
|
112
|
-
}
|
|
113
|
-
static errorIsX0x(errIn, xClass) {
|
|
114
|
-
let rval = false;
|
|
115
|
-
if (errIn && EpsilonHttpError.objectIsEpsilonHttpError(errIn)) {
|
|
116
|
-
const err = errIn;
|
|
117
|
-
const val = ratchet_common_1.NumberRatchet.safeNumber(err.httpStatusCode);
|
|
118
|
-
const bot = xClass * 100;
|
|
119
|
-
const top = bot + 99;
|
|
120
|
-
rval = val >= bot && val <= top;
|
|
121
|
-
}
|
|
122
|
-
return rval;
|
|
123
|
-
}
|
|
124
|
-
static errorIs40x(err) {
|
|
125
|
-
return EpsilonHttpError.errorIsX0x(err, 4);
|
|
126
|
-
}
|
|
127
|
-
static errorIs50x(err) {
|
|
128
|
-
return EpsilonHttpError.errorIsX0x(err, 5);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
exports.EpsilonHttpError = EpsilonHttpError;
|
|
132
|
-
EpsilonHttpError.EPSILON_HTTP_ERROR_FLAG_KEY = '__epsilonHttpErrorFlag';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ForbiddenError = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class ForbiddenError extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(ForbiddenError.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.ForbiddenError = ForbiddenError;
|
|
12
|
-
ForbiddenError.HTTP_CODE = 403;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GatewayTimeout = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class GatewayTimeout extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(GatewayTimeout.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.GatewayTimeout = GatewayTimeout;
|
|
12
|
-
GatewayTimeout.HTTP_CODE = 504;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MethodNotAllowedError = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class MethodNotAllowedError extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(MethodNotAllowedError.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.MethodNotAllowedError = MethodNotAllowedError;
|
|
12
|
-
MethodNotAllowedError.HTTP_CODE = 405;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MisconfiguredError = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class MisconfiguredError extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(MisconfiguredError.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.MisconfiguredError = MisconfiguredError;
|
|
12
|
-
MisconfiguredError.HTTP_CODE = 500;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotFoundError = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class NotFoundError extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(NotFoundError.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.NotFoundError = NotFoundError;
|
|
12
|
-
NotFoundError.HTTP_CODE = 404;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotImplemented = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class NotImplemented extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(NotImplemented.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.NotImplemented = NotImplemented;
|
|
12
|
-
NotImplemented.HTTP_CODE = 501;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequestTimeoutError = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class RequestTimeoutError extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(RequestTimeoutError.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.RequestTimeoutError = RequestTimeoutError;
|
|
12
|
-
RequestTimeoutError.HTTP_CODE = 500;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceUnavailable = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class ServiceUnavailable extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(ServiceUnavailable.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.ServiceUnavailable = ServiceUnavailable;
|
|
12
|
-
ServiceUnavailable.HTTP_CODE = 503;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TooManyRequestsError = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class TooManyRequestsError extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(TooManyRequestsError.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.TooManyRequestsError = TooManyRequestsError;
|
|
12
|
-
TooManyRequestsError.HTTP_CODE = 429;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnauthorizedError = void 0;
|
|
4
|
-
const epsilon_http_error_1 = require("./epsilon-http-error");
|
|
5
|
-
class UnauthorizedError extends epsilon_http_error_1.EpsilonHttpError {
|
|
6
|
-
constructor(...errors) {
|
|
7
|
-
super(...errors);
|
|
8
|
-
this.withHttpStatusCode(UnauthorizedError.HTTP_CODE);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.UnauthorizedError = UnauthorizedError;
|
|
12
|
-
UnauthorizedError.HTTP_CODE = 401;
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventUtil = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const unauthorized_error_1 = require("./error/unauthorized-error");
|
|
6
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
7
|
-
const bad_request_error_1 = require("./error/bad-request-error");
|
|
8
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
9
|
-
const jsonwebtoken_1 = tslib_1.__importDefault(require("jsonwebtoken"));
|
|
10
|
-
const ratchet_common_3 = require("@bitblit/ratchet-common");
|
|
11
|
-
const ratchet_common_4 = require("@bitblit/ratchet-common");
|
|
12
|
-
const epsilon_constants_1 = require("../epsilon-constants");
|
|
13
|
-
const ratchet_common_5 = require("@bitblit/ratchet-common");
|
|
14
|
-
class EventUtil {
|
|
15
|
-
constructor() { }
|
|
16
|
-
static extractStage(event) {
|
|
17
|
-
if (!event.path.startsWith('/')) {
|
|
18
|
-
throw new bad_request_error_1.BadRequestError('Path should start with / but does not : ' + event.path);
|
|
19
|
-
}
|
|
20
|
-
const idx = event.path.indexOf('/', 1);
|
|
21
|
-
if (idx == -1) {
|
|
22
|
-
throw new bad_request_error_1.BadRequestError('No second / found in the path : ' + event.path);
|
|
23
|
-
}
|
|
24
|
-
return event.path.substring(1, idx);
|
|
25
|
-
}
|
|
26
|
-
static extractHostHeader(event) {
|
|
27
|
-
return ratchet_common_2.MapRatchet.extractValueFromMapIgnoreCase(event.headers, 'Host');
|
|
28
|
-
}
|
|
29
|
-
static extractProtocol(event) {
|
|
30
|
-
return ratchet_common_2.MapRatchet.extractValueFromMapIgnoreCase(event.headers, 'X-Forwarded-Proto');
|
|
31
|
-
}
|
|
32
|
-
static extractApiGatewayStage(event) {
|
|
33
|
-
const rc = EventUtil.extractRequestContext(event);
|
|
34
|
-
return rc ? rc.stage : null;
|
|
35
|
-
}
|
|
36
|
-
static extractRequestContext(event) {
|
|
37
|
-
return event.requestContext;
|
|
38
|
-
}
|
|
39
|
-
static extractAuthorizer(event) {
|
|
40
|
-
const rc = EventUtil.extractRequestContext(event);
|
|
41
|
-
return rc ? rc.authorizer : null;
|
|
42
|
-
}
|
|
43
|
-
static ipAddressChain(event) {
|
|
44
|
-
const headerVal = event && event.headers ? ratchet_common_2.MapRatchet.extractValueFromMapIgnoreCase(event.headers, 'X-Forwarded-For') : null;
|
|
45
|
-
let headerList = headerVal ? String(headerVal).split(',') : [];
|
|
46
|
-
headerList = headerList.map((s) => s.trim());
|
|
47
|
-
return headerList;
|
|
48
|
-
}
|
|
49
|
-
static ipAddress(event) {
|
|
50
|
-
const list = EventUtil.ipAddressChain(event);
|
|
51
|
-
return list && list.length > 0 ? list[0] : null;
|
|
52
|
-
}
|
|
53
|
-
static extractFullPath(event, overrideProtocol = null) {
|
|
54
|
-
const protocol = overrideProtocol || EventUtil.extractProtocol(event) || 'https';
|
|
55
|
-
return protocol + '://' + event.requestContext['domainName'] + event.requestContext.path;
|
|
56
|
-
}
|
|
57
|
-
static extractFullPrefix(event, overrideProtocol = null) {
|
|
58
|
-
const protocol = overrideProtocol || EventUtil.extractProtocol(event) || 'https';
|
|
59
|
-
const prefix = event.requestContext.path.substring(0, event.requestContext.path.indexOf('/', 1));
|
|
60
|
-
return protocol + '://' + event.requestContext['domainName'] + prefix;
|
|
61
|
-
}
|
|
62
|
-
static jsonBodyToObject(event) {
|
|
63
|
-
let rval = null;
|
|
64
|
-
if (event.body) {
|
|
65
|
-
const contentType = ratchet_common_2.MapRatchet.extractValueFromMapIgnoreCase(event.headers, 'Content-Type') || 'application/octet-stream';
|
|
66
|
-
rval = event.body;
|
|
67
|
-
if (event.isBase64Encoded) {
|
|
68
|
-
rval = Buffer.from(rval, 'base64');
|
|
69
|
-
}
|
|
70
|
-
if (contentType.startsWith('application/json')) {
|
|
71
|
-
rval = JSON.parse(rval.toString('ascii'));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return rval;
|
|
75
|
-
}
|
|
76
|
-
static calcLogLevelViaEventOrEnvParam(curLevel, event, rConfig) {
|
|
77
|
-
let rval = curLevel;
|
|
78
|
-
if ((rConfig === null || rConfig === void 0 ? void 0 : rConfig.envParamLogLevelName) && process.env[rConfig.envParamLogLevelName]) {
|
|
79
|
-
rval = ratchet_common_5.EnumRatchet.keyToEnum(ratchet_common_5.LoggerLevelName, process.env[rConfig.envParamLogLevelName]);
|
|
80
|
-
ratchet_common_1.Logger.silly('Found env log level : %s', rval);
|
|
81
|
-
}
|
|
82
|
-
if (rConfig &&
|
|
83
|
-
rConfig.queryParamLogLevelName &&
|
|
84
|
-
event &&
|
|
85
|
-
event.queryStringParameters &&
|
|
86
|
-
event.queryStringParameters[rConfig.queryParamLogLevelName]) {
|
|
87
|
-
rval = ratchet_common_5.EnumRatchet.keyToEnum(ratchet_common_5.LoggerLevelName, event.queryStringParameters[rConfig.queryParamLogLevelName]);
|
|
88
|
-
ratchet_common_1.Logger.silly('Found query log level : %s', rval);
|
|
89
|
-
}
|
|
90
|
-
return rval;
|
|
91
|
-
}
|
|
92
|
-
static fixStillEncodedQueryParams(event) {
|
|
93
|
-
if (event === null || event === void 0 ? void 0 : event.queryStringParameters) {
|
|
94
|
-
const newParams = {};
|
|
95
|
-
Object.keys(event.queryStringParameters).forEach((k) => {
|
|
96
|
-
const val = event.queryStringParameters[k];
|
|
97
|
-
if (k.toLowerCase().startsWith('amp;')) {
|
|
98
|
-
newParams[k.substring(4)] = val;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
newParams[k] = val;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
event.queryStringParameters = newParams;
|
|
105
|
-
}
|
|
106
|
-
if (event === null || event === void 0 ? void 0 : event.multiValueQueryStringParameters) {
|
|
107
|
-
const newParams = {};
|
|
108
|
-
Object.keys(event.multiValueQueryStringParameters).forEach((k) => {
|
|
109
|
-
const val = event.multiValueQueryStringParameters[k];
|
|
110
|
-
if (k.toLowerCase().startsWith('amp;')) {
|
|
111
|
-
newParams[k.substring(4)] = val;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
newParams[k] = val;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
event.multiValueQueryStringParameters = newParams;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
static applyTokenToEventForTesting(event, jwtToken) {
|
|
121
|
-
const jwtFullData = jsonwebtoken_1.default.decode(jwtToken, { complete: true });
|
|
122
|
-
if (!jwtFullData['payload']) {
|
|
123
|
-
throw new Error('No payload found in passed token');
|
|
124
|
-
}
|
|
125
|
-
const jwtData = jwtFullData['payload'];
|
|
126
|
-
event.headers = event.headers || {};
|
|
127
|
-
event.headers[epsilon_constants_1.EpsilonConstants.AUTH_HEADER_NAME.toLowerCase()] = 'Bearer ' + jwtToken;
|
|
128
|
-
event.requestContext = event.requestContext || {};
|
|
129
|
-
const newAuth = Object.assign({}, event.requestContext.authorizer);
|
|
130
|
-
newAuth.userData = jwtData;
|
|
131
|
-
newAuth.userDataJSON = jwtData ? JSON.stringify(jwtData) : null;
|
|
132
|
-
newAuth.srcData = jwtToken;
|
|
133
|
-
event.requestContext.authorizer = newAuth;
|
|
134
|
-
}
|
|
135
|
-
static extractBasicAuthenticationToken(event, throwErrorOnMissingBad = false) {
|
|
136
|
-
let rval = null;
|
|
137
|
-
if (!!event && !!event.headers) {
|
|
138
|
-
const headerVal = EventUtil.extractAuthorizationHeaderCaseInsensitive(event);
|
|
139
|
-
if (!!headerVal && headerVal.startsWith('Basic ')) {
|
|
140
|
-
const parsed = ratchet_common_3.Base64Ratchet.base64StringToString(headerVal.substring(6));
|
|
141
|
-
const sp = parsed.split(':');
|
|
142
|
-
ratchet_common_1.Logger.silly('Parsed to %j', sp);
|
|
143
|
-
if (!!sp && sp.length === 2) {
|
|
144
|
-
rval = {
|
|
145
|
-
username: sp[0],
|
|
146
|
-
password: sp[1],
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (!rval && throwErrorOnMissingBad) {
|
|
152
|
-
throw new unauthorized_error_1.UnauthorizedError('Could not find valid basic authentication header');
|
|
153
|
-
}
|
|
154
|
-
return rval;
|
|
155
|
-
}
|
|
156
|
-
static eventIsAGraphQLIntrospection(event) {
|
|
157
|
-
let rval = false;
|
|
158
|
-
if (!!event) {
|
|
159
|
-
if (!!event.httpMethod && 'post' === event.httpMethod.toLowerCase()) {
|
|
160
|
-
if (!!event.path && event.path.endsWith('/graphql')) {
|
|
161
|
-
const body = EventUtil.jsonBodyToObject(event);
|
|
162
|
-
rval = !!body && !!body['operationName'] && body['operationName'] === 'IntrospectionQuery';
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return rval;
|
|
167
|
-
}
|
|
168
|
-
static extractAuthorizationHeaderCaseInsensitive(evt) {
|
|
169
|
-
return ratchet_common_2.MapRatchet.caseInsensitiveAccess((evt === null || evt === void 0 ? void 0 : evt.headers) || {}, epsilon_constants_1.EpsilonConstants.AUTH_HEADER_NAME);
|
|
170
|
-
}
|
|
171
|
-
static extractBearerTokenFromEvent(evt) {
|
|
172
|
-
let rval = null;
|
|
173
|
-
const authHeader = ratchet_common_4.StringRatchet.trimToEmpty(EventUtil.extractAuthorizationHeaderCaseInsensitive(evt));
|
|
174
|
-
if (authHeader.toLowerCase().startsWith('bearer ')) {
|
|
175
|
-
rval = authHeader.substring(7);
|
|
176
|
-
}
|
|
177
|
-
return rval;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
exports.EventUtil = EventUtil;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResponseUtil = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
6
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
7
|
-
const zlib_1 = tslib_1.__importDefault(require("zlib"));
|
|
8
|
-
class ResponseUtil {
|
|
9
|
-
constructor() { }
|
|
10
|
-
static errorResponse(err) {
|
|
11
|
-
const body = {
|
|
12
|
-
errors: err.errors,
|
|
13
|
-
httpStatusCode: err.httpStatusCode,
|
|
14
|
-
requestId: err.requestId,
|
|
15
|
-
};
|
|
16
|
-
if (err.detailErrorCode) {
|
|
17
|
-
body['detailErrorCode'] = err.detailErrorCode;
|
|
18
|
-
}
|
|
19
|
-
if (err.endUserErrors && err.endUserErrors.length > 0) {
|
|
20
|
-
body['endUserErrors'] = err.endUserErrors;
|
|
21
|
-
}
|
|
22
|
-
if (err.details) {
|
|
23
|
-
body['details'] = err.details;
|
|
24
|
-
}
|
|
25
|
-
if (err.wrappedError) {
|
|
26
|
-
body['wrappedError'] = err.wrappedError.name + ' : ' + err.wrappedError.message;
|
|
27
|
-
}
|
|
28
|
-
const errorResponse = {
|
|
29
|
-
statusCode: err.httpStatusCode,
|
|
30
|
-
isBase64Encoded: false,
|
|
31
|
-
headers: {
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
},
|
|
34
|
-
body: JSON.stringify(body),
|
|
35
|
-
};
|
|
36
|
-
return errorResponse;
|
|
37
|
-
}
|
|
38
|
-
static redirect(target, code = 301, queryParams = null) {
|
|
39
|
-
if (code !== 301 && code !== 302 && code !== 307) {
|
|
40
|
-
throw new Error('Code must be 301 or 302 or 307 for a redirect');
|
|
41
|
-
}
|
|
42
|
-
let redirectTarget = target;
|
|
43
|
-
if (queryParams) {
|
|
44
|
-
const keys = Object.keys(queryParams);
|
|
45
|
-
if (keys.length > 0) {
|
|
46
|
-
ratchet_common_1.Logger.silly('Applying params to input target : %j', queryParams);
|
|
47
|
-
redirectTarget += redirectTarget.indexOf('?') === -1 ? '?' : '&';
|
|
48
|
-
for (let i = 0; i < keys.length; i++) {
|
|
49
|
-
const k = keys[i];
|
|
50
|
-
redirectTarget += k + '=' + encodeURIComponent(queryParams[k]);
|
|
51
|
-
if (i < keys.length - 1) {
|
|
52
|
-
redirectTarget += '&';
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
statusCode: code,
|
|
59
|
-
body: '{"redirect-target":"' + redirectTarget + '}',
|
|
60
|
-
headers: {
|
|
61
|
-
'Content-Type': 'application/json',
|
|
62
|
-
Location: redirectTarget,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
static coerceToProxyResult(input) {
|
|
67
|
-
let rval = null;
|
|
68
|
-
if (input != null) {
|
|
69
|
-
if (typeof input === 'object') {
|
|
70
|
-
if (input.statusCode && input.body !== undefined) {
|
|
71
|
-
rval = Object.assign({}, input);
|
|
72
|
-
if (typeof input.body === 'string') {
|
|
73
|
-
}
|
|
74
|
-
else if (Buffer.isBuffer(input.body)) {
|
|
75
|
-
rval.body = input.body.toString('base64');
|
|
76
|
-
rval.headers = input.headers || {};
|
|
77
|
-
rval.headers['Content-Type'] = input.body.contentType;
|
|
78
|
-
rval.isBase64Encoded = true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
const headers = input.headers || {};
|
|
83
|
-
headers['Content-Type'] = 'application/json';
|
|
84
|
-
rval = ResponseUtil.coerceToProxyResult({
|
|
85
|
-
statusCode: 200,
|
|
86
|
-
body: JSON.stringify(input),
|
|
87
|
-
headers: headers,
|
|
88
|
-
isBase64Encoded: false,
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else if (typeof input === 'string' || Buffer.isBuffer(input)) {
|
|
93
|
-
rval = ResponseUtil.coerceToProxyResult({ statusCode: 200, body: input });
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
const headers = input.headers || {};
|
|
97
|
-
headers['Content-Type'] = 'application/json';
|
|
98
|
-
rval = ResponseUtil.coerceToProxyResult({
|
|
99
|
-
statusCode: 200,
|
|
100
|
-
body: JSON.stringify(input),
|
|
101
|
-
headers: headers,
|
|
102
|
-
isBase64Encoded: false,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return rval;
|
|
107
|
-
}
|
|
108
|
-
static async applyGzipIfPossible(encodingHeader, proxyResult) {
|
|
109
|
-
const rval = proxyResult;
|
|
110
|
-
if (encodingHeader && encodingHeader.toLowerCase().indexOf('gzip') > -1) {
|
|
111
|
-
const bigEnough = proxyResult.body.length > 1400;
|
|
112
|
-
let contentType = ratchet_common_2.MapRatchet.extractValueFromMapIgnoreCase(proxyResult.headers, 'content-type') || '';
|
|
113
|
-
contentType = contentType.toLowerCase();
|
|
114
|
-
const exemptContent = contentType === 'application/pdf' || contentType === 'application/zip' || contentType.startsWith('image/');
|
|
115
|
-
if (bigEnough && !exemptContent) {
|
|
116
|
-
const asBuffer = proxyResult.isBase64Encoded ? Buffer.from(proxyResult.body, 'base64') : Buffer.from(proxyResult.body);
|
|
117
|
-
const zipped = await this.gzip(asBuffer);
|
|
118
|
-
ratchet_common_1.Logger.info('Comp from %s to %d bytes', asBuffer.length, zipped.length);
|
|
119
|
-
const zipped64 = zipped.toString('base64');
|
|
120
|
-
rval.body = zipped64;
|
|
121
|
-
rval.isBase64Encoded = true;
|
|
122
|
-
rval.headers = rval.headers || {};
|
|
123
|
-
rval.headers['Content-Encoding'] = 'gzip';
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
ratchet_common_1.Logger.silly('Not gzipping, too small or exempt content');
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
ratchet_common_1.Logger.silly('Not gzipping, not an accepted encoding');
|
|
131
|
-
}
|
|
132
|
-
return rval;
|
|
133
|
-
}
|
|
134
|
-
static gzip(input) {
|
|
135
|
-
const promise = new Promise(function (resolve, reject) {
|
|
136
|
-
zlib_1.default.gzip(input, function (error, result) {
|
|
137
|
-
if (!error)
|
|
138
|
-
resolve(result);
|
|
139
|
-
else
|
|
140
|
-
reject(error);
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
return promise;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.ResponseUtil = ResponseUtil;
|