Commit Graph

10 Commits

Author SHA1 Message Date
Lance Ball 276b810dd8
BREAKING CHANGE(lib): rewrite in TypeScript (#226)
This is a major rewrite of the entire codebase into TypeScript. Nearly
all tests have been retained except where behavior is significantly
different. Some highlights of these changes:

* lowercase all CloudEvent properties and fix base64 encoded data

Previously there was a format() function that would convert a CloudEvent
object into JSON with all of the properties lowercased. With this rewrite
a CloudEvent object can be converted to JSON simply with JSON.stringify().

However, in order to be compliant with the JSON representation outlined in
the spec here https://github.com/cloudevents/spec/blob/v1.0/json-format.md
all of the event properties must be all lowercase.

* lib(transport): make transport mode an Enum
* src: allow custom headers (#1)
* lib(exports): export explicitly versioned names where appropriate
* lib(cloudevent): modify ctor to accept extensions inline
* lib(cloudevent): make extensions a part of the event object
* test: convert all tests to typescript
* examples: update all examples with latest API changes
* docs: update README with latest API changes
* src: add prettier for code style and fix a lot of linting errors
* lib: move data decoding to occur within the CloudEvent object

Signed-off-by: Lance Ball <lball@redhat.com>
2020-06-29 14:46:20 -04:00
Lucas Holmquist dcb3c4e98a
chore: Update examples to use the latest sdk version(2.0.2) (#206)
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-06-09 18:08:15 -04:00
Lance Ball b866edddd9
docs: update README and examples with new API (#138)
This commit modifies the README to show new API usage for the
`HTTPReceiver` and `CloudEvent` classes, and updates the examples
to use this as well.

Overall structure and content has been modified to look more like
the sdk-go README.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-11 09:41:05 -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 3f238a0124
src: add eslint configuration and npm script
Automatically fixed > 2000 issues. The remaining 200+ issues need
to be fixed by hand. Additionally, all strings are double quotes
which is not typically standard and I wonder about fixing that too.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-22 10:15:05 -04:00
Fabio José a7e8354d56 Set the version of sdk to 1.0.0
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-06 11:22:04 -03:00
Fabio José c35af5b66e Fix link to requestbin
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-04 10:00:30 -03:00
Fabio José 807d60462b ts Example using binary receiver
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-04 09:54:16 -03:00
Fabio José 0d8c8a13ae ts example with binary emitter
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-10-29 21:43:21 -03:00
Fabio José b4b04963b9 Typescript examples
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-10-29 20:49:54 -03:00