Repository navigation
PDFCLOUD-6573 Add TDM reservation policy support - #60
Draft
datalogics-tsmith wants to merge 17 commits into
Draft
datalogics-tsmith wants to merge 17 commits into
datalogics-tsmith wants to merge 17 commits into
Conversation
- Add typed rendering options for invoice appearance and localization. - Validate uploaded resources, color channels, fonts, and regeneration. - Serialize the public input shape into the pdfRest wire contract. Assisted-by: Codex
- Add synchronous and asynchronous helpers for uploaded invoice XML. - Support optional PDFs, logos, rendering controls, and request options. - Cover serialization, validation, response mapping, and both transports. Assisted-by: Codex
- Exercise every closed rendering option through both client transports. - Verify regenerated PDFs, response metadata, and server-side rejection. - Add a deterministic minimum-profile invoice fixture. Assisted-by: Codex
- Add a standalone typed example with a deterministic invoice fixture. - Verify the generated PDF and print useful response metadata. - Link the helper from the API guide and example inventories. Assisted-by: Codex
- Compose page ranges from typed ascending selections and reject invalid combinations before transport. - Add deterministic sync and async annotation assertions with a printable PDF fixture. Assisted-by: Codex
- Validate a single uploaded PDF resource before request serialization. - Model validation findings and response status fields returned by pdfRest. - Export the public response models for typed client consumers. Assisted-by: Codex
- Send uploaded PDF resource IDs to the validation endpoint. - Return typed results from synchronous and asynchronous clients. - Preserve request customization and timeout support. Assisted-by: Codex
- Verify payload serialization and local resource validation. - Exercise response literals, aliases, findings, and demo redactions. - Assert sync and async request customization and transport behavior. Assisted-by: Codex
- Exercise valid and invalid validation requests through both clients. - Confirm created and regenerated invoices pass validation and PDF/A checks. - Accept confirmed and demo-redacted content comparison results. Assisted-by: Codex
- Create a deterministic invoice before validating its conformance. - Display typed status, PDF/A, content-match, and finding details. - Add the workflow to the runnable example inventory. Assisted-by: Codex
- Link the validation helper from the electronic invoice API guide. - Describe package, content, and PDF/A conformance validation. Assisted-by: Codex
- Verify INVALID report.pdf responses live through both clients. - Match valid and demo-redacted response assertions across transports. - Cover empty resource-list rejection before request execution. Assisted-by: Codex
- Add synchronous and asynchronous helpers for uploaded PDF resources. - Validate HTTP and HTTPS policy URLs without changing valid values. - Cover serialization, customization, validation, and response mapping. Assisted-by: Codex
- Exercise default and custom output names through both client transports. - Inspect generated PDF metadata and server-side policy rejection. Assisted-by: Codex
- Link the helper and explain URL-based reservation metadata behavior. - Add a runnable upload example and list it in the example inventory. Assisted-by: Codex
- Mark the additive TDM helper for a minor feature release. - Keep the project lock metadata synchronized. Assisted-by: Codex
✅ Deploy Preview for pdfrest-python ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PDFCLOUD-6573
Why this change
The Python SDK does not expose pdfRest's TDM reservation operation, so callers cannot use the typed clients to embed a hosted text-and-data-mining policy URL in an uploaded PDF. This adds a supported workflow for applying that compliance metadata without requiring callers to assemble raw requests.
What changed (high level)
New synchronous and asynchronous
apply_tdm_reservationhelpers accept one uploaded PDF, an HTTP or HTTPS policy URL, and an optional output name. A dedicated Pydantic payload model owns MIME, cardinality, output-prefix, and URL validation while preserving valid policy URLs exactly in the serialized request. The SDK validates syntax only; it does not fetch or inspect the policy destination.The change also adds focused unit and live coverage, a runnable example, API guidance, and the minor-version metadata required for an additive public helper.
Behavior changes
Callers can apply TDM reservation metadata through either client transport and receive the standard typed file response. Missing or empty policies, bare policy text, unsupported schemes, whitespace, malformed percent escapes, backslashes, non-PDF resources, empty resource lists, and multiple resources fail locally before transport. Valid encoded paths, query strings, and fragments are preserved rather than normalized.
The API is additive and does not change existing helper behavior.
Validation
The complete non-live suite passed on Python 3.10 through 3.14 with 3,291 tests passed, 10 expected skips, and 96% overall coverage on each interpreter. The client class-function coverage gate passed at its 90% threshold.
The focused live suite passed all 6 sync and async cases against the local service, covering default and custom output names, embedded policy metadata, and server-side missing-policy rejection. The standalone example also completed successfully against the local service.
Ruff formatting and linting, basedpyright, all configured pre-commit hooks, the strict MkDocs build, wheel/sdist build, and
git diff --checkpassed. The full repository-wide live suite and full examples matrix were not run; live and example validation were scoped to this endpoint.Risks and follow-ups
The current service/OpenAPI contract still describes any non-empty policy string as accepted, while this SDK helper intentionally requires a valid HTTP or HTTPS URL. Coordinate the service and documentation rollout before releasing the SDK so users see one consistent contract.
After #57 and #58 merge, refresh this branch against
mainand recheck the 1.5.0 version metadata because the earlier stack also changes the package version. Main-repository CI provides the final clean-environment verification.