Closed
Description
When a developer wants to use CloudEvents, they think about an event, not which version they're using. The way this module is written is highly segmented towards the version of CloudEvent.
Rather than this:
const v1 = require("cloudevents-sdk/v1");
Where const v1
doesn't make much sense.
We should have
const CloudEvents = require("cloudevents-sdk");
It should be easy to create a CloudEvent:
let myevent= new CloudEvent({
specversion: '1.0',
source: '/source',
type: 'type',
dataContentType: 'text/plain',
dataschema: 'http://d.schema.com/my.json',
subject: 'cha.json',
data: 'my-data',
addExtension: ["my-ext", "0x600"]
});
let myevent2= new CloudEvent({
specversion: '0.3',
source: '/source',
type: 'type',
dataContentType: 'text/plain',
dataschema: 'http://d.schema.com/my.json',
subject: 'cha.json',
data: 'my-data',
addExtension: ["my-ext", "0x600"]
});
We should remove the v03
and v1
folders in the repo and just have one CloudEvent
that can support multiple versions.
Metadata
Metadata
Assignees
Labels
No labels