@bitblit/ratchet-epsilon-common 4.0.85-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/CHANGELOG.md +177 -0
- package/License.txt +13 -0
- package/README.md +242 -0
- package/dist/cjs/background/background-dynamo-log-table-handler.js +38 -0
- package/dist/cjs/background/background-entry.js +2 -0
- package/dist/cjs/background/background-execution-event-type.js +11 -0
- package/dist/cjs/background/background-execution-event.js +2 -0
- package/dist/cjs/background/background-execution-listener.js +2 -0
- package/dist/cjs/background/background-handler.js +269 -0
- package/dist/cjs/background/background-http-adapter-handler.js +127 -0
- package/dist/cjs/background/background-meta-response-internal.js +2 -0
- package/dist/cjs/background/background-process-handling.js +8 -0
- package/dist/cjs/background/background-process-log-table-entry.js +2 -0
- package/dist/cjs/background/background-queue-response-internal.js +2 -0
- package/dist/cjs/background/background-validator.js +88 -0
- package/dist/cjs/background/epsilon-background-process-error.js +93 -0
- package/dist/cjs/background/internal-background-entry.js +2 -0
- package/dist/cjs/background/manager/abstract-background-manager.js +92 -0
- package/dist/cjs/background/manager/aws-sqs-sns-background-manager.js +153 -0
- package/dist/cjs/background/manager/background-manager-like.js +2 -0
- package/dist/cjs/background/manager/single-thread-local-background-manager.js +49 -0
- package/dist/cjs/background/s3-background-transaction-logger.js +54 -0
- package/dist/cjs/build/ratchet-epsilon-common-info.js +18 -0
- package/dist/cjs/built-in/background/echo-processor.js +18 -0
- package/dist/cjs/built-in/background/log-and-enqueue-echo-processor.js +16 -0
- package/dist/cjs/built-in/background/log-message-background-error-processor.js +10 -0
- package/dist/cjs/built-in/background/no-op-processor.js +13 -0
- package/dist/cjs/built-in/background/retry-processor.js +41 -0
- package/dist/cjs/built-in/background/sample-delay-processor.js +16 -0
- package/dist/cjs/built-in/background/sample-input-validated-processor-data.js +2 -0
- package/dist/cjs/built-in/background/sample-input-validated-processor.js +16 -0
- package/dist/cjs/built-in/built-in-trace-id-generators.js +25 -0
- package/dist/cjs/built-in/daemon/daemon-authorizer-function.js +2 -0
- package/dist/cjs/built-in/daemon/daemon-config.js +2 -0
- package/dist/cjs/built-in/daemon/daemon-group-selection-function.js +2 -0
- package/dist/cjs/built-in/daemon/daemon-handler.js +62 -0
- package/dist/cjs/built-in/daemon/daemon-process-state-list.js +2 -0
- package/dist/cjs/built-in/http/apollo-filter.js +63 -0
- package/dist/cjs/built-in/http/built-in-auth-filters.js +115 -0
- package/dist/cjs/built-in/http/built-in-authorizers.js +43 -0
- package/dist/cjs/built-in/http/built-in-filters.js +222 -0
- package/dist/cjs/built-in/http/built-in-handlers.js +73 -0
- package/dist/cjs/built-in/http/log-level-manipulation-filter.js +20 -0
- package/dist/cjs/built-in/http/run-handler-as-filter.js +64 -0
- package/dist/cjs/cli-bootstrap/epsilon-run-background-process-from-command-line-dry-run.js +20 -0
- package/dist/cjs/config/background/background-aws-config.js +2 -0
- package/dist/cjs/config/background/background-config.js +2 -0
- package/dist/cjs/config/background/background-error-processor.js +2 -0
- package/dist/cjs/config/background/background-processor.js +2 -0
- package/dist/cjs/config/background/background-transaction-log.js +2 -0
- package/dist/cjs/config/background/background-transaction-logger.js +2 -0
- package/dist/cjs/config/cron/abstract-cron-entry.js +2 -0
- package/dist/cjs/config/cron/cron-background-entry.js +2 -0
- package/dist/cjs/config/cron/cron-config.js +2 -0
- package/dist/cjs/config/dynamo-db-config.js +2 -0
- package/dist/cjs/config/epsilon-config.js +2 -0
- package/dist/cjs/config/epsilon-lambda-event-handler.js +2 -0
- package/dist/cjs/config/epsilon-logger-config.js +2 -0
- package/dist/cjs/config/generic-aws-event-handler-function.js +2 -0
- package/dist/cjs/config/http/authorizer-function.js +2 -0
- package/dist/cjs/config/http/epsilon-authorization-context.js +2 -0
- package/dist/cjs/config/http/extended-api-gateway-event.js +2 -0
- package/dist/cjs/config/http/filter-chain-context.js +2 -0
- package/dist/cjs/config/http/filter-function.js +2 -0
- package/dist/cjs/config/http/handler-function.js +2 -0
- package/dist/cjs/config/http/http-config.js +2 -0
- package/dist/cjs/config/http/http-processing-config.js +2 -0
- package/dist/cjs/config/http/mapped-http-processing-config.js +2 -0
- package/dist/cjs/config/http/null-returned-object-handling.js +9 -0
- package/dist/cjs/config/inter-api/inter-api-aws-config.js +2 -0
- package/dist/cjs/config/inter-api/inter-api-config.js +2 -0
- package/dist/cjs/config/inter-api/inter-api-process-mapping.js +2 -0
- package/dist/cjs/config/logging-trace-id-generator.js +2 -0
- package/dist/cjs/config/open-api/open-api-document-components.js +2 -0
- package/dist/cjs/config/open-api/open-api-document-path.js +2 -0
- package/dist/cjs/config/open-api/open-api-document.js +2 -0
- package/dist/cjs/config/s3-config.js +2 -0
- package/dist/cjs/config/sns-config.js +2 -0
- package/dist/cjs/epsilon-build-properties.js +28 -0
- package/dist/cjs/epsilon-constants.js +49 -0
- package/dist/cjs/epsilon-global-handler.js +155 -0
- package/dist/cjs/epsilon-instance.js +2 -0
- package/dist/cjs/epsilon-logging-extension-processor.js +19 -0
- package/dist/cjs/http/auth/api-gateway-adapter-authentication-handler.js +75 -0
- package/dist/cjs/http/auth/auth0-web-token-manipulator.js +62 -0
- package/dist/cjs/http/auth/basic-auth-token.js +2 -0
- package/dist/cjs/http/auth/google-web-token-manipulator.js +72 -0
- package/dist/cjs/http/auth/jwt-ratchet-local-web-token-manipulator.js +29 -0
- package/dist/cjs/http/auth/local-web-token-manipulator.js +74 -0
- package/dist/cjs/http/auth/web-token-manipulator.js +2 -0
- package/dist/cjs/http/error/bad-gateway.js +12 -0
- package/dist/cjs/http/error/bad-request-error.js +12 -0
- package/dist/cjs/http/error/conflict-error.js +12 -0
- package/dist/cjs/http/error/epsilon-http-error.js +132 -0
- package/dist/cjs/http/error/forbidden-error.js +12 -0
- package/dist/cjs/http/error/gateway-timeout.js +12 -0
- package/dist/cjs/http/error/method-not-allowed-error.js +12 -0
- package/dist/cjs/http/error/misconfigured-error.js +12 -0
- package/dist/cjs/http/error/not-found-error.js +12 -0
- package/dist/cjs/http/error/not-implemented.js +12 -0
- package/dist/cjs/http/error/request-timeout-error.js +12 -0
- package/dist/cjs/http/error/service-unavailable.js +12 -0
- package/dist/cjs/http/error/too-many-requests-error.js +12 -0
- package/dist/cjs/http/error/unauthorized-error.js +12 -0
- package/dist/cjs/http/event-util.js +180 -0
- package/dist/cjs/http/response-util.js +146 -0
- package/dist/cjs/http/route/epsilon-router.js +2 -0
- package/dist/cjs/http/route/extended-auth-response-context.js +2 -0
- package/dist/cjs/http/route/route-mapping.js +2 -0
- package/dist/cjs/http/route/route-validator-config.js +2 -0
- package/dist/cjs/http/route/router-util.js +238 -0
- package/dist/cjs/http/web-handler.js +122 -0
- package/dist/cjs/http/web-v2-handler.js +25 -0
- package/dist/cjs/index.js +136 -0
- package/dist/cjs/inter-api/inter-api-entry.js +2 -0
- package/dist/cjs/inter-api/inter-api-util.js +62 -0
- package/dist/cjs/inter-api-manager.js +67 -0
- package/dist/cjs/lambda-event-handler/cron-epsilon-lambda-event-handler.js +76 -0
- package/dist/cjs/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js +36 -0
- package/dist/cjs/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js +32 -0
- package/dist/cjs/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js +26 -0
- package/dist/cjs/lambda-event-handler/s3-epsilon-lambda-event-handler.js +44 -0
- package/dist/cjs/local-container-server.js +79 -0
- package/dist/cjs/local-server-cert.js +71 -0
- package/dist/cjs/local-server.js +145 -0
- package/dist/cjs/open-api-util/open-api-doc-modifications.js +2 -0
- package/dist/cjs/open-api-util/open-api-doc-modifier.js +83 -0
- package/dist/cjs/open-api-util/yaml-combiner.js +32 -0
- package/dist/cjs/run-background-process-from-command-line.js +37 -0
- package/dist/cjs/sample/sample-batch-only-local-server.js +19 -0
- package/dist/cjs/sample/sample-local-server.js +30 -0
- package/dist/cjs/sample/sample-server-components.js +197 -0
- package/dist/cjs/test-error-server.js +48 -0
- package/dist/cjs/util/aws-util.js +69 -0
- package/dist/cjs/util/context-util.js +104 -0
- package/dist/cjs/util/cron-util.js +72 -0
- package/dist/cjs/util/epsilon-config-parser.js +70 -0
- package/dist/es/background/background-dynamo-log-table-handler.js +33 -0
- package/dist/es/background/background-entry.js +1 -0
- package/dist/es/background/background-execution-event-type.js +8 -0
- package/dist/es/background/background-execution-event.js +1 -0
- package/dist/es/background/background-execution-listener.js +1 -0
- package/dist/es/background/background-handler.js +265 -0
- package/dist/es/background/background-http-adapter-handler.js +123 -0
- package/dist/es/background/background-meta-response-internal.js +1 -0
- package/dist/es/background/background-process-handling.js +5 -0
- package/dist/es/background/background-process-log-table-entry.js +1 -0
- package/dist/es/background/background-queue-response-internal.js +1 -0
- package/dist/es/background/background-validator.js +84 -0
- package/dist/es/background/epsilon-background-process-error.js +88 -0
- package/dist/es/background/internal-background-entry.js +1 -0
- package/dist/es/background/manager/abstract-background-manager.js +88 -0
- package/dist/es/background/manager/aws-sqs-sns-background-manager.js +149 -0
- package/dist/es/background/manager/background-manager-like.js +1 -0
- package/dist/es/background/manager/single-thread-local-background-manager.js +45 -0
- package/dist/es/background/s3-background-transaction-logger.js +49 -0
- package/dist/es/build/ratchet-epsilon-common-info.js +14 -0
- package/dist/es/built-in/background/echo-processor.js +14 -0
- package/dist/es/built-in/background/log-and-enqueue-echo-processor.js +12 -0
- package/dist/es/built-in/background/log-message-background-error-processor.js +6 -0
- package/dist/es/built-in/background/no-op-processor.js +9 -0
- package/dist/es/built-in/background/retry-processor.js +36 -0
- package/dist/es/built-in/background/sample-delay-processor.js +12 -0
- package/dist/es/built-in/background/sample-input-validated-processor-data.js +1 -0
- package/dist/es/built-in/background/sample-input-validated-processor.js +12 -0
- package/dist/es/built-in/built-in-trace-id-generators.js +21 -0
- package/dist/es/built-in/daemon/daemon-authorizer-function.js +1 -0
- package/dist/es/built-in/daemon/daemon-config.js +1 -0
- package/dist/es/built-in/daemon/daemon-group-selection-function.js +1 -0
- package/dist/es/built-in/daemon/daemon-handler.js +58 -0
- package/dist/es/built-in/daemon/daemon-process-state-list.js +1 -0
- package/dist/es/built-in/http/apollo-filter.js +58 -0
- package/dist/es/built-in/http/built-in-auth-filters.js +107 -0
- package/dist/es/built-in/http/built-in-authorizers.js +39 -0
- package/dist/es/built-in/http/built-in-filters.js +208 -0
- package/dist/es/built-in/http/built-in-handlers.js +69 -0
- package/dist/es/built-in/http/log-level-manipulation-filter.js +16 -0
- package/dist/es/built-in/http/run-handler-as-filter.js +60 -0
- package/dist/es/cli-bootstrap/epsilon-run-background-process-from-command-line-dry-run.js +17 -0
- package/dist/es/config/background/background-aws-config.js +1 -0
- package/dist/es/config/background/background-config.js +1 -0
- package/dist/es/config/background/background-error-processor.js +1 -0
- package/dist/es/config/background/background-processor.js +1 -0
- package/dist/es/config/background/background-transaction-log.js +1 -0
- package/dist/es/config/background/background-transaction-logger.js +1 -0
- package/dist/es/config/cron/abstract-cron-entry.js +1 -0
- package/dist/es/config/cron/cron-background-entry.js +1 -0
- package/dist/es/config/cron/cron-config.js +1 -0
- package/dist/es/config/dynamo-db-config.js +1 -0
- package/dist/es/config/epsilon-config.js +1 -0
- package/dist/es/config/epsilon-lambda-event-handler.js +1 -0
- package/dist/es/config/epsilon-logger-config.js +1 -0
- package/dist/es/config/generic-aws-event-handler-function.js +1 -0
- package/dist/es/config/http/authorizer-function.js +1 -0
- package/dist/es/config/http/epsilon-authorization-context.js +1 -0
- package/dist/es/config/http/extended-api-gateway-event.js +1 -0
- package/dist/es/config/http/filter-chain-context.js +1 -0
- package/dist/es/config/http/filter-function.js +1 -0
- package/dist/es/config/http/handler-function.js +1 -0
- package/dist/es/config/http/http-config.js +1 -0
- package/dist/es/config/http/http-processing-config.js +1 -0
- package/dist/es/config/http/mapped-http-processing-config.js +1 -0
- package/dist/es/config/http/null-returned-object-handling.js +6 -0
- package/dist/es/config/inter-api/inter-api-aws-config.js +1 -0
- package/dist/es/config/inter-api/inter-api-config.js +1 -0
- package/dist/es/config/inter-api/inter-api-process-mapping.js +1 -0
- package/dist/es/config/logging-trace-id-generator.js +1 -0
- package/dist/es/config/open-api/open-api-document-components.js +1 -0
- package/dist/es/config/open-api/open-api-document-path.js +1 -0
- package/dist/es/config/open-api/open-api-document.js +1 -0
- package/dist/es/config/s3-config.js +1 -0
- package/dist/es/config/sns-config.js +1 -0
- package/dist/es/epsilon-build-properties.js +24 -0
- package/dist/es/epsilon-constants.js +45 -0
- package/dist/es/epsilon-global-handler.js +149 -0
- package/dist/es/epsilon-instance.js +1 -0
- package/dist/es/epsilon-logging-extension-processor.js +15 -0
- package/dist/es/http/auth/api-gateway-adapter-authentication-handler.js +71 -0
- package/dist/es/http/auth/auth0-web-token-manipulator.js +56 -0
- package/dist/es/http/auth/basic-auth-token.js +1 -0
- package/dist/es/http/auth/google-web-token-manipulator.js +67 -0
- package/dist/es/http/auth/jwt-ratchet-local-web-token-manipulator.js +25 -0
- package/dist/es/http/auth/local-web-token-manipulator.js +70 -0
- package/dist/es/http/auth/web-token-manipulator.js +1 -0
- package/dist/es/http/error/bad-gateway.js +8 -0
- package/dist/es/http/error/bad-request-error.js +8 -0
- package/dist/es/http/error/conflict-error.js +8 -0
- package/dist/es/http/error/epsilon-http-error.js +127 -0
- package/dist/es/http/error/forbidden-error.js +8 -0
- package/dist/es/http/error/gateway-timeout.js +8 -0
- package/dist/es/http/error/method-not-allowed-error.js +8 -0
- package/dist/es/http/error/misconfigured-error.js +8 -0
- package/dist/es/http/error/not-found-error.js +8 -0
- package/dist/es/http/error/not-implemented.js +8 -0
- package/dist/es/http/error/request-timeout-error.js +8 -0
- package/dist/es/http/error/service-unavailable.js +8 -0
- package/dist/es/http/error/too-many-requests-error.js +8 -0
- package/dist/es/http/error/unauthorized-error.js +8 -0
- package/dist/es/http/event-util.js +175 -0
- package/dist/es/http/response-util.js +141 -0
- package/dist/es/http/route/epsilon-router.js +1 -0
- package/dist/es/http/route/extended-auth-response-context.js +1 -0
- package/dist/es/http/route/route-mapping.js +1 -0
- package/dist/es/http/route/route-validator-config.js +1 -0
- package/dist/es/http/route/router-util.js +233 -0
- package/dist/es/http/web-handler.js +116 -0
- package/dist/es/http/web-v2-handler.js +21 -0
- package/dist/es/index.js +133 -0
- package/dist/es/inter-api/inter-api-entry.js +1 -0
- package/dist/es/inter-api/inter-api-util.js +58 -0
- package/dist/es/inter-api-manager.js +63 -0
- package/dist/es/lambda-event-handler/cron-epsilon-lambda-event-handler.js +72 -0
- package/dist/es/lambda-event-handler/dynamo-epsilon-lambda-event-handler.js +32 -0
- package/dist/es/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.js +28 -0
- package/dist/es/lambda-event-handler/inter-api-epsilon-lambda-event-handler.js +22 -0
- package/dist/es/lambda-event-handler/s3-epsilon-lambda-event-handler.js +40 -0
- package/dist/es/local-container-server.js +74 -0
- package/dist/es/local-server-cert.js +67 -0
- package/dist/es/local-server.js +140 -0
- package/dist/es/open-api-util/open-api-doc-modifications.js +1 -0
- package/dist/es/open-api-util/open-api-doc-modifier.js +78 -0
- package/dist/es/open-api-util/yaml-combiner.js +27 -0
- package/dist/es/run-background-process-from-command-line.js +32 -0
- package/dist/es/sample/sample-batch-only-local-server.js +17 -0
- package/dist/es/sample/sample-local-server.js +28 -0
- package/dist/es/sample/sample-server-components.js +192 -0
- package/dist/es/test-error-server.js +43 -0
- package/dist/es/util/aws-util.js +65 -0
- package/dist/es/util/context-util.js +95 -0
- package/dist/es/util/cron-util.js +68 -0
- package/dist/es/util/epsilon-config-parser.js +64 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.es.tsbuildinfo +1 -0
- package/dist/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/background/background-dynamo-log-table-handler.d.ts +11 -0
- package/dist/types/background/background-entry.d.ts +4 -0
- package/dist/types/background/background-execution-event-type.d.ts +7 -0
- package/dist/types/background/background-execution-event.d.ts +8 -0
- package/dist/types/background/background-execution-listener.d.ts +5 -0
- package/dist/types/background/background-handler.d.ts +33 -0
- package/dist/types/background/background-http-adapter-handler.d.ts +26 -0
- package/dist/types/background/background-meta-response-internal.d.ts +5 -0
- package/dist/types/background/background-process-handling.d.ts +4 -0
- package/dist/types/background/background-process-log-table-entry.d.ts +11 -0
- package/dist/types/background/background-queue-response-internal.d.ts +8 -0
- package/dist/types/background/background-validator.d.ts +20 -0
- package/dist/types/background/epsilon-background-process-error.d.ts +30 -0
- package/dist/types/background/internal-background-entry.d.ts +7 -0
- package/dist/types/background/manager/abstract-background-manager.d.ts +26 -0
- package/dist/types/background/manager/aws-sqs-sns-background-manager.d.ts +30 -0
- package/dist/types/background/manager/background-manager-like.d.ts +24 -0
- package/dist/types/background/manager/single-thread-local-background-manager.d.ts +22 -0
- package/dist/types/background/s3-background-transaction-logger.d.ts +17 -0
- package/dist/types/build/ratchet-epsilon-common-info.d.ts +5 -0
- package/dist/types/built-in/background/echo-processor.d.ts +7 -0
- package/dist/types/built-in/background/log-and-enqueue-echo-processor.d.ts +6 -0
- package/dist/types/built-in/background/log-message-background-error-processor.d.ts +5 -0
- package/dist/types/built-in/background/no-op-processor.d.ts +6 -0
- package/dist/types/built-in/background/retry-processor.d.ts +16 -0
- package/dist/types/built-in/background/sample-delay-processor.d.ts +6 -0
- package/dist/types/built-in/background/sample-input-validated-processor-data.d.ts +4 -0
- package/dist/types/built-in/background/sample-input-validated-processor.d.ts +8 -0
- package/dist/types/built-in/built-in-trace-id-generators.d.ts +5 -0
- package/dist/types/built-in/daemon/daemon-authorizer-function.d.ts +5 -0
- package/dist/types/built-in/daemon/daemon-config.d.ts +8 -0
- package/dist/types/built-in/daemon/daemon-group-selection-function.d.ts +4 -0
- package/dist/types/built-in/daemon/daemon-handler.d.ts +22 -0
- package/dist/types/built-in/daemon/daemon-process-state-list.d.ts +8 -0
- package/dist/types/built-in/http/apollo-filter.d.ts +10 -0
- package/dist/types/built-in/http/built-in-auth-filters.d.ts +9 -0
- package/dist/types/built-in/http/built-in-authorizers.d.ts +8 -0
- package/dist/types/built-in/http/built-in-filters.d.ts +25 -0
- package/dist/types/built-in/http/built-in-handlers.d.ts +9 -0
- package/dist/types/built-in/http/log-level-manipulation-filter.d.ts +9 -0
- package/dist/types/built-in/http/run-handler-as-filter.d.ts +12 -0
- package/dist/types/cli-bootstrap/epsilon-run-background-process-from-command-line-dry-run.d.ts +2 -0
- package/dist/types/config/background/background-aws-config.d.ts +7 -0
- package/dist/types/config/background/background-config.d.ts +14 -0
- package/dist/types/config/background/background-error-processor.d.ts +4 -0
- package/dist/types/config/background/background-processor.d.ts +6 -0
- package/dist/types/config/background/background-transaction-log.d.ts +8 -0
- package/dist/types/config/background/background-transaction-logger.d.ts +5 -0
- package/dist/types/config/cron/abstract-cron-entry.d.ts +12 -0
- package/dist/types/config/cron/cron-background-entry.d.ts +15 -0
- package/dist/types/config/cron/cron-config.d.ts +6 -0
- package/dist/types/config/dynamo-db-config.d.ts +5 -0
- package/dist/types/config/epsilon-config.d.ts +20 -0
- package/dist/types/config/epsilon-lambda-event-handler.d.ts +7 -0
- package/dist/types/config/epsilon-logger-config.d.ts +12 -0
- package/dist/types/config/generic-aws-event-handler-function.d.ts +3 -0
- package/dist/types/config/http/authorizer-function.d.ts +6 -0
- package/dist/types/config/http/epsilon-authorization-context.d.ts +5 -0
- package/dist/types/config/http/extended-api-gateway-event.d.ts +7 -0
- package/dist/types/config/http/filter-chain-context.d.ts +14 -0
- package/dist/types/config/http/filter-function.d.ts +4 -0
- package/dist/types/config/http/handler-function.d.ts +5 -0
- package/dist/types/config/http/http-config.d.ts +15 -0
- package/dist/types/config/http/http-processing-config.d.ts +11 -0
- package/dist/types/config/http/mapped-http-processing-config.d.ts +7 -0
- package/dist/types/config/http/null-returned-object-handling.d.ts +5 -0
- package/dist/types/config/inter-api/inter-api-aws-config.d.ts +5 -0
- package/dist/types/config/inter-api/inter-api-config.d.ts +6 -0
- package/dist/types/config/inter-api/inter-api-process-mapping.d.ts +11 -0
- package/dist/types/config/logging-trace-id-generator.d.ts +4 -0
- package/dist/types/config/open-api/open-api-document-components.d.ts +4 -0
- package/dist/types/config/open-api/open-api-document-path.d.ts +2 -0
- package/dist/types/config/open-api/open-api-document.d.ts +6 -0
- package/dist/types/config/s3-config.d.ts +6 -0
- package/dist/types/config/sns-config.d.ts +5 -0
- package/dist/types/epsilon-build-properties.d.ts +9 -0
- package/dist/types/epsilon-constants.d.ts +16 -0
- package/dist/types/epsilon-global-handler.d.ts +23 -0
- package/dist/types/epsilon-instance.d.ts +19 -0
- package/dist/types/epsilon-logging-extension-processor.d.ts +5 -0
- package/dist/types/http/auth/api-gateway-adapter-authentication-handler.d.ts +18 -0
- package/dist/types/http/auth/auth0-web-token-manipulator.d.ts +13 -0
- package/dist/types/http/auth/basic-auth-token.d.ts +7 -0
- package/dist/types/http/auth/google-web-token-manipulator.d.ts +14 -0
- package/dist/types/http/auth/jwt-ratchet-local-web-token-manipulator.d.ts +13 -0
- package/dist/types/http/auth/local-web-token-manipulator.d.ts +20 -0
- package/dist/types/http/auth/web-token-manipulator.d.ts +7 -0
- package/dist/types/http/error/bad-gateway.d.ts +5 -0
- package/dist/types/http/error/bad-request-error.d.ts +5 -0
- package/dist/types/http/error/conflict-error.d.ts +5 -0
- package/dist/types/http/error/epsilon-http-error.d.ts +41 -0
- package/dist/types/http/error/forbidden-error.d.ts +5 -0
- package/dist/types/http/error/gateway-timeout.d.ts +5 -0
- package/dist/types/http/error/method-not-allowed-error.d.ts +5 -0
- package/dist/types/http/error/misconfigured-error.d.ts +5 -0
- package/dist/types/http/error/not-found-error.d.ts +5 -0
- package/dist/types/http/error/not-implemented.d.ts +5 -0
- package/dist/types/http/error/request-timeout-error.d.ts +5 -0
- package/dist/types/http/error/service-unavailable.d.ts +5 -0
- package/dist/types/http/error/too-many-requests-error.d.ts +5 -0
- package/dist/types/http/error/unauthorized-error.d.ts +5 -0
- package/dist/types/http/event-util.d.ts +47 -0
- package/dist/types/http/response-util.d.ts +11 -0
- package/dist/types/http/route/epsilon-router.d.ts +8 -0
- package/dist/types/http/route/extended-auth-response-context.d.ts +6 -0
- package/dist/types/http/route/route-mapping.d.ts +12 -0
- package/dist/types/http/route/route-validator-config.d.ts +5 -0
- package/dist/types/http/route/router-util.d.ts +26 -0
- package/dist/types/http/web-handler.d.ts +26 -0
- package/dist/types/http/web-v2-handler.d.ts +13 -0
- package/dist/types/index.d.ts +136 -0
- package/dist/types/inter-api/inter-api-entry.d.ts +7 -0
- package/dist/types/inter-api/inter-api-util.d.ts +10 -0
- package/dist/types/inter-api-manager.d.ts +17 -0
- package/dist/types/lambda-event-handler/cron-epsilon-lambda-event-handler.d.ts +14 -0
- package/dist/types/lambda-event-handler/dynamo-epsilon-lambda-event-handler.d.ts +11 -0
- package/dist/types/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.d.ts +10 -0
- package/dist/types/lambda-event-handler/inter-api-epsilon-lambda-event-handler.d.ts +10 -0
- package/dist/types/lambda-event-handler/s3-epsilon-lambda-event-handler.d.ts +10 -0
- package/dist/types/local-container-server.d.ts +13 -0
- package/dist/types/local-server-cert.d.ts +5 -0
- package/dist/types/local-server.d.ts +19 -0
- package/dist/types/open-api-util/open-api-doc-modifications.d.ts +8 -0
- package/dist/types/open-api-util/open-api-doc-modifier.d.ts +10 -0
- package/dist/types/open-api-util/yaml-combiner.d.ts +3 -0
- package/dist/types/run-background-process-from-command-line.d.ts +13 -0
- package/dist/types/sample/sample-batch-only-local-server.d.ts +1 -0
- package/dist/types/sample/sample-local-server.d.ts +1 -0
- package/dist/types/sample/sample-server-components.d.ts +12 -0
- package/dist/types/test-error-server.d.ts +13 -0
- package/dist/types/util/aws-util.d.ts +8 -0
- package/dist/types/util/context-util.d.ts +33 -0
- package/dist/types/util/cron-util.d.ts +11 -0
- package/dist/types/util/epsilon-config-parser.d.ts +14 -0
- package/package.json +132 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { APIGatewayEvent, APIGatewayEventRequestContext, AuthResponseContext } from 'aws-lambda';
|
|
2
|
+
import { EpsilonLoggerConfig } from '../config/epsilon-logger-config';
|
|
3
|
+
import { BasicAuthToken } from './auth/basic-auth-token';
|
|
4
|
+
import { LoggerLevelName } from '@bitblit/ratchet-common';
|
|
5
|
+
/**
|
|
6
|
+
* Endpoints about the api itself
|
|
7
|
+
*/
|
|
8
|
+
export declare class EventUtil {
|
|
9
|
+
private constructor();
|
|
10
|
+
static extractStage(event: APIGatewayEvent): string;
|
|
11
|
+
static extractHostHeader(event: APIGatewayEvent): string;
|
|
12
|
+
static extractProtocol(event: APIGatewayEvent): string;
|
|
13
|
+
static extractApiGatewayStage(event: APIGatewayEvent): string;
|
|
14
|
+
static extractRequestContext(event: APIGatewayEvent): APIGatewayEventRequestContext;
|
|
15
|
+
static extractAuthorizer(event: APIGatewayEvent): AuthResponseContext;
|
|
16
|
+
static ipAddressChain(event: APIGatewayEvent): string[];
|
|
17
|
+
static ipAddress(event: APIGatewayEvent): string;
|
|
18
|
+
static extractFullPath(event: APIGatewayEvent, overrideProtocol?: string): string;
|
|
19
|
+
static extractFullPrefix(event: APIGatewayEvent, overrideProtocol?: string): string;
|
|
20
|
+
static jsonBodyToObject(event: APIGatewayEvent): any;
|
|
21
|
+
static calcLogLevelViaEventOrEnvParam(curLevel: LoggerLevelName, event: APIGatewayEvent, rConfig: EpsilonLoggerConfig): LoggerLevelName;
|
|
22
|
+
/**
|
|
23
|
+
* This is a weird function - sometimes your customers will not decode their query params and it
|
|
24
|
+
* results in query params that look like 'amp;SOMETHING' instead of 'SOMETHING'. This function
|
|
25
|
+
* looks for params that look like that, and strips the amp; from them. If you have any
|
|
26
|
+
* params you are expecting that have 'amp;' in front of them, DON'T use this function.
|
|
27
|
+
*
|
|
28
|
+
* Also, you are a moron for having a param that looks like that
|
|
29
|
+
*
|
|
30
|
+
* Yes, it would be better to fix this on the client side, but that is not always an option
|
|
31
|
+
* in production
|
|
32
|
+
* @param event
|
|
33
|
+
*/
|
|
34
|
+
static fixStillEncodedQueryParams(event: APIGatewayEvent): void;
|
|
35
|
+
/**
|
|
36
|
+
* Allows you to force in a token for an arbitrary event without having to pass the whole thing
|
|
37
|
+
* through Epsilon. Useful for when you need to test a handler that needs authorization,
|
|
38
|
+
* and don't need to instantiate all of epsilon, just the handler
|
|
39
|
+
* @param event Event to decorate
|
|
40
|
+
* @param jwtToken String containing a valid JWT token
|
|
41
|
+
*/
|
|
42
|
+
static applyTokenToEventForTesting(event: APIGatewayEvent, jwtToken: string): void;
|
|
43
|
+
static extractBasicAuthenticationToken(event: APIGatewayEvent, throwErrorOnMissingBad?: boolean): BasicAuthToken;
|
|
44
|
+
static eventIsAGraphQLIntrospection(event: APIGatewayEvent): boolean;
|
|
45
|
+
static extractAuthorizationHeaderCaseInsensitive(evt: APIGatewayEvent): string;
|
|
46
|
+
static extractBearerTokenFromEvent(evt: APIGatewayEvent): string;
|
|
47
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ProxyResult } from 'aws-lambda';
|
|
3
|
+
import { EpsilonHttpError } from './error/epsilon-http-error';
|
|
4
|
+
export declare class ResponseUtil {
|
|
5
|
+
private constructor();
|
|
6
|
+
static errorResponse<T>(err: EpsilonHttpError<T>): ProxyResult;
|
|
7
|
+
static redirect(target: string, code?: number, queryParams?: any): ProxyResult;
|
|
8
|
+
static coerceToProxyResult(input: any): ProxyResult;
|
|
9
|
+
static applyGzipIfPossible(encodingHeader: string, proxyResult: ProxyResult): Promise<ProxyResult>;
|
|
10
|
+
static gzip(input: Buffer): Promise<Buffer>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RouteMapping } from './route-mapping';
|
|
2
|
+
import { ModelValidator } from '@bitblit/ratchet-misc';
|
|
3
|
+
import { HttpConfig } from '../../config/http/http-config';
|
|
4
|
+
export interface EpsilonRouter {
|
|
5
|
+
routes: RouteMapping[];
|
|
6
|
+
openApiModelValidator: ModelValidator;
|
|
7
|
+
config: HttpConfig;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RouteValidatorConfig } from './route-validator-config';
|
|
2
|
+
import { HandlerFunction } from '../../config/http/handler-function';
|
|
3
|
+
import { HttpProcessingConfig } from '../../config/http/http-processing-config';
|
|
4
|
+
export interface RouteMapping {
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
function: HandlerFunction<any>;
|
|
8
|
+
metaProcessingConfig: HttpProcessingConfig;
|
|
9
|
+
validation: RouteValidatorConfig;
|
|
10
|
+
outboundValidation: RouteValidatorConfig;
|
|
11
|
+
authorizerName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EpsilonRouter } from './epsilon-router';
|
|
2
|
+
import { OpenApiDocument } from '../../config/open-api/open-api-document';
|
|
3
|
+
import { ModelValidator } from '@bitblit/ratchet-misc';
|
|
4
|
+
import { BackgroundHttpAdapterHandler } from '../../background/background-http-adapter-handler';
|
|
5
|
+
import { HttpConfig } from '../../config/http/http-config';
|
|
6
|
+
import { HttpProcessingConfig } from '../../config/http/http-processing-config';
|
|
7
|
+
import { WebTokenManipulator } from '../auth/web-token-manipulator';
|
|
8
|
+
import { FilterFunction } from '../../config/http/filter-function';
|
|
9
|
+
import { JwtTokenBase } from '@bitblit/ratchet-common';
|
|
10
|
+
/**
|
|
11
|
+
* Endpoints about the api itself
|
|
12
|
+
*/
|
|
13
|
+
export declare class RouterUtil {
|
|
14
|
+
private constructor();
|
|
15
|
+
static defaultAuthenticationHeaderParsingEpsilonPreFilters(webTokenManipulator: WebTokenManipulator<JwtTokenBase>): FilterFunction[];
|
|
16
|
+
static defaultEpsilonPreFilters(): FilterFunction[];
|
|
17
|
+
static defaultEpsilonPostFilters(): FilterFunction[];
|
|
18
|
+
static defaultEpsilonErrorFilters(): FilterFunction[];
|
|
19
|
+
static defaultHttpMetaProcessingConfigWithAuthenticationHeaderParsing(webTokenManipulator: WebTokenManipulator<JwtTokenBase>): HttpProcessingConfig;
|
|
20
|
+
static defaultHttpMetaProcessingConfig(): HttpProcessingConfig;
|
|
21
|
+
static assignDefaultsOnHttpConfig(cfg: HttpConfig): HttpConfig;
|
|
22
|
+
static findApplicableMeta(httpConfig: HttpConfig, method: string, path: string): HttpProcessingConfig;
|
|
23
|
+
static openApiYamlToRouterConfig(httpConfig: HttpConfig, openApiDoc: OpenApiDocument, modelValidator: ModelValidator, backgroundHttpAdapterHandler: BackgroundHttpAdapterHandler): EpsilonRouter;
|
|
24
|
+
private static findAndValidateModelName;
|
|
25
|
+
static openApiPathToRouteParserPath(input: string): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EpsilonRouter } from './route/epsilon-router';
|
|
2
|
+
import { APIGatewayEvent, Context, ProxyResult } from 'aws-lambda';
|
|
3
|
+
import Route from 'route-parser';
|
|
4
|
+
import { RouteMapping } from './route/route-mapping';
|
|
5
|
+
import { ExtendedAPIGatewayEvent } from '../config/http/extended-api-gateway-event';
|
|
6
|
+
import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler';
|
|
7
|
+
/**
|
|
8
|
+
* This class functions as the adapter from a default lambda function to the handlers exposed via Epsilon
|
|
9
|
+
*/
|
|
10
|
+
export declare class WebHandler implements EpsilonLambdaEventHandler<APIGatewayEvent> {
|
|
11
|
+
private routerConfig;
|
|
12
|
+
static readonly MAXIMUM_LAMBDA_BODY_SIZE_BYTES: number;
|
|
13
|
+
constructor(routerConfig: EpsilonRouter);
|
|
14
|
+
get router(): EpsilonRouter;
|
|
15
|
+
extractLabel(evt: APIGatewayEvent, context: Context): string;
|
|
16
|
+
handlesEvent(evt: any): boolean;
|
|
17
|
+
processEvent(event: APIGatewayEvent, context: Context): Promise<ProxyResult>;
|
|
18
|
+
openApiLambdaHandler(evt: ExtendedAPIGatewayEvent, context: Context): Promise<ProxyResult>;
|
|
19
|
+
findBestMatchingRoute(event: APIGatewayEvent): RouteAndParse;
|
|
20
|
+
private cleanPath;
|
|
21
|
+
}
|
|
22
|
+
export interface RouteAndParse {
|
|
23
|
+
mapping: RouteMapping;
|
|
24
|
+
route: Route;
|
|
25
|
+
parsed: any;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { APIGatewayProxyEventV2, Context, ProxyResult } from 'aws-lambda';
|
|
2
|
+
import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler';
|
|
3
|
+
import { WebHandler } from './web-handler';
|
|
4
|
+
/**
|
|
5
|
+
* This class functions as the adapter from a default lambda function to the handlers exposed via Epsilon
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebV2Handler implements EpsilonLambdaEventHandler<APIGatewayProxyEventV2> {
|
|
8
|
+
private webHandler;
|
|
9
|
+
constructor(webHandler: WebHandler);
|
|
10
|
+
extractLabel(evt: APIGatewayProxyEventV2, context: Context): string;
|
|
11
|
+
handlesEvent(evt: any): boolean;
|
|
12
|
+
processEvent(evt: APIGatewayProxyEventV2, context: Context): Promise<ProxyResult>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from './epsilon-build-properties';
|
|
5
|
+
export * from './epsilon-constants';
|
|
6
|
+
export * from './epsilon-global-handler';
|
|
7
|
+
export * from './epsilon-instance';
|
|
8
|
+
export * from './epsilon-logging-extension-processor';
|
|
9
|
+
export * from './inter-api-manager';
|
|
10
|
+
export * from './local-container-server';
|
|
11
|
+
export * from './local-server-cert';
|
|
12
|
+
export * from './local-server';
|
|
13
|
+
export * from './run-background-process-from-command-line';
|
|
14
|
+
export * from './test-error-server';
|
|
15
|
+
export * from './background/background-dynamo-log-table-handler';
|
|
16
|
+
export * from './background/background-entry';
|
|
17
|
+
export * from './background/background-execution-event-type';
|
|
18
|
+
export * from './background/background-execution-event';
|
|
19
|
+
export * from './background/background-execution-listener';
|
|
20
|
+
export * from './background/background-handler';
|
|
21
|
+
export * from './background/background-http-adapter-handler';
|
|
22
|
+
export * from './background/background-meta-response-internal';
|
|
23
|
+
export * from './background/background-process-handling';
|
|
24
|
+
export * from './background/background-process-log-table-entry';
|
|
25
|
+
export * from './background/background-queue-response-internal';
|
|
26
|
+
export * from './background/background-validator';
|
|
27
|
+
export * from './background/epsilon-background-process-error';
|
|
28
|
+
export * from './background/internal-background-entry';
|
|
29
|
+
export * from './background/s3-background-transaction-logger';
|
|
30
|
+
export * from './background/manager/abstract-background-manager';
|
|
31
|
+
export * from './background/manager/aws-sqs-sns-background-manager';
|
|
32
|
+
export * from './background/manager/background-manager-like';
|
|
33
|
+
export * from './background/manager/single-thread-local-background-manager';
|
|
34
|
+
export * from './build/ratchet-epsilon-common-info';
|
|
35
|
+
export * from './built-in/built-in-trace-id-generators';
|
|
36
|
+
export * from './built-in/background/echo-processor';
|
|
37
|
+
export * from './built-in/background/log-and-enqueue-echo-processor';
|
|
38
|
+
export * from './built-in/background/log-message-background-error-processor';
|
|
39
|
+
export * from './built-in/background/no-op-processor';
|
|
40
|
+
export * from './built-in/background/retry-processor';
|
|
41
|
+
export * from './built-in/background/sample-delay-processor';
|
|
42
|
+
export * from './built-in/background/sample-input-validated-processor-data';
|
|
43
|
+
export * from './built-in/background/sample-input-validated-processor';
|
|
44
|
+
export * from './built-in/daemon/daemon-authorizer-function';
|
|
45
|
+
export * from './built-in/daemon/daemon-config';
|
|
46
|
+
export * from './built-in/daemon/daemon-group-selection-function';
|
|
47
|
+
export * from './built-in/daemon/daemon-handler';
|
|
48
|
+
export * from './built-in/daemon/daemon-process-state-list';
|
|
49
|
+
export * from './built-in/http/apollo-filter';
|
|
50
|
+
export * from './built-in/http/built-in-auth-filters';
|
|
51
|
+
export * from './built-in/http/built-in-authorizers';
|
|
52
|
+
export * from './built-in/http/built-in-filters';
|
|
53
|
+
export * from './built-in/http/built-in-handlers';
|
|
54
|
+
export * from './built-in/http/log-level-manipulation-filter';
|
|
55
|
+
export * from './built-in/http/run-handler-as-filter';
|
|
56
|
+
export * from './cli-bootstrap/epsilon-run-background-process-from-command-line-dry-run';
|
|
57
|
+
export * from './config/dynamo-db-config';
|
|
58
|
+
export * from './config/epsilon-config';
|
|
59
|
+
export * from './config/epsilon-lambda-event-handler';
|
|
60
|
+
export * from './config/epsilon-logger-config';
|
|
61
|
+
export * from './config/generic-aws-event-handler-function';
|
|
62
|
+
export * from './config/logging-trace-id-generator';
|
|
63
|
+
export * from './config/s3-config';
|
|
64
|
+
export * from './config/sns-config';
|
|
65
|
+
export * from './config/background/background-aws-config';
|
|
66
|
+
export * from './config/background/background-config';
|
|
67
|
+
export * from './config/background/background-error-processor';
|
|
68
|
+
export * from './config/background/background-processor';
|
|
69
|
+
export * from './config/background/background-transaction-log';
|
|
70
|
+
export * from './config/background/background-transaction-logger';
|
|
71
|
+
export * from './config/cron/abstract-cron-entry';
|
|
72
|
+
export * from './config/cron/cron-background-entry';
|
|
73
|
+
export * from './config/cron/cron-config';
|
|
74
|
+
export * from './config/http/authorizer-function';
|
|
75
|
+
export * from './config/http/epsilon-authorization-context';
|
|
76
|
+
export * from './config/http/extended-api-gateway-event';
|
|
77
|
+
export * from './config/http/filter-chain-context';
|
|
78
|
+
export * from './config/http/filter-function';
|
|
79
|
+
export * from './config/http/handler-function';
|
|
80
|
+
export * from './config/http/http-config';
|
|
81
|
+
export * from './config/http/http-processing-config';
|
|
82
|
+
export * from './config/http/mapped-http-processing-config';
|
|
83
|
+
export * from './config/http/null-returned-object-handling';
|
|
84
|
+
export * from './config/inter-api/inter-api-aws-config';
|
|
85
|
+
export * from './config/inter-api/inter-api-config';
|
|
86
|
+
export * from './config/inter-api/inter-api-process-mapping';
|
|
87
|
+
export * from './config/open-api/open-api-document-components';
|
|
88
|
+
export * from './config/open-api/open-api-document-path';
|
|
89
|
+
export * from './config/open-api/open-api-document';
|
|
90
|
+
export * from './http/event-util';
|
|
91
|
+
export * from './http/response-util';
|
|
92
|
+
export * from './http/web-handler';
|
|
93
|
+
export * from './http/web-v2-handler';
|
|
94
|
+
export * from './http/auth/api-gateway-adapter-authentication-handler';
|
|
95
|
+
export * from './http/auth/auth0-web-token-manipulator';
|
|
96
|
+
export * from './http/auth/basic-auth-token';
|
|
97
|
+
export * from './http/auth/google-web-token-manipulator';
|
|
98
|
+
export * from './http/auth/jwt-ratchet-local-web-token-manipulator';
|
|
99
|
+
export * from './http/auth/local-web-token-manipulator';
|
|
100
|
+
export * from './http/auth/web-token-manipulator';
|
|
101
|
+
export * from './http/error/bad-gateway';
|
|
102
|
+
export * from './http/error/bad-request-error';
|
|
103
|
+
export * from './http/error/conflict-error';
|
|
104
|
+
export * from './http/error/epsilon-http-error';
|
|
105
|
+
export * from './http/error/forbidden-error';
|
|
106
|
+
export * from './http/error/gateway-timeout';
|
|
107
|
+
export * from './http/error/method-not-allowed-error';
|
|
108
|
+
export * from './http/error/misconfigured-error';
|
|
109
|
+
export * from './http/error/not-found-error';
|
|
110
|
+
export * from './http/error/not-implemented';
|
|
111
|
+
export * from './http/error/request-timeout-error';
|
|
112
|
+
export * from './http/error/service-unavailable';
|
|
113
|
+
export * from './http/error/too-many-requests-error';
|
|
114
|
+
export * from './http/error/unauthorized-error';
|
|
115
|
+
export * from './http/route/epsilon-router';
|
|
116
|
+
export * from './http/route/extended-auth-response-context';
|
|
117
|
+
export * from './http/route/route-mapping';
|
|
118
|
+
export * from './http/route/route-validator-config';
|
|
119
|
+
export * from './http/route/router-util';
|
|
120
|
+
export * from './inter-api/inter-api-entry';
|
|
121
|
+
export * from './inter-api/inter-api-util';
|
|
122
|
+
export * from './lambda-event-handler/cron-epsilon-lambda-event-handler';
|
|
123
|
+
export * from './lambda-event-handler/dynamo-epsilon-lambda-event-handler';
|
|
124
|
+
export * from './lambda-event-handler/generic-sns-epsilon-lambda-event-handler';
|
|
125
|
+
export * from './lambda-event-handler/inter-api-epsilon-lambda-event-handler';
|
|
126
|
+
export * from './lambda-event-handler/s3-epsilon-lambda-event-handler';
|
|
127
|
+
export * from './open-api-util/open-api-doc-modifications';
|
|
128
|
+
export * from './open-api-util/open-api-doc-modifier';
|
|
129
|
+
export * from './open-api-util/yaml-combiner';
|
|
130
|
+
export * from './sample/sample-batch-only-local-server';
|
|
131
|
+
export * from './sample/sample-local-server';
|
|
132
|
+
export * from './sample/sample-server-components';
|
|
133
|
+
export * from './util/aws-util';
|
|
134
|
+
export * from './util/context-util';
|
|
135
|
+
export * from './util/cron-util';
|
|
136
|
+
export * from './util/epsilon-config-parser';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SNSEvent } from 'aws-lambda';
|
|
2
|
+
import { InterApiEntry } from './inter-api-entry';
|
|
3
|
+
import { InterApiConfig } from '../config/inter-api/inter-api-config';
|
|
4
|
+
import { BackgroundManagerLike } from '../background/manager/background-manager-like';
|
|
5
|
+
export declare class InterApiUtil {
|
|
6
|
+
static isInterApiSnsEvent(event: any): boolean;
|
|
7
|
+
static extractEntryFromEvent(evt: SNSEvent): InterApiEntry<any>;
|
|
8
|
+
static processInterApiEvent(evt: SNSEvent, cfg: InterApiConfig, mgr: BackgroundManagerLike): Promise<string[]>;
|
|
9
|
+
static addTraceToInterApiEntry(ent: InterApiEntry<any>): InterApiEntry<any>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InterApiEntry } from './inter-api/inter-api-entry';
|
|
2
|
+
import { InterApiAwsConfig } from './config/inter-api/inter-api-aws-config';
|
|
3
|
+
import { SNSClient } from '@aws-sdk/client-sns';
|
|
4
|
+
/**
|
|
5
|
+
* Handles all submission of events to the inter-api SNS topic (if any)
|
|
6
|
+
*/
|
|
7
|
+
export declare class InterApiManager {
|
|
8
|
+
private _aws;
|
|
9
|
+
private _sns;
|
|
10
|
+
constructor(_aws: InterApiAwsConfig, _sns: SNSClient);
|
|
11
|
+
get config(): InterApiAwsConfig;
|
|
12
|
+
get sns(): SNSClient;
|
|
13
|
+
createEntry<T>(type: string, data?: T): InterApiEntry<T>;
|
|
14
|
+
fireInterApiEventByParts<T>(type: string, data?: T): Promise<string>;
|
|
15
|
+
fireInterApiEvent<T>(entry: InterApiEntry<T>): Promise<string>;
|
|
16
|
+
writeMessageToSnsTopic(message: string): Promise<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler';
|
|
2
|
+
import { Context, ProxyResult, ScheduledEvent } from 'aws-lambda';
|
|
3
|
+
import { EpsilonInstance } from '../epsilon-instance';
|
|
4
|
+
import { CronConfig } from '../config/cron/cron-config';
|
|
5
|
+
import { BackgroundHandler } from '../background/background-handler';
|
|
6
|
+
import { BackgroundManagerLike } from '../background/manager/background-manager-like';
|
|
7
|
+
export declare class CronEpsilonLambdaEventHandler implements EpsilonLambdaEventHandler<ScheduledEvent> {
|
|
8
|
+
private _epsilon;
|
|
9
|
+
constructor(_epsilon: EpsilonInstance);
|
|
10
|
+
extractLabel(evt: ScheduledEvent, context: Context): string;
|
|
11
|
+
handlesEvent(evt: any): boolean;
|
|
12
|
+
processEvent(evt: ScheduledEvent, context: Context): Promise<ProxyResult>;
|
|
13
|
+
static processCronEvent(evt: ScheduledEvent, cronConfig: CronConfig, backgroundManager: BackgroundManagerLike, background: BackgroundHandler): Promise<boolean>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler';
|
|
2
|
+
import { Context, DynamoDBStreamEvent, ProxyResult } from 'aws-lambda';
|
|
3
|
+
import { EpsilonInstance } from '../epsilon-instance';
|
|
4
|
+
export declare class DynamoEpsilonLambdaEventHandler implements EpsilonLambdaEventHandler<DynamoDBStreamEvent> {
|
|
5
|
+
private _epsilon;
|
|
6
|
+
constructor(_epsilon: EpsilonInstance);
|
|
7
|
+
extractLabel(evt: DynamoDBStreamEvent, context: Context): string;
|
|
8
|
+
handlesEvent(evt: any): boolean;
|
|
9
|
+
processEvent(evt: DynamoDBStreamEvent, context: Context): Promise<ProxyResult>;
|
|
10
|
+
processUncaughtError(event: DynamoDBStreamEvent, context: Context, err: any): Promise<ProxyResult>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler';
|
|
2
|
+
import { Context, ProxyResult, SNSEvent } from 'aws-lambda';
|
|
3
|
+
import { EpsilonInstance } from '../epsilon-instance';
|
|
4
|
+
export declare class GenericSnsEpsilonLambdaEventHandler implements EpsilonLambdaEventHandler<SNSEvent> {
|
|
5
|
+
private _epsilon;
|
|
6
|
+
constructor(_epsilon: EpsilonInstance);
|
|
7
|
+
extractLabel(evt: SNSEvent, context: Context): string;
|
|
8
|
+
handlesEvent(evt: any): boolean;
|
|
9
|
+
processEvent(evt: SNSEvent, context: Context): Promise<ProxyResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler';
|
|
2
|
+
import { Context, ProxyResult, SNSEvent } from 'aws-lambda';
|
|
3
|
+
import { EpsilonInstance } from '../epsilon-instance';
|
|
4
|
+
export declare class InterApiEpsilonLambdaEventHandler implements EpsilonLambdaEventHandler<SNSEvent> {
|
|
5
|
+
private _epsilon;
|
|
6
|
+
constructor(_epsilon: EpsilonInstance);
|
|
7
|
+
extractLabel(evt: SNSEvent, context: Context): string;
|
|
8
|
+
handlesEvent(evt: any): boolean;
|
|
9
|
+
processEvent(evt: SNSEvent, context: Context): Promise<ProxyResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler';
|
|
2
|
+
import { Context, ProxyResult, S3Event } from 'aws-lambda';
|
|
3
|
+
import { EpsilonInstance } from '../epsilon-instance';
|
|
4
|
+
export declare class S3EpsilonLambdaEventHandler implements EpsilonLambdaEventHandler<S3Event> {
|
|
5
|
+
private _epsilon;
|
|
6
|
+
constructor(_epsilon: EpsilonInstance);
|
|
7
|
+
extractLabel(evt: S3Event, context: Context): string;
|
|
8
|
+
handlesEvent(evt: any): boolean;
|
|
9
|
+
processEvent(evt: S3Event, context: Context): Promise<ProxyResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
/**
|
|
4
|
+
* A simplistic server for testing your lambdas locally
|
|
5
|
+
*/
|
|
6
|
+
export declare class LocalContainerServer {
|
|
7
|
+
private port;
|
|
8
|
+
private server;
|
|
9
|
+
private aborted;
|
|
10
|
+
constructor(port?: number);
|
|
11
|
+
runServer(): Promise<boolean>;
|
|
12
|
+
requestHandler(request: IncomingMessage, response: ServerResponse): Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { APIGatewayEvent, Context, ProxyResult } from 'aws-lambda';
|
|
3
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
|
+
import { EpsilonGlobalHandler } from './epsilon-global-handler';
|
|
5
|
+
/**
|
|
6
|
+
* A simplistic server for testing your lambdas locally
|
|
7
|
+
*/
|
|
8
|
+
export declare class LocalServer {
|
|
9
|
+
private globalHandler;
|
|
10
|
+
private port;
|
|
11
|
+
private server;
|
|
12
|
+
private aborted;
|
|
13
|
+
constructor(globalHandler: EpsilonGlobalHandler, port?: number, https?: boolean);
|
|
14
|
+
runServer(): Promise<boolean>;
|
|
15
|
+
requestHandler(request: IncomingMessage, response: ServerResponse): Promise<any>;
|
|
16
|
+
static bodyAsBase64String(request: IncomingMessage): Promise<string>;
|
|
17
|
+
static messageToApiGatewayEvent(request: IncomingMessage, context: Context): Promise<APIGatewayEvent>;
|
|
18
|
+
static writeProxyResultToServerResponse(proxyResult: ProxyResult, response: ServerResponse): Promise<boolean>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OpenApiDocModifications } from './open-api-doc-modifications';
|
|
2
|
+
/**
|
|
3
|
+
* Monitoring endpoints
|
|
4
|
+
*/
|
|
5
|
+
export declare class OpenApiDocModifier {
|
|
6
|
+
private options;
|
|
7
|
+
constructor(options: OpenApiDocModifications);
|
|
8
|
+
modifyOpenApiDoc(yamlString: string): string;
|
|
9
|
+
private matchNone;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EpsilonGlobalHandler } from './epsilon-global-handler';
|
|
2
|
+
/**
|
|
3
|
+
* IMPORTANT NOTE
|
|
4
|
+
* This file is part of the bootstrapper to bridge from the Epsilon Background processor
|
|
5
|
+
* to the AWS Batch processing Docker setup.
|
|
6
|
+
*
|
|
7
|
+
* DO NOT MESS WITH IT UNLESS YOU REALLY KNOW WHAT YOU ARE DOING.
|
|
8
|
+
*
|
|
9
|
+
* You are likely to mess it up otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RunBackgroundProcessFromCommandLine {
|
|
12
|
+
static processBackgroundCliRequest(epsilon: EpsilonGlobalHandler, dryRun?: boolean): Promise<boolean>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ApolloServer } from 'apollo-server-lambda';
|
|
2
|
+
import { EpsilonGlobalHandler } from '../epsilon-global-handler';
|
|
3
|
+
import { EpsilonConfig } from '../config/epsilon-config';
|
|
4
|
+
export declare class SampleServerComponents {
|
|
5
|
+
private constructor();
|
|
6
|
+
static createSampleApollo(): Promise<ApolloServer>;
|
|
7
|
+
static createSampleEpsilonConfig(): Promise<EpsilonConfig>;
|
|
8
|
+
static createSampleEpsilonGlobalHandler(): Promise<EpsilonGlobalHandler>;
|
|
9
|
+
static createSampleBatchOnlyEpsilonGlobalHandler(): Promise<EpsilonGlobalHandler>;
|
|
10
|
+
static loadSampleOpenApiYaml(): string;
|
|
11
|
+
static loadSampleServerGQL(): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
/**
|
|
4
|
+
* A simplistic server for testing your lambdas locally
|
|
5
|
+
*/
|
|
6
|
+
export declare class TestErrorServer {
|
|
7
|
+
private port;
|
|
8
|
+
private server;
|
|
9
|
+
private aborted;
|
|
10
|
+
constructor(port?: number);
|
|
11
|
+
runServer(): Promise<boolean>;
|
|
12
|
+
requestHandler(request: IncomingMessage, response: ServerResponse): Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { APIGatewayEvent, APIGatewayEventRequestContextV2, APIGatewayEventRequestContextWithAuthorizer, APIGatewayProxyEventV2 } from 'aws-lambda';
|
|
2
|
+
export declare class AwsUtil {
|
|
3
|
+
static apiGatewayV2ToApiGatewayV1(srcEvt: APIGatewayProxyEventV2): APIGatewayEvent;
|
|
4
|
+
static apiGatewayV2RequestContextToApiGatewayV1RequestContext(srcEvt: APIGatewayEventRequestContextV2): APIGatewayEventRequestContextWithAuthorizer<any>;
|
|
5
|
+
static findInMap<T>(toFind: string, map: Map<string, T>): T;
|
|
6
|
+
static matchExact(r: any, str: any): boolean;
|
|
7
|
+
static resolvePotentialFunctionToResult<T>(src: any, def: T): T;
|
|
8
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Context, ProxyResult } from 'aws-lambda';
|
|
2
|
+
import { EpsilonInstance } from '../epsilon-instance';
|
|
3
|
+
import { InternalBackgroundEntry } from '../background/internal-background-entry';
|
|
4
|
+
import { InterApiEntry } from '../inter-api/inter-api-entry';
|
|
5
|
+
export declare class ContextUtil {
|
|
6
|
+
private static CURRENT_EPSILON_REFERENCE;
|
|
7
|
+
private static CURRENT_CONTEXT;
|
|
8
|
+
private static CURRENT_EVENT;
|
|
9
|
+
private static CURRENT_LOG_VARS;
|
|
10
|
+
private static CURRENT_PROCESS_LABEL;
|
|
11
|
+
private static CURRENT_OVERRIDE_TRACE_ID;
|
|
12
|
+
private static CURRENT_OVERRIDE_TRACE_DEPTH;
|
|
13
|
+
private constructor();
|
|
14
|
+
static initContext(epsilon: EpsilonInstance, evt: any, ctx: Context, processLabel: string): void;
|
|
15
|
+
static clearContext(): void;
|
|
16
|
+
static setOverrideTrace(traceId: string, traceDepth: number): void;
|
|
17
|
+
static setOverrideTraceFromInternalBackgroundEntry(entry: InternalBackgroundEntry<any>): void;
|
|
18
|
+
static setOverrideTraceFromInterApiEntry(interApiEntry: InterApiEntry<any>): void;
|
|
19
|
+
static addHeadersToRecord(input: Record<string, any>, depthOffset?: number): void;
|
|
20
|
+
static addTraceToProxyResult(pr: ProxyResult): void;
|
|
21
|
+
static addTraceToHttpRequestInit(ri: RequestInit): void;
|
|
22
|
+
static setProcessLabel(processLabel: string): void;
|
|
23
|
+
static currentRequestId(): string;
|
|
24
|
+
static remainingTimeMS(): number;
|
|
25
|
+
static currentProcessLabel(): string;
|
|
26
|
+
private static traceHeaderName;
|
|
27
|
+
private static traceDepthHeaderName;
|
|
28
|
+
static currentTraceId(): string;
|
|
29
|
+
static currentTraceDepth(): number;
|
|
30
|
+
static addLogVariable(name: string, val: string | number | boolean): void;
|
|
31
|
+
static fetchLogVariable(name: string): string | number | boolean;
|
|
32
|
+
static fetchLogVariables(): Record<string, string | number | boolean>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScheduledEvent } from 'aws-lambda';
|
|
2
|
+
import { AbstractCronEntry } from '../config/cron/abstract-cron-entry';
|
|
3
|
+
import { CronConfig } from '../config/cron/cron-config';
|
|
4
|
+
export declare class CronUtil {
|
|
5
|
+
static everyNMinuteFilter(n: number): number[];
|
|
6
|
+
static everyNDaysOfYearFilter(n: number): number[];
|
|
7
|
+
static everyNElementFilter(n: number, m: number): number[];
|
|
8
|
+
static numberMatchesFilter(num: number, filter: number[]): boolean;
|
|
9
|
+
static eventMatchesEntry(event: ScheduledEvent, entry: AbstractCronEntry, cfg: CronConfig, testTimeEpochMS?: number): boolean;
|
|
10
|
+
static cronEntryName(entry: AbstractCronEntry, idx?: number): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModelValidator } from '@bitblit/ratchet-misc';
|
|
2
|
+
import { OpenApiDocument } from '../config/open-api/open-api-document';
|
|
3
|
+
import { EpsilonConfig } from '../config/epsilon-config';
|
|
4
|
+
import { EpsilonInstance } from '../epsilon-instance';
|
|
5
|
+
import { EpsilonGlobalHandler } from '../epsilon-global-handler';
|
|
6
|
+
import { BackgroundManagerLike } from '../background/manager/background-manager-like';
|
|
7
|
+
export declare class EpsilonConfigParser {
|
|
8
|
+
constructor();
|
|
9
|
+
static epsilonConfigToEpsilonGlobalHandler(config: EpsilonConfig, backgroundManager?: BackgroundManagerLike): EpsilonGlobalHandler;
|
|
10
|
+
static epsilonConfigToEpsilonInstance(config: EpsilonConfig, backgroundManager?: BackgroundManagerLike): EpsilonInstance;
|
|
11
|
+
static parseOpenApiDocument(yamlString: string): OpenApiDocument;
|
|
12
|
+
static openApiDocToValidator(doc: OpenApiDocument): ModelValidator;
|
|
13
|
+
static validateGlobalConfig(config: EpsilonConfig): void;
|
|
14
|
+
}
|