Commit Graph

15 Commits

Author SHA1 Message Date
Snyk bot d3593556f1
fix: examples/typescript-ex/package.json to reduce vulnerabilities (#395)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-HOSTEDGITINFO-1088355

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-06 10:58:06 -04:00
Lance Ball 1af3d43341 fix: Emitter should not extend EventEmitter
This change modifies Emitter so that it does not directly extend the Node.js
EventEmitter class. Instead, it holds a singleton instance of an EventEmitter
but is not an instance of EventEmitter itself.

This commit also updates the typescript example to use a modern version of
@types/node and typescript.

Finally there are a few minor formatting changes picked up by eslint.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2021-02-27 19:27:20 -05:00
Snyk bot f8514062d4
[Snyk] Security upgrade cloudevents from 3.1.0 to 4.0.0 (#377)
* fix: examples/typescript-ex/package.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-AXIOS-1038255

* chore: update example to use the 4.0 API

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>

Co-authored-by: Lucas Holmquist <lholmqui@redhat.com>
2021-01-06 09:55:37 -05:00
Lucas Holmquist 7423acb7fc
fix: upgrade cloudevents from 3.0.1 to 3.1.0 (#335)
Snyk has created this PR to upgrade cloudevents from 3.0.1 to 3.1.0.

See this package in npm:
https://www.npmjs.com/package/cloudevents

See this project in Snyk:
https://app.snyk.io/org/lance/project/cb2960b0-db0c-4e77-9ab2-e78efded812e?utm_source=github&utm_medium=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-09-03 14:52:50 -04:00
Lucas Holmquist 763838c89c
chore: Update examples to use latest sdk changes (#282)
* This updates all the examples to use the latest module version(3.0.0)


Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-07-30 09:24:02 -04:00
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