Commit Graph

2 Commits

Author SHA1 Message Date
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 2c469efaf5
build: add tsc type checks and emit declarations in the ci/test pipeline (#155)
This commit introduces TypeScript checks and generates type declarations
for the existing JavaScript codebase using `tsc` prior to running the linter task.

Ref: https://github.com/cloudevents/sdk-javascript/issues/9

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-18 14:56:01 -04:00