@bitblit/ratchet-epsilon-common 4.0.419-alpha → 4.0.421-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/lib/background/background-dynamo-log-table-handler.d.ts +11 -0
- package/lib/background/background-dynamo-log-table-handler.js +38 -0
- package/lib/background/background-dynamo-log-table-handler.js.map +1 -0
- package/lib/background/background-entry.d.ts +4 -0
- package/lib/background/background-entry.js +2 -0
- package/lib/background/background-entry.js.map +1 -0
- package/lib/background/background-execution-event-type.d.ts +8 -0
- package/lib/background/background-execution-event-type.js +8 -0
- package/lib/background/background-execution-event-type.js.map +1 -0
- package/lib/background/background-execution-event.d.ts +8 -0
- package/lib/background/background-execution-event.js +2 -0
- package/lib/background/background-execution-event.js.map +1 -0
- package/lib/background/background-execution-listener.d.ts +5 -0
- package/lib/background/background-execution-listener.js +2 -0
- package/lib/background/background-execution-listener.js.map +1 -0
- package/lib/background/background-handler.d.ts +29 -0
- package/lib/background/background-handler.js +280 -0
- package/lib/background/background-handler.js.map +1 -0
- package/lib/background/background-http-adapter-handler.d.ts +22 -0
- package/lib/background/background-http-adapter-handler.js +129 -0
- package/lib/background/background-http-adapter-handler.js.map +1 -0
- package/lib/background/background-meta-response-internal.d.ts +5 -0
- package/lib/background/background-meta-response-internal.js +2 -0
- package/lib/background/background-meta-response-internal.js.map +1 -0
- package/lib/background/background-process-handling.d.ts +5 -0
- package/lib/background/background-process-handling.js +5 -0
- package/lib/background/background-process-handling.js.map +1 -0
- package/lib/background/background-process-log-table-entry.d.ts +11 -0
- package/lib/background/background-process-log-table-entry.js +2 -0
- package/lib/background/background-process-log-table-entry.js.map +1 -0
- package/lib/background/background-queue-response-internal.d.ts +8 -0
- package/lib/background/background-queue-response-internal.js +2 -0
- package/lib/background/background-queue-response-internal.js.map +1 -0
- package/lib/background/background-validator.d.ts +17 -0
- package/lib/background/background-validator.js +87 -0
- package/lib/background/background-validator.js.map +1 -0
- package/lib/background/epsilon-background-process-error.d.ts +30 -0
- package/lib/background/epsilon-background-process-error.js +94 -0
- package/lib/background/epsilon-background-process-error.js.map +1 -0
- package/lib/background/index.d.ts +20 -0
- package/lib/background/index.js +21 -0
- package/lib/background/index.js.map +1 -0
- package/lib/background/internal-background-entry.d.ts +8 -0
- package/lib/background/internal-background-entry.js +2 -0
- package/lib/background/internal-background-entry.js.map +1 -0
- package/lib/background/manager/abstract-background-manager.d.ts +19 -0
- package/lib/background/manager/abstract-background-manager.js +90 -0
- package/lib/background/manager/abstract-background-manager.js.map +1 -0
- package/lib/background/manager/aws-large-payload-s3-sqs-sns-background-manager.d.ts +19 -0
- package/lib/background/manager/aws-large-payload-s3-sqs-sns-background-manager.js +58 -0
- package/lib/background/manager/aws-large-payload-s3-sqs-sns-background-manager.js.map +1 -0
- package/lib/background/manager/aws-sqs-sns-background-manager.d.ts +23 -0
- package/lib/background/manager/aws-sqs-sns-background-manager.js +154 -0
- package/lib/background/manager/aws-sqs-sns-background-manager.js.map +1 -0
- package/lib/background/manager/background-manager-like.d.ts +18 -0
- package/lib/background/manager/background-manager-like.js +2 -0
- package/lib/background/manager/background-manager-like.js.map +1 -0
- package/lib/background/manager/single-thread-local-background-manager.d.ts +15 -0
- package/lib/background/manager/single-thread-local-background-manager.js +46 -0
- package/lib/background/manager/single-thread-local-background-manager.js.map +1 -0
- package/lib/background/s3-background-transaction-logger.d.ts +17 -0
- package/lib/background/s3-background-transaction-logger.js +53 -0
- package/lib/background/s3-background-transaction-logger.js.map +1 -0
- package/lib/build/index.d.ts +1 -0
- package/lib/build/index.js +2 -0
- package/lib/build/index.js.map +1 -0
- package/lib/build/ratchet-epsilon-common-info.d.ts +5 -0
- package/lib/build/ratchet-epsilon-common-info.js +15 -0
- package/lib/build/ratchet-epsilon-common-info.js.map +1 -0
- package/lib/built-in/background/echo-processor.d.ts +7 -0
- package/lib/built-in/background/echo-processor.js +16 -0
- package/lib/built-in/background/echo-processor.js.map +1 -0
- package/lib/built-in/background/log-and-enqueue-echo-processor.d.ts +6 -0
- package/lib/built-in/background/log-and-enqueue-echo-processor.js +13 -0
- package/lib/built-in/background/log-and-enqueue-echo-processor.js.map +1 -0
- package/lib/built-in/background/log-message-background-error-processor.d.ts +5 -0
- package/lib/built-in/background/log-message-background-error-processor.js +7 -0
- package/lib/built-in/background/log-message-background-error-processor.js.map +1 -0
- package/lib/built-in/background/no-op-processor.d.ts +6 -0
- package/lib/built-in/background/no-op-processor.js +10 -0
- package/lib/built-in/background/no-op-processor.js.map +1 -0
- package/lib/built-in/background/retry-processor.d.ts +16 -0
- package/lib/built-in/background/retry-processor.js +41 -0
- package/lib/built-in/background/retry-processor.js.map +1 -0
- package/lib/built-in/background/sample-delay-processor.d.ts +6 -0
- package/lib/built-in/background/sample-delay-processor.js +14 -0
- package/lib/built-in/background/sample-delay-processor.js.map +1 -0
- package/lib/built-in/background/sample-input-validated-processor-data.d.ts +4 -0
- package/lib/built-in/background/sample-input-validated-processor-data.js +2 -0
- package/lib/built-in/background/sample-input-validated-processor-data.js.map +1 -0
- package/lib/built-in/background/sample-input-validated-processor.d.ts +8 -0
- package/lib/built-in/background/sample-input-validated-processor.js +13 -0
- package/lib/built-in/background/sample-input-validated-processor.js.map +1 -0
- package/lib/built-in/built-in-trace-id-generators.d.ts +5 -0
- package/lib/built-in/built-in-trace-id-generators.js +20 -0
- package/lib/built-in/built-in-trace-id-generators.js.map +1 -0
- package/lib/built-in/daemon/daemon-authorizer-function.d.ts +3 -0
- package/lib/built-in/daemon/daemon-authorizer-function.js +2 -0
- package/lib/built-in/daemon/daemon-authorizer-function.js.map +1 -0
- package/lib/built-in/daemon/daemon-config.d.ts +8 -0
- package/lib/built-in/daemon/daemon-config.js +2 -0
- package/lib/built-in/daemon/daemon-config.js.map +1 -0
- package/lib/built-in/daemon/daemon-group-selection-function.d.ts +2 -0
- package/lib/built-in/daemon/daemon-group-selection-function.js +2 -0
- package/lib/built-in/daemon/daemon-group-selection-function.js.map +1 -0
- package/lib/built-in/daemon/daemon-handler.d.ts +16 -0
- package/lib/built-in/daemon/daemon-handler.js +60 -0
- package/lib/built-in/daemon/daemon-handler.js.map +1 -0
- package/lib/built-in/daemon/daemon-process-state-list.d.ts +5 -0
- package/lib/built-in/daemon/daemon-process-state-list.js +2 -0
- package/lib/built-in/daemon/daemon-process-state-list.js.map +1 -0
- package/lib/built-in/http/apollo/apollo-util.d.ts +10 -0
- package/lib/built-in/http/apollo/apollo-util.js +37 -0
- package/lib/built-in/http/apollo/apollo-util.js.map +1 -0
- package/lib/built-in/http/apollo/default-epsilon-apollo-context.d.ts +10 -0
- package/lib/built-in/http/apollo/default-epsilon-apollo-context.js +2 -0
- package/lib/built-in/http/apollo/default-epsilon-apollo-context.js.map +1 -0
- package/lib/built-in/http/apollo/epsilon-apollo-cors-method.d.ts +6 -0
- package/lib/built-in/http/apollo/epsilon-apollo-cors-method.js +6 -0
- package/lib/built-in/http/apollo/epsilon-apollo-cors-method.js.map +1 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.d.ts +5 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.js +2 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.js.map +1 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-options.d.ts +10 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-options.js +2 -0
- package/lib/built-in/http/apollo/epsilon-lambda-apollo-options.js.map +1 -0
- package/lib/built-in/http/apollo-filter.d.ts +10 -0
- package/lib/built-in/http/apollo-filter.js +111 -0
- package/lib/built-in/http/apollo-filter.js.map +1 -0
- package/lib/built-in/http/built-in-auth-filters.d.ts +9 -0
- package/lib/built-in/http/built-in-auth-filters.js +108 -0
- package/lib/built-in/http/built-in-auth-filters.js.map +1 -0
- package/lib/built-in/http/built-in-authorizers.d.ts +8 -0
- package/lib/built-in/http/built-in-authorizers.js +40 -0
- package/lib/built-in/http/built-in-authorizers.js.map +1 -0
- package/lib/built-in/http/built-in-filters.d.ts +26 -0
- package/lib/built-in/http/built-in-filters.js +212 -0
- package/lib/built-in/http/built-in-filters.js.map +1 -0
- package/lib/built-in/http/built-in-handlers.d.ts +9 -0
- package/lib/built-in/http/built-in-handlers.js +70 -0
- package/lib/built-in/http/built-in-handlers.js.map +1 -0
- package/lib/built-in/http/log-level-manipulation-filter.d.ts +6 -0
- package/lib/built-in/http/log-level-manipulation-filter.js +17 -0
- package/lib/built-in/http/log-level-manipulation-filter.js.map +1 -0
- package/lib/built-in/http/run-handler-as-filter.d.ts +14 -0
- package/lib/built-in/http/run-handler-as-filter.js +79 -0
- package/lib/built-in/http/run-handler-as-filter.js.map +1 -0
- package/lib/built-in/index.d.ts +26 -0
- package/lib/built-in/index.js +27 -0
- package/lib/built-in/index.js.map +1 -0
- package/lib/cli/index.d.ts +2 -0
- package/lib/cli/index.js +3 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/ratchet-cli-handler.d.ts +6 -0
- package/lib/cli/ratchet-cli-handler.js +21 -0
- package/lib/cli/ratchet-cli-handler.js.map +1 -0
- package/lib/cli/run-background-process-from-command-line.d.ts +3 -0
- package/lib/cli/run-background-process-from-command-line.js +23 -0
- package/lib/cli/run-background-process-from-command-line.js.map +1 -0
- package/lib/config/background/background-aws-config.d.ts +7 -0
- package/lib/config/background/background-aws-config.js +2 -0
- package/lib/config/background/background-aws-config.js.map +1 -0
- package/lib/config/background/background-config.d.ts +14 -0
- package/lib/config/background/background-config.js +2 -0
- package/lib/config/background/background-config.js.map +1 -0
- package/lib/config/background/background-error-processor.d.ts +4 -0
- package/lib/config/background/background-error-processor.js +2 -0
- package/lib/config/background/background-error-processor.js.map +1 -0
- package/lib/config/background/background-processor.d.ts +6 -0
- package/lib/config/background/background-processor.js +2 -0
- package/lib/config/background/background-processor.js.map +1 -0
- package/lib/config/background/background-transaction-log.d.ts +8 -0
- package/lib/config/background/background-transaction-log.js +2 -0
- package/lib/config/background/background-transaction-log.js.map +1 -0
- package/lib/config/background/background-transaction-logger.d.ts +5 -0
- package/lib/config/background/background-transaction-logger.js +2 -0
- package/lib/config/background/background-transaction-logger.js.map +1 -0
- package/lib/config/cron/abstract-cron-entry.d.ts +12 -0
- package/lib/config/cron/abstract-cron-entry.js +2 -0
- package/lib/config/cron/abstract-cron-entry.js.map +1 -0
- package/lib/config/cron/cron-background-entry.d.ts +6 -0
- package/lib/config/cron/cron-background-entry.js +2 -0
- package/lib/config/cron/cron-background-entry.js.map +1 -0
- package/lib/config/cron/cron-config.d.ts +6 -0
- package/lib/config/cron/cron-config.js +2 -0
- package/lib/config/cron/cron-config.js.map +1 -0
- package/lib/config/dynamo-db-config.d.ts +5 -0
- package/lib/config/dynamo-db-config.js +2 -0
- package/lib/config/dynamo-db-config.js.map +1 -0
- package/lib/config/epsilon-config.d.ts +24 -0
- package/lib/config/epsilon-config.js +2 -0
- package/lib/config/epsilon-config.js.map +1 -0
- package/lib/config/epsilon-lambda-event-handler.d.ts +7 -0
- package/lib/config/epsilon-lambda-event-handler.js +2 -0
- package/lib/config/epsilon-lambda-event-handler.js.map +1 -0
- package/lib/config/epsilon-logger-config.d.ts +13 -0
- package/lib/config/epsilon-logger-config.js +2 -0
- package/lib/config/epsilon-logger-config.js.map +1 -0
- package/lib/config/generic-aws-event-handler-function.d.ts +1 -0
- package/lib/config/generic-aws-event-handler-function.js +2 -0
- package/lib/config/generic-aws-event-handler-function.js.map +1 -0
- package/lib/config/http/authorizer-function.d.ts +4 -0
- package/lib/config/http/authorizer-function.js +2 -0
- package/lib/config/http/authorizer-function.js.map +1 -0
- package/lib/config/http/epsilon-authorization-context.d.ts +5 -0
- package/lib/config/http/epsilon-authorization-context.js +2 -0
- package/lib/config/http/epsilon-authorization-context.js.map +1 -0
- package/lib/config/http/extended-api-gateway-event.d.ts +7 -0
- package/lib/config/http/extended-api-gateway-event.js +2 -0
- package/lib/config/http/extended-api-gateway-event.js.map +1 -0
- package/lib/config/http/filter-chain-context.d.ts +14 -0
- package/lib/config/http/filter-chain-context.js +2 -0
- package/lib/config/http/filter-chain-context.js.map +1 -0
- package/lib/config/http/filter-function.d.ts +2 -0
- package/lib/config/http/filter-function.js +2 -0
- package/lib/config/http/filter-function.js.map +1 -0
- package/lib/config/http/handler-function.d.ts +3 -0
- package/lib/config/http/handler-function.js +2 -0
- package/lib/config/http/handler-function.js.map +1 -0
- package/lib/config/http/http-config.d.ts +15 -0
- package/lib/config/http/http-config.js +2 -0
- package/lib/config/http/http-config.js.map +1 -0
- package/lib/config/http/http-processing-config.d.ts +11 -0
- package/lib/config/http/http-processing-config.js +2 -0
- package/lib/config/http/http-processing-config.js.map +1 -0
- package/lib/config/http/mapped-http-processing-config.d.ts +7 -0
- package/lib/config/http/mapped-http-processing-config.js +2 -0
- package/lib/config/http/mapped-http-processing-config.js.map +1 -0
- package/lib/config/http/null-returned-object-handling.d.ts +6 -0
- package/lib/config/http/null-returned-object-handling.js +6 -0
- package/lib/config/http/null-returned-object-handling.js.map +1 -0
- package/lib/config/index.d.ts +35 -0
- package/lib/config/index.js +36 -0
- package/lib/config/index.js.map +1 -0
- package/lib/config/inter-api/inter-api-aws-config.d.ts +5 -0
- package/lib/config/inter-api/inter-api-aws-config.js +2 -0
- package/lib/config/inter-api/inter-api-aws-config.js.map +1 -0
- package/lib/config/inter-api/inter-api-config.d.ts +6 -0
- package/lib/config/inter-api/inter-api-config.js +2 -0
- package/lib/config/inter-api/inter-api-config.js.map +1 -0
- package/lib/config/inter-api/inter-api-process-mapping.d.ts +6 -0
- package/lib/config/inter-api/inter-api-process-mapping.js +2 -0
- package/lib/config/inter-api/inter-api-process-mapping.js.map +1 -0
- package/lib/config/logging-trace-id-generator.d.ts +2 -0
- package/lib/config/logging-trace-id-generator.js +2 -0
- package/lib/config/logging-trace-id-generator.js.map +1 -0
- package/lib/config/no-handlers-found-error.d.ts +3 -0
- package/lib/config/no-handlers-found-error.js +7 -0
- package/lib/config/no-handlers-found-error.js.map +1 -0
- package/lib/config/open-api/open-api-document-components.d.ts +4 -0
- package/lib/config/open-api/open-api-document-components.js +2 -0
- package/lib/config/open-api/open-api-document-components.js.map +1 -0
- package/lib/config/open-api/open-api-document-path.d.ts +2 -0
- package/lib/config/open-api/open-api-document-path.js +2 -0
- package/lib/config/open-api/open-api-document-path.js.map +1 -0
- package/lib/config/open-api/open-api-document.d.ts +6 -0
- package/lib/config/open-api/open-api-document.js +2 -0
- package/lib/config/open-api/open-api-document.js.map +1 -0
- package/lib/config/s3-config.d.ts +6 -0
- package/lib/config/s3-config.js +2 -0
- package/lib/config/s3-config.js.map +1 -0
- package/lib/config/sns-config.d.ts +5 -0
- package/lib/config/sns-config.js +2 -0
- package/lib/config/sns-config.js.map +1 -0
- package/lib/config/sqs-config.d.ts +5 -0
- package/lib/config/sqs-config.js +2 -0
- package/lib/config/sqs-config.js.map +1 -0
- package/lib/epsilon-build-properties.d.ts +9 -0
- package/lib/epsilon-build-properties.js +25 -0
- package/lib/epsilon-build-properties.js.map +1 -0
- package/lib/epsilon-constants.d.ts +16 -0
- package/lib/epsilon-constants.js +47 -0
- package/lib/epsilon-constants.js.map +1 -0
- package/lib/epsilon-global-handler.d.ts +20 -0
- package/lib/epsilon-global-handler.js +177 -0
- package/lib/epsilon-global-handler.js.map +1 -0
- package/lib/epsilon-instance.d.ts +14 -0
- package/lib/epsilon-instance.js +2 -0
- package/lib/epsilon-instance.js.map +1 -0
- package/lib/epsilon-logging-extension-processor.d.ts +6 -0
- package/lib/epsilon-logging-extension-processor.js +16 -0
- package/lib/epsilon-logging-extension-processor.js.map +1 -0
- package/lib/http/auth/api-gateway-adapter-authentication-handler.d.ts +8 -0
- package/lib/http/auth/api-gateway-adapter-authentication-handler.js +73 -0
- package/lib/http/auth/api-gateway-adapter-authentication-handler.js.map +1 -0
- package/lib/http/auth/auth0-web-token-manipulator.d.ts +13 -0
- package/lib/http/auth/auth0-web-token-manipulator.js +62 -0
- package/lib/http/auth/auth0-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/basic-auth-token.d.ts +4 -0
- package/lib/http/auth/basic-auth-token.js +2 -0
- package/lib/http/auth/basic-auth-token.js.map +1 -0
- package/lib/http/auth/google-web-token-manipulator.d.ts +14 -0
- package/lib/http/auth/google-web-token-manipulator.js +71 -0
- package/lib/http/auth/google-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.d.ts +11 -0
- package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.js +27 -0
- package/lib/http/auth/jwt-ratchet-local-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/local-web-token-manipulator.d.ts +19 -0
- package/lib/http/auth/local-web-token-manipulator.js +83 -0
- package/lib/http/auth/local-web-token-manipulator.js.map +1 -0
- package/lib/http/auth/web-token-manipulator.d.ts +4 -0
- package/lib/http/auth/web-token-manipulator.js +2 -0
- package/lib/http/auth/web-token-manipulator.js.map +1 -0
- package/lib/http/error/bad-gateway.d.ts +5 -0
- package/lib/http/error/bad-gateway.js +10 -0
- package/lib/http/error/bad-gateway.js.map +1 -0
- package/lib/http/error/bad-request-error.d.ts +5 -0
- package/lib/http/error/bad-request-error.js +10 -0
- package/lib/http/error/bad-request-error.js.map +1 -0
- package/lib/http/error/conflict-error.d.ts +5 -0
- package/lib/http/error/conflict-error.js +10 -0
- package/lib/http/error/conflict-error.js.map +1 -0
- package/lib/http/error/forbidden-error.d.ts +5 -0
- package/lib/http/error/forbidden-error.js +10 -0
- package/lib/http/error/forbidden-error.js.map +1 -0
- package/lib/http/error/gateway-timeout.d.ts +5 -0
- package/lib/http/error/gateway-timeout.js +10 -0
- package/lib/http/error/gateway-timeout.js.map +1 -0
- package/lib/http/error/method-not-allowed-error.d.ts +5 -0
- package/lib/http/error/method-not-allowed-error.js +10 -0
- package/lib/http/error/method-not-allowed-error.js.map +1 -0
- package/lib/http/error/misconfigured-error.d.ts +5 -0
- package/lib/http/error/misconfigured-error.js +10 -0
- package/lib/http/error/misconfigured-error.js.map +1 -0
- package/lib/http/error/not-found-error.d.ts +5 -0
- package/lib/http/error/not-found-error.js +10 -0
- package/lib/http/error/not-found-error.js.map +1 -0
- package/lib/http/error/not-implemented.d.ts +5 -0
- package/lib/http/error/not-implemented.js +10 -0
- package/lib/http/error/not-implemented.js.map +1 -0
- package/lib/http/error/request-timeout-error.d.ts +5 -0
- package/lib/http/error/request-timeout-error.js +10 -0
- package/lib/http/error/request-timeout-error.js.map +1 -0
- package/lib/http/error/service-unavailable.d.ts +5 -0
- package/lib/http/error/service-unavailable.js +10 -0
- package/lib/http/error/service-unavailable.js.map +1 -0
- package/lib/http/error/too-many-requests-error.d.ts +5 -0
- package/lib/http/error/too-many-requests-error.js +10 -0
- package/lib/http/error/too-many-requests-error.js.map +1 -0
- package/lib/http/error/unauthorized-error.d.ts +5 -0
- package/lib/http/error/unauthorized-error.js +10 -0
- package/lib/http/error/unauthorized-error.js.map +1 -0
- package/lib/http/event-util.d.ts +27 -0
- package/lib/http/event-util.js +209 -0
- package/lib/http/event-util.js.map +1 -0
- package/lib/http/index.d.ts +29 -0
- package/lib/http/index.js +30 -0
- package/lib/http/index.js.map +1 -0
- package/lib/http/response-util.d.ts +10 -0
- package/lib/http/response-util.js +142 -0
- package/lib/http/response-util.js.map +1 -0
- package/lib/http/route/epsilon-router.d.ts +8 -0
- package/lib/http/route/epsilon-router.js +2 -0
- package/lib/http/route/epsilon-router.js.map +1 -0
- package/lib/http/route/extended-auth-response-context.d.ts +6 -0
- package/lib/http/route/extended-auth-response-context.js +2 -0
- package/lib/http/route/extended-auth-response-context.js.map +1 -0
- package/lib/http/route/route-mapping.d.ts +12 -0
- package/lib/http/route/route-mapping.js +2 -0
- package/lib/http/route/route-mapping.js.map +1 -0
- package/lib/http/route/route-validator-config.d.ts +5 -0
- package/lib/http/route/route-validator-config.js +2 -0
- package/lib/http/route/route-validator-config.js.map +1 -0
- package/lib/http/route/router-util.d.ts +23 -0
- package/lib/http/route/router-util.js +234 -0
- package/lib/http/route/router-util.js.map +1 -0
- package/lib/http/web-handler.d.ts +23 -0
- package/lib/http/web-handler.js +118 -0
- package/lib/http/web-handler.js.map +1 -0
- package/lib/http/web-v2-handler.d.ts +10 -0
- package/lib/http/web-v2-handler.js +23 -0
- package/lib/http/web-v2-handler.js.map +1 -0
- package/lib/inter-api/index.d.ts +2 -0
- package/lib/inter-api/index.js +3 -0
- package/lib/inter-api/index.js.map +1 -0
- package/lib/inter-api/inter-api-entry.d.ts +7 -0
- package/lib/inter-api/inter-api-entry.js +2 -0
- package/lib/inter-api/inter-api-entry.js.map +1 -0
- package/lib/inter-api/inter-api-util.d.ts +10 -0
- package/lib/inter-api/inter-api-util.js +60 -0
- package/lib/inter-api/inter-api-util.js.map +1 -0
- package/lib/inter-api-manager.d.ts +14 -0
- package/lib/inter-api-manager.js +66 -0
- package/lib/inter-api-manager.js.map +1 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.d.ts +14 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.js +74 -0
- package/lib/lambda-event-handler/cron-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.d.ts +11 -0
- package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js +36 -0
- package/lib/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js +32 -0
- package/lib/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/generic-sqs-epsilon-lambda-event-handler.d.ts +11 -0
- package/lib/lambda-event-handler/generic-sqs-epsilon-lambda-event-handler.js +36 -0
- package/lib/lambda-event-handler/generic-sqs-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/index.d.ts +6 -0
- package/lib/lambda-event-handler/index.js +7 -0
- package/lib/lambda-event-handler/index.js.map +1 -0
- package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js +24 -0
- package/lib/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.d.ts +10 -0
- package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.js +42 -0
- package/lib/lambda-event-handler/s3-epsilon-lambda-event-handler.js.map +1 -0
- package/lib/local-container-server.d.ts +11 -0
- package/lib/local-container-server.js +85 -0
- package/lib/local-container-server.js.map +1 -0
- package/lib/local-server-cert.d.ts +5 -0
- package/lib/local-server-cert.js +68 -0
- package/lib/local-server-cert.js.map +1 -0
- package/lib/local-server.d.ts +19 -0
- package/lib/local-server.js +203 -0
- package/lib/local-server.js.map +1 -0
- package/lib/open-api-util/index.d.ts +3 -0
- package/lib/open-api-util/index.js +4 -0
- package/lib/open-api-util/index.js.map +1 -0
- package/lib/open-api-util/open-api-doc-modifications.d.ts +8 -0
- package/lib/open-api-util/open-api-doc-modifications.js +2 -0
- package/lib/open-api-util/open-api-doc-modifications.js.map +1 -0
- package/lib/open-api-util/open-api-doc-modifier.d.ts +7 -0
- package/lib/open-api-util/open-api-doc-modifier.js +80 -0
- package/lib/open-api-util/open-api-doc-modifier.js.map +1 -0
- package/lib/open-api-util/yaml-combiner.d.ts +3 -0
- package/lib/open-api-util/yaml-combiner.js +28 -0
- package/lib/open-api-util/yaml-combiner.js.map +1 -0
- package/lib/sample/index.d.ts +3 -0
- package/lib/sample/index.js +4 -0
- package/lib/sample/index.js.map +1 -0
- package/lib/sample/sample-server-components.d.ts +10 -0
- package/lib/sample/sample-server-components.js +181 -0
- package/lib/sample/sample-server-components.js.map +1 -0
- package/lib/sample/sample-server-static-files.d.ts +5 -0
- package/lib/sample/sample-server-static-files.js +609 -0
- package/lib/sample/sample-server-static-files.js.map +1 -0
- package/lib/sample/test-error-server.d.ts +10 -0
- package/lib/sample/test-error-server.js +45 -0
- package/lib/sample/test-error-server.js.map +1 -0
- package/lib/util/aws-util.d.ts +8 -0
- package/lib/util/aws-util.js +66 -0
- package/lib/util/aws-util.js.map +1 -0
- package/lib/util/context-util.d.ts +34 -0
- package/lib/util/context-util.js +104 -0
- package/lib/util/context-util.js.map +1 -0
- package/lib/util/cron-util.d.ts +11 -0
- package/lib/util/cron-util.js +69 -0
- package/lib/util/cron-util.js.map +1 -0
- package/lib/util/epsilon-config-parser.d.ts +14 -0
- package/lib/util/epsilon-config-parser.js +66 -0
- package/lib/util/epsilon-config-parser.js.map +1 -0
- package/lib/util/index.d.ts +4 -0
- package/lib/util/index.js +5 -0
- package/lib/util/index.js.map +1 -0
- package/package.json +25 -27
- package/lib/index.mjs +0 -2
- package/lib/types.d.ts +0 -1202
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FilterFunction } from '../../config/http/filter-function.js';
|
|
2
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
3
|
+
export declare class BuiltInFilters {
|
|
4
|
+
static readonly MAXIMUM_LAMBDA_BODY_SIZE_BYTES: number;
|
|
5
|
+
static combineFilters(fCtx: FilterChainContext, filters: FilterFunction[]): Promise<boolean>;
|
|
6
|
+
static applyGzipIfPossible(fCtx: FilterChainContext): Promise<boolean>;
|
|
7
|
+
static addConstantHeaders(fCtx: FilterChainContext, headers: Record<string, string>): Promise<boolean>;
|
|
8
|
+
static addAWSRequestIdHeader(fCtx: FilterChainContext, headerName?: string): Promise<boolean>;
|
|
9
|
+
static addAllowEverythingCORSHeaders(fCtx: FilterChainContext): Promise<boolean>;
|
|
10
|
+
static addAllowReflectionCORSHeaders(fCtx: FilterChainContext): Promise<boolean>;
|
|
11
|
+
static uriDecodeQueryParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
12
|
+
private static decodeUriComponentAndReplacePlus;
|
|
13
|
+
static fixStillEncodedQueryParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
14
|
+
static disallowStringNullAsPathParameter(fCtx: FilterChainContext): Promise<boolean>;
|
|
15
|
+
static disallowStringNullAsQueryStringParameter(fCtx: FilterChainContext): Promise<boolean>;
|
|
16
|
+
static ensureEventMaps(fCtx: FilterChainContext): Promise<boolean>;
|
|
17
|
+
static parseJsonBodyToObject(fCtx: FilterChainContext): Promise<boolean>;
|
|
18
|
+
static checkMaximumLambdaBodySize(fCtx: FilterChainContext): Promise<boolean>;
|
|
19
|
+
static validateInboundBody(fCtx: FilterChainContext): Promise<boolean>;
|
|
20
|
+
static validateInboundQueryParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
21
|
+
static validateInboundPathParams(fCtx: FilterChainContext): Promise<boolean>;
|
|
22
|
+
static validateOutboundResponse(fCtx: FilterChainContext): Promise<boolean>;
|
|
23
|
+
static autoRespondToOptionsRequestWithCors(fCtx: FilterChainContext): Promise<boolean>;
|
|
24
|
+
static autoRespond(fCtx: FilterChainContext, inBody: any): Promise<boolean>;
|
|
25
|
+
static secureOutboundServerErrorForProduction(fCtx: FilterChainContext, errorMessage: string, errCode: number): Promise<boolean>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/logger/logger';
|
|
2
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lang/string-ratchet';
|
|
3
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
4
|
+
import { MapRatchet } from '@bitblit/ratchet-common/lang/map-ratchet';
|
|
5
|
+
import { EventUtil } from '../../http/event-util.js';
|
|
6
|
+
import { BadRequestError } from '../../http/error/bad-request-error.js';
|
|
7
|
+
import { ResponseUtil } from '../../http/response-util.js';
|
|
8
|
+
import { MisconfiguredError } from '../../http/error/misconfigured-error.js';
|
|
9
|
+
export class BuiltInFilters {
|
|
10
|
+
static MAXIMUM_LAMBDA_BODY_SIZE_BYTES = 1024 * 1024 * 5 - 1024 * 100;
|
|
11
|
+
static async combineFilters(fCtx, filters) {
|
|
12
|
+
let cont = true;
|
|
13
|
+
if (filters && filters.length > 0) {
|
|
14
|
+
for (let i = 0; i < filters.length && cont; i++) {
|
|
15
|
+
cont = await filters[i](fCtx);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return cont;
|
|
19
|
+
}
|
|
20
|
+
static async applyGzipIfPossible(fCtx) {
|
|
21
|
+
if (fCtx.event?.headers && fCtx.result) {
|
|
22
|
+
const encodingHeader = fCtx.event && fCtx.event.headers ? MapRatchet.extractValueFromMapIgnoreCase(fCtx.event.headers, 'accept-encoding') : null;
|
|
23
|
+
fCtx.result = await ResponseUtil.applyGzipIfPossible(encodingHeader, fCtx.result);
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
static async addConstantHeaders(fCtx, headers) {
|
|
28
|
+
if (headers && fCtx.result) {
|
|
29
|
+
fCtx.result.headers = Object.assign({}, headers, fCtx.result.headers);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
Logger.warn('Could not add headers - either result or headers were missing');
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
static async addAWSRequestIdHeader(fCtx, headerName = 'X-REQUEST-ID') {
|
|
37
|
+
if (fCtx.result && StringRatchet.trimToNull(headerName) && headerName.startsWith('X-')) {
|
|
38
|
+
fCtx.result.headers = fCtx.result.headers || {};
|
|
39
|
+
fCtx.result.headers[headerName] = fCtx.context?.awsRequestId || 'Request-Id-Missing';
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
Logger.warn('Could not add request id header - either result or context were missing or name was invalid');
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
static async addAllowEverythingCORSHeaders(fCtx) {
|
|
47
|
+
return BuiltInFilters.addConstantHeaders(fCtx, {
|
|
48
|
+
'Access-Control-Allow-Origin': '*',
|
|
49
|
+
'Access-Control-Allow-Methods': '*',
|
|
50
|
+
'Access-Control-Allow-Headers': '*',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
static async addAllowReflectionCORSHeaders(fCtx) {
|
|
54
|
+
return BuiltInFilters.addConstantHeaders(fCtx, {
|
|
55
|
+
'Access-Control-Allow-Origin': MapRatchet.caseInsensitiveAccess(fCtx.event.headers, 'Origin') || '*',
|
|
56
|
+
'Access-Control-Allow-Methods': MapRatchet.caseInsensitiveAccess(fCtx.event.headers, 'Access-Control-Request-Method') || '*',
|
|
57
|
+
'Access-Control-Allow-Headers': MapRatchet.caseInsensitiveAccess(fCtx.event.headers, 'Access-Control-Request-Headers') || '*',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static async uriDecodeQueryParams(fCtx) {
|
|
61
|
+
if (fCtx?.event?.queryStringParameters) {
|
|
62
|
+
Object.keys(fCtx.event.queryStringParameters).forEach((k) => {
|
|
63
|
+
const val = fCtx.event.queryStringParameters[k];
|
|
64
|
+
if (val) {
|
|
65
|
+
fCtx.event.queryStringParameters[k] = BuiltInFilters.decodeUriComponentAndReplacePlus(val);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (fCtx?.event?.multiValueQueryStringParameters) {
|
|
70
|
+
Object.keys(fCtx.event.multiValueQueryStringParameters).forEach((k) => {
|
|
71
|
+
const val = fCtx.event.multiValueQueryStringParameters[k];
|
|
72
|
+
if (val && val.length) {
|
|
73
|
+
const cleaned = val.map((v) => BuiltInFilters.decodeUriComponentAndReplacePlus(v));
|
|
74
|
+
fCtx.event.multiValueQueryStringParameters[k] = cleaned;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
static decodeUriComponentAndReplacePlus(val) {
|
|
81
|
+
return decodeURIComponent(val.replace(/\+/g, ' '));
|
|
82
|
+
}
|
|
83
|
+
static async fixStillEncodedQueryParams(fCtx) {
|
|
84
|
+
EventUtil.fixStillEncodedQueryParams(fCtx.event);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
static async disallowStringNullAsPathParameter(fCtx) {
|
|
88
|
+
if (fCtx?.event?.pathParameters) {
|
|
89
|
+
Object.keys(fCtx.event.pathParameters).forEach((k) => {
|
|
90
|
+
if ('null' === StringRatchet.trimToEmpty(fCtx.event.pathParameters[k]).toLowerCase()) {
|
|
91
|
+
throw new BadRequestError().withFormattedErrorMessage('Path parameter %s was string -null-', k);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
static async disallowStringNullAsQueryStringParameter(fCtx) {
|
|
98
|
+
if (fCtx?.event?.queryStringParameters) {
|
|
99
|
+
Object.keys(fCtx.event.queryStringParameters).forEach((k) => {
|
|
100
|
+
if ('null' === StringRatchet.trimToEmpty(fCtx.event.queryStringParameters[k]).toLowerCase()) {
|
|
101
|
+
throw new BadRequestError().withFormattedErrorMessage('Query parameter %s was string -null-', k);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
static async ensureEventMaps(fCtx) {
|
|
108
|
+
fCtx.event.queryStringParameters = fCtx.event.queryStringParameters || {};
|
|
109
|
+
fCtx.event.headers = fCtx.event.headers || {};
|
|
110
|
+
fCtx.event.pathParameters = fCtx.event.pathParameters || {};
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
static async parseJsonBodyToObject(fCtx) {
|
|
114
|
+
if (fCtx.event?.body) {
|
|
115
|
+
try {
|
|
116
|
+
fCtx.event.parsedBody = EventUtil.jsonBodyToObject(fCtx.event);
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
throw new RestfulApiHttpError('Supplied body was not parsable as valid JSON').withHttpStatusCode(400);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
static async checkMaximumLambdaBodySize(fCtx) {
|
|
125
|
+
if (fCtx.result?.body && fCtx.result.body.length > BuiltInFilters.MAXIMUM_LAMBDA_BODY_SIZE_BYTES) {
|
|
126
|
+
const delta = fCtx.result.body.length - BuiltInFilters.MAXIMUM_LAMBDA_BODY_SIZE_BYTES;
|
|
127
|
+
throw new RestfulApiHttpError('Response size is ' + fCtx.result.body.length + ' bytes, which is ' + delta + ' bytes too large for this handler').withHttpStatusCode(500);
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
static async validateInboundBody(fCtx) {
|
|
132
|
+
if (fCtx?.event?.parsedBody && fCtx.routeAndParse) {
|
|
133
|
+
if (fCtx.routeAndParse.mapping.validation) {
|
|
134
|
+
if (!fCtx.modelValidator) {
|
|
135
|
+
throw new MisconfiguredError('Requested body validation but supplied no validator');
|
|
136
|
+
}
|
|
137
|
+
const errors = fCtx.modelValidator.validate(fCtx.routeAndParse.mapping.validation.modelName, fCtx.event.parsedBody, fCtx.routeAndParse.mapping.validation.emptyAllowed, fCtx.routeAndParse.mapping.validation.extraPropertiesAllowed);
|
|
138
|
+
if (errors.length > 0) {
|
|
139
|
+
Logger.info('Found errors while validating %s object %j', fCtx.routeAndParse.mapping.validation.modelName, errors);
|
|
140
|
+
const newError = new BadRequestError(...errors);
|
|
141
|
+
throw newError;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
Logger.debug('No validation since no route specified or no parsed body');
|
|
147
|
+
}
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
static async validateInboundQueryParams(fCtx) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
static async validateInboundPathParams(fCtx) {
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
static async validateOutboundResponse(fCtx) {
|
|
157
|
+
if (fCtx?.rawResult) {
|
|
158
|
+
if (fCtx.routeAndParse.mapping.outboundValidation) {
|
|
159
|
+
Logger.debug('Applying outbound check to %j', fCtx.rawResult);
|
|
160
|
+
const errors = fCtx.modelValidator.validate(fCtx.routeAndParse.mapping.outboundValidation.modelName, fCtx.rawResult, fCtx.routeAndParse.mapping.outboundValidation.emptyAllowed, fCtx.routeAndParse.mapping.outboundValidation.extraPropertiesAllowed);
|
|
161
|
+
if (errors.length > 0) {
|
|
162
|
+
Logger.error('Found outbound errors while validating %s object %j', fCtx.routeAndParse.mapping.outboundValidation.modelName, errors);
|
|
163
|
+
errors.unshift('Server sent object invalid according to spec');
|
|
164
|
+
throw new RestfulApiHttpError().withErrors(errors).withHttpStatusCode(500).withDetails(fCtx.rawResult);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
Logger.debug('Applied no outbound validation because none set');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
Logger.debug('No validation since no outbound body or disabled');
|
|
173
|
+
}
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
static async autoRespondToOptionsRequestWithCors(fCtx) {
|
|
177
|
+
if (StringRatchet.trimToEmpty(fCtx?.event?.httpMethod).toLowerCase() === 'options') {
|
|
178
|
+
fCtx.result = {
|
|
179
|
+
statusCode: 200,
|
|
180
|
+
body: '{"cors":true, "m":2}',
|
|
181
|
+
};
|
|
182
|
+
await BuiltInFilters.addAllowReflectionCORSHeaders(fCtx);
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
static async autoRespond(fCtx, inBody) {
|
|
190
|
+
const body = inBody || {
|
|
191
|
+
message: 'Not Implemented',
|
|
192
|
+
};
|
|
193
|
+
fCtx.result = {
|
|
194
|
+
statusCode: 200,
|
|
195
|
+
body: JSON.stringify(body),
|
|
196
|
+
};
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
static async secureOutboundServerErrorForProduction(fCtx, errorMessage, errCode) {
|
|
200
|
+
if (fCtx?.result?.statusCode) {
|
|
201
|
+
if (errCode === null || fCtx.result.statusCode === errCode) {
|
|
202
|
+
Logger.warn('Securing outbound error info (was : %j)', fCtx.result.body);
|
|
203
|
+
fCtx.rawResult = new RestfulApiHttpError(errorMessage).withHttpStatusCode(fCtx.result.statusCode);
|
|
204
|
+
const oldResult = fCtx.result;
|
|
205
|
+
fCtx.result = ResponseUtil.errorResponse(fCtx.rawResult);
|
|
206
|
+
fCtx.result.headers = Object.assign({}, oldResult.headers || {}, fCtx.result.headers || {});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=built-in-filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-in-filters.js","sourceRoot":"","sources":["../../../src/built-in/http/built-in-filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,MAAM,OAAO,cAAc;IAClB,MAAM,CAAU,8BAA8B,GAAW,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC;IAEtF,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,IAAwB,EAAE,OAAyB;QACpF,IAAI,IAAI,GAAY,IAAI,CAAC;QACzB,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAA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-lambda';
|
|
2
|
+
import { ExtendedAPIGatewayEvent } from '../../config/http/extended-api-gateway-event.js';
|
|
3
|
+
import { EpsilonRouter } from '../../http/route/epsilon-router.js';
|
|
4
|
+
export declare class BuiltInHandlers {
|
|
5
|
+
static expectedHandledByFilter(evt: ExtendedAPIGatewayEvent, flag?: string): Promise<any>;
|
|
6
|
+
static handleNotImplemented(evt: ExtendedAPIGatewayEvent, flag?: string): Promise<any>;
|
|
7
|
+
static sample(evt: ExtendedAPIGatewayEvent, flag?: string, context?: Context): Promise<any>;
|
|
8
|
+
static defaultErrorProcessor(event: APIGatewayEvent, err: Error, cfg: EpsilonRouter): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/logger/logger';
|
|
2
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lang/string-ratchet';
|
|
3
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
4
|
+
import { NumberRatchet } from '@bitblit/ratchet-common/lang/number-ratchet';
|
|
5
|
+
import { BadRequestError } from '../../http/error/bad-request-error.js';
|
|
6
|
+
import { UnauthorizedError } from '../../http/error/unauthorized-error.js';
|
|
7
|
+
import { NotFoundError } from '../../http/error/not-found-error.js';
|
|
8
|
+
import { ForbiddenError } from '../../http/error/forbidden-error.js';
|
|
9
|
+
import { NotImplemented } from '../../http/error/not-implemented.js';
|
|
10
|
+
import { MisconfiguredError } from '../../http/error/misconfigured-error.js';
|
|
11
|
+
export class BuiltInHandlers {
|
|
12
|
+
static async expectedHandledByFilter(evt, flag) {
|
|
13
|
+
throw new MisconfiguredError().withFormattedErrorMessage('Should not happen - it was expected that route %s would be handled by a filter', evt.path);
|
|
14
|
+
}
|
|
15
|
+
static async handleNotImplemented(evt, flag) {
|
|
16
|
+
Logger.info('A request was made to %s with body %j - not yet implemented', evt.path, evt.body);
|
|
17
|
+
const rval = {
|
|
18
|
+
time: new Date().toLocaleString(),
|
|
19
|
+
path: evt.path,
|
|
20
|
+
message: 'NOT IMPLEMENTED YET',
|
|
21
|
+
};
|
|
22
|
+
return rval;
|
|
23
|
+
}
|
|
24
|
+
static async sample(evt, flag, context) {
|
|
25
|
+
const rval = {
|
|
26
|
+
time: new Date().toLocaleString(),
|
|
27
|
+
evt: evt,
|
|
28
|
+
pad: StringRatchet.createRandomHexString(2000),
|
|
29
|
+
flag: flag,
|
|
30
|
+
};
|
|
31
|
+
if (context) {
|
|
32
|
+
rval['context'] = context;
|
|
33
|
+
}
|
|
34
|
+
const errNumber = NumberRatchet.safeNumber(evt.queryStringParameters['error']);
|
|
35
|
+
if (errNumber) {
|
|
36
|
+
switch (errNumber) {
|
|
37
|
+
case -1:
|
|
38
|
+
throw new Error('Test random failure');
|
|
39
|
+
case 400:
|
|
40
|
+
throw new BadRequestError('Bad request error');
|
|
41
|
+
case 401:
|
|
42
|
+
throw new UnauthorizedError('Unauthorized error');
|
|
43
|
+
case 403:
|
|
44
|
+
throw new ForbiddenError('Forbidden error');
|
|
45
|
+
case 404:
|
|
46
|
+
throw new NotFoundError('Not Found error');
|
|
47
|
+
case 501:
|
|
48
|
+
throw new NotImplemented('Not Implemented');
|
|
49
|
+
default:
|
|
50
|
+
throw new RestfulApiHttpError()
|
|
51
|
+
.withFormattedErrorMessage('Default error - %s', errNumber)
|
|
52
|
+
.withHttpStatusCode(500)
|
|
53
|
+
.withDetails({ src: errNumber })
|
|
54
|
+
.withEndUserErrors(['msg1', 'msg2']);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
let test = StringRatchet.trimToNull(evt.queryStringParameters['test']);
|
|
58
|
+
if (test) {
|
|
59
|
+
test = test.toLowerCase();
|
|
60
|
+
if (test === 'null') {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return rval;
|
|
65
|
+
}
|
|
66
|
+
static async defaultErrorProcessor(event, err, cfg) {
|
|
67
|
+
Logger.warn('Unhandled error (in promise catch) : %s \nStack was: %s\nEvt was: %j\nConfig was: %j', err.message, err.stack, event, cfg);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=built-in-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-in-handlers.js","sourceRoot":"","sources":["../../../src/built-in/http/built-in-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAG5E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,OAAO,eAAe;IACnB,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,GAA4B,EAAE,IAAa;QACrF,MAAM,IAAI,kBAAkB,EAAE,CAAC,yBAAyB,CACtD,gFAAgF,EAChF,GAAG,CAAC,IAAI,CACT,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,GAA4B,EAAE,IAAa;QAClF,MAAM,CAAC,IAAI,CAAC,6DAA6D,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAE/F,MAAM,IAAI,GAAQ;YAChB,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE;YACjC,IAAI,EAAE,GAAG,CAAC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AAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,IAAI,IAAI,GAAW,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/E,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YAC1B,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,KAAsB,EAAE,GAAU,EAAE,GAAkB;QAC9F,MAAM,CAAC,IAAI,CAAC,sFAAsF,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1I,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
2
|
+
export declare class LogLevelManipulationFilter {
|
|
3
|
+
private static LOG_LEVEL_BEFORE_CHANGE;
|
|
4
|
+
static setLogLevelForTransaction(fCtx: FilterChainContext): Promise<boolean>;
|
|
5
|
+
static clearLogLevelForTransaction(fCtx: FilterChainContext): Promise<boolean>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/logger/logger';
|
|
2
|
+
export class LogLevelManipulationFilter {
|
|
3
|
+
static LOG_LEVEL_BEFORE_CHANGE = null;
|
|
4
|
+
static async setLogLevelForTransaction(fCtx) {
|
|
5
|
+
LogLevelManipulationFilter.LOG_LEVEL_BEFORE_CHANGE = Logger.getLevel();
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
static async clearLogLevelForTransaction(fCtx) {
|
|
9
|
+
if (LogLevelManipulationFilter.LOG_LEVEL_BEFORE_CHANGE) {
|
|
10
|
+
Logger.setLevel(LogLevelManipulationFilter.LOG_LEVEL_BEFORE_CHANGE);
|
|
11
|
+
LogLevelManipulationFilter.LOG_LEVEL_BEFORE_CHANGE = null;
|
|
12
|
+
Logger.updateTracePrefix(null);
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=log-level-manipulation-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-level-manipulation-filter.js","sourceRoot":"","sources":["../../../src/built-in/http/log-level-manipulation-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAO/D,MAAM,OAAO,0BAA0B;IAC7B,MAAM,CAAC,uBAAuB,GAAoB,IAAI,CAAC;IAGxD,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,IAAwB;QACpE,0BAA0B,CAAC,uBAAuB,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAEvE,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,IAAwB;QACtE,IAAI,0BAA0B,CAAC,uBAAuB,EAAE,CAAC;YACvD,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;YACpE,0BAA0B,CAAC,uBAAuB,GAAG,IAAI,CAAC;YAC1D,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from 'aws-lambda';
|
|
2
|
+
import { ExtendedAPIGatewayEvent } from '../../config/http/extended-api-gateway-event.js';
|
|
3
|
+
import { RouteAndParse } from '../../http/web-handler.js';
|
|
4
|
+
import { NullReturnedObjectHandling } from '../../config/http/null-returned-object-handling.js';
|
|
5
|
+
import { FilterFunction } from '../../config/http/filter-function.js';
|
|
6
|
+
import { FilterChainContext } from '../../config/http/filter-chain-context.js';
|
|
7
|
+
export declare class RunHandlerAsFilter {
|
|
8
|
+
static runHandler(fCtx: FilterChainContext, rm: RouteAndParse): Promise<boolean>;
|
|
9
|
+
static applyNullReturnedObjectHandling(result: any, handling: NullReturnedObjectHandling): any;
|
|
10
|
+
static findHandler(rm: RouteAndParse, event: ExtendedAPIGatewayEvent, context: Context, add404OnMissing?: boolean): Promise<any>;
|
|
11
|
+
static addRunHandlerAsFilterToList(filters: FilterFunction[], rm: RouteAndParse): void;
|
|
12
|
+
private static eventToStringForLog;
|
|
13
|
+
static redact(input: string): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/logger/logger';
|
|
2
|
+
import { PromiseRatchet } from '@bitblit/ratchet-common/lang/promise-ratchet';
|
|
3
|
+
import { StringRatchet } from '@bitblit/ratchet-common/lang/string-ratchet';
|
|
4
|
+
import { TimeoutToken } from '@bitblit/ratchet-common/lang/timeout-token';
|
|
5
|
+
import { RestfulApiHttpError } from '@bitblit/ratchet-common/network/restful-api-http-error';
|
|
6
|
+
import { RequestTimeoutError } from '../../http/error/request-timeout-error.js';
|
|
7
|
+
import { ResponseUtil } from '../../http/response-util.js';
|
|
8
|
+
import { NotFoundError } from '../../http/error/not-found-error.js';
|
|
9
|
+
import { NullReturnedObjectHandling } from '../../config/http/null-returned-object-handling.js';
|
|
10
|
+
export class RunHandlerAsFilter {
|
|
11
|
+
static async runHandler(fCtx, rm) {
|
|
12
|
+
const handler = RunHandlerAsFilter.findHandler(rm, fCtx.event, fCtx.context);
|
|
13
|
+
Logger.debug('Processing event with epsilon: %j', RunHandlerAsFilter.eventToStringForLog(fCtx.event));
|
|
14
|
+
let tmp = await handler;
|
|
15
|
+
if (TimeoutToken.isTimeoutToken(tmp)) {
|
|
16
|
+
tmp.writeToLog();
|
|
17
|
+
throw new RequestTimeoutError('Timed out');
|
|
18
|
+
}
|
|
19
|
+
Logger.debug('Initial return value : %j', tmp);
|
|
20
|
+
tmp = RunHandlerAsFilter.applyNullReturnedObjectHandling(tmp, rm.mapping.metaProcessingConfig.nullReturnedObjectHandling);
|
|
21
|
+
fCtx.rawResult = tmp;
|
|
22
|
+
fCtx.result = ResponseUtil.coerceToProxyResult(tmp);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
static applyNullReturnedObjectHandling(result, handling) {
|
|
26
|
+
let rval = result;
|
|
27
|
+
if (result === null || result === undefined) {
|
|
28
|
+
if (handling === NullReturnedObjectHandling.Error) {
|
|
29
|
+
Logger.error('Null object returned and Error specified, throwing 500');
|
|
30
|
+
throw new RestfulApiHttpError('Null object').withHttpStatusCode(500);
|
|
31
|
+
}
|
|
32
|
+
else if (handling === NullReturnedObjectHandling.Return404NotFoundResponse) {
|
|
33
|
+
throw new NotFoundError('Resource not found');
|
|
34
|
+
}
|
|
35
|
+
else if (handling === NullReturnedObjectHandling.ConvertToEmptyString) {
|
|
36
|
+
Logger.warn('Null object returned from handler and convert not specified, converting to empty string');
|
|
37
|
+
rval = '';
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
throw new RestfulApiHttpError('Cant happen - failed enum check').withHttpStatusCode(500);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return rval;
|
|
44
|
+
}
|
|
45
|
+
static async findHandler(rm, event, context, add404OnMissing = true) {
|
|
46
|
+
let rval = null;
|
|
47
|
+
if (rm) {
|
|
48
|
+
event.pathParameters = Object.assign({}, event.pathParameters, rm.parsed);
|
|
49
|
+
rval = PromiseRatchet.timeout(rm.mapping.function(event, context), 'Timed out after ' +
|
|
50
|
+
rm.mapping.metaProcessingConfig.timeoutMS +
|
|
51
|
+
' ms. Request was ' +
|
|
52
|
+
RunHandlerAsFilter.eventToStringForLog(event), rm.mapping.metaProcessingConfig.timeoutMS);
|
|
53
|
+
}
|
|
54
|
+
else if (add404OnMissing) {
|
|
55
|
+
throw new NotFoundError('No such endpoint');
|
|
56
|
+
}
|
|
57
|
+
return rval;
|
|
58
|
+
}
|
|
59
|
+
static addRunHandlerAsFilterToList(filters, rm) {
|
|
60
|
+
if (filters) {
|
|
61
|
+
filters.push((fCtx) => RunHandlerAsFilter.runHandler(fCtx, rm));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static eventToStringForLog(event) {
|
|
65
|
+
const eventToLog = structuredClone(event);
|
|
66
|
+
if (eventToLog?.authorization?.raw) {
|
|
67
|
+
eventToLog.authorization.raw = RunHandlerAsFilter.redact(eventToLog.authorization.raw);
|
|
68
|
+
}
|
|
69
|
+
if (eventToLog?.headers?.authorization) {
|
|
70
|
+
eventToLog.headers.authorization = RunHandlerAsFilter.redact(eventToLog.headers.authorization);
|
|
71
|
+
}
|
|
72
|
+
return JSON.stringify(eventToLog);
|
|
73
|
+
}
|
|
74
|
+
static redact(input) {
|
|
75
|
+
const rval = input ? StringRatchet.obscure(input, 1, 1) : input;
|
|
76
|
+
return rval;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=run-handler-as-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-handler-as-filter.js","sourceRoot":"","sources":["../../../src/built-in/http/run-handler-as-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAG7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,q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M,MAAM,CAAC,2BAA2B,CAAC,OAAyB,EAAE,EAAiB;QACpF,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,mBAAmB,CAAC,KAAU;QAC3C,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC;YACnC,UAAU,CAAC,aAAa,CAAC,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;YACvC,UAAU,CAAC,OAAO,CAAC,aAAa,GAAG,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACjG,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,KAAa;QAChC,MAAM,IAAI,GAAW,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACxE,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './built-in-trace-id-generators.js';
|
|
2
|
+
export * from './background/echo-processor.js';
|
|
3
|
+
export * from './background/log-and-enqueue-echo-processor.js';
|
|
4
|
+
export * from './background/log-message-background-error-processor.js';
|
|
5
|
+
export * from './background/no-op-processor.js';
|
|
6
|
+
export * from './background/retry-processor.js';
|
|
7
|
+
export * from './background/sample-delay-processor.js';
|
|
8
|
+
export * from './background/sample-input-validated-processor-data.js';
|
|
9
|
+
export * from './background/sample-input-validated-processor.js';
|
|
10
|
+
export * from './daemon/daemon-authorizer-function.js';
|
|
11
|
+
export * from './daemon/daemon-config.js';
|
|
12
|
+
export * from './daemon/daemon-group-selection-function.js';
|
|
13
|
+
export * from './daemon/daemon-handler.js';
|
|
14
|
+
export * from './daemon/daemon-process-state-list.js';
|
|
15
|
+
export * from './http/apollo-filter.js';
|
|
16
|
+
export * from './http/built-in-auth-filters.js';
|
|
17
|
+
export * from './http/built-in-authorizers.js';
|
|
18
|
+
export * from './http/built-in-filters.js';
|
|
19
|
+
export * from './http/built-in-handlers.js';
|
|
20
|
+
export * from './http/log-level-manipulation-filter.js';
|
|
21
|
+
export * from './http/run-handler-as-filter.js';
|
|
22
|
+
export * from './http/apollo/apollo-util.js';
|
|
23
|
+
export * from './http/apollo/default-epsilon-apollo-context.js';
|
|
24
|
+
export * from './http/apollo/epsilon-apollo-cors-method.js';
|
|
25
|
+
export * from './http/apollo/epsilon-lambda-apollo-context-function-argument.js';
|
|
26
|
+
export * from './http/apollo/epsilon-lambda-apollo-options.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './built-in-trace-id-generators.js';
|
|
2
|
+
export * from './background/echo-processor.js';
|
|
3
|
+
export * from './background/log-and-enqueue-echo-processor.js';
|
|
4
|
+
export * from './background/log-message-background-error-processor.js';
|
|
5
|
+
export * from './background/no-op-processor.js';
|
|
6
|
+
export * from './background/retry-processor.js';
|
|
7
|
+
export * from './background/sample-delay-processor.js';
|
|
8
|
+
export * from './background/sample-input-validated-processor-data.js';
|
|
9
|
+
export * from './background/sample-input-validated-processor.js';
|
|
10
|
+
export * from './daemon/daemon-authorizer-function.js';
|
|
11
|
+
export * from './daemon/daemon-config.js';
|
|
12
|
+
export * from './daemon/daemon-group-selection-function.js';
|
|
13
|
+
export * from './daemon/daemon-handler.js';
|
|
14
|
+
export * from './daemon/daemon-process-state-list.js';
|
|
15
|
+
export * from './http/apollo-filter.js';
|
|
16
|
+
export * from './http/built-in-auth-filters.js';
|
|
17
|
+
export * from './http/built-in-authorizers.js';
|
|
18
|
+
export * from './http/built-in-filters.js';
|
|
19
|
+
export * from './http/built-in-handlers.js';
|
|
20
|
+
export * from './http/log-level-manipulation-filter.js';
|
|
21
|
+
export * from './http/run-handler-as-filter.js';
|
|
22
|
+
export * from './http/apollo/apollo-util.js';
|
|
23
|
+
export * from './http/apollo/default-epsilon-apollo-context.js';
|
|
24
|
+
export * from './http/apollo/epsilon-apollo-cors-method.js';
|
|
25
|
+
export * from './http/apollo/epsilon-lambda-apollo-context-function-argument.js';
|
|
26
|
+
export * from './http/apollo/epsilon-lambda-apollo-options.js';
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/built-in/index.ts"],"names":[],"mappings":"AAIA,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kEAAkE,CAAC;AACjF,cAAc,gDAAgD,CAAC"}
|
package/lib/cli/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAIA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+CAA+C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AbstractRatchetCliHandler } from '@bitblit/ratchet-node-only/cli/abstract-ratchet-cli-handler';
|
|
2
|
+
import { BuildInformation } from '@bitblit/ratchet-common/build/build-information';
|
|
3
|
+
export declare class RatchetCliHandler extends AbstractRatchetCliHandler {
|
|
4
|
+
fetchHandlerMap(): Record<string, any>;
|
|
5
|
+
fetchVersionInfo(): BuildInformation;
|
|
6
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AbstractRatchetCliHandler } from '@bitblit/ratchet-node-only/cli/abstract-ratchet-cli-handler';
|
|
2
|
+
import { RunBackgroundProcessFromCommandLine } from './run-background-process-from-command-line.js';
|
|
3
|
+
import { TestErrorServer } from '../sample/test-error-server.js';
|
|
4
|
+
import { LocalContainerServer } from '../local-container-server.js';
|
|
5
|
+
import { RatchetEpsilonCommonInfo } from '../build/ratchet-epsilon-common-info.js';
|
|
6
|
+
import { LocalServer } from '../local-server.js';
|
|
7
|
+
export class RatchetCliHandler extends AbstractRatchetCliHandler {
|
|
8
|
+
fetchHandlerMap() {
|
|
9
|
+
return {
|
|
10
|
+
'run-background-process': RunBackgroundProcessFromCommandLine.runFromCliArgs,
|
|
11
|
+
'run-test-error-server': TestErrorServer.runFromCliArgs,
|
|
12
|
+
'run-local-container-server': LocalContainerServer.runFromCliArgs,
|
|
13
|
+
'run-sample-local-server': LocalServer.runSampleLocalServerFromCliArgs,
|
|
14
|
+
'run-sample-local-batch-server': LocalServer.runSampleLocalServerFromCliArgs,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
fetchVersionInfo() {
|
|
18
|
+
return RatchetEpsilonCommonInfo.buildInformation();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=ratchet-cli-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ratchet-cli-handler.js","sourceRoot":"","sources":["../../src/cli/ratchet-cli-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6DAA6D,CAAC;AAExG,OAAO,EAAE,mCAAmC,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,iBAAkB,SAAQ,yBAAyB;IAC9D,eAAe;QACb,OAAO;YACL,wBAAwB,EAAE,mCAAmC,CAAC,cAAc;YAC5E,uBAAuB,EAAE,eAAe,CAAC,cAAc;YACvD,4BAA4B,EAAE,oBAAoB,CAAC,cAAc;YACjE,yBAAyB,EAAE,WAAW,CAAC,+BAA+B;YACtE,+BAA+B,EAAE,WAAW,CAAC,+BAA+B;SAC7E,CAAC;IACJ,CAAC;IAED,gBAAgB;QACd,OAAO,wBAAwB,CAAC,gBAAgB,EAAE,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Logger } from '@bitblit/ratchet-common/logger/logger';
|
|
2
|
+
import { BooleanRatchet } from '@bitblit/ratchet-common/lang/boolean-ratchet';
|
|
3
|
+
export class RunBackgroundProcessFromCommandLine {
|
|
4
|
+
static async runFromCliArgs(args) {
|
|
5
|
+
if (args.length > 1) {
|
|
6
|
+
const procName = args[0];
|
|
7
|
+
const dryRun = args.length > 1 && BooleanRatchet.parseBool(args[1]);
|
|
8
|
+
const data = args.length > 2 ? JSON.parse(args[2]) : null;
|
|
9
|
+
const meta = args.length > 3 ? JSON.parse(args[3]) : null;
|
|
10
|
+
const epsilon = null;
|
|
11
|
+
if (dryRun) {
|
|
12
|
+
Logger.info('Dry-Run, would have sent : %s %j %j', procName, data, meta);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
await epsilon.processSingleBackgroundByParts(procName, data, meta);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
console.log('Usage : run-background-process {processName} {dryRun true/false} {dataJson} {metaJson}');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=run-background-process-from-command-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-background-process-from-command-line.js","sourceRoot":"","sources":["../../src/cli/run-background-process-from-command-line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAW9E,MAAM,OAAO,mCAAmC;IACvC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,IAAc;QAC/C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,MAAM,QAAQ,GAAW,IAAI,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,MAAM,GAAY,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7E,MAAM,IAAI,GAAQ,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC/D,MAAM,IAAI,GAAQ,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC/D,MAAM,OAAO,GAAyB,IAAI,CAAC;YAE3C,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,qCAAqC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAC3E,CAAC;iBAAM,CAAC;gBACN,MAAM,OAAO,CAAC,8BAA8B,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,wFAAwF,CAAC,CAAC;QACxG,CAAC;IACH,CAAC;CACF"}
|