Closed cmbirk closed 2 years ago
Thanks for the issue. Can you provide more detail with link to parts inside here? There is not much detail in the issue.
The types could possibly be improved, although it may be better for the type library depending on the request: https://github.com/googleapis/google-cloudevents-nodejs
Hey @cmbirk, any update here?
I think you're talking about this interface:
I don't believe we can set the event object to a string for all event types.
For CloudEvents, we have the dedicated types repo (link above), with richer types.
For Pub/Sub, I don't believe a string is correct either for the data field. Thus closing. Feel free to give an update if there are concerns!
The data field in event functions is currently set as an empty object, but I believe it should be set as a base64 encoded string: https://cloud.google.com/pubsub/docs/push
We can add a DecodedData type that accepts a generic as well so that developers can type the shape coming out of the encoded string.
I'm happy to open a PR to update the typing if it's useful.