Commit Graph

140 Commits

Author SHA1 Message Date
Rathan Kumar c65afe94d2
chore: updated check mark symbol to show some green checkboxes (#582)
Signed-off-by: Rathan Kumar <RathanKumar@users.noreply.github.com>
2024-04-16 09:56:25 -04:00
Doug Davis f93f896002
add link to our security mailing list (#568) 2023-10-17 10:49:20 -04:00
Doug Davis 16d0c0f91f
Governance docs per CE PR 1226 (#565)
Signed-off-by: Doug Davis <dug@microsoft.com>
2023-09-28 10:03:26 -04:00
Lucas Holmquist 11442d32d3
chore: remove old Node versions from the readme (#549)
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2023-05-16 16:14:18 -04:00
Lance Ball 43c3584b98
fix: handle big integers in incoming events (#495)
* fix: handle big integers in incoming events

An event may have data that contains a BigInt. The builtin `JSON` parser
for JavaScript does not handle the `BigInt` types. The introduced
`json-bigint` dependency (34k) does.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2023-05-10 12:45:43 -04:00
Jordan Moore 7ff64f8b82
chore: Update CI action to node 18.x (#533)
* Update CI action to node 18.x

Signed-off-by: Jordan Moore <1930631+OneCricketeer@users.noreply.github.com>

* doc: update README

Signed-off-by: Jordan Moore <1930631+OneCricketeer@users.noreply.github.com>

---------

Signed-off-by: Jordan Moore <1930631+OneCricketeer@users.noreply.github.com>
2023-03-08 10:48:51 -05:00
Craig Dennis 953bc2a143 chore: Typos
Receive corrections

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2023-02-16 11:15:11 -05:00
Grant Timmerman a62eb44669
chore: update owners (#499)
* chore: update owners

Signed-off-by: Grant Timmerman <744973+grant@users.noreply.github.com>
2022-06-15 00:50:18 -04:00
Jason Lock addbd9acf1
Fix typo in README (#488)
Signed-off-by: Jason Lock <jasonlock@Jasons-MacBook-Pro.local>
2022-05-10 11:59:56 -04:00
Lance Ball 4ab6356bd7
docs: update readme to include http builtin transport (#483)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-21 08:40:16 -04:00
Lance Ball ae8cb96f8a
doc: update maintainers in README.md (#478)
This commit modifies the structure of the README.md to add a markdown
heading. This change is motiviated by the CLO tool provided by CNCF.
This repository is failing a check for maintainers as you can see on
the dashboard:
https://clomonitor.io/projects/cloudevents/cloudevents#sdk-javascript

Documentation for this change can be found here:
https://github.com/cncf/clomonitor/blob/main/docs/checks.md#maintainers

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-17 13:21:48 -04:00
Lucas Holmquist 8abbc114af
chore: update readme with current Node LTS versions and add Node 16 to the testing matrix(#465)
* chore: update readme with current Node LTS versions

* squash: add node 16 to action matrix

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2022-01-27 09:43:42 -05:00
Grant Timmerman 349b84c3da
docs: fix ts example (#467)
* docs: fix ts example

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* docs: fix ts example

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* docs: update quote mark

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2022-01-26 22:50:36 -06:00
David Pereira c603831e93
docs: add TS examples for CloudEvent usage (#461)
* docs: add TS examples for CloudEvent usage

Co-authored-by: Lance Ball <lball@redhat.com>
2022-01-26 16:54:49 -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
Lance Ball 5d1f744f50
feat: add support for kafka transport (#455)
This commit extends the `message` package to include Kafka transport.

Additionally, some of the type information has changed across the project
to more accurately reflect the type of `Message` (by including `T`).

Related: https://github.com/cloudevents/sdk-javascript/issues/390
Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-07 16:14:09 -05:00
Lance Ball 9a46e335f5
feat: add batch mode (#448)
Adds a batched content mode for incoming events.

```js
// It's possible for this to return 1:N events
const ceArray = HTTP.toEvent(req.headers, req.body);
```

Signed-off-by: Lance Ball <lball@redhat.com>
2021-12-07 15:36:10 -05:00
Lance Ball 66f0b42f0d
chore: update codacy badges (#409)
Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-21 17:13:05 -04:00
Lance Ball d10fee05ba
doc: fix README.md coverage/quality badge links (#401)
For some reason they had never been changed from @fabiojose

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

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-15 18:49:10 -04:00
Ali Ok ed8148326b
chore(docs): Fix minor import problems in README (#374)
Signed-off-by: Ali Ok <aliok@redhat.com>
2021-01-04 11:02:53 -05:00
Lucas Holmquist 79296a8e63
chore: add a transition guide. fixes #360 (#363)
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-12-07 11:21:30 -05:00
Remi Cattiau 43d9e01972 feat: allow ensureDelivery to be able to ensure delivery on emit
Signed-off-by: Remi Cattiau <remi@cattiau.com>
2020-11-17 08:41:16 -05:00
Remi Cattiau bda8581464 docs: add Emitter logic example
Signed-off-by: Remi Cattiau <remi@cattiau.com>
2020-11-17 08:41:16 -05:00
Lance Ball 138de37084
docs: update README with latest API changes (#347)
Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-01 15:12:19 -04:00
Lance Ball 0a12146565
docs: update README with maintainer names (#337)
This commit changes the README to include all currently active contributors

Signed-off-by: Lance Ball <lball@redhat.com>
2020-09-09 09:45:47 -04:00
Lucas Holmquist 73f0becc2b
chore: Update README with correct links for the support specification versions (#321)
* chore(readme): Remove reference of HTTPReceiver

* chore(readme): fix support specification links.

* This adds the real links to the v0.3 and v1.0 specification.

fixes #320

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-08-19 15:39:37 -04:00
Lucas Holmquist 4bf2eb838a
chore: Update references of master to main (#316)
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-08-12 19:00:02 -04:00
Doug Davis 81623ac443
chore: typo (#313)
Signed-off-by: Doug Davis <dug@us.ibm.com>
2020-08-11 11:01:40 -04:00
Doug Davis b3624c2b1a
docs: add ref to CoC and other things (#244)
* add ref to CoC and other things

Signed-off-by: Doug Davis <dug@us.ibm.com>
2020-08-11 10:18:47 -04:00
Grant Timmerman d590e3a007
docs: improve readme receiver example (#309)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-08-11 09:31:05 -04:00
Grant Timmerman 3fab5f2c92
docs: update badge name (#289)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-07-30 08:43:51 -04:00
Lucas Holmquist e219a30708
chore: Update readme with correct Receiver usage (#287)
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-07-29 18:48:14 -04:00
Grant Timmerman 565f867424
feat: use npm name cloudevents (#260)
BREAKING CHANGE:  This changes the modules name from cloudevents-sdk to cloudevents

* feat: use npm name cloudevents
fixes #215

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-07-24 10:04:25 -04:00
Lance Ball c49693189d
docs: clean up spec compliance table on README.md (#252)
This commit separates the spec compliance table in the README.md file
into three: the core spec, event formats, and transport protocols.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/166
Signed-off-by: Lance Ball <lball@redhat.com>
2020-07-16 17:45:03 -04:00
Lucas Holmquist de6f0a2945
docs(README): Update readme to mention that CloudEvents are read-only now (#248)
* also update readme with a mention about the cloneWith method

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-07-15 09:50:46 -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 850e893ca7
docs(README): fix wrong order of arguments in the accept example (#224)
fixes #222

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-06-18 17:11:46 -04:00
Lucas Holmquist ed1d3286fa
docs: Update references of specific versions to use Latest Supported. (#211)
* docs: Update references of specific versions to use Latest Supported.

fixes #160

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-06-08 15:47:30 -04:00
Lucas Holmquist 9857eda5ef
docs(README): fix example typo (#208)
fixes #173

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-06-04 18:04:03 -04:00
Grant Timmerman 1b9b3af176
Update README.md (#205)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-06-04 11:29:53 -07:00
Lance Ball 0fe57d123a
chore: add GitHub action for CI on master and prs (#181)
* chore: replace travis-ci badge with github action
* chore: remove .travis.yaml

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-26 17:09:55 -04:00
Lance Ball abc114b24e
lib!: change CloudEvent to use direct object notation and get/set properties (#172)
This commit makes a substantial change to the API, changing the CloudEvent class
to accept properties as an object in the constructor. For example:

```js
const CloudEvent = require('cloudevents-sdk');

// all event properties except extensions may be set in the constructor
const event = new CloudEvent({
  source: 'http://my.event.source',
  type: 'test-event-type'
});

// get and set all properties standard property notation
console.log(event.time); // the event timestamp
event.subject = 'my event subject';
```

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-22 13:03:36 -04:00
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
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 07323e078f
docs: organize README badges and remove TS example (#112)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-05-04 10:33:40 -07:00
Grant Timmerman 223a7c6f03
docs: remove repo structure docs (#111)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-05-04 10:25:48 -07:00
Helio Frota 53524acb0e
fix: misspelled word (#115)
Signed-off-by: Helio Frota <00hf11@gmail.com>
2020-05-02 08:30:01 -07:00
Grant Timmerman f30c814a09
chore: remove note with bad link and non SDK docs (#109)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-05-01 10:59:21 -07: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
Grant Timmerman 56036b09dd docs: remove 0.1, 0.2 spec support from README
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-30 12:31:08 -03:00