Skip to content

Commit 1dcaffd

Browse files
committed
feat: init for fiscal document service package
1 parent 62f1746 commit 1dcaffd

File tree

81 files changed

+10402
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+10402
-1
lines changed

.github/workflows/publish.yaml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: Publish new version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Optional version to use (bypasses version bump and git commits if provided)'
8+
required: false
9+
default: ""
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
generate-api-docs:
16+
name: Update version and build python module
17+
runs-on: ubuntu-latest
18+
permissions:
19+
id-token: write
20+
contents: read
21+
steps:
22+
- name: Configure AWS credentials
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
role-to-assume: arn:aws:iam::048781935247:role/GH-APP-OIDC-CBMyFrontDesk
26+
aws-region: us-west-2
27+
28+
- name: Get app private key from SSM and apply mask
29+
id: app-private-key
30+
shell: bash
31+
run: |
32+
aws ssm get-parameter --name /github/app/CBMyFrontDesk/private-key --output text --with-decryption --query Parameter.Value > private.key
33+
{
34+
echo "key<<EOF"
35+
cat private.key
36+
echo "EOF"
37+
} >> $GITHUB_OUTPUT
38+
while read -r line;
39+
do
40+
if [[ -n "${line}" ]]; then
41+
echo "::add-mask::${line}"
42+
fi
43+
done < private.key
44+
rm private.key
45+
46+
- name: Generate token
47+
id: generate-token
48+
uses: tibdex/github-app-token@v2
49+
with:
50+
app_id: 391670
51+
private_key: ${{ steps.app-private-key.outputs.key }}
52+
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
with:
56+
token: ${{ steps.generate-token.outputs.token }}
57+
58+
- name: Get API docs
59+
run: |
60+
curl -sL -o fiscal-document-openapi.yaml https://api.us2.cloudbeds.com/fiscal-document/openapi.yaml
61+
62+
- name: Get next version
63+
run: |
64+
if [ -n "${{ inputs.version }}" ]; then
65+
echo "next_version=${{ inputs.version }}" >> $GITHUB_ENV
66+
echo "Version provided: ${{ inputs.version }}"
67+
else
68+
current_version=$(cat VERSION)
69+
echo "Current version: $current_version"
70+
71+
IFS='.' read -r major minor patch <<< "$current_version"
72+
minor=$((minor + 1))
73+
next_version="$major.$minor.$patch"
74+
echo "Next version: $next_version"
75+
76+
echo "next_version=$next_version" >> $GITHUB_ENV
77+
fi
78+
79+
- name: Setup Java
80+
uses: actions/setup-java@v4
81+
with:
82+
java-version: 23
83+
distribution: corretto
84+
85+
- name: Install OpenAPI generator
86+
run: |
87+
OPENAPI_GENERATOR_VERSION=$(cat .openapi-generator/VERSION)
88+
curl -s https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$OPENAPI_GENERATOR_VERSION/openapi-generator-cli-$OPENAPI_GENERATOR_VERSION.jar -o openapi-generator-cli.jar
89+
90+
- name: Bump version in VERSION and openapitools.json
91+
run: |
92+
echo ${{ env.next_version }} > VERSION
93+
sed -i 's/"packageVersion": "[0-9]*\.[0-9]*\.[0-9]*"/"packageVersion": "${{ env.next_version }}"/' openapitools.json
94+
95+
- name: Generate API docs
96+
run: |
97+
find $(cat PACKAGE) -mindepth 1 ! -name 'py.typed' -delete
98+
java -jar openapi-generator-cli.jar generate -c openapitools.json
99+
100+
- name: Git Setup
101+
if: inputs.version == ''
102+
run: |
103+
git config --global user.name "github-actions"
104+
git config --global user.email "[email protected]"
105+
106+
- name: Update repository with new version
107+
if: inputs.version == ''
108+
run: |
109+
git add VERSION openapitools.json $(cat PACKAGE) README.md .openapi-generator/FILES
110+
git commit -m "Bump version to ${{ env.next_version }}"
111+
git push
112+
113+
build-release:
114+
name: Build release distribution
115+
runs-on: ubuntu-latest
116+
needs: generate-api-docs
117+
env:
118+
UV_VERSION: 0.5.31
119+
steps:
120+
- name: Checkout code
121+
uses: actions/checkout@v4
122+
with:
123+
ref: ${{ github.ref_name }}
124+
125+
- name: Setup Python
126+
uses: actions/setup-python@v5
127+
with:
128+
python-version-file: .python-version
129+
130+
- name: Build release distributions
131+
run: |
132+
pip install "uv==${{ env.UV_VERSION }}"
133+
uv sync --locked --no-dev
134+
uv build
135+
136+
- name: Upload distributions
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: release-dists
140+
path: dist/
141+
142+
- name: Create Release
143+
if: inputs.version == ''
144+
env:
145+
GITHUB_TOKEN: ${{ github.token }}
146+
run: >-
147+
gh release create $(cat VERSION)
148+
--notes $(cat VERSION)
149+
--target ${{ github.ref_name }}
150+
--title $(cat VERSION)
151+
152+
pypi-publish:
153+
name: Publish to PyPI
154+
runs-on: ubuntu-latest
155+
needs: build-release
156+
environment:
157+
name: pypi
158+
permissions:
159+
id-token: write
160+
steps:
161+
- name: Retrieve release distributions
162+
uses: actions/download-artifact@v4
163+
with:
164+
name: release-dists
165+
path: dist/
166+
167+
- name: Publish release distributions to PyPI
168+
uses: pypa/gh-action-pypi-publish@release/v1
169+
with:
170+
packages-dir: dist/

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv
11+
.idea
12+
13+
fiscal-document-openapi.yaml
14+
*.jar

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/FILES

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
README.md
2+
cloudbeds_fiscal_document/__init__.py
3+
cloudbeds_fiscal_document/api/__init__.py
4+
cloudbeds_fiscal_document/api/configs_api.py
5+
cloudbeds_fiscal_document/api/fiscal_documents_api.py
6+
cloudbeds_fiscal_document/api_client.py
7+
cloudbeds_fiscal_document/api_response.py
8+
cloudbeds_fiscal_document/configuration.py
9+
cloudbeds_fiscal_document/docs/ApiError.md
10+
cloudbeds_fiscal_document/docs/ConfigsApi.md
11+
cloudbeds_fiscal_document/docs/ConfigsResponse.md
12+
cloudbeds_fiscal_document/docs/ConfigsUpdateRequest.md
13+
cloudbeds_fiscal_document/docs/CreateCreditNoteRequest.md
14+
cloudbeds_fiscal_document/docs/CreateInvoiceRequest.md
15+
cloudbeds_fiscal_document/docs/FiscalDocumentDetailedResponse.md
16+
cloudbeds_fiscal_document/docs/FiscalDocumentEmailRequest.md
17+
cloudbeds_fiscal_document/docs/FiscalDocumentKind.md
18+
cloudbeds_fiscal_document/docs/FiscalDocumentPaginated.md
19+
cloudbeds_fiscal_document/docs/FiscalDocumentPatchRequest.md
20+
cloudbeds_fiscal_document/docs/FiscalDocumentStatus.md
21+
cloudbeds_fiscal_document/docs/FiscalDocumentSummaryResponse.md
22+
cloudbeds_fiscal_document/docs/FiscalDocumentTransactionResponse.md
23+
cloudbeds_fiscal_document/docs/FiscalDocumentTransactionsPaginated.md
24+
cloudbeds_fiscal_document/docs/FiscalDocumentsApi.md
25+
cloudbeds_fiscal_document/docs/GovernmentIntegration.md
26+
cloudbeds_fiscal_document/docs/GovernmentIntegrationQr.md
27+
cloudbeds_fiscal_document/docs/SourceKind.md
28+
cloudbeds_fiscal_document/exceptions.py
29+
cloudbeds_fiscal_document/models/__init__.py
30+
cloudbeds_fiscal_document/models/api_error.py
31+
cloudbeds_fiscal_document/models/configs_response.py
32+
cloudbeds_fiscal_document/models/configs_update_request.py
33+
cloudbeds_fiscal_document/models/create_credit_note_request.py
34+
cloudbeds_fiscal_document/models/create_invoice_request.py
35+
cloudbeds_fiscal_document/models/fiscal_document_detailed_response.py
36+
cloudbeds_fiscal_document/models/fiscal_document_email_request.py
37+
cloudbeds_fiscal_document/models/fiscal_document_kind.py
38+
cloudbeds_fiscal_document/models/fiscal_document_paginated.py
39+
cloudbeds_fiscal_document/models/fiscal_document_patch_request.py
40+
cloudbeds_fiscal_document/models/fiscal_document_status.py
41+
cloudbeds_fiscal_document/models/fiscal_document_summary_response.py
42+
cloudbeds_fiscal_document/models/fiscal_document_transaction_response.py
43+
cloudbeds_fiscal_document/models/fiscal_document_transactions_paginated.py
44+
cloudbeds_fiscal_document/models/government_integration.py
45+
cloudbeds_fiscal_document/models/government_integration_qr.py
46+
cloudbeds_fiscal_document/models/source_kind.py
47+
cloudbeds_fiscal_document/rest.py
48+
cloudbeds_fiscal_document/test/__init__.py

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.11.0

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2025 Cloudbeds (http://cloudbeds.com)
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
13+
all 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
21+
THE SOFTWARE.

PACKAGE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cloudbeds_fiscal_document

0 commit comments

Comments
 (0)