Commit Graph

10 Commits

Author SHA1 Message Date
Lance Ball 250a0a144c
feat!: expose a version agnostic event emitter (#141)
* feat!: expose a version agnostic event emitter

This is a breaking change.

This commit exposes an HTTP based event emitter that simplifes the API.
To use it, simply import the SDK and start emitting. The default spec
version is 1.0, but you can use 0.3 by supplying that to the constructor.

By default, CloudEvents are emitted in binary mode, but this can be changed
by providing the "structured" parameter to the `send()` function.

This commit also eliminates the version specific emitters and receivers
from the `v1` and `v03` exports, and eliminates the explicit usage of
versioned emitters from `lib/bindings/http`.

Finally, the CE headers can be retrieved from the emitter for a given
event by passing the event to the `headers()` function.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-14 11:37:02 -04:00
Grant Timmerman 05ecbdea4f
feat: use CloudEvents not cloudevents everywhere (#101)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-30 16:14:13 -07:00
Lance Ball 3a063d7245
fix: support mTLS in 1.0 Binary and Structured emitters
This commit modifies both of the 1.0 emitters so that they may
accept typed objects as a part of the configuration. When using
mTLS in Node, you need to provide an `Agent` to the underlying
HTTP handler. In this case, Axios will pass this object along to
Node.js when it is provided.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-08 16:13:57 -04:00
Fabio José cf701e423c Remove HTTPUnmarshaller
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-04 10:13:04 -03:00
Fabio José 43c6bfe9dc Exporting the http unmarshaller spec 1.0
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-04 10:07:02 -03:00
Fabio José 23b0648a07 Exporting the binary receiber
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-04 09:45:25 -03:00
Fabio José 41d9328ac8 Exporting the structured receiver
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-02 07:05:42 -03:00
Fabio José f47de94b48 Exporting the http binary emitter spec 1.0
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-10-29 21:15:29 -03:00
Fabio José 249efce8e1 Http structured emitter
Types

Impl.

Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-10-29 16:29:08 -03:00
Fabio José 48258bb01a Spec v1.0 start with typescript types
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-10-29 08:55:24 -03:00