flowstash-cli 0.2.0__tar.gz → 0.2.3__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 (48) hide show
  1. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/PKG-INFO +2 -2
  2. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/pyproject.toml +2 -2
  3. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/AGENTS.md +48 -4
  4. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/__init__.py +0 -0
  5. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/commands/__init__.py +0 -0
  6. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/commands/auth.py +0 -0
  7. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/commands/build.py +0 -0
  8. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/commands/deploy.py +0 -0
  9. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/commands/project.py +0 -0
  10. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/commands/run.py +0 -0
  11. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/commands/webhook.py +0 -0
  12. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/core/__init__.py +0 -0
  13. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/core/api_client.py +0 -0
  14. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/core/auth_server.py +0 -0
  15. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/core/builder.py +0 -0
  16. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/core/config.py +0 -0
  17. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/core/docker_utils.py +0 -0
  18. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/core/patcher.py +0 -0
  19. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/main.py +0 -0
  20. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/README.md +0 -0
  21. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_.dockerignore +0 -0
  22. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_.flowstash +0 -0
  23. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_api_main.py +0 -0
  24. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/[env]/(backend-asyncio)/backend.yaml +0 -0
  25. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/[env]/(backend-dramatiq)/backend.yaml +0 -0
  26. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/[env]/(backend-managed)/backend.yaml +0 -0
  27. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/[env]/_backend.yaml +0 -0
  28. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/shared/.env +0 -0
  29. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/shared/backend.yaml +0 -0
  30. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/shared/clients/demoClient.yaml +0 -0
  31. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_config/shared/clients.yaml +0 -0
  32. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_deployment/[env]/(backend-asyncio)/docker-compose.yaml +0 -0
  33. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_deployment/[env]/(backend-dramatiq)/docker-compose.yaml +0 -0
  34. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_deployment/[env]/.env +0 -0
  35. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_deployment/shared/.env +0 -0
  36. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_deployment/shared/api.Dockerfile +0 -0
  37. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_deployment/shared/worker.Dockerfile +0 -0
  38. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_pyproject.toml +0 -0
  39. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_api/__init__.py +0 -0
  40. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_api/_routes/webhooks.py +0 -0
  41. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_shared/__init__.py +0 -0
  42. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_shared/clients/client.py +0 -0
  43. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_shared/models/models.py +0 -0
  44. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_shared/tasks/sharedTasks.py +0 -0
  45. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_worker/__init__.py +0 -0
  46. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_src/_worker/tasks/tasks.py +0 -0
  47. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/templates/_worker_main.py +0 -0
  48. {flowstash_cli-0.2.0 → flowstash_cli-0.2.3}/src/flowstash/cli/ui/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flowstash-cli
3
- Version: 0.2.0
3
+ Version: 0.2.3
4
4
  Summary: CLI for the flowstash Managed Platform
5
5
  Author: juraj.bezdek@gmail.com
6
6
  Author-email: juraj.bezdek@gmail.com
@@ -9,7 +9,7 @@ Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Programming Language :: Python :: 3.12
11
11
  Classifier: Programming Language :: Python :: 3.13
12
- Requires-Dist: flowstash-runtime (>=0.1.2,<0.2.0)
12
+ Requires-Dist: flowstash-runtime (>=0.2.3,<0.3.0)
13
13
  Requires-Dist: httpx (>=0.27.0)
14
14
  Requires-Dist: keyring (>=25.0.0)
15
15
  Requires-Dist: libcst (>=1.1.0)
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "flowstash-cli"
3
- version = "0.2.0"
3
+ version = "0.2.3"
4
4
  description = "CLI for the flowstash Managed Platform"
5
5
  authors = [{name = "juraj.bezdek@gmail.com", email = "juraj.bezdek@gmail.com"}]
6
6
  requires-python = ">=3.11"
7
7
  dependencies = [
8
- "flowstash-runtime>=0.1.2,<0.2.0",
8
+ "flowstash-runtime>=0.2.3,<0.3.0",
9
9
  "typer[all]>=0.12.0",
10
10
  "httpx>=0.27.0",
11
11
  "pyyaml>=6.0.1",
@@ -114,13 +114,52 @@ with integration_context(integration="my-int", integration_pipeline="pipe"):
114
114
  flowstash makes it easy to interact with external APIs via Clients. They handle setting Base URLs, automatic Authentication headers, observability tracing, and defaults out of the box.
115
115
 
116
116
  ### Adding a Client
117
- To configure a new REST client, you place a configuration file (like `slackClient.yaml`) in your shared clients folder. flowstash dynamically loads these clients if your configuration registry points to the folder. For example, if you have `_config/shared/clients.yaml` configured as follows:
117
+
118
+ To configure a new REST client, you place a configuration file (like `slackClient.yaml`) in your shared clients folder. flowstash dynamically loads these clients if your configuration registry points to the folder.
119
+
120
+ #### The `clients.yaml` Pointer
121
+ The `clients.yaml` file in your shared configuration folder tells flowstash where to find your client definitions. Its schema is defined by `ClientsConfigPointer` in `flowstash.config.runtime_config`:
122
+
123
+ ```yaml
124
+ path: clients # Relative or absolute path to the clients directory
125
+ pattern: "*.yaml" # Glob pattern to match client files (default: "*.yaml")
126
+ recursive: false # If true, searches subdirectories (default: false)
127
+ ```
128
+
129
+ #### Client Settings Schema
130
+ Each individual client file follows the `ClientSettings` schema defined in `flowstash.clients.config`. You can use either camelCase (default) or snake_case for field names.
131
+
132
+ Common fields:
133
+ - `baseUrl` (or `base_url`): The root URL for all requests.
134
+ - `timeout`: Request timeout in seconds (default: 10.0).
135
+ - `auth`: Authentication configuration.
136
+ - `retry`: Configuration for automatic retries.
137
+
138
+ #### Example: API Key Authentication
118
139
  ```yaml
119
- path: clients
120
- pattern: "*.yaml"
140
+ client_id: myClient # Optional: defaults to filename
141
+ baseUrl: https://api.example.com
142
+ auth:
143
+ type: api_key
144
+ key: "X-API-Key" # Header or query parameter name
145
+ value: "${MY_API_KEY}" # Value (supports environment variables)
146
+ in: header # Place in "header" (default) or "query"
121
147
  ```
148
+
149
+ #### Example: OAuth2 Authentication
150
+ ```yaml
151
+ baseUrl: https://api.service.com
152
+ auth:
153
+ type: oauth2
154
+ client_id: "${CLIENT_ID}"
155
+ client_secret: "${CLIENT_SECRET}"
156
+ token_url: "https://auth.service.com/oauth/token"
157
+ scopes: ["read", "write"]
158
+ ```
159
+
122
160
  You can simply define `clients/slackClient.yaml` and the system will expose it to your tasks.
123
161
 
162
+
124
163
  ### Using a Client
125
164
  Once configured, you can retrieve the standard HTTP client (from the `flowstash.clients` package) anywhere.
126
165
 
@@ -145,7 +184,7 @@ from flowstash.clients import HttpClient, client
145
184
  from typing import List
146
185
 
147
186
  # Extending HttpClient and registering with the @client decorator
148
- @client("DemoClient")
187
+ @client("demoClient") # Make sure the clientId ('demoClient') matches the clientId in yaml / config file name (if not specified in config yaml)
149
188
  class DemoClient(HttpClient):
150
189
  """Custom client for the Demo API."""
151
190
 
@@ -157,6 +196,11 @@ class DemoClient(HttpClient):
157
196
  response = await self.request("GET", f"/users/{user_id}")
158
197
  return response.json()
159
198
 
199
+ @classmethod
200
+ def get(cls) -> DemoClient:
201
+ return get_client("demoClient")
202
+
203
+
160
204
  # You can then resolve this custom client by name:
161
205
  # demo = get_client("DemoClient")
162
206
  ```