Commit Graph

2 Commits

Author SHA1 Message Date
Lance Ball b5c0b56f52
fix: use `isolatedModules: true` in tsconfig.json (#469)
* fix: use `isolatedModules: true` in tsconfig.json

This setting ensures the module can be used in projects where the workflow
includes type checking and transpilation as two separate steps.

See: https://ncjamieson.com/dont-export-const-enums/

Fixes: https://github.com/cloudevents/sdk-javascript/issues/456

Signed-off-by: Lance Ball <lball@redhat.com>
2022-02-10 08:39:09 -05:00
Lance Ball 591d133f31
feat: add MQTT transport messaging (#459)
Add MQTT as a `Message` format.

This commit adds `MQTT` to the supported transport protocols by adding a `Binding` and the `MQTTMessage<T>` type, extending the base `Message` type, adding the MQTT fields for `payload`, `PUBLISH` and `User Properties`. The `payload` field directly maps to `Message#body`, while `User Properties` roughly maps to `Message#headers`, even though the properties here are not formatted with a `ce-` prefix like other transport protocols. This is per the spec. See: https://github.com/cloudevents/spec/blob/v1.0.1/mqtt-protocol-binding.md. 

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-14 11:41:15 -05:00