flowstash-cli 0.1.0__py3-none-any.whl

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/__init__.py +0 -0
  2. flowstash/commands/__init__.py +0 -0
  3. flowstash/commands/auth.py +112 -0
  4. flowstash/commands/build.py +127 -0
  5. flowstash/commands/deploy.py +143 -0
  6. flowstash/commands/project.py +555 -0
  7. flowstash/commands/run.py +65 -0
  8. flowstash/core/__init__.py +0 -0
  9. flowstash/core/api_client.py +62 -0
  10. flowstash/core/auth_server.py +45 -0
  11. flowstash/core/builder.py +40 -0
  12. flowstash/core/config.py +81 -0
  13. flowstash/core/docker_utils.py +33 -0
  14. flowstash/main.py +269 -0
  15. flowstash/templates/AGENTS.md +222 -0
  16. flowstash/templates/README.md +135 -0
  17. flowstash/templates/_.dockerignore +8 -0
  18. flowstash/templates/_.flowstash +4 -0
  19. flowstash/templates/_api_main.py +21 -0
  20. flowstash/templates/_config/[env]/(backend-asyncio)/backend.yaml +4 -0
  21. flowstash/templates/_config/[env]/(backend-dramatiq)/backend.yaml +8 -0
  22. flowstash/templates/_config/[env]/(backend-managed)/backend.yaml +6 -0
  23. flowstash/templates/_config/[env]/_backend.yaml +4 -0
  24. flowstash/templates/_config/shared/.env +1 -0
  25. flowstash/templates/_config/shared/backend.yaml +4 -0
  26. flowstash/templates/_config/shared/clients/demoClient.yaml +39 -0
  27. flowstash/templates/_config/shared/clients.yaml +3 -0
  28. flowstash/templates/_deployment/[env]/(backend-asyncio)/docker-compose.yaml +24 -0
  29. flowstash/templates/_deployment/[env]/(backend-dramatiq)/docker-compose.yaml +34 -0
  30. flowstash/templates/_deployment/[env]/.env +3 -0
  31. flowstash/templates/_deployment/shared/.env +5 -0
  32. flowstash/templates/_deployment/shared/api.Dockerfile +18 -0
  33. flowstash/templates/_deployment/shared/worker.Dockerfile +18 -0
  34. flowstash/templates/_pyproject.toml +40 -0
  35. flowstash/templates/_src/_api/__init__.py +1 -0
  36. flowstash/templates/_src/_api/_routes/webhooks.py +25 -0
  37. flowstash/templates/_src/_shared/__init__.py +1 -0
  38. flowstash/templates/_src/_shared/clients/client.py +18 -0
  39. flowstash/templates/_src/_shared/models/models.py +1 -0
  40. flowstash/templates/_src/_shared/tasks/sharedTasks.py +10 -0
  41. flowstash/templates/_src/_worker/__init__.py +1 -0
  42. flowstash/templates/_src/_worker/tasks/tasks.py +15 -0
  43. flowstash/templates/_worker_main.py +25 -0
  44. flowstash/ui/__init__.py +0 -0
  45. flowstash_cli-0.1.0.dist-info/METADATA +19 -0
  46. flowstash_cli-0.1.0.dist-info/RECORD +48 -0
  47. flowstash_cli-0.1.0.dist-info/WHEEL +4 -0
  48. flowstash_cli-0.1.0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,18 @@
1
+ from typing import List, Optional
2
+ from flowstash_lib.clients import HttpClient, client
3
+
4
+ @client("DemoClient")
5
+ class DemoClient(HttpClient):
6
+ """
7
+ Client for the Demo API.
8
+ """
9
+
10
+ async def get_users(self) -> List[dict]:
11
+ response = await self.request("GET", "/users")
12
+ data = response.json()
13
+ return data
14
+
15
+ async def get_user(self, user_id: int) -> dict:
16
+ response = await self.request("GET", f"/users/{{user_id}}")
17
+ data = response.json()
18
+ return data
@@ -0,0 +1 @@
1
+ # Shared models for the integration
@@ -0,0 +1,10 @@
1
+ from flowstash_lib.decorators import integration_task
2
+ from flowstash_clients import get_client
3
+
4
+ @integration_task(integration="demo", integration_pipeline="adhoc_task")
5
+ async def adhoc_task(data: dict):
6
+ """
7
+ Ad-hoc task triggered via webhook.
8
+ """
9
+
10
+ print(f"Running ad-hoc task with data: {data}")
@@ -0,0 +1 @@
1
+ # Worker package
@@ -0,0 +1,15 @@
1
+ from flowstash_lib.decorators import integration_task
2
+ from flowstash_lib.queue.backend import Schedule
3
+
4
+
5
+
6
+
7
+ @integration_task(integration="demo", integration_pipeline="demo", default_schedule=Schedule(cron="* * * * *"))
8
+ def demo_task(user_id: int):
9
+ """
10
+ Task to process a user by ID.
11
+ """
12
+ print(f"Processing user {user_id}...")
13
+
14
+
15
+
@@ -0,0 +1,25 @@
1
+ import os
2
+ import asyncio
3
+ import logging
4
+ from pathlib import Path
5
+ from flowstash_lib.config.env_loader import load_config_dir
6
+ from flowstash_runtime import initialize_runtime, run_worker
7
+
8
+ logging.basicConfig(level=logging.INFO)
9
+
10
+ # Load config
11
+ env = os.getenv("ENVIRONMENT", "dev")
12
+ config = load_config_dir("config", environment=env)
13
+
14
+ # Initialize runtime with auto-import of the tasks directory
15
+ runtime = initialize_runtime(
16
+ config,
17
+ auto_import=[
18
+ Path(__file__).parent / "src" / "shared" / "tasks",
19
+ Path(__file__).parent / "src" / "worker" / "tasks"
20
+ ]
21
+ )
22
+ if __name__ == "__main__":
23
+ # If run directly, start the worker
24
+ print(f"Worker starting with backend: {config.worker.backend}")
25
+ asyncio.run(run_worker(config))
File without changes
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.3
2
+ Name: flowstash-cli
3
+ Version: 0.1.0
4
+ Summary: CLI for the flowstash Managed Platform
5
+ Author: juraj.bezdek@gmail.com
6
+ Author-email: juraj.bezdek@gmail.com
7
+ Requires-Python: >=3.11
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Requires-Dist: flowstash-runtime (>=0.3.0,<0.4.0)
13
+ Requires-Dist: httpx (>=0.27.0)
14
+ Requires-Dist: keyring (>=25.0.0)
15
+ Requires-Dist: pydantic (>=2.0.0)
16
+ Requires-Dist: pyyaml (>=6.0.1)
17
+ Requires-Dist: questionary (>=2.0.1)
18
+ Requires-Dist: rich (>=13.7.0)
19
+ Requires-Dist: typer[all] (>=0.12.0)
@@ -0,0 +1,48 @@
1
+ flowstash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ flowstash/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ flowstash/commands/auth.py,sha256=s2g5EaeNSUYrOZ8ACgOTh64hDomDatABNeAsiBrZ6Zk,3711
4
+ flowstash/commands/build.py,sha256=5QoyVF7KMOMn4DGweri8v3YIOKwjWzmHlMzB5tiuCtA,5436
5
+ flowstash/commands/deploy.py,sha256=wsvBNxeVYvxMtT8ZPliS8LZS0AqMT5WEMA1NsJZzBLs,5606
6
+ flowstash/commands/project.py,sha256=TkBDkqR_M3bAD2l637A-VzvBwdIOf72LJ996Qa4hprg,21854
7
+ flowstash/commands/run.py,sha256=sS78gzu3PxKl6wHQXaf5DoLYgIDyQozvQT-yjvamt1s,2511
8
+ flowstash/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ flowstash/core/api_client.py,sha256=yflv8woxEov9TddF_HHTHaxl5NFj_US_9fG0R4S2hMY,2187
10
+ flowstash/core/auth_server.py,sha256=uzWfD3u_DlcywjuIJt94-9bnn2737TEjeP82nfkShOc,1430
11
+ flowstash/core/builder.py,sha256=YCb2wAMZe3uVHHYr3UK_632C-1bIKM6kU8TVSkBnqpY,1363
12
+ flowstash/core/config.py,sha256=6YjALGQrclNRizwUNxZEMt6IziJH4bh0bFK9VxZxsV4,2415
13
+ flowstash/core/docker_utils.py,sha256=9wHZpGYCGYNbKSDL5JXVIYg58hnMboiRzLI_48A6apQ,1094
14
+ flowstash/main.py,sha256=QQd2mVLte4_O_3h21CoyKv8mBjIh_noKT0v4enkICdE,10397
15
+ flowstash/templates/AGENTS.md,sha256=FNsdbJtArbC9feMAULoMTtghDZ9sq3tDU2CEceTHV6E,10429
16
+ flowstash/templates/README.md,sha256=12q4K4cbokfB3UXVUDxBEb5N6LrVfV7fHbr3AUUADhY,4029
17
+ flowstash/templates/_.dockerignore,sha256=53V65mJj_DjU_2LSksMAh7elbnzkhJexGbFB9QemU94,70
18
+ flowstash/templates/_.flowstash,sha256=lQ9fXt2cjzDWBtABzOt4jiBnyoRc9iuotwZ_d6hdZMQ,76
19
+ flowstash/templates/_api_main.py,sha256=cLnIFYq22v5dTfXsFBHSbwSpGvQZEXhZu7Ag9UhuKMg,722
20
+ flowstash/templates/_config/[env]/(backend-asyncio)/backend.yaml,sha256=ef0fMQ1vbNIW0RKps8vHJgYG_6Iy6ALHHI4bqXgyVos,54
21
+ flowstash/templates/_config/[env]/(backend-dramatiq)/backend.yaml,sha256=fTx8n1f2WA22z3VLBUfV7CUXSCcdKA5TaimREhunWHc,60
22
+ flowstash/templates/_config/[env]/(backend-managed)/backend.yaml,sha256=CR_-aOBf84noOIVrNCuZ5n1kgk7XYlhpkvtlZmJtTlk,57
23
+ flowstash/templates/_config/[env]/_backend.yaml,sha256=dK9efahcLHXodhL0CkD-LiEXv6zAcA75L-7th5OzD1Q,158
24
+ flowstash/templates/_config/shared/.env,sha256=qq999zp-1E-8oZszHZxssnJSZyxDozx7XHsDOMtvgE0,41
25
+ flowstash/templates/_config/shared/backend.yaml,sha256=hV30rtwDJy4oglI16Vbn0dskrVwdsbuVU-2O3sbSc8I,32
26
+ flowstash/templates/_config/shared/clients/demoClient.yaml,sha256=TmB-5Rgg0rZ74ivVzqDOkJAD4Qu-Ignxzxrqm8v8wvs,963
27
+ flowstash/templates/_config/shared/clients.yaml,sha256=aqoArjKb9ahOtzslFKmVMtwLFnqYLjn9kVyTZdJJo-4,49
28
+ flowstash/templates/_deployment/[env]/(backend-asyncio)/docker-compose.yaml,sha256=Xstg9ORblfsL22htxBQZzb76Fx3-Qwi0W8J7Bi3URvQ,559
29
+ flowstash/templates/_deployment/[env]/(backend-dramatiq)/docker-compose.yaml,sha256=edm7MYTDF5xUpYfHNu-CMdjOI4X4nBKsd_SDAWMZuFQ,763
30
+ flowstash/templates/_deployment/[env]/.env,sha256=Iw0A578jxupxe0hN-aWtCSkvOs9frgj_AOY5Cd1qqTs,119
31
+ flowstash/templates/_deployment/shared/.env,sha256=FpIm7BtTa05Dh0z8tWKO8Ixm1hlgojMLXs6nY5v-9D8,162
32
+ flowstash/templates/_deployment/shared/api.Dockerfile,sha256=FywDoQ4wekX9Apw5G_zHDbvjTX1anxZz-Agc1sufHfI,531
33
+ flowstash/templates/_deployment/shared/worker.Dockerfile,sha256=MukTdrpLOsnrx8XN3Uox_LJrfebfL94uPrXowgK1ZfU,535
34
+ flowstash/templates/_pyproject.toml,sha256=OHJRF0v7qd5hf1XZ8srWe_IhMeKoWeMToc16z9bFPH8,693
35
+ flowstash/templates/_src/_api/__init__.py,sha256=-HTwAJ8O401KTSPm8ZYja2d0RRn6oj1_SOFX75w-mT0,14
36
+ flowstash/templates/_src/_api/_routes/webhooks.py,sha256=TEEw1CwGQt7OgH7u9xzGcGHN5TARpLvGHGLil5_jcWE,800
37
+ flowstash/templates/_src/_shared/__init__.py,sha256=P11XqAJuEVcM9Am4Tn4es0H9E48pnGYBXtRc10De9Yk,17
38
+ flowstash/templates/_src/_shared/clients/client.py,sha256=02W4_uOvruQCfcp9OMAdbwzQX0P7R-bdB-3GT7hB36s,517
39
+ flowstash/templates/_src/_shared/models/models.py,sha256=zjYuPA68t5HoWgxhaFj5w1vtSpQdJei37B055ZX2lf8,35
40
+ flowstash/templates/_src/_shared/tasks/sharedTasks.py,sha256=-mh_Q592WTL3bM74Po8bsP3GH9nZFtD_c_qTP1oLWLo,311
41
+ flowstash/templates/_src/_worker/__init__.py,sha256=_xWl4-0UZsl0A-DWtN2RDUwL-lVyvLyKREuslcfnhWE,17
42
+ flowstash/templates/_src/_worker/tasks/tasks.py,sha256=9xwLnFEuCDWKwGVon9A5tRk5YYZN03628p8uKXGnNC0,355
43
+ flowstash/templates/_worker_main.py,sha256=ESOXX3dADtNdJYOrEnZXn8QE0NvySet4s1dcfpN1NSc,753
44
+ flowstash/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
+ flowstash_cli-0.1.0.dist-info/METADATA,sha256=fLjp0Hs_IH7UhGppPcv3GuvFaUsSB09j7NRiSEfe1vs,685
46
+ flowstash_cli-0.1.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
47
+ flowstash_cli-0.1.0.dist-info/entry_points.txt,sha256=kXE1OUPynuqBitecSKV6T694Wq5OdVNIskjthfVj9TE,48
48
+ flowstash_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.1.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ flowstash=flowstash.main:app
3
+