modmex-lambda 0.6.0__tar.gz → 0.6.2__tar.gz
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.
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/PKG-INFO +5 -1
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/README.md +4 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/events/s3.py +81 -1
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/schedule.py +34 -1
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/pyproject.toml +1 -1
- modmex_lambda-0.6.2/tests/stream/events/test_s3.py +161 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_schedule.py +89 -11
- modmex_lambda-0.6.0/tests/stream/events/test_s3.py +0 -54
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/.github/workflows/ci.yml +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/.github/workflows/release.yml +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/.gitignore +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/LICENSE +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/cloudwatch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/eventbridge.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/eventbridge_scheduler.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/icloudwatch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/idynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/ieventbridge.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/ieventbridge_scheduler.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/ilambda.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/is3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/isns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/isqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/lambda_.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/module.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/api_gateway_authorizer_event.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/api_gateway_websocket_event.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/common.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/dependencies.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/api_gateway.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/constants.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/content_types.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/cors.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/dependencies/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/dependencies/compat.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/dependencies/dependant.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/dependencies/dependency_middleware.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/dependencies/depends.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/dependencies/params.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/dependencies/types.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/exception_handler.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/exceptions.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/gateway_response.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/middlewares.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/params.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/request.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/response.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/routing.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/routing_fallbacks.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_handler/types.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/event_sources.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/exceptions.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/logging.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/params.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/parser.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/persistence/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/persistence/dynamodb/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/persistence/dynamodb/expressions.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/persistence/dynamodb/keys.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/persistence/dynamodb/materialized_views.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/persistence/dynamodb/stream_fields.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/py.typed +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/request.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/resolver.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/response.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/routing.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/shared/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/shared/cookies.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/shared/headers_serializer.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/shared/json_encoder.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/shared/types.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/events/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/events/dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/events/kinesis.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/events/sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/events/sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/filters/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/filters/content.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/filters/event_type.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/filters/latch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/filters/skip.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/base_flavor.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/cdc.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/collect.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/correlate.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/evaluate.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/expired.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/iflavor.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/job.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/materialize.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/task.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/flavors/update.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/irules_registry.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/cloudwatch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/ioperator.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/lambda_.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/publisher.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/scheduler.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/operators/sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/rules_registry.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/runner.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/schedulers.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/sources/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/sources/base.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/sources/dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/sources/kinesis.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/sources/s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/sources/sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/sources/sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/apigateway.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/aws.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/batch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/cloudwatch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/concurrency.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/contracts.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/data_classes/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/data_classes/dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/decorators.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/eventbridge.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/faults.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/filters.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/json_encoder.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/lambda_.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/operators.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/pluralize.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/print.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/retry.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/split.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/tags.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/time.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/stream/utils/uow.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/tracing.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/validation.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/poetry.lock +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/conftest.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/conftest.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/test_cloudwatch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/test_dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/test_lazy_clients.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/test_s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/test_simple_connectors.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/test_sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/connectors/test_sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/data_classes/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/data_classes/test_api_gateway_proxy_event.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/data_classes/test_cognito_user_pool_event.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/data_classes/test_common.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_api_gateway.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_cors.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_dependencies.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_exception_handler.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_gateway_response.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_request.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_response.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/event_handler/test_routing.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/persistence/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/persistence/test_dynamodb_expressions.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/persistence/test_dynamodb_keys.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/persistence/test_dynamodb_materialized_views.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/persistence/test_dynamodb_stream_fields.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/shared/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/shared/test_cookies_headers.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/shared/test_json_encoder.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/conftest.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/events/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/events/test_dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/events/test_kinesis.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/events/test_sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/events/test_sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/filters/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/filters/test_content.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/filters/test_event_type.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/filters/test_latch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/filters/test_skip.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/source_events.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_base_flavor.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_cdc.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_collect.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_correlate.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_evaluate.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_expired.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_job.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_materialize.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_task.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/flavors/test_update.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/operators/test_scheduler.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/test_dependency_resolver.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/test_faults.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/test_rules_registry.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/test_runner.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/test_runner_pipeline.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/test_sources.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/__init__.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/faults.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_apigateway.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_aws.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_batch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_cloudwatch.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_concurrency.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_decorators.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_dynamodb.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_eventbridge.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_filters.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_json_encoder.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_lambda.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_operators.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_pluralize.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_print.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_retry.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_s3.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_sns.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_split.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_sqs.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_tags.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_time.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/stream/utils/test_uow.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/test_lazy_imports.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/test_logging.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/test_parser_event_sources.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/test_reexports.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/test_tracing.py +0 -0
- {modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/tests/test_validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: modmex-lambda
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Ultra-lightweight AWS Lambda utilities for API Gateway routing and event handling.
|
|
5
5
|
Author: Modmex
|
|
6
6
|
License: MIT
|
|
@@ -1188,6 +1188,10 @@ Use `schedule_at` when the deadline is already an explicit, timezone-aware
|
|
|
1188
1188
|
is calculated from the source event's millisecond `timestamp`, not from Lambda
|
|
1189
1189
|
processing time. Declare exactly one of those fields.
|
|
1190
1190
|
|
|
1191
|
+
If the calculated deadline has already passed when the source event is
|
|
1192
|
+
processed, `Schedule` does not create an invalid `at(...)` schedule. It
|
|
1193
|
+
publishes the deferred domain event immediately on the configured bus instead.
|
|
1194
|
+
|
|
1191
1195
|
### Event Hub
|
|
1192
1196
|
|
|
1193
1197
|
EventBridge is a natural hub for domain events. Flavors like
|
|
@@ -1165,6 +1165,10 @@ Use `schedule_at` when the deadline is already an explicit, timezone-aware
|
|
|
1165
1165
|
is calculated from the source event's millisecond `timestamp`, not from Lambda
|
|
1166
1166
|
processing time. Declare exactly one of those fields.
|
|
1167
1167
|
|
|
1168
|
+
If the calculated deadline has already passed when the source event is
|
|
1169
|
+
processed, `Schedule` does not create an invalid `at(...)` schedule. It
|
|
1170
|
+
publishes the deferred domain event immediately on the configured bus instead.
|
|
1171
|
+
|
|
1168
1172
|
### Event Hub
|
|
1169
1173
|
|
|
1170
1174
|
EventBridge is a natural hub for domain events. Flavors like
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import json
|
|
2
2
|
import pydash
|
|
3
3
|
from pydash import get
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
'from_s3',
|
|
8
|
+
'from_sqs_eventbridge_s3',
|
|
9
|
+
'from_sqs_sns_s3',
|
|
10
|
+
'to_s3_records',
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
def from_s3(event):
|
|
6
15
|
return pydash.map_(
|
|
7
16
|
event['Records'],
|
|
@@ -15,6 +24,69 @@ def from_s3(event):
|
|
|
15
24
|
}
|
|
16
25
|
)
|
|
17
26
|
|
|
27
|
+
def from_sqs_sns_s3(event):
|
|
28
|
+
"""Normalize an S3 notification delivered through SNS and SQS.
|
|
29
|
+
|
|
30
|
+
An SNS message can contain more than one S3 record, so this function
|
|
31
|
+
returns one UOW per S3 record. The event contract is the same as
|
|
32
|
+
:func:`from_s3`; the transport envelopes are retained in ``record``.
|
|
33
|
+
"""
|
|
34
|
+
return pydash._(event['Records']).map(
|
|
35
|
+
lambda sqs_record: _from_sqs_record(sqs_record)
|
|
36
|
+
).flatten().value()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def from_sqs_eventbridge_s3(event):
|
|
40
|
+
"""Normalize an S3 EventBridge notification delivered through SQS."""
|
|
41
|
+
return pydash._(event['Records']).map(
|
|
42
|
+
lambda sqs_record: _from_sqs_eventbridge_record(sqs_record)
|
|
43
|
+
).flatten().value()
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _from_sqs_eventbridge_record(sqs_record):
|
|
47
|
+
eventbridge_record = json.loads(sqs_record['body'])
|
|
48
|
+
detail = eventbridge_record['detail']
|
|
49
|
+
s3_record = {
|
|
50
|
+
**eventbridge_record,
|
|
51
|
+
'eventName': _eventbridge_s3_event_name(eventbridge_record),
|
|
52
|
+
's3': detail,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return pydash.map_(from_s3({'Records': [s3_record]}), lambda uow: {
|
|
56
|
+
**uow,
|
|
57
|
+
'record': {
|
|
58
|
+
'sqs': sqs_record,
|
|
59
|
+
'eventbridge': eventbridge_record,
|
|
60
|
+
's3': uow['record'],
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _eventbridge_s3_event_name(eventbridge_record):
|
|
66
|
+
detail_type = eventbridge_record.get('detail-type', '')
|
|
67
|
+
if detail_type.startswith('Object Created'):
|
|
68
|
+
return 'ObjectCreated:Put'
|
|
69
|
+
if detail_type.startswith('Object Deleted'):
|
|
70
|
+
return 'ObjectCreated:Delete'
|
|
71
|
+
return detail_type
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _from_sqs_record(sqs_record):
|
|
75
|
+
sns_record = json.loads(sqs_record['body'])
|
|
76
|
+
s3_event = json.loads(sns_record['Message'])
|
|
77
|
+
|
|
78
|
+
return pydash.map_(
|
|
79
|
+
from_s3(s3_event),
|
|
80
|
+
lambda uow: {
|
|
81
|
+
**uow,
|
|
82
|
+
'record': {
|
|
83
|
+
'sqs': sqs_record,
|
|
84
|
+
'sns': sns_record,
|
|
85
|
+
's3': uow['record'],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
)
|
|
89
|
+
|
|
18
90
|
def _calculate_event_type_prefix(record):
|
|
19
91
|
if record['eventName'] in ['ObjectCreated:Post','ObjectCreated:Put']:
|
|
20
92
|
return 'object-created'
|
|
@@ -64,3 +136,11 @@ def to_s3_records(notifications):
|
|
|
64
136
|
for i,n in enumerate(notifications)
|
|
65
137
|
]
|
|
66
138
|
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
__all__ = [
|
|
142
|
+
'from_s3',
|
|
143
|
+
'from_sqs_sns_s3',
|
|
144
|
+
'from_sqs_eventbridge_s3',
|
|
145
|
+
'to_s3_records',
|
|
146
|
+
]
|
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
from datetime import datetime, timedelta, timezone
|
|
4
4
|
from typing import Any, Callable, Optional
|
|
5
5
|
|
|
6
|
+
from pydash import get
|
|
6
7
|
from reactivex import Observable, operators as ops
|
|
7
8
|
|
|
8
9
|
from modmex_lambda.connectors.ieventbridge import IEventBridgeConnector
|
|
@@ -47,7 +48,15 @@ class Schedule(BaseFlavor):
|
|
|
47
48
|
logger=logger,
|
|
48
49
|
connector=connector,
|
|
49
50
|
dependency_resolver=dependency_resolver,
|
|
50
|
-
publisher_options=
|
|
51
|
+
publisher_options={
|
|
52
|
+
**(publisher_options or {}),
|
|
53
|
+
"event_field": "emit",
|
|
54
|
+
**(
|
|
55
|
+
{"source": rule["source"]}
|
|
56
|
+
if isinstance(rule.get("source"), str)
|
|
57
|
+
else {}
|
|
58
|
+
),
|
|
59
|
+
},
|
|
51
60
|
)
|
|
52
61
|
self.rule = rule
|
|
53
62
|
|
|
@@ -57,14 +66,31 @@ class Schedule(BaseFlavor):
|
|
|
57
66
|
|
|
58
67
|
def __call__(self, source: Observable):
|
|
59
68
|
return source.pipe(
|
|
69
|
+
try_filter(self._for_collected_events),
|
|
70
|
+
try_map(self._normalize),
|
|
60
71
|
try_filter(on_event_type(self.rule)),
|
|
61
72
|
ops.do_action(print_start(self.logger)),
|
|
62
73
|
try_filter(on_content(self.rule)),
|
|
63
74
|
try_map(faulty(self._to_schedule_request)),
|
|
64
75
|
self.scheduler_ops,
|
|
76
|
+
self.publisher,
|
|
65
77
|
ops.do_action(print_end(self.logger)),
|
|
66
78
|
)
|
|
67
79
|
|
|
80
|
+
@staticmethod
|
|
81
|
+
def _for_collected_events(uow: Uow) -> bool:
|
|
82
|
+
return (
|
|
83
|
+
get(uow, "record.eventName") == "INSERT"
|
|
84
|
+
and get(uow, "record.dynamodb.Keys.sk.S") == "EVENT"
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
@staticmethod
|
|
88
|
+
def _normalize(uow: Uow) -> Uow:
|
|
89
|
+
return {
|
|
90
|
+
**uow,
|
|
91
|
+
"event": get(uow, "event.raw.new.event"),
|
|
92
|
+
}
|
|
93
|
+
|
|
68
94
|
def _to_schedule_request(self, uow: Uow) -> Uow:
|
|
69
95
|
schedule_at = self._resolve_schedule_at(uow)
|
|
70
96
|
if schedule_at.tzinfo is None:
|
|
@@ -79,9 +105,16 @@ class Schedule(BaseFlavor):
|
|
|
79
105
|
raise ValueError("bus_arn or BUS_ARN is required.")
|
|
80
106
|
if not role_arn:
|
|
81
107
|
raise ValueError("role_arn or SCHEDULER_ROLE_ARN is required.")
|
|
108
|
+
if schedule_at <= datetime.now(timezone.utc):
|
|
109
|
+
return {
|
|
110
|
+
**uow,
|
|
111
|
+
"scheduled_event": scheduled_event,
|
|
112
|
+
"emit": scheduled_event,
|
|
113
|
+
}
|
|
82
114
|
return {
|
|
83
115
|
**uow,
|
|
84
116
|
"scheduled_event": scheduled_event,
|
|
117
|
+
"emit": None,
|
|
85
118
|
"schedule_request": {
|
|
86
119
|
"Name": self._value("schedule_name", uow),
|
|
87
120
|
"GroupName": self._value("group_name", uow, "default"),
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "modmex-lambda"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.2"
|
|
8
8
|
description = "Ultra-lightweight AWS Lambda utilities for API Gateway routing and event handling."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10,<4.0"
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
from expects import equal, expect
|
|
2
|
+
import json
|
|
3
|
+
|
|
4
|
+
from modmex_lambda.stream.events.s3 import (
|
|
5
|
+
from_s3,
|
|
6
|
+
from_sqs_eventbridge_s3,
|
|
7
|
+
from_sqs_sns_s3,
|
|
8
|
+
to_s3_records,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_from_s3_created_events():
|
|
13
|
+
records = to_s3_records([
|
|
14
|
+
{
|
|
15
|
+
'bucket': {
|
|
16
|
+
'name': 'bucket',
|
|
17
|
+
},
|
|
18
|
+
'object': {
|
|
19
|
+
'key': 'thing.json',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
])
|
|
23
|
+
|
|
24
|
+
uows = from_s3(records)
|
|
25
|
+
|
|
26
|
+
expect(len(uows)).to(equal(1))
|
|
27
|
+
expect(uows[0]['event']).to(equal({
|
|
28
|
+
'id': 'thing.json',
|
|
29
|
+
'type': 'object-created',
|
|
30
|
+
's3': records['Records'][0]['s3'],
|
|
31
|
+
}))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_from_s3_deleted_events():
|
|
35
|
+
records = to_s3_records([
|
|
36
|
+
{
|
|
37
|
+
'bucket': {
|
|
38
|
+
'name': 'bucket',
|
|
39
|
+
},
|
|
40
|
+
'object': {
|
|
41
|
+
'key': 'thing.json',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
])
|
|
45
|
+
records['Records'][0]['eventName'] = 'ObjectCreated:Delete'
|
|
46
|
+
|
|
47
|
+
expect(from_s3(records)[0]['event']['type']).to(equal('object-deleted'))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def test_from_s3_unknown_events():
|
|
51
|
+
records = to_s3_records([
|
|
52
|
+
{
|
|
53
|
+
'bucket': {},
|
|
54
|
+
'object': {
|
|
55
|
+
'key': 'thing.json',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
])
|
|
59
|
+
records['Records'][0]['eventName'] = 'ObjectRestore:Completed'
|
|
60
|
+
|
|
61
|
+
expect(from_s3(records)[0]['event']['type']).to(equal(None))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def test_from_sqs_sns_s3_normalizes_s3_event_and_keeps_envelopes():
|
|
65
|
+
s3_event = to_s3_records([
|
|
66
|
+
{
|
|
67
|
+
'bucket': {'name': 'bucket'},
|
|
68
|
+
'object': {'key': 'thing.json'},
|
|
69
|
+
},
|
|
70
|
+
])
|
|
71
|
+
sns_record = {
|
|
72
|
+
'Type': 'Notification',
|
|
73
|
+
'MessageId': 'message-id',
|
|
74
|
+
'Message': json.dumps(s3_event),
|
|
75
|
+
}
|
|
76
|
+
sqs_record = {
|
|
77
|
+
'messageId': 'sqs-message-id',
|
|
78
|
+
'body': json.dumps(sns_record),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
uows = from_sqs_sns_s3({'Records': [sqs_record]})
|
|
82
|
+
|
|
83
|
+
expect(len(uows)).to(equal(1))
|
|
84
|
+
expect(uows[0]['event']).to(equal({
|
|
85
|
+
'id': 'thing.json',
|
|
86
|
+
'type': 'object-created',
|
|
87
|
+
's3': s3_event['Records'][0]['s3'],
|
|
88
|
+
}))
|
|
89
|
+
expect(uows[0]['record']).to(equal({
|
|
90
|
+
'sqs': sqs_record,
|
|
91
|
+
'sns': sns_record,
|
|
92
|
+
's3': s3_event['Records'][0],
|
|
93
|
+
}))
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_from_sqs_sns_s3_expands_all_s3_records_from_each_message():
|
|
97
|
+
s3_event = to_s3_records([
|
|
98
|
+
{'bucket': {'name': 'bucket'}, 'object': {'key': 'one.json'}},
|
|
99
|
+
{'bucket': {'name': 'bucket'}, 'object': {'key': 'two.json'}},
|
|
100
|
+
])
|
|
101
|
+
message = {'Message': json.dumps(s3_event)}
|
|
102
|
+
event = {'Records': [
|
|
103
|
+
{'messageId': 'one', 'body': json.dumps(message)},
|
|
104
|
+
{'messageId': 'two', 'body': json.dumps(message)},
|
|
105
|
+
]}
|
|
106
|
+
|
|
107
|
+
uows = from_sqs_sns_s3(event)
|
|
108
|
+
|
|
109
|
+
expect([uow['event']['id'] for uow in uows]).to(
|
|
110
|
+
equal(['one.json', 'two.json', 'one.json', 'two.json'])
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def test_from_sqs_eventbridge_s3_normalizes_eventbridge_s3_notification():
|
|
115
|
+
eventbridge_record = {
|
|
116
|
+
'version': '0',
|
|
117
|
+
'id': 'eventbridge-id',
|
|
118
|
+
'detail-type': 'Object Created',
|
|
119
|
+
'source': 'aws.s3',
|
|
120
|
+
'account': '123456789012',
|
|
121
|
+
'time': '2026-07-26T18:35:42Z',
|
|
122
|
+
'region': 'us-east-1',
|
|
123
|
+
'resources': ['arn:aws:s3:::my-bucket'],
|
|
124
|
+
'detail': {
|
|
125
|
+
'version': '0',
|
|
126
|
+
'bucket': {'name': 'my-bucket'},
|
|
127
|
+
'object': {
|
|
128
|
+
'key': 'uploads/document.pdf',
|
|
129
|
+
'size': 123456,
|
|
130
|
+
'etag': 'd41d8cd98f00b204e9800998ecf8427e',
|
|
131
|
+
'sequencer': '0068A2D7B1F3D12345',
|
|
132
|
+
},
|
|
133
|
+
'request-id': 'ABCDEFG123456',
|
|
134
|
+
'requester': 'AIDA...',
|
|
135
|
+
'source-ip-address': '1.2.3.4',
|
|
136
|
+
'reason': 'PutObject',
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
sqs_record = {
|
|
140
|
+
'messageId': 'sqs-message-id',
|
|
141
|
+
'eventSource': 'aws:sqs',
|
|
142
|
+
'body': json.dumps(eventbridge_record),
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
uows = from_sqs_eventbridge_s3({'Records': [sqs_record]})
|
|
146
|
+
|
|
147
|
+
expect(len(uows)).to(equal(1))
|
|
148
|
+
expect(uows[0]['event']).to(equal({
|
|
149
|
+
'id': 'uploads/document.pdf',
|
|
150
|
+
'type': 'object-created',
|
|
151
|
+
's3': eventbridge_record['detail'],
|
|
152
|
+
}))
|
|
153
|
+
expect(uows[0]['record']).to(equal({
|
|
154
|
+
'sqs': sqs_record,
|
|
155
|
+
'eventbridge': eventbridge_record,
|
|
156
|
+
's3': {
|
|
157
|
+
**eventbridge_record,
|
|
158
|
+
'eventName': 'ObjectCreated:Put',
|
|
159
|
+
's3': eventbridge_record['detail'],
|
|
160
|
+
},
|
|
161
|
+
}))
|
|
@@ -5,18 +5,23 @@ from expects import equal, expect
|
|
|
5
5
|
|
|
6
6
|
from modmex_lambda.stream.flavors.schedule import Schedule
|
|
7
7
|
from modmex_lambda.stream.rules_registry import RulesRegistry
|
|
8
|
-
from modmex_lambda.stream.sources.
|
|
9
|
-
from tests.stream.flavors.source_events import
|
|
8
|
+
from modmex_lambda.stream.sources.dynamodb import dynamodb_source
|
|
9
|
+
from tests.stream.flavors.source_events import dynamodb_stream_event
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class SchedulerConnector:
|
|
13
13
|
def __init__(self):
|
|
14
14
|
self.requests = []
|
|
15
|
+
self.events = []
|
|
15
16
|
|
|
16
17
|
def create_schedule(self, request):
|
|
17
18
|
self.requests.append(request)
|
|
18
19
|
return {"ScheduleArn": "arn:aws:scheduler:example"}
|
|
19
20
|
|
|
21
|
+
def put_events(self, request):
|
|
22
|
+
self.events.append(request)
|
|
23
|
+
return {"FailedEntryCount": 0}
|
|
24
|
+
|
|
20
25
|
|
|
21
26
|
class Resolver:
|
|
22
27
|
def __init__(self, connector):
|
|
@@ -26,9 +31,23 @@ class Resolver:
|
|
|
26
31
|
return self.connector
|
|
27
32
|
|
|
28
33
|
|
|
34
|
+
def collected_event_record(event):
|
|
35
|
+
return {
|
|
36
|
+
"keys": {"pk": event["id"], "sk": "EVENT"},
|
|
37
|
+
"new_image": {
|
|
38
|
+
"pk": event["id"],
|
|
39
|
+
"sk": "EVENT",
|
|
40
|
+
"discriminator": "EVENT",
|
|
41
|
+
"sequence_number": "1",
|
|
42
|
+
"ttl": 1911063600,
|
|
43
|
+
"event": event,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
29
48
|
def test_schedule_creates_one_time_eventbridge_delivery():
|
|
30
49
|
connector = SchedulerConnector()
|
|
31
|
-
scheduled_at = datetime(
|
|
50
|
+
scheduled_at = datetime(2030, 7, 23, 18, 5, tzinfo=timezone.utc)
|
|
32
51
|
flavor = Schedule(
|
|
33
52
|
{
|
|
34
53
|
"id": "schedule-result-deadline",
|
|
@@ -55,7 +74,7 @@ def test_schedule_creates_one_time_eventbridge_delivery():
|
|
|
55
74
|
)
|
|
56
75
|
collected = []
|
|
57
76
|
|
|
58
|
-
@
|
|
77
|
+
@dynamodb_source(
|
|
59
78
|
RulesRegistry().registry(flavor),
|
|
60
79
|
concurrency=False,
|
|
61
80
|
on_next=lambda _pipeline, uow: collected.append(uow),
|
|
@@ -63,18 +82,18 @@ def test_schedule_creates_one_time_eventbridge_delivery():
|
|
|
63
82
|
def handler(_event, _context):
|
|
64
83
|
return {"statusCode": 200}
|
|
65
84
|
|
|
66
|
-
handler(
|
|
85
|
+
handler(dynamodb_stream_event([collected_event_record({
|
|
67
86
|
"id": "communication-completed-1",
|
|
68
87
|
"type": "communication-completed",
|
|
69
|
-
"timestamp":
|
|
88
|
+
"timestamp": 1911060000000,
|
|
70
89
|
"partition_key": "communication#comm-1",
|
|
71
90
|
"script_run": {"id": "sr-1", "workspace_id": "ws-1"},
|
|
72
|
-
}]), None)
|
|
91
|
+
})]), None)
|
|
73
92
|
|
|
74
93
|
expect(len(collected)).to(equal(1))
|
|
75
94
|
request = connector.requests[0]
|
|
76
95
|
expect(request["Name"]).to(equal("script-run-result-deadline-sr-1"))
|
|
77
|
-
expect(request["ScheduleExpression"]).to(equal("at(
|
|
96
|
+
expect(request["ScheduleExpression"]).to(equal("at(2030-07-23T18:05:00)"))
|
|
78
97
|
expect(request["ActionAfterCompletion"]).to(equal("DELETE"))
|
|
79
98
|
expect(request["Target"]["EventBridgeParameters"]).to(equal({
|
|
80
99
|
"Source": "communication-control-service",
|
|
@@ -86,7 +105,7 @@ def test_schedule_creates_one_time_eventbridge_delivery():
|
|
|
86
105
|
expect(event["triggers"]).to(equal([{
|
|
87
106
|
"id": "communication-completed-1",
|
|
88
107
|
"type": "communication-completed",
|
|
89
|
-
"timestamp":
|
|
108
|
+
"timestamp": 1911060000000,
|
|
90
109
|
}]))
|
|
91
110
|
expect(event["script_run"]).to(equal({"id": "sr-1", "workspace_id": "ws-1"}))
|
|
92
111
|
|
|
@@ -135,12 +154,12 @@ def test_schedule_calculates_delay_minutes_from_event_timestamp():
|
|
|
135
154
|
"event": {
|
|
136
155
|
"id": "event-1",
|
|
137
156
|
"type": "communication-completed",
|
|
138
|
-
"timestamp":
|
|
157
|
+
"timestamp": 1911060000000,
|
|
139
158
|
},
|
|
140
159
|
})
|
|
141
160
|
|
|
142
161
|
expect(request["schedule_request"]["ScheduleExpression"]).to(equal(
|
|
143
|
-
"at(
|
|
162
|
+
"at(2030-07-23T18:05:00)"
|
|
144
163
|
))
|
|
145
164
|
|
|
146
165
|
|
|
@@ -169,3 +188,62 @@ def test_schedule_requires_one_scheduling_strategy():
|
|
|
169
188
|
))
|
|
170
189
|
else:
|
|
171
190
|
raise AssertionError("Expected conflicting scheduling strategies to fail.")
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def test_schedule_immediately_emits_an_expired_deadline_without_creating_schedule():
|
|
194
|
+
flavor = Schedule({
|
|
195
|
+
"id": "expired-schedule",
|
|
196
|
+
"event_type": "communication-completed",
|
|
197
|
+
"schedule_at": lambda _uow: datetime(2000, 1, 1, tzinfo=timezone.utc),
|
|
198
|
+
"schedule_name": "expired",
|
|
199
|
+
"bus_arn": "bus",
|
|
200
|
+
"role_arn": "role",
|
|
201
|
+
"to_event": lambda _uow, _flavor, template: {
|
|
202
|
+
**template,
|
|
203
|
+
"type": "deadline",
|
|
204
|
+
},
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
request = flavor._to_schedule_request({ # pylint: disable=protected-access
|
|
208
|
+
"event": {
|
|
209
|
+
"id": "event-1",
|
|
210
|
+
"type": "communication-completed",
|
|
211
|
+
"timestamp": 946684800000,
|
|
212
|
+
},
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
expect("schedule_request" in request).to(equal(False))
|
|
216
|
+
expect(request["emit"]["type"]).to(equal("deadline"))
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def test_schedule_publishes_an_expired_deadline_without_creating_a_schedule():
|
|
220
|
+
connector = SchedulerConnector()
|
|
221
|
+
flavor = Schedule(
|
|
222
|
+
{
|
|
223
|
+
"id": "expired-schedule-pipeline",
|
|
224
|
+
"event_type": "communication-completed",
|
|
225
|
+
"schedule_at": lambda _uow: datetime(2000, 1, 1, tzinfo=timezone.utc),
|
|
226
|
+
"schedule_name": "expired-pipeline",
|
|
227
|
+
"bus_arn": "bus",
|
|
228
|
+
"role_arn": "role",
|
|
229
|
+
"to_event": lambda _uow, _flavor, template: {
|
|
230
|
+
**template,
|
|
231
|
+
"type": "deadline",
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
dependency_resolver=Resolver(connector),
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
@dynamodb_source(RulesRegistry().registry(flavor), concurrency=False)
|
|
238
|
+
def handler(_event, _context):
|
|
239
|
+
return {"statusCode": 200}
|
|
240
|
+
|
|
241
|
+
handler(dynamodb_stream_event([collected_event_record({
|
|
242
|
+
"id": "communication-completed-1",
|
|
243
|
+
"type": "communication-completed",
|
|
244
|
+
"timestamp": 946684800000,
|
|
245
|
+
})]), None)
|
|
246
|
+
|
|
247
|
+
expect(connector.requests).to(equal([]))
|
|
248
|
+
expect(len(connector.events)).to(equal(1))
|
|
249
|
+
expect(connector.events[0]["Entries"][0]["DetailType"]).to(equal("deadline"))
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
from expects import equal, expect
|
|
2
|
-
from modmex_lambda.stream.events.s3 import from_s3, to_s3_records
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def test_from_s3_created_events():
|
|
6
|
-
records = to_s3_records([
|
|
7
|
-
{
|
|
8
|
-
'bucket': {
|
|
9
|
-
'name': 'bucket',
|
|
10
|
-
},
|
|
11
|
-
'object': {
|
|
12
|
-
'key': 'thing.json',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
])
|
|
16
|
-
|
|
17
|
-
uows = from_s3(records)
|
|
18
|
-
|
|
19
|
-
expect(len(uows)).to(equal(1))
|
|
20
|
-
expect(uows[0]['event']).to(equal({
|
|
21
|
-
'id': 'thing.json',
|
|
22
|
-
'type': 'object-created',
|
|
23
|
-
's3': records['Records'][0]['s3'],
|
|
24
|
-
}))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def test_from_s3_deleted_events():
|
|
28
|
-
records = to_s3_records([
|
|
29
|
-
{
|
|
30
|
-
'bucket': {
|
|
31
|
-
'name': 'bucket',
|
|
32
|
-
},
|
|
33
|
-
'object': {
|
|
34
|
-
'key': 'thing.json',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
])
|
|
38
|
-
records['Records'][0]['eventName'] = 'ObjectCreated:Delete'
|
|
39
|
-
|
|
40
|
-
expect(from_s3(records)[0]['event']['type']).to(equal('object-deleted'))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def test_from_s3_unknown_events():
|
|
44
|
-
records = to_s3_records([
|
|
45
|
-
{
|
|
46
|
-
'bucket': {},
|
|
47
|
-
'object': {
|
|
48
|
-
'key': 'thing.json',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
])
|
|
52
|
-
records['Records'][0]['eventName'] = 'ObjectRestore:Completed'
|
|
53
|
-
|
|
54
|
-
expect(from_s3(records)[0]['event']['type']).to(equal(None))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/eventbridge_scheduler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/connectors/ieventbridge_scheduler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/api_gateway_proxy_event.py
RENAMED
|
File without changes
|
|
File without changes
|
{modmex_lambda-0.6.0 → modmex_lambda-0.6.2}/modmex_lambda/data_classes/cognito_user_pool_event.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|