sdk-javascript/examples/typescript-ex
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
..
src BREAKING CHANGE(lib): rewrite in TypeScript (#226) 2020-06-29 14:46:20 -04:00
README.md chore: Update examples to use the latest sdk version(2.0.2) (#206) 2020-06-09 18:08:15 -04:00
package.json BREAKING CHANGE(lib): rewrite in TypeScript (#226) 2020-06-29 14:46:20 -04:00
tsconfig.json chore: Update examples to use the latest sdk version(2.0.2) (#206) 2020-06-09 18:08:15 -04:00
tslint.json Typescript examples 2019-10-29 20:49:54 -03:00

README.md

Typescript Example

The types are available since v1.0.0

How To Start

Install and transpile:

npm install

Then, start

npm start