PE-6131 add pdf upload support to postgrid node npm package#25
PE-6131 add pdf upload support to postgrid node npm package#25andrew-postgrid wants to merge 2 commits intomainfrom
Conversation
| * stamped on). | ||
| */ | ||
| pdf: string; | ||
| pdf: string | Uploadable; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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.
Aingkaran
left a comment
There was a problem hiding this comment.
ill approve for now pending calvins comment if it can be addressed
Thanks ! |
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
maybeMultipartFormRequestOptionswhich 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