Skip to content

Commit 148133c

Browse files
feat: update API client methods
API changes: - Update API client - Update API client - Update API client - Update API client - Update API client - ... and 6 more API files Model changes: - Add pdf_variant model - Update __init__ model - Update account_info_response model - Update app_routers_v1_pdf_async_export_type model - Update app_routers_v1_pdf_export_type model - ... and 20 more model files Generated from OpenAPI spec v1.7.0
1 parent 2079070 commit 148133c

67 files changed

Lines changed: 301 additions & 174 deletions

File tree

Some content is hidden

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

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "templatefox"
3-
version = "1.6.1"
3+
version = "1.7.0"
44
description = "Official TemplateFox Python SDK - Generate PDFs from HTML templates"
55
license = {text = "MIT"}
66
authors = [
@@ -13,7 +13,7 @@ requires-python = ">=3.9"
1313
dependencies = [
1414
"urllib3 (>=2.1.0,<3.0.0)",
1515
"python-dateutil (>=2.8.2)",
16-
"pydantic (>=2)",
16+
"pydantic (>=2.11)",
1717
"typing-extensions (>=4.7.1)",
1818
]
1919

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
urllib3 >= 2.1.0, < 3.0.0
22
python_dateutil >= 2.8.2
3-
pydantic >= 2
3+
pydantic >= 2.11
44
typing-extensions >= 4.7.1

setup.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# coding: utf-8
2-
31
"""
42
TemplateFox API
53
64
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
75
8-
The version of the OpenAPI document: 1.6.1
6+
The version of the OpenAPI document: 1.7.0
97
Contact: support@pdftemplateapi.com
108
Generated by OpenAPI Generator (https://openapi-generator.tech)
119
@@ -22,12 +20,12 @@
2220
# prerequisite: setuptools
2321
# http://pypi.python.org/pypi/setuptools
2422
NAME = "templatefox"
25-
VERSION = "1.6.1"
23+
VERSION = "1.7.0"
2624
PYTHON_REQUIRES = ">= 3.9"
2725
REQUIRES = [
2826
"urllib3 >= 2.1.0, < 3.0.0",
2927
"python-dateutil >= 2.8.2",
30-
"pydantic >= 2",
28+
"pydantic >= 2.11",
3129
"typing-extensions >= 4.7.1",
3230
]
3331

@@ -47,4 +45,4 @@
4745
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
4846
""", # noqa: E501
4947
package_data={"templatefox": ["py.typed"]},
50-
)
48+
)

templatefox/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
88
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
99
10-
The version of the OpenAPI document: 1.6.1
10+
The version of the OpenAPI document: 1.7.0
1111
Contact: support@pdftemplateapi.com
1212
Generated by OpenAPI Generator (https://openapi-generator.tech)
1313
1414
Do not edit the class manually.
1515
""" # noqa: E501
1616

1717

18-
__version__ = "1.6.1"
18+
__version__ = "1.7.0"
1919

2020
# Define package exports
2121
__all__ = [
@@ -45,6 +45,7 @@
4545
"JobStatus",
4646
"JobStatusResponse",
4747
"LocationInner",
48+
"PdfVariant",
4849
"S3ConfigRequest",
4950
"S3ConfigResponse",
5051
"S3SuccessResponse",
@@ -89,6 +90,7 @@
8990
from templatefox.models.job_status import JobStatus as JobStatus
9091
from templatefox.models.job_status_response import JobStatusResponse as JobStatusResponse
9192
from templatefox.models.location_inner import LocationInner as LocationInner
93+
from templatefox.models.pdf_variant import PdfVariant as PdfVariant
9294
from templatefox.models.s3_config_request import S3ConfigRequest as S3ConfigRequest
9395
from templatefox.models.s3_config_response import S3ConfigResponse as S3ConfigResponse
9496
from templatefox.models.s3_success_response import S3SuccessResponse as S3SuccessResponse

templatefox/api/account_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# coding: utf-8
2-
31
"""
42
TemplateFox API
53
64
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
75
8-
The version of the OpenAPI document: 1.6.1
6+
The version of the OpenAPI document: 1.7.0
97
Contact: support@pdftemplateapi.com
108
Generated by OpenAPI Generator (https://openapi-generator.tech)
119
1210
Do not edit the class manually.
1311
""" # noqa: E501
1412

13+
1514
import warnings
1615
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1716
from typing import Any, Dict, List, Optional, Tuple, Union

templatefox/api/integrations_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# coding: utf-8
2-
31
"""
42
TemplateFox API
53
64
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
75
8-
The version of the OpenAPI document: 1.6.1
6+
The version of the OpenAPI document: 1.7.0
97
Contact: support@pdftemplateapi.com
108
Generated by OpenAPI Generator (https://openapi-generator.tech)
119
1210
Do not edit the class manually.
1311
""" # noqa: E501
1412

13+
1514
import warnings
1615
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1716
from typing import Any, Dict, List, Optional, Tuple, Union

templatefox/api/pdf_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# coding: utf-8
2-
31
"""
42
TemplateFox API
53
64
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
75
8-
The version of the OpenAPI document: 1.6.1
6+
The version of the OpenAPI document: 1.7.0
97
Contact: support@pdftemplateapi.com
108
Generated by OpenAPI Generator (https://openapi-generator.tech)
119
1210
Do not edit the class manually.
1311
""" # noqa: E501
1412

13+
1514
import warnings
1615
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1716
from typing import Any, Dict, List, Optional, Tuple, Union

templatefox/api/pdf_async_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# coding: utf-8
2-
31
"""
42
TemplateFox API
53
64
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
75
8-
The version of the OpenAPI document: 1.6.1
6+
The version of the OpenAPI document: 1.7.0
97
Contact: support@pdftemplateapi.com
108
Generated by OpenAPI Generator (https://openapi-generator.tech)
119
1210
Do not edit the class manually.
1311
""" # noqa: E501
1412

13+
1514
import warnings
1615
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1716
from typing import Any, Dict, List, Optional, Tuple, Union

templatefox/api/templates_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# coding: utf-8
2-
31
"""
42
TemplateFox API
53
64
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
75
8-
The version of the OpenAPI document: 1.6.1
6+
The version of the OpenAPI document: 1.7.0
97
Contact: support@pdftemplateapi.com
108
Generated by OpenAPI Generator (https://openapi-generator.tech)
119
1210
Do not edit the class manually.
1311
""" # noqa: E501
1412

13+
1514
import warnings
1615
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1716
from typing import Any, Dict, List, Optional, Tuple, Union

templatefox/api_client.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# coding: utf-8
2-
31
"""
42
TemplateFox API
53
64
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
75
8-
The version of the OpenAPI document: 1.6.1
6+
The version of the OpenAPI document: 1.7.0
97
Contact: support@pdftemplateapi.com
108
Generated by OpenAPI Generator (https://openapi-generator.tech)
119
1210
Do not edit the class manually.
1311
""" # noqa: E501
1412

1513

14+
1615
import datetime
1716
from dateutil.parser import parse
1817
from enum import Enum
@@ -70,6 +69,7 @@ class ApiClient:
7069
'date': datetime.date,
7170
'datetime': datetime.datetime,
7271
'decimal': decimal.Decimal,
72+
'UUID': uuid.UUID,
7373
'object': object,
7474
}
7575
_pool = None
@@ -92,7 +92,7 @@ def __init__(
9292
self.default_headers[header_name] = header_value
9393
self.cookie = cookie
9494
# Set default User-Agent.
95-
self.user_agent = 'OpenAPI-Generator/1.6.1/python'
95+
self.user_agent = 'OpenAPI-Generator/1.7.0/python'
9696
self.client_side_validation = configuration.client_side_validation
9797

9898
def __enter__(self):
@@ -307,7 +307,7 @@ def response_deserialize(
307307
response_text = None
308308
return_data = None
309309
try:
310-
if response_type == "bytearray":
310+
if response_type in ("bytearray", "bytes"):
311311
return_data = response_data.data
312312
elif response_type == "file":
313313
return_data = self.__deserialize_file(response_data)
@@ -469,6 +469,8 @@ def __deserialize(self, data, klass):
469469
return self.__deserialize_datetime(data)
470470
elif klass is decimal.Decimal:
471471
return decimal.Decimal(data)
472+
elif klass is uuid.UUID:
473+
return uuid.UUID(data)
472474
elif issubclass(klass, Enum):
473475
return self.__deserialize_enum(data, klass)
474476
else:
@@ -709,7 +711,9 @@ def __deserialize_file(self, response):
709711
content_disposition
710712
)
711713
assert m is not None, "Unexpected 'content-disposition' header value"
712-
filename = m.group(1)
714+
filename = os.path.basename(m.group(1)) # Strip any directory traversal
715+
if filename in ("", ".", ".."): # fall back to tmp filename
716+
filename = os.path.basename(path)
713717
path = os.path.join(os.path.dirname(path), filename)
714718

715719
with open(path, "wb") as f:

0 commit comments

Comments
 (0)