Load model via JSON String / direct input #223
-
Hello, is it possible to load a model and all the required properties into the pass payload, instead of through the „model“ parameter which reads a file, directly through an input into the generation payload? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 10 replies
-
Hi @xL0b0, thanks for using passkit-generator!
passkit-generator/examples/cloudflare-worker/src/index.ts Lines 44 to 67 in bab4117 If you don't mean this, do you mind clarify further what you mean? Let me know! |
Beta Was this translation helpful? Give feedback.
-
That's kinda what I wanted to do, this was my approach:
So I have a function that gets the completely parsed pass already from another function that fills in all the values into the JSON and then this function just writes the pass. So not reading them from a file, but passing it into the function dynamically. |
Beta Was this translation helpful? Give feedback.
-
Tyvm, I will shortly give this a try and leave a star! So in my case, I want to make an eventTicket, would that object also simply go into here then:
|
Beta Was this translation helpful? Give feedback.
-
And right now I also have in my pass.json all my images as reference, in the images key
Shall I leave this in still, but buffer all images too, like you did in your code example? |
Beta Was this translation helpful? Give feedback.
-
I just want to set all variables for my event ticket pass via the arguments in the constructor of PKPass without using a pass.json file 😅 |
Beta Was this translation helpful? Give feedback.
-
I just don't understand really what to now write into the otherDynamicProps since I got the entire data for the pass already in pass.json that I'm referencing in the first part of the arguments? Can you help me on that please? |
Beta Was this translation helpful? Give feedback.
-
Okay, my point is just simply here that I want to create a new Pass and instead of having to create files locally, like pass.json I just want to pass in my pass that I update with dynamic values, into the arguments of new PKPass, so I can then create a pass. |
Beta Was this translation helpful? Give feedback.
-
Okay, I made it, finally understood the issue! |
Beta Was this translation helpful? Give feedback.
Hi @xL0b0, thanks for using passkit-generator!
PKPass
constructor accepts a list of file-buffer, as you can see in both examples and documentation.passkit-generator/examples/cloudflare-worker/src/index.ts
Lines 44 to 67 in bab4117