capawesome-cloud 0.1.0__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.
- capawesome_cloud-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +54 -0
- capawesome_cloud-0.1.0/.github/ISSUE_TEMPLATE/config.yml +4 -0
- capawesome_cloud-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +37 -0
- capawesome_cloud-0.1.0/.github/workflows/ci.yml +84 -0
- capawesome_cloud-0.1.0/.github/workflows/release.yml +77 -0
- capawesome_cloud-0.1.0/.gitignore +26 -0
- capawesome_cloud-0.1.0/CHANGELOG.md +5 -0
- capawesome_cloud-0.1.0/LICENSE +21 -0
- capawesome_cloud-0.1.0/PKG-INFO +321 -0
- capawesome_cloud-0.1.0/README.md +285 -0
- capawesome_cloud-0.1.0/examples/README.md +31 -0
- capawesome_cloud-0.1.0/examples/error_handling.py +27 -0
- capawesome_cloud-0.1.0/examples/list_apps.py +27 -0
- capawesome_cloud-0.1.0/examples/manage_live_updates.py +35 -0
- capawesome_cloud-0.1.0/examples/trigger_native_build.py +46 -0
- capawesome_cloud-0.1.0/pyproject.toml +86 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/__init__.py +58 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/_http.py +198 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/_types.py +23 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/_version.py +1 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/client.py +88 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/exceptions.py +136 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/models.py +190 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/pagination.py +72 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/py.typed +0 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/__init__.py +36 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/_base.py +100 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/apps.py +135 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/automations.py +109 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/build_sources.py +29 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/builds.py +195 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/certificates.py +153 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/channels.py +104 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/deployments.py +112 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/destinations.py +117 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/devices.py +68 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/environments.py +153 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/jobs.py +95 -0
- capawesome_cloud-0.1.0/src/capawesome_cloud/resources/webhooks.py +95 -0
- capawesome_cloud-0.1.0/tests/conftest.py +17 -0
- capawesome_cloud-0.1.0/tests/test_client.py +54 -0
- capawesome_cloud-0.1.0/tests/test_errors_and_retries.py +181 -0
- capawesome_cloud-0.1.0/tests/test_jobs.py +30 -0
- capawesome_cloud-0.1.0/tests/test_pagination.py +51 -0
- capawesome_cloud-0.1.0/tests/test_resources.py +92 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: 🚨 Bug report
|
|
2
|
+
title: 'bug: '
|
|
3
|
+
description: Create a bug report to help us improve
|
|
4
|
+
labels: ['bug/fix', 'needs: triage']
|
|
5
|
+
|
|
6
|
+
body:
|
|
7
|
+
- type: input
|
|
8
|
+
attributes:
|
|
9
|
+
label: Version
|
|
10
|
+
description: |
|
|
11
|
+
Let us know which version of the SDK you are using. You can find it by running `pip show capawesome-cloud`. Please make sure you are using the latest version before reporting an issue. Chances are that the bug you discovered has already been fixed in a subsequent version.
|
|
12
|
+
placeholder: 0.1.0
|
|
13
|
+
validations:
|
|
14
|
+
required: true
|
|
15
|
+
- type: textarea
|
|
16
|
+
attributes:
|
|
17
|
+
label: Current behavior
|
|
18
|
+
description: A concise description of what you're experiencing.
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
- type: textarea
|
|
22
|
+
attributes:
|
|
23
|
+
label: Expected behavior
|
|
24
|
+
description: A concise description of what you expected to happen.
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
- type: textarea
|
|
28
|
+
attributes:
|
|
29
|
+
label: Steps to reproduce
|
|
30
|
+
description: Steps to reproduce the behaviour using the provided example.
|
|
31
|
+
placeholder: |
|
|
32
|
+
1. In this environment...
|
|
33
|
+
2. With this config...
|
|
34
|
+
3. Run '...'
|
|
35
|
+
4. See error...
|
|
36
|
+
validations:
|
|
37
|
+
required: true
|
|
38
|
+
- type: textarea
|
|
39
|
+
attributes:
|
|
40
|
+
label: Other information
|
|
41
|
+
description: List any other information that is relevant to your issue. Operating system, Python version, etc.
|
|
42
|
+
- type: checkboxes
|
|
43
|
+
attributes:
|
|
44
|
+
label: Before submitting
|
|
45
|
+
description: |
|
|
46
|
+
A well-written bug report allows the maintainers to quickly recreate the necessary conditions to inspect the bug and quickly find its root cause.
|
|
47
|
+
Please ensure your bug report fulfills all of the following requirements.
|
|
48
|
+
options:
|
|
49
|
+
- label: I have read and followed the [bug report guidelines](https://capawesome.io/contributing/bug-reports/).
|
|
50
|
+
required: true
|
|
51
|
+
- label: I have attached links to possibly related issues and discussions.
|
|
52
|
+
required: true
|
|
53
|
+
- label: I understand that incomplete issues (e.g. without reproduction) are closed.
|
|
54
|
+
required: true
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: ⚡️ Feature request
|
|
2
|
+
title: 'feat: '
|
|
3
|
+
description: Suggest an idea for this project
|
|
4
|
+
labels: ['feature', 'needs: triage']
|
|
5
|
+
|
|
6
|
+
body:
|
|
7
|
+
- type: textarea
|
|
8
|
+
attributes:
|
|
9
|
+
label: Current problem
|
|
10
|
+
description: A clear and concise description of what the problem is.
|
|
11
|
+
placeholder: I'm always frustrated when [...]
|
|
12
|
+
validations:
|
|
13
|
+
required: true
|
|
14
|
+
- type: textarea
|
|
15
|
+
attributes:
|
|
16
|
+
label: Preferred solution
|
|
17
|
+
description: A clear and concise description of what you want to happen.
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
attributes:
|
|
22
|
+
label: Alternative options
|
|
23
|
+
description: A clear and concise description of any alternative solutions or features you've considered.
|
|
24
|
+
- type: textarea
|
|
25
|
+
attributes:
|
|
26
|
+
label: Additional context
|
|
27
|
+
description: Add any other context or screenshots about the feature request here.
|
|
28
|
+
- type: checkboxes
|
|
29
|
+
attributes:
|
|
30
|
+
label: Before submitting
|
|
31
|
+
description: |
|
|
32
|
+
Please ensure your idea fulfills all of the following requirements.
|
|
33
|
+
options:
|
|
34
|
+
- label: I have read and followed the [feature request guidelines](https://capawesome.io/contributing/feature-requests/).
|
|
35
|
+
required: true
|
|
36
|
+
- label: I have attached links to possibly related issues and discussions.
|
|
37
|
+
required: true
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- '**.md'
|
|
9
|
+
pull_request:
|
|
10
|
+
paths-ignore:
|
|
11
|
+
- '**.md'
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
env:
|
|
15
|
+
DEFAULT_PYTHON_VERSION: '3.12'
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
name: Build
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
- name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
28
|
+
cache: pip
|
|
29
|
+
cache-dependency-path: pyproject.toml
|
|
30
|
+
- name: Install build tooling
|
|
31
|
+
run: python -m pip install --upgrade pip build
|
|
32
|
+
- name: Build
|
|
33
|
+
run: python -m build
|
|
34
|
+
- name: Upload artifacts
|
|
35
|
+
uses: actions/upload-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: dist
|
|
38
|
+
path: dist
|
|
39
|
+
|
|
40
|
+
test:
|
|
41
|
+
name: Test (Python ${{ matrix.python-version }})
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
strategy:
|
|
44
|
+
fail-fast: false
|
|
45
|
+
matrix:
|
|
46
|
+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
|
47
|
+
steps:
|
|
48
|
+
- name: Checkout
|
|
49
|
+
uses: actions/checkout@v4
|
|
50
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
51
|
+
uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python-version }}
|
|
54
|
+
cache: pip
|
|
55
|
+
cache-dependency-path: pyproject.toml
|
|
56
|
+
- name: Install dependencies
|
|
57
|
+
run: |
|
|
58
|
+
python -m pip install --upgrade pip
|
|
59
|
+
pip install -e ".[dev]"
|
|
60
|
+
- name: Run tests
|
|
61
|
+
run: pytest
|
|
62
|
+
|
|
63
|
+
lint:
|
|
64
|
+
name: Lint
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
steps:
|
|
67
|
+
- name: Checkout
|
|
68
|
+
uses: actions/checkout@v4
|
|
69
|
+
- name: Set up Python ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
70
|
+
uses: actions/setup-python@v5
|
|
71
|
+
with:
|
|
72
|
+
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
73
|
+
cache: pip
|
|
74
|
+
cache-dependency-path: pyproject.toml
|
|
75
|
+
- name: Install dependencies
|
|
76
|
+
run: |
|
|
77
|
+
python -m pip install --upgrade pip
|
|
78
|
+
pip install -e ".[dev]"
|
|
79
|
+
- name: Check formatting
|
|
80
|
+
run: ruff format --check src tests examples
|
|
81
|
+
- name: Run linter
|
|
82
|
+
run: ruff check src tests examples
|
|
83
|
+
- name: Run type checking
|
|
84
|
+
run: mypy
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishes the package to (Test)PyPI via Trusted Publishing (OIDC) — no API
|
|
4
|
+
# tokens are stored. Run manually and pick the target index: publish to
|
|
5
|
+
# `testpypi` first, verify, then run again with `pypi`.
|
|
6
|
+
on:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
target:
|
|
10
|
+
description: Package index to publish to
|
|
11
|
+
required: true
|
|
12
|
+
type: choice
|
|
13
|
+
default: testpypi
|
|
14
|
+
options:
|
|
15
|
+
- testpypi
|
|
16
|
+
- pypi
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
name: Build
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: '3.12'
|
|
29
|
+
- name: Build distributions
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip build
|
|
32
|
+
python -m build
|
|
33
|
+
- name: Check distributions
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install --upgrade twine
|
|
36
|
+
python -m twine check dist/*
|
|
37
|
+
- name: Upload distributions
|
|
38
|
+
uses: actions/upload-artifact@v4
|
|
39
|
+
with:
|
|
40
|
+
name: dist
|
|
41
|
+
path: dist/
|
|
42
|
+
|
|
43
|
+
publish-testpypi:
|
|
44
|
+
name: Publish to TestPyPI
|
|
45
|
+
if: ${{ inputs.target == 'testpypi' }}
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment: testpypi
|
|
49
|
+
permissions:
|
|
50
|
+
id-token: write
|
|
51
|
+
steps:
|
|
52
|
+
- name: Download distributions
|
|
53
|
+
uses: actions/download-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: dist
|
|
56
|
+
path: dist/
|
|
57
|
+
- name: Publish
|
|
58
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
59
|
+
with:
|
|
60
|
+
repository-url: https://test.pypi.org/legacy/
|
|
61
|
+
|
|
62
|
+
publish-pypi:
|
|
63
|
+
name: Publish to PyPI
|
|
64
|
+
if: ${{ inputs.target == 'pypi' }}
|
|
65
|
+
needs: build
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
environment: pypi
|
|
68
|
+
permissions:
|
|
69
|
+
id-token: write
|
|
70
|
+
steps:
|
|
71
|
+
- name: Download distributions
|
|
72
|
+
uses: actions/download-artifact@v4
|
|
73
|
+
with:
|
|
74
|
+
name: dist
|
|
75
|
+
path: dist/
|
|
76
|
+
- name: Publish
|
|
77
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
*.egg
|
|
9
|
+
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
env/
|
|
14
|
+
|
|
15
|
+
# Tooling caches
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.coverage
|
|
20
|
+
htmlcov/
|
|
21
|
+
coverage.xml
|
|
22
|
+
|
|
23
|
+
# Editors / OS
|
|
24
|
+
.idea/
|
|
25
|
+
.vscode/
|
|
26
|
+
.DS_Store
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Robin Genz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: capawesome-cloud
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for the Capawesome Cloud API
|
|
5
|
+
Project-URL: Homepage, https://capawesome.io/cloud
|
|
6
|
+
Project-URL: Documentation, https://cloud.capawesome.io/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/capawesome-team/cloud-python
|
|
8
|
+
Project-URL: API Reference, https://api.cloud.capawesome.io/openapi
|
|
9
|
+
Author-email: Capawesome Team <support@capawesome.io>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: api,capacitor,capawesome,live-updates,sdk
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Requires-Dist: httpx<1,>=0.27
|
|
27
|
+
Requires-Dist: pydantic<3,>=2.7
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: commitizen>=3.29; extra == 'dev'
|
|
30
|
+
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-cov>=5; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
33
|
+
Requires-Dist: respx>=0.21; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# capawesome-cloud
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/capawesome-cloud/)
|
|
40
|
+
[](https://pypi.org/project/capawesome-cloud/)
|
|
41
|
+
[](https://github.com/capawesome-team/cloud-python/blob/main/LICENSE)
|
|
42
|
+
|
|
43
|
+
Python SDK for the [Capawesome Cloud](https://capawesome.io/cloud/) API.
|
|
44
|
+
|
|
45
|
+
It provides a fully typed, synchronous interface for managing apps, live update channels and deployments, native builds, app store destinations, and more.
|
|
46
|
+
|
|
47
|
+
> **Note:** The Capawesome Cloud API is still in development and may change without notice. Response types intentionally expose only the most relevant properties to minimize breaking changes.
|
|
48
|
+
|
|
49
|
+
## SDKs
|
|
50
|
+
|
|
51
|
+
Official SDKs for the Capawesome Cloud API:
|
|
52
|
+
|
|
53
|
+
| Language | Package | Repository |
|
|
54
|
+
| -------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------- |
|
|
55
|
+
| Node.js | [`@capawesome/cloud-sdk`](https://www.npmjs.com/package/@capawesome/cloud-sdk) | [cloud-node](https://github.com/capawesome-team/cloud-node) |
|
|
56
|
+
| Python | [`capawesome-cloud`](https://pypi.org/project/capawesome-cloud/) | [cloud-python](https://github.com/capawesome-team/cloud-python) |
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install capawesome-cloud
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Requirements:** Python 3.9 or later.
|
|
65
|
+
|
|
66
|
+
## Getting started
|
|
67
|
+
|
|
68
|
+
Create an API token in the [Capawesome Cloud Console](https://console.cloud.capawesome.io/settings/tokens) and pass it to the client (or set the `CAPAWESOME_CLOUD_TOKEN` environment variable, with `CAPAWESOME_TOKEN` accepted as a fallback):
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from capawesome_cloud import CapawesomeCloud
|
|
72
|
+
|
|
73
|
+
client = CapawesomeCloud(token="cap_...")
|
|
74
|
+
|
|
75
|
+
for app in client.apps.list():
|
|
76
|
+
print(app.id, app.name)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The client holds a connection pool, so reuse a single instance. Use it as a context manager (or call `client.close()`) to release connections when done:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
with CapawesomeCloud(token="cap_...") as client:
|
|
83
|
+
...
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Configuration
|
|
87
|
+
|
|
88
|
+
| Option | Type | Default | Description |
|
|
89
|
+
| ---------------- | --------------- | --------------------------------- | ---------------------------------------------------------- |
|
|
90
|
+
| `token` | `str` | `CAPAWESOME_CLOUD_TOKEN` env var | API token used to authenticate. |
|
|
91
|
+
| `base_url` | `str` | `https://api.cloud.capawesome.io` | Base URL of the API (for self-hosting/testing). |
|
|
92
|
+
| `timeout` | `float` | `30.0` | Request timeout in seconds. |
|
|
93
|
+
| `max_retries` | `int` | `2` | Retries with exponential backoff. `429` is retried for any request; network/`5xx` failures are retried only for idempotent methods (GET/PUT/DELETE), never `POST`/`PATCH`. |
|
|
94
|
+
| `backoff_factor` | `float` | `0.5` | Base delay for the retry backoff. |
|
|
95
|
+
| `http_client` | `httpx.Client` | `None` | Bring your own pre-configured `httpx.Client`. |
|
|
96
|
+
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
Resources mirror the API's path hierarchy. App-scoped resources are nested under `client.apps.*`; organization-scoped resources are on the client directly (e.g. `client.jobs`). Every app-scoped method takes `app_id` as its first argument.
|
|
100
|
+
|
|
101
|
+
### Apps
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
apps = client.apps.list()
|
|
105
|
+
app = client.apps.get(app_id)
|
|
106
|
+
created = client.apps.create(name="My App", type="capacitor")
|
|
107
|
+
client.apps.update(app_id, name="Renamed App")
|
|
108
|
+
client.apps.delete(app_id)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Live updates
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# Create a channel
|
|
115
|
+
channel = client.apps.channels.create(app_id, name="production")
|
|
116
|
+
|
|
117
|
+
# Pause / resume a channel
|
|
118
|
+
client.apps.channels.pause(app_id, channel.id)
|
|
119
|
+
client.apps.channels.resume(app_id, channel.id)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Deployments
|
|
123
|
+
|
|
124
|
+
Promote a build to a channel (live updates) or a destination (app store publishing):
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
deployment = client.apps.deployments.create(
|
|
128
|
+
app_id,
|
|
129
|
+
app_build_id=app_build_id,
|
|
130
|
+
app_channel_name="production",
|
|
131
|
+
rollout_percentage=0.5,
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Native builds
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
build = client.apps.builds.create(app_id, platform="ios", git_ref="main")
|
|
139
|
+
|
|
140
|
+
# Poll the job that processes the build until it finishes
|
|
141
|
+
job = client.jobs.wait(build.job_id)
|
|
142
|
+
print(job.status)
|
|
143
|
+
|
|
144
|
+
logs = client.jobs.logs(job.id)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Build artifacts
|
|
148
|
+
|
|
149
|
+
Binary downloads return `bytes`:
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
data = client.apps.builds.artifacts.download(app_id, build_id, artifact_id)
|
|
153
|
+
with open("artifact.ipa", "wb") as file:
|
|
154
|
+
file.write(data)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
You can also obtain a signed, time-limited download URL:
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
result = client.apps.builds.artifacts.get_download_url(app_id, build_id, artifact_id)
|
|
161
|
+
print(result["url"])
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### Certificates
|
|
165
|
+
|
|
166
|
+
`file` may be a path, raw `bytes`, or an open binary file object:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
import os
|
|
170
|
+
|
|
171
|
+
certificate = client.apps.certificates.create(
|
|
172
|
+
app_id,
|
|
173
|
+
name="Distribution Certificate",
|
|
174
|
+
platform="ios",
|
|
175
|
+
type="production",
|
|
176
|
+
file="distribution.p12",
|
|
177
|
+
password=os.environ["CERT_PASSWORD"],
|
|
178
|
+
)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Environments, secrets & variables
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
environment = client.apps.environments.create(app_id, name="production")
|
|
185
|
+
|
|
186
|
+
client.apps.environments.secrets.create(
|
|
187
|
+
app_id,
|
|
188
|
+
environment.id,
|
|
189
|
+
key="API_KEY",
|
|
190
|
+
value=os.environ["API_KEY"],
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
client.apps.environments.variables.create(
|
|
194
|
+
app_id,
|
|
195
|
+
environment.id,
|
|
196
|
+
key="API_URL",
|
|
197
|
+
value="https://api.example.com",
|
|
198
|
+
)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Pagination
|
|
202
|
+
|
|
203
|
+
List methods return an iterator that lazily pages through **all** results:
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
for device in client.apps.devices.list(app_id):
|
|
207
|
+
print(device.id, device.app_version_name)
|
|
208
|
+
|
|
209
|
+
# Collect everything into a list
|
|
210
|
+
channels = client.apps.channels.list(app_id).to_list()
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
To fetch a single page (for manual offset control), use `list_page()`:
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
page = client.apps.channels.list_page(app_id, limit=20, offset=0)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Responses
|
|
220
|
+
|
|
221
|
+
Responses are typed [Pydantic](https://docs.pydantic.dev) models. App-scoped models are prefixed with `App` (`AppChannel`, `AppWebhook`, `AppBuild`, ...) to match the API's entity names. Only the most relevant fields are declared; any additional fields the API returns are still accessible (e.g. via `model_dump()`) but are **not part of the public contract** and should not be relied upon.
|
|
222
|
+
|
|
223
|
+
```python
|
|
224
|
+
channel = client.apps.channels.get(app_id, channel_id)
|
|
225
|
+
print(channel.name, channel.created_at) # documented fields
|
|
226
|
+
print(channel.model_dump()) # full raw payload, incl. extra fields
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Clearing fields
|
|
230
|
+
|
|
231
|
+
Update methods only send the arguments you pass. To **clear** a nullable field, pass `None`; omit the argument to leave it unchanged.
|
|
232
|
+
|
|
233
|
+
```python
|
|
234
|
+
# Pin a device to a channel
|
|
235
|
+
client.apps.devices.update(app_id, device_id, forced_app_channel_id="ch_123")
|
|
236
|
+
|
|
237
|
+
# Unpin it again (sends null)
|
|
238
|
+
client.apps.devices.update(app_id, device_id, forced_app_channel_id=None)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Available resources
|
|
242
|
+
|
|
243
|
+
| Resource | Description |
|
|
244
|
+
| ----------------------------------- | --------------------------------------------------- |
|
|
245
|
+
| `client.apps` | Create, read, update, delete and transfer apps. |
|
|
246
|
+
| `client.apps.channels` | Manage live update channels (incl. pause/resume). |
|
|
247
|
+
| `client.apps.deployments` | Promote builds to channels or destinations. |
|
|
248
|
+
| `client.apps.builds` | Trigger and manage native builds. |
|
|
249
|
+
| `client.apps.builds.artifacts` | List and download build artifacts. |
|
|
250
|
+
| `client.apps.build_sources` | Register and download native build sources. |
|
|
251
|
+
| `client.apps.certificates` | Manage signing certificates. |
|
|
252
|
+
| `client.apps.destinations` | Manage app store publishing destinations. |
|
|
253
|
+
| `client.apps.environments` | Manage environments, secrets and variables. |
|
|
254
|
+
| `client.apps.automations` | Manage build automations. |
|
|
255
|
+
| `client.apps.devices` | Manage registered devices. |
|
|
256
|
+
| `client.apps.webhooks` | Manage app webhooks. |
|
|
257
|
+
| `client.jobs` | Inspect background jobs and their logs. |
|
|
258
|
+
|
|
259
|
+
## Error handling
|
|
260
|
+
|
|
261
|
+
Any non-2xx response is raised as a `CapawesomeCloudError`, carrying the HTTP `status`, the `message` from the API, and the raw `body`:
|
|
262
|
+
|
|
263
|
+
```python
|
|
264
|
+
from capawesome_cloud import CapawesomeCloud, CapawesomeCloudError
|
|
265
|
+
|
|
266
|
+
client = CapawesomeCloud(token="cap_...")
|
|
267
|
+
|
|
268
|
+
try:
|
|
269
|
+
client.apps.get("unknown")
|
|
270
|
+
except CapawesomeCloudError as error:
|
|
271
|
+
print(error.status) # 404
|
|
272
|
+
print(error.status_text) # "Not Found"
|
|
273
|
+
print(error.message) # "App not found."
|
|
274
|
+
print(error.body) # {"message": "App not found."}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Network failures raise `APIConnectionError` / `APITimeoutError`, which also derive from `CapawesomeCloudError` — so a single `except CapawesomeCloudError` catches every error the SDK can raise. For those, `status` is `None`.
|
|
278
|
+
|
|
279
|
+
## Development
|
|
280
|
+
|
|
281
|
+
### Setup
|
|
282
|
+
|
|
283
|
+
Clone the repository, then create a virtual environment and install the package with its development dependencies:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
python -m venv .venv && source .venv/bin/activate
|
|
287
|
+
pip install -e ".[dev]"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Commit messages follow [Conventional Commits](https://www.conventionalcommits.org), enforced by [Commitizen](https://commitizen-tools.github.io/commitizen/) — run `cz commit` for a guided prompt. Common commands during development:
|
|
291
|
+
|
|
292
|
+
| Command | Description |
|
|
293
|
+
| ------------------------------------------ | -------------------------------------- |
|
|
294
|
+
| `python -m build` | Build the package into `dist/`. |
|
|
295
|
+
| `ruff check src tests examples` | Run the linter. |
|
|
296
|
+
| `ruff format src tests examples` | Auto-format the code. |
|
|
297
|
+
| `ruff format --check src tests examples` | Check formatting without writing. |
|
|
298
|
+
| `mypy` | Type-check the package. |
|
|
299
|
+
| `cz commit` | Create a Conventional Commit. |
|
|
300
|
+
|
|
301
|
+
### Testing
|
|
302
|
+
|
|
303
|
+
Tests are written with [pytest](https://docs.pytest.org) and live in the `tests/` directory. HTTP is mocked with [RESPX](https://lundberg.github.io/respx/), so the suite makes no network calls:
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
pytest # run the suite once
|
|
307
|
+
pytest --cov=capawesome_cloud # run with a coverage report
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Publishing
|
|
311
|
+
|
|
312
|
+
Releases are driven by [Commitizen](https://commitizen-tools.github.io/commitizen/), which derives the next version and changelog entries from [Conventional Commits](https://www.conventionalcommits.org).
|
|
313
|
+
|
|
314
|
+
1. Make sure `main` is up to date and CI is green.
|
|
315
|
+
2. Run `cz bump`. This bumps the version (in `[tool.commitizen]` and `src/capawesome_cloud/_version.py`), regenerates `CHANGELOG.md`, and creates a release commit plus a matching `vX.Y.Z` tag — all locally, nothing is pushed yet. Pass `--dry-run` first if you want to preview the result.
|
|
316
|
+
3. Review the generated commit and changelog, then push everything: `git push --follow-tags origin main`.
|
|
317
|
+
4. Build the distributions with `python -m build`, then publish to PyPI with `python -m twine upload dist/*` (requires `pip install build twine`).
|
|
318
|
+
|
|
319
|
+
## License
|
|
320
|
+
|
|
321
|
+
See [LICENSE](./LICENSE).
|