clear-skies-aws 2.0.10__tar.gz → 2.0.12__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.
Files changed (87) hide show
  1. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.copier-answers.yml +1 -1
  2. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.github/workflows/run-tests.yml +2 -1
  3. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.github/workflows/tests-matrix.yaml +8 -24
  4. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.pre-commit-config.yaml +5 -8
  5. clear_skies_aws-2.0.12/.vscode/settings.json +21 -0
  6. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/CHANGELOG.md +32 -0
  7. clear_skies_aws-2.0.12/LATEST_CHANGELOG.md +16 -0
  8. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/PKG-INFO +3 -2
  9. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/pyproject.toml +3 -3
  10. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/backends/backend.py +17 -21
  11. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/backends/sqs_backend.py +7 -10
  12. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/__init__.py +2 -0
  13. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/lambda_alb.py +2 -1
  14. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/lambda_api_gateway.py +2 -1
  15. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/lambda_api_gateway_web_socket.py +2 -1
  16. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/lambda_invoke.py +2 -1
  17. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/lambda_sns.py +4 -1
  18. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/lambda_sqs_standard.py +2 -1
  19. clear_skies_aws-2.0.12/src/clearskies_aws/contexts/lambda_step_function.py +129 -0
  20. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/__init__.py +2 -0
  21. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/lambda_alb.py +2 -1
  22. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/lambda_api_gateway.py +2 -1
  23. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/lambda_api_gateway_web_socket.py +2 -1
  24. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/lambda_input_output.py +8 -2
  25. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/lambda_invoke.py +2 -1
  26. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/lambda_sns.py +2 -1
  27. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/lambda_sqs_standard.py +2 -1
  28. clear_skies_aws-2.0.12/src/clearskies_aws/input_outputs/lambda_step_function.py +208 -0
  29. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/uv.lock +392 -345
  30. clear_skies_aws-2.0.10/LATEST_CHANGELOG.md +0 -5
  31. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.editorconfig +0 -0
  32. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.github/workflows/create-version.yaml +0 -0
  33. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.github/workflows/docs.yaml +0 -0
  34. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.github/workflows/tests.yaml +0 -0
  35. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.gitignore +0 -0
  36. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/.python-version +0 -0
  37. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/LICENSE +0 -0
  38. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/README.md +0 -0
  39. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/cliff.toml +0 -0
  40. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/ruff.toml +0 -0
  41. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/__init__.py +0 -0
  42. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/actions/__init__.py +0 -0
  43. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/actions/action_aws.py +0 -0
  44. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/actions/assume_role.py +0 -0
  45. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/actions/ses.py +0 -0
  46. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/actions/sns.py +0 -0
  47. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/actions/sqs.py +0 -0
  48. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/actions/step_function.py +0 -0
  49. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/backends/__init__.py +0 -0
  50. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/backends/dynamo_db_backend.py +0 -0
  51. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/backends/dynamo_db_condition_parser.py +0 -0
  52. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/backends/dynamo_db_parti_ql_backend.py +0 -0
  53. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/configs/__init__.py +0 -0
  54. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/contexts/cli_web_socket_mock.py +0 -0
  55. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/cursors/__init__.py +0 -0
  56. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/cursors/iam/__init__.py +0 -0
  57. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/cursors/iam/rds_mysql.py +0 -0
  58. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/cursors/port_forwarding/__init__.py +0 -0
  59. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/cursors/port_forwarding/ssm.py +0 -0
  60. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/di/__init__.py +0 -0
  61. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/di/aws_additional_config_auto_import.py +0 -0
  62. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/di/inject/__init__.py +0 -0
  63. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/di/inject/boto3.py +0 -0
  64. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/di/inject/boto3_session.py +0 -0
  65. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/di/inject/parameter_store.py +0 -0
  66. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/endpoints/__init__.py +0 -0
  67. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/endpoints/secrets_manager_rotation.py +0 -0
  68. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/endpoints/simple_body_routing.py +0 -0
  69. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/input_outputs/cli_web_socket_mock.py +0 -0
  70. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/mocks/__init__.py +0 -0
  71. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/mocks/actions/__init__.py +0 -0
  72. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/mocks/actions/ses.py +0 -0
  73. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/mocks/actions/sns.py +0 -0
  74. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/mocks/actions/sqs.py +0 -0
  75. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/mocks/actions/step_function.py +0 -0
  76. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/models/__init__.py +0 -0
  77. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/models/web_socket_connection_model.py +0 -0
  78. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/__init__.py +0 -0
  79. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/additional_configs/__init__.py +0 -0
  80. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/additional_configs/iam_db_auth.py +0 -0
  81. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/additional_configs/iam_db_auth_with_ssm.py +0 -0
  82. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/additional_configs/mysql_connection_dynamic_producer_via_ssh_cert_bastion.py +0 -0
  83. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/additional_configs/mysql_connection_dynamic_producer_via_ssm_bastion.py +0 -0
  84. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/akeyless_with_ssm_cache.py +0 -0
  85. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/parameter_store.py +0 -0
  86. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/secrets.py +0 -0
  87. {clear_skies_aws-2.0.10 → clear_skies_aws-2.0.12}/src/clearskies_aws/secrets/secrets_manager.py +0 -0
@@ -1,5 +1,5 @@
1
1
  # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
- _commit: v0.0.34
2
+ _commit: v0.0.45
3
3
  _src_path: https://github.com/clearskies-py/clearskies-module-template
4
4
  author_email: tom.nijboer@cimpress.com
5
5
  author_name: Tom Nijboer
@@ -67,7 +67,7 @@ jobs:
67
67
  python-version: ${{ matrix.python-version }}
68
68
  run-mypy: ${{ needs.changes.outputs.tests == 'true' }}
69
69
  run-pytest: ${{ needs.changes.outputs.tests == 'true' }}
70
- run-black: ${{ needs.changes.outputs.tests == 'true' }}
70
+ run-ruff-format: ${{ needs.changes.outputs.tests == 'true' }}
71
71
  run-ruff-check: ${{ needs.changes.outputs.tests == 'true' }}
72
72
  secrets: inherit
73
73
  strategy:
@@ -76,6 +76,7 @@ jobs:
76
76
  - '3.11'
77
77
  - '3.12'
78
78
  - '3.13'
79
+ - '3.14'
79
80
  fail-fast: false
80
81
 
81
82
  status:
@@ -14,7 +14,7 @@ on:
14
14
  run-pytest:
15
15
  required: true
16
16
  type: boolean
17
- run-black:
17
+ run-ruff-format:
18
18
  required: true
19
19
  type: boolean
20
20
  run-ruff-check:
@@ -46,7 +46,6 @@ jobs:
46
46
  - name: Install dependencies
47
47
  run: uv sync --locked --all-extras --dev
48
48
  - run: uv run mypy src --check || true
49
- continue-on-error: true
50
49
 
51
50
  pytest:
52
51
  name: pytest
@@ -64,32 +63,17 @@ jobs:
64
63
  enable-cache: true
65
64
  - name: Install dependencies
66
65
  run: uv sync --locked --all-extras --dev
67
- - run: uv run pytest -v
68
- continue-on-error: true
69
- - run: git diff --exit-code --stat
70
- continue-on-error: true
66
+ - run: uv run pytest -v . -m "not broken"
67
+ - run: git diff --exit-code --stat HEAD
71
68
 
72
- black:
73
- name: black
69
+ ruff-format:
70
+ name: ruff-format
74
71
  runs-on: ${{ inputs.runner }}
75
- if: inputs.run-black
72
+ if: inputs.run-ruff-format
76
73
  steps:
77
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
78
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
79
- with:
80
- persist-credentials: false
81
-
82
- - name: Install uv and set the python version
83
- uses: astral-sh/setup-uv@v6
84
- with:
85
- python-version: ${{ inputs.python-version }}
86
- enable-cache: true
87
- - name: Install dependencies
88
- run: uv sync --locked --all-extras --dev
89
- - uses: psf/black@stable
74
+ - uses: astral-sh/ruff-action@v3
90
75
  with:
91
- options: "--check --verbose"
92
- src: "./src"
76
+ args: "format --diff"
93
77
 
94
78
  ruff-check:
95
79
  name: ruff-check
@@ -1,5 +1,5 @@
1
- # Pre-commit configuration for Akeyless Custom Producer
2
- fail_fast: true
1
+ # Pre-commit configuration for Clearkskies AWS project
2
+ fail_fast: false
3
3
 
4
4
  ci:
5
5
  autofix_commit_msg: "chore(pre-commit): autofix run"
@@ -8,6 +8,9 @@ ci:
8
8
  default_install_hook_types:
9
9
  - pre-commit
10
10
  - commit-msg
11
+ - post-checkout
12
+ - post-merge
13
+ - post-rewrite
11
14
 
12
15
  default_stages: ["pre-commit"]
13
16
 
@@ -36,12 +39,6 @@ repos:
36
39
  hooks:
37
40
  - id: uv-lock
38
41
 
39
- - repo: https://github.com/psf/black
40
- rev: 25.1.0
41
- hooks:
42
- - id: black
43
- files: \.py$
44
-
45
42
  - repo: https://github.com/astral-sh/ruff-pre-commit
46
43
  rev: v0.12.1
47
44
  hooks:
@@ -0,0 +1,21 @@
1
+ {
2
+ "python.testing.pytestArgs": ["tests"],
3
+ "python.testing.unittestEnabled": false,
4
+ "python.testing.pytestEnabled": true,
5
+ "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
6
+ "ruff.interpreter": ["${workspaceFolder}/.venv/bin/python"],
7
+ "ruff.path": ["${workspaceFolder}/.venv/bin/ruff"],
8
+ "ruff.configuration": "${workspaceFolder}/ruff.toml",
9
+ "ruff.nativeServer": "on",
10
+ "[python]": {
11
+ "editor.formatOnSave": true,
12
+ "editor.codeActionsOnSave": {
13
+ "source.fixAll": "explicit",
14
+ "source.organizeImports": "explicit"
15
+ },
16
+ "editor.defaultFormatter": "charliermarsh.ruff"
17
+ },
18
+ "mypy-type-checker.args": [
19
+ "--config-file=${workspaceFolder}/pyproject.toml"
20
+ ]
21
+ }
@@ -5,8 +5,38 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.12] - 2026-01-27
9
+
10
+ ### Added
11
+ - Add docs
12
+ - Add stepfucntions context with variables to ENV vars
13
+
14
+ ### Changed
15
+ - Merge pull request #11 from clearskies-py/stepfunctions-variables by @cmancone in [#11](https://github.com/clearskies-py/aws/pull/11)
16
+ - Update docstrings of stepfunctions
17
+ - Move Environment to the input output of step functions
18
+ - Udpate to QueryResult
19
+ - Update to latest copier template
20
+
21
+ ### Fixed
22
+ - Ignore dynamodb mypy issues
23
+
24
+ ## [2.0.11] - 2026-01-21
25
+
26
+ ### Changed
27
+ - Bump version to v2.0.11 by @github-actions[bot]
28
+
29
+ ### Fixed
30
+ - Set correct type for context
31
+
32
+ ### Removed
33
+ - Remove black
34
+
8
35
  ## [2.0.10] - 2026-01-21
9
36
 
37
+ ### Changed
38
+ - Bump version to v2.0.10 by @github-actions[bot]
39
+
10
40
  ### Fixed
11
41
  - Jinja2 import
12
42
 
@@ -136,6 +166,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
136
166
  * @cmancone made their first contribution
137
167
  * @ made their first contribution
138
168
  * @github-actions[bot] made their first contribution
169
+ [2.0.12]: https://github.com/clearskies-py/aws/compare/v2.0.11..v2.0.12
170
+ [2.0.11]: https://github.com/clearskies-py/aws/compare/v2.0.10..v2.0.11
139
171
  [2.0.10]: https://github.com/clearskies-py/aws/compare/v2.0.9..v2.0.10
140
172
  [2.0.9]: https://github.com/clearskies-py/aws/compare/v2.0.8..v2.0.9
141
173
  [2.0.8]: https://github.com/clearskies-py/aws/compare/v2.0.7..v2.0.8
@@ -0,0 +1,16 @@
1
+ ## [2.0.12] - 2026-01-27
2
+
3
+ ### Added
4
+ - Add docs
5
+ - Add stepfucntions context with variables to ENV vars
6
+
7
+ ### Changed
8
+ - Merge pull request #11 from clearskies-py/stepfunctions-variables by @cmancone in [#11](https://github.com/clearskies-py/aws/pull/11)
9
+ - Update docstrings of stepfunctions
10
+ - Move Environment to the input output of step functions
11
+ - Udpate to QueryResult
12
+ - Update to latest copier template
13
+
14
+ ### Fixed
15
+ - Ignore dynamodb mypy issues
16
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clear-skies-aws
3
- Version: 2.0.10
3
+ Version: 2.0.12
4
4
  Summary: clearskies bindings for working in AWS
5
5
  Project-URL: Repository, https://github.com/clearskies-py/clearskies-aws
6
6
  Project-URL: Issues, https://github.com/clearskies-py/clearskies-aws/issues
@@ -15,8 +15,9 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Programming Language :: Python :: 3
17
17
  Requires-Python: <4.0,>=3.11
18
+ Requires-Dist: awslambdaric>=3.1.1
18
19
  Requires-Dist: boto3<2.0.0,>=1.26.148
19
- Requires-Dist: clear-skies<3.0.0,>=2.0.20
20
+ Requires-Dist: clear-skies<3.0.0,>=2.0.37
20
21
  Requires-Dist: jinja2>=3.1.6
21
22
  Requires-Dist: types-boto3[dynamodb,secretsmanager,ses,sns,sqs,ssm,stepfunctions]<2.0.0,>=1.38.13
22
23
  Provides-Extra: akeyless
@@ -3,13 +3,14 @@
3
3
  name = "clear-skies-aws"
4
4
  description = "clearskies bindings for working in AWS"
5
5
  license = "MIT"
6
- version = "2.0.10"
6
+ version = "2.0.12"
7
7
  readme = "./README.md"
8
8
  authors = [{name = "tnijboer"}, {name = "Conor Mancone", email = "cmancone@gmail.com"}]
9
9
  requires-python = '>=3.11,<4.0'
10
10
  dependencies = [
11
+ "awslambdaric>=3.1.1",
11
12
  'boto3 (>=1.26.148,<2.0.0)',
12
- "clear-skies>=2.0.20,<3.0.0",
13
+ "clear-skies>=2.0.37,<3.0.0",
13
14
  "jinja2>=3.1.6",
14
15
  'types-boto3[dynamodb,sns,sqs,ses,ssm,secretsmanager,stepfunctions] (>=1.38.13,<2.0.0)',
15
16
  ]
@@ -77,7 +78,6 @@ markers = [
77
78
  # This is the dedicated section for uv"s configuration
78
79
  [dependency-groups]
79
80
  dev = [
80
- "black>=25.1.0",
81
81
  "mypy>=1.18.1",
82
82
  "pre-commit>=4.3.0",
83
83
  "pytest>=8.4.1",
@@ -7,6 +7,12 @@ import clearskies.model
7
7
  import clearskies.query
8
8
  from clearskies.autodoc.schema import Schema as AutoDocSchema
9
9
  from clearskies.di import inject
10
+ from clearskies.query.result import (
11
+ CountQueryResult,
12
+ RecordQueryResult,
13
+ RecordsQueryResult,
14
+ SuccessQueryResult,
15
+ )
10
16
 
11
17
  from clearskies_aws.di.inject import boto3
12
18
 
@@ -31,35 +37,25 @@ class Backend(clearskies.Configurable, clearskies.backends.Backend, clearskies.d
31
37
  boto3 = boto3.Boto3()
32
38
  environment = inject.Environment()
33
39
 
34
- def update(self, id: int | str, data: dict[str, Any], model: clearskies.model.Model) -> dict[str, Any]:
40
+ def update(self, id: int | str, data: dict[str, Any], model: clearskies.model.Model) -> RecordQueryResult:
35
41
  """Update the record with the given id with the information from the data dictionary."""
36
- return {}
42
+ return RecordQueryResult(record={})
37
43
 
38
- def create(self, data: dict[str, Any], model: clearskies.model.Model) -> dict[str, Any]:
44
+ def create(self, data: dict[str, Any], model: clearskies.model.Model) -> RecordQueryResult:
39
45
  """Create a record with the information from the data dictionary."""
40
- return {}
46
+ return RecordQueryResult(record={})
41
47
 
42
- def delete(self, id: int | str, model: clearskies.model.Model) -> bool:
48
+ def delete(self, id: int | str, model: clearskies.model.Model) -> SuccessQueryResult:
43
49
  """Delete the record with the given id."""
44
- return True
50
+ return SuccessQueryResult()
45
51
 
46
- def count(self, query: clearskies.query.Query) -> int:
52
+ def count(self, query: clearskies.query.Query) -> CountQueryResult:
47
53
  """Return the number of records which match the given query configuration."""
48
- return 1
49
-
50
- def records(
51
- self,
52
- query: clearskies.query.Query,
53
- next_page_data: dict[str, str | int] | None = None,
54
- ) -> list[dict[str, Any]]:
55
- """
56
- Return a list of records that match the given query configuration.
54
+ return CountQueryResult(count=1)
57
55
 
58
- next_page_data is used to return data to the caller. Pass in an empty dictionary, and it will be populated
59
- with the data needed to return the next page of results. If it is still an empty dictionary when returned,
60
- then there is no additional data.
61
- """
62
- return []
56
+ def records(self, query: clearskies.query.Query) -> RecordsQueryResult:
57
+ """Return a list of records that match the given query configuration."""
58
+ return RecordsQueryResult(records=[])
63
59
 
64
60
  def validate_pagination_data(self, data: dict[str, Any], case_mapping: Callable[[str], str]) -> str:
65
61
  """
@@ -5,6 +5,7 @@ from typing import Any
5
5
 
6
6
  from clearskies import Model
7
7
  from clearskies.query import Query
8
+ from clearskies.query.result import CountQueryResult, RecordQueryResult, RecordsQueryResult, SuccessQueryResult
8
9
  from types_boto3_sqs import SQSClient
9
10
 
10
11
  from clearskies_aws.backends import backend
@@ -37,25 +38,21 @@ class SqsBackend(backend.Backend):
37
38
 
38
39
  return self._sqs
39
40
 
40
- def create(self, data: dict[str, Any], model: Model) -> dict[str, Any]:
41
+ def create(self, data: dict[str, Any], model: Model) -> RecordQueryResult:
41
42
  self.sqs.send_message(
42
43
  QueueUrl=model.destination_name(),
43
44
  MessageBody=json.dumps(data),
44
45
  )
45
- return {**data}
46
+ return RecordQueryResult(record={**data})
46
47
 
47
- def update(self, id: int | str, data: dict[str, Any], model: Model) -> dict[str, Any]:
48
+ def update(self, id: int | str, data: dict[str, Any], model: Model) -> RecordQueryResult:
48
49
  raise ValueError("The SQS backend only supports the create operation")
49
50
 
50
- def delete(self, id: int | str, model: Model) -> bool:
51
+ def delete(self, id: int | str, model: Model) -> SuccessQueryResult:
51
52
  raise ValueError("The SQS backend only supports the create operation")
52
53
 
53
- def count(self, query: Query) -> int:
54
+ def count(self, query: Query) -> CountQueryResult:
54
55
  raise ValueError("The SQS backend only supports the create operation")
55
56
 
56
- def records(
57
- self,
58
- query: Query,
59
- next_page_data: dict[str, str | int] | None = None,
60
- ) -> list[dict[str, Any]]:
57
+ def records(self, query: Query) -> RecordsQueryResult:
61
58
  raise ValueError("The SQS backend only supports the create operation")
@@ -11,6 +11,7 @@ from clearskies_aws.contexts.lambda_sns import LambdaSns
11
11
  from clearskies_aws.contexts.lambda_sqs_standard import (
12
12
  LambdaSqsStandard,
13
13
  )
14
+ from clearskies_aws.contexts.lambda_step_function import LambdaStepFunction
14
15
 
15
16
  __all__ = [
16
17
  "CliWebSocketMock",
@@ -20,4 +21,5 @@ __all__ = [
20
21
  "LambdaInvoke",
21
22
  "LambdaSns",
22
23
  "LambdaSqsStandard",
24
+ "LambdaStepFunction",
23
25
  ]
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any
4
4
 
5
+ from awslambdaric.lambda_context import LambdaContext
5
6
  from clearskies.contexts.context import Context
6
7
 
7
8
  from clearskies_aws.input_outputs import LambdaAlb as LambdaAlbInputOutput
@@ -77,5 +78,5 @@ class LambdaAlb(Context):
77
78
  ```
78
79
  """
79
80
 
80
- def __call__(self, event: dict[str, Any], context: dict[str, Any]) -> Any: # type: ignore[override]
81
+ def __call__(self, event: dict[str, Any], context: LambdaContext | dict[str, Any]) -> Any: # type: ignore[override]
81
82
  return self.execute_application(LambdaAlbInputOutput(event, context))
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any
4
4
 
5
+ from awslambdaric.lambda_context import LambdaContext
5
6
  from clearskies.contexts.context import Context
6
7
 
7
8
  from clearskies_aws.input_outputs import LambdaApiGateway as LambdaApiGatewayInputOutput
@@ -77,5 +78,5 @@ class LambdaApiGateway(Context):
77
78
  ```
78
79
  """
79
80
 
80
- def __call__(self, event: dict[str, Any], context: dict[str, Any]) -> dict[str, Any]: # type: ignore[override]
81
+ def __call__(self, event: dict[str, Any], context: LambdaContext | dict[str, Any]) -> dict[str, Any]: # type: ignore[override]
81
82
  return self.execute_application(LambdaApiGatewayInputOutput(event, context))
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any
4
4
 
5
+ from awslambdaric.lambda_context import LambdaContext
5
6
  from clearskies.contexts.context import Context
6
7
 
7
8
  from clearskies_aws.input_outputs import (
@@ -74,6 +75,6 @@ class LambdaApiGatewayWebSocket(Context):
74
75
  """
75
76
 
76
77
  def __call__( # type: ignore[override]
77
- self, event: dict[str, Any], context: dict[str, Any], url: str = "", request_method: str = ""
78
+ self, event: dict[str, Any], context: LambdaContext | dict[str, Any], url: str = "", request_method: str = ""
78
79
  ) -> dict[str, Any]:
79
80
  return self.execute_application(LambdaApiGatewayWebSocketInputOutput(event, context, url))
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any
4
4
 
5
+ from awslambdaric.lambda_context import LambdaContext
5
6
  from clearskies.authentication import Public
6
7
  from clearskies.contexts.context import Context
7
8
 
@@ -126,7 +127,7 @@ class LambdaInvoke(Context):
126
127
  """
127
128
 
128
129
  def __call__( # type: ignore[override]
129
- self, event: dict[str, Any], context: dict[str, Any], request_method: str = "", url: str = ""
130
+ self, event: dict[str, Any], context: LambdaContext | dict[str, Any], request_method: str = "", url: str = ""
130
131
  ) -> dict[str, Any]:
131
132
  return self.execute_application(
132
133
  LambdaInvokeInputOutput(
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any
4
4
 
5
+ from awslambdaric.lambda_context import LambdaContext
5
6
  from clearskies.authentication import Public
6
7
  from clearskies.contexts.context import Context
7
8
 
@@ -114,7 +115,9 @@ class LambdaSns(Context):
114
115
  ```
115
116
  """
116
117
 
117
- def __call__(self, event: dict[str, Any], context: dict[str, Any], request_method: str = "", url: str = ""): # type: ignore[override]
118
+ def __call__(
119
+ self, event: dict[str, Any], context: LambdaContext | dict[str, Any], request_method: str = "", url: str = ""
120
+ ): # type: ignore[override]
118
121
  try:
119
122
  return self.execute_application(
120
123
  LambdaSnsInputOutput(event, context, request_method=request_method, url=url)
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import traceback
4
4
  from typing import Any
5
5
 
6
+ from awslambdaric.lambda_context import LambdaContext
6
7
  from clearskies.authentication import Public
7
8
  from clearskies.contexts.context import Context
8
9
 
@@ -121,7 +122,7 @@ class LambdaSqsStandard(Context):
121
122
  """
122
123
 
123
124
  def __call__( # type: ignore[override]
124
- self, event: dict[str, Any], context: dict[str, Any], url: str = "", request_method: str = ""
125
+ self, event: dict[str, Any], context: LambdaContext | dict[str, Any], url: str = "", request_method: str = ""
125
126
  ) -> dict[str, Any]:
126
127
  item_failures = []
127
128
  for record in event["Records"]:
@@ -0,0 +1,129 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any, Callable
4
+
5
+ from clearskies.contexts.context import Context
6
+
7
+ from clearskies_aws.input_outputs.lambda_step_function import LambdaStepFunction as LambdaStepFunctionInputOutput
8
+
9
+
10
+ class LambdaStepFunction(Context):
11
+ """
12
+ Execute a Lambda invoked from AWS Step Functions.
13
+
14
+ This context is used when your clearskies application is running in a Lambda that is
15
+ invoked from an AWS Step Functions state machine. It supports extracting variables
16
+ assigned in the Step Functions state and exposing them through the clearskies
17
+ Environment class.
18
+
19
+ ### Usage
20
+
21
+ Basic usage:
22
+
23
+ ```python
24
+ import clearskies
25
+ import clearskies_aws
26
+
27
+
28
+ def my_function(request_data, environment):
29
+ # Access extracted environment variables
30
+ business_name = environment.get("BUSINESS_NAME")
31
+ return {"business": business_name, "data": request_data}
32
+
33
+
34
+ lambda_step_function = clearskies_aws.contexts.LambdaStepFunction(
35
+ clearskies.endpoints.Callable(
36
+ my_function,
37
+ return_standard_response=False,
38
+ ),
39
+ environment_keys=["BUSINESS_NAME", "GITLAB_AUTH_KEY"],
40
+ )
41
+
42
+
43
+ def lambda_handler(event, context):
44
+ return lambda_step_function(event, context)
45
+ ```
46
+
47
+ ### Configuration Options
48
+
49
+ The `environment_keys` parameter accepts three types:
50
+
51
+ **1. List of keys** - Extract specific keys from the event:
52
+ ```python
53
+ clearskies_aws.contexts.LambdaStepFunction(
54
+ endpoint, environment_keys=["BUSINESS_NAME", "GITLAB_AUTH_KEY"]
55
+ )
56
+ ```
57
+
58
+ **2. Mapping dict** - Map event keys to environment variable names:
59
+ ```python
60
+ clearskies_aws.contexts.LambdaStepFunction(
61
+ endpoint,
62
+ environment_keys={
63
+ "BUSINESS_NAME": "BUSINESS_NAME", # same name
64
+ "GITLAB_AUTH_KEY": "GITLAB_TOKEN_PATH", # rename
65
+ },
66
+ )
67
+ ```
68
+
69
+ **3. Callable** - Full control via a function (supports dependency injection):
70
+ ```python
71
+ def extract_env_vars(event, secrets):
72
+ # Can inject clearskies dependencies like secrets
73
+ return {
74
+ "BUSINESS_NAME": event.get("BUSINESS_NAME"),
75
+ "GITLAB_KEY": secrets.get(event.get("GITLAB_AUTH_KEY")),
76
+ }
77
+
78
+
79
+ clearskies_aws.contexts.LambdaStepFunction(endpoint, environment_keys=extract_env_vars)
80
+ ```
81
+
82
+ ### Context Specifics
83
+
84
+ When using this context, the following named parameters become available to inject
85
+ into any callable invoked by clearskies:
86
+
87
+ | Name | Type | Description |
88
+ |:----------------------:|:------------------:|:------------------------------------:|
89
+ | `event` | `dict[str, Any]` | The lambda `event` object |
90
+ | `context` | `dict[str, Any]` | The lambda `context` object |
91
+ | `invocation_type` | `str` | Always `"step-functions"` |
92
+ | `function_name` | `str` | The name of the lambda function |
93
+ | `function_version` | `str` | The function version |
94
+ | `request_id` | `str` | The AWS request id for the call |
95
+ | `states_context` | `dict[str, Any]` | The Step Functions $states context |
96
+
97
+ """
98
+
99
+ def __init__(
100
+ self,
101
+ endpoint,
102
+ environment_keys: list[str] | dict[str, str] | Callable[..., dict[str, Any]] | None = None,
103
+ **kwargs,
104
+ ):
105
+ super().__init__(endpoint, **kwargs)
106
+ self._environment_keys = environment_keys
107
+
108
+ def __call__( # type: ignore[override]
109
+ self,
110
+ event: dict[str, Any],
111
+ context: dict[str, Any],
112
+ request_method: str = "",
113
+ url: str = "",
114
+ ) -> dict[str, Any]:
115
+ input_output = LambdaStepFunctionInputOutput(
116
+ event,
117
+ context,
118
+ request_method=request_method,
119
+ url=url,
120
+ environment_keys=self._environment_keys,
121
+ )
122
+
123
+ # Inject extra environment variables from the step function event
124
+ input_output.inject_extra_environment_variables(
125
+ self.di.build("environment", cache=True),
126
+ self.di,
127
+ )
128
+
129
+ return self.execute_application(input_output)
@@ -9,6 +9,7 @@ from clearskies_aws.input_outputs.lambda_api_gateway_web_socket import (
9
9
  from clearskies_aws.input_outputs.lambda_invoke import LambdaInvoke
10
10
  from clearskies_aws.input_outputs.lambda_sns import LambdaSns
11
11
  from clearskies_aws.input_outputs.lambda_sqs_standard import LambdaSqsStandard
12
+ from clearskies_aws.input_outputs.lambda_step_function import LambdaStepFunction
12
13
 
13
14
  __all__ = [
14
15
  "CliWebSocketMock",
@@ -18,4 +19,5 @@ __all__ = [
18
19
  "LambdaInvoke",
19
20
  "LambdaSns",
20
21
  "LambdaSqsStandard",
22
+ "LambdaStepFunction",
21
23
  ]
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any
4
4
 
5
+ from awslambdaric.lambda_context import LambdaContext
5
6
  from clearskies.configs import String
6
7
  from clearskies.input_outputs import Headers
7
8
 
@@ -11,7 +12,7 @@ from clearskies_aws.input_outputs import lambda_input_output
11
12
  class LambdaAlb(lambda_input_output.LambdaInputOutput):
12
13
  """Application Load Balancer specific Lambda input/output handler."""
13
14
 
14
- def __init__(self, event: dict[str, Any], context: dict[str, Any]):
15
+ def __init__(self, event: dict[str, Any], context: LambdaContext | dict[str, Any]):
15
16
  # Call parent constructor
16
17
  super().__init__(event, context)
17
18
 
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import Any
4
4
 
5
+ from awslambdaric.lambda_context import LambdaContext
5
6
  from clearskies.configs import String
6
7
  from clearskies.input_outputs import Headers
7
8
 
@@ -13,7 +14,7 @@ class LambdaApiGateway(lambda_input_output.LambdaInputOutput):
13
14
 
14
15
  resource = String(default="")
15
16
 
16
- def __init__(self, event: dict, context: dict[str, Any]):
17
+ def __init__(self, event: dict, context: LambdaContext | dict[str, Any]):
17
18
  # Call parent constructor
18
19
  super().__init__(event, context)
19
20
 
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import json
4
4
  from typing import Any
5
5
 
6
+ from awslambdaric.lambda_context import LambdaContext
6
7
  from clearskies.configs import String
7
8
  from clearskies.input_outputs import Headers
8
9
 
@@ -15,7 +16,7 @@ class LambdaApiGatewayWebSocket(lambda_input_output.LambdaInputOutput):
15
16
  route_key = String(default="")
16
17
  connection_id = String(default="")
17
18
 
18
- def __init__(self, event: dict[str, Any], context: dict[str, Any], url: str = ""):
19
+ def __init__(self, event: dict[str, Any], context: LambdaContext | dict[str, Any], url: str = ""):
19
20
  # Call parent constructor
20
21
  super().__init__(event, context)
21
22