Skip to content

PE-6131 add pdf upload support to postgrid node npm package#25

Draft
andrew-postgrid wants to merge 2 commits intomainfrom
andrew/pe-6131-add-pdf-upload-support-to-postgrid-node-npm-package
Draft

PE-6131 add pdf upload support to postgrid node npm package#25
andrew-postgrid wants to merge 2 commits intomainfrom
andrew/pe-6131-add-pdf-upload-support-to-postgrid-node-npm-package

Conversation

@andrew-postgrid
Copy link

Context

Currently, the SDK do not support uploading PDFs to create an order from a PDF file. We want to add that support

Implementation detail

Using maybeMultipartFormRequestOptions which is already available. If options contains file uploads, convert to multipart/form-data. Also add type support (Uploadable) for pdf field.

Test Plan

Add some tests in tests/uploads.test.ts, should automatically run in CI

@andrew-postgrid andrew-postgrid self-assigned this Feb 4, 2026
@andrew-postgrid andrew-postgrid marked this pull request as ready for review February 4, 2026 15:03
* stamped on).
*/
pdf: string;
pdf: string | Uploadable;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyway for us to annotate this in our open API spec to have this auto generated? Otherwise for future or other file uploads, we will need to remember to come here and upload the types.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CalvinPostgrid In TypeSpec, looks like we already do the right thing pdf: url | bytes. Stainless’s Node generator today looks like collapses that to string in the SDK, rather than recognizing byte or file. I feel what we can do is to add a post-process script and run it after every stainless regeneration, but here will be a lot of works here I guess.

Copy link

@Aingkaran Aingkaran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill approve for now pending calvins comment if it can be addressed

@andrew-postgrid
Copy link
Author

ill approve for now pending calvins comment if it can be addressed

Thanks !

@andrew-postgrid andrew-postgrid marked this pull request as draft February 5, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants