Skip to content

Commit 969cb68

Browse files
committed
Test the release workflow (a throwaway branch, not a release)
1 parent e83ebda commit 969cb68

55 files changed

Lines changed: 972 additions & 289 deletions

Some content is hidden

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

‎.github/workflows/release.yml‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Written by DocSpring/docspring's api_clients/scripts/generate from api_clients/github_workflows/python/release.yml:
2+
# change it there.
3+
#
4+
# Builds the package on every push and pull request. A v* tag (pushed by the monorepo's api_clients/scripts/release)
5+
# also publishes it to PyPI with trusted publishing, in the release environment, and waits until PyPI serves it.
6+
# OpenAPI Generator's python.yml runs the package's tests.
7+
name: Release
8+
9+
on:
10+
push:
11+
branches: ['**']
12+
tags: ['v*']
13+
pull_request:
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23+
with:
24+
persist-credentials: false
25+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
26+
- name: Check the tag matches the package version
27+
if: github.ref_type == 'tag'
28+
run: |
29+
VERSION="$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
30+
if [ "v$VERSION" != "$GITHUB_REF_NAME" ]; then
31+
echo "::error::The tag is $GITHUB_REF_NAME, but the package version is $VERSION"
32+
exit 1
33+
fi
34+
- run: uv build --wheel
35+
- run: uvx twine check --strict dist/*
36+
- if: github.ref_type == 'tag'
37+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
38+
with:
39+
name: package
40+
path: dist/
41+
if-no-files-found: error
42+
43+
publish:
44+
needs: build
45+
if: github.ref_type == 'tag'
46+
runs-on: ubuntu-latest
47+
environment: release
48+
permissions:
49+
contents: read
50+
id-token: write
51+
steps:
52+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
53+
with:
54+
name: package
55+
path: dist/
56+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
57+
58+
verify:
59+
needs: publish
60+
runs-on: ubuntu-latest
61+
timeout-minutes: 15
62+
steps:
63+
- name: Wait until PyPI serves the version
64+
run: |
65+
VERSION="${GITHUB_REF_NAME#v}"
66+
for _ in $(seq 60); do
67+
if curl -fsS -o /dev/null "https://pypi.org/pypi/docspring/$VERSION/json"; then
68+
echo "PyPI serves docspring $VERSION"
69+
exit 0
70+
fi
71+
sleep 10
72+
done
73+
echo "::error::PyPI doesn't serve docspring $VERSION after 10 minutes"
74+
exit 1

‎CHANGELOG.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
### 4.4.0 [October 31, 2026]
2+
3+
- New: page designs (`template_type` `page_designer`), PDFs designed in the Page Designer from a JSON layout, with no
4+
document to start from. create_template makes one from its `layout`, or with an empty page when `layout` is left
5+
out, and update_template replaces its layout. DocSpring adds a field for each value the layout reads. A template's
6+
`layout` is in the [Page Designer layout format](https://docspring.com/docs/page-designer/layout-format/) (its
7+
[JSON Schema](https://docspring.com/schemas/page-designer/layout.v1.json)), and is null for other templates.
8+
- New: every method that creates, changes or deletes something takes an `Idempotency-Key` header, as its last argument,
9+
`idempotency_key`. Send the same key when you send a request again after a timeout or a network error: within 24
10+
hours, DocSpring returns the first response instead of running the request twice. Arguments you already pass keep
11+
their places.
12+
- Changed: the request validator checks what API v2 now refuses: an ID, a query value or a template name that's blank or
13+
only whitespace, an update with nothing to change, a version with a leading zero (`01`), a `filename` with a slash, a
14+
signer `email` that isn't an email address, and an HTML template's `scale` outside 0.1 to 2.
15+
- New: get_template_model_code takes `rust` as its `lang`, for Rust structs that serde reads and writes.
16+
117
### 4.3.0 [October 31, 2026]
218

319
- New: get_template_model_code takes `rust` as its `lang`, for Rust structs that serde reads and writes.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ e-signatures.
1010
The code in this repository is generated from DocSpring's OpenAPI spec ([About this SDK](#about-this-sdk)). Issues and
1111
pull requests are welcome.
1212

13-
Version 4.3.0. Requires Python >=3.10.
13+
Version 4.4.0. Requires Python >=3.10.
1414

1515
## Install and configure
1616

‎docs/Client.md‎

Lines changed: 163 additions & 96 deletions
Large diffs are not rendered by default.

‎docs/CombinedPdfSource.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**type** | [**CombinedPdfSourceType**](CombinedPdfSourceType.md) | What the PDF is: a submission's PDF, another combined PDF, a template's PDF, a custom file (POST /custom_files) or a PDF to download from a URL. |
1010
**id** | **str** | The ID of the submission, combined PDF, template or custom file. | [optional]
1111
**url** | **str** | For a `url` source, the URL to download the PDF from. Removed once the combined PDF has expired. | [optional]
12-
**template_version** | **str** | For a `template` source, the version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published). | [optional]
12+
**template_version** | **str** | For a `template` source, the version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` (the newest published version, or the draft when none has been published) or `draft`. Default `latest`. | [optional]
1313
**processed** | **bool** | For a `template` source: true (the default) merges the template's processed PDF, which is the PDF submissions are filled in on (decrypted, with its form fields removed). false merges the PDF as it was uploaded. | [optional]
1414

1515
## Example

‎docs/CombinedPdfSourceInput.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**type** | **str** | Must be `url`. | [default to 'url']
1010
**id** | **str** | The ID of the submission, combined PDF, template or custom file. |
11-
**template_version** | **str** | For a `template` source, the version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published). | [optional]
11+
**template_version** | **str** | For a `template` source, the version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` (the newest published version, or the draft when none has been published) or `draft`. Default `latest`. | [optional]
1212
**processed** | **bool** | For a `template` source: true (the default) merges the template's processed PDF, which is the PDF submissions are filled in on (decrypted, with its form fields removed). false merges the PDF as it was uploaded. | [optional]
1313
**url** | **str** | For a `url` source, the URL to download the PDF from. Removed once the combined PDF has expired. |
1414

‎docs/CreateSubmissionBatchRequest.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**metadata** | **Dict[str, object]** | Your own data about the batch, such as an ID from your app. | [optional]
1010
**template_id** | **str** | The template for each submission that doesn't name its own `template_id`. | [optional]
11-
**template_version** | **str** | The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published). | [optional]
11+
**template_version** | **str** | The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` (the newest published version, or the draft when none has been published) or `draft`. Default `latest`. | [optional]
1212
**test** | **bool** | The default `test` for each submission that doesn't set its own. | [optional]
1313
**output_formats** | [**List[OutputFormat]**](OutputFormat.md) | The default `output_formats` for each submission that doesn't set its own. | [optional]
1414
**submissions** | [**List[SubmissionInput]**](SubmissionInput.md) | Up to 50 submissions. Each one takes the properties of POST /templates/{template_id}/submissions except `signature_requests`, plus `template_id` and `template_version` when it uses a different template from the batch. |

‎docs/CreateSubmissionRequest.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ The submission's data and settings.
66

77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
9-
**test** | **bool** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions. | [optional]
9+
**test** | **bool** | Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions, and the demo API token's are always live. | [optional]
1010
**editable** | **bool** | `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`. | [optional]
11-
**data** | **Dict[str, object]** | The values of the template's fields, by field name. Required for PDF and Word templates, unless `signature_requests` collects them (PDF templates only). | [optional]
11+
**data** | **Dict[str, object]** | The values of the template's fields, by field name. Required for PDF templates, Word templates and page designs, unless `signature_requests` collects them (PDF templates only). | [optional]
1212
**metadata** | **Dict[str, object]** | Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`). | [optional]
1313
**password** | **str** | A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. Word documents and OpenDocument files can't be password-protected, so a submission with a password can't make them. | [optional]
1414
**output_formats** | [**List[OutputFormat]**](OutputFormat.md) | What the submission makes: `pdf`, `docx` (a Word document, from a Word template), `odt` (an OpenDocument file, the format LibreOffice uses, converted from a Word template's Word document), and `png` (an image of each page of the PDF, up to 100 pages, which adds `pdf`) when you ask for it. Default `["pdf"]`, or a Word template's `output_format`. POST /submissions/{submission_id}/generate_files adds `png`, and a Word template's submission's `pdf`, `docx` or `odt`, to a processed submission. | [optional]
15-
**expires_in** | **int** | Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. | [optional]
15+
**expires_in** | **int** | Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours. The demo API token's submissions expire within an hour: up to 3600, and that's their default. | [optional]
1616
**field_overrides** | [**Dict[str, FieldOverride]**](FieldOverride.md) | Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`. | [optional]
1717
**html** | **str** | For an HTML template, HTML to use instead of the template's. | [optional]
1818
**css** | **str** | For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity. | [optional]

0 commit comments

Comments
 (0)