From cf8f570730ba738e0abb5cbd0e97b63b1565f44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Jos=C3=A9?= Date: Mon, 29 Jul 2019 11:11:04 -0300 Subject: [PATCH] Test the SDK requirements spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio José --- README.md | 34 ++++++++++++++++++---------------- v02/index.js | 5 +++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 v02/index.js diff --git a/README.md b/README.md index fb2a4aa..e1b88f0 100644 --- a/README.md +++ b/README.md @@ -44,23 +44,23 @@ npm install cloudevents-sdk These are the supported specifications by this version. -| **Specifications** | **v0.1** | **v0.2** | -|---------------------------------------|----------|----------| -| CloudEvents | yes | yes | -| HTTP Transport Binding - Structured | yes | yes | -| HTTP Transport Binding - Binary | yes | yes | -| JSON Event Format | yes | yes | +| **Specifications** | **v0.1** | **v0.2** | **v0.3** | +|---------------------------------------|----------|----------|----------| +| CloudEvents | yes | yes | yes | +| HTTP Transport Binding - Structured | yes | yes | ?? | +| HTTP Transport Binding - Binary | yes | yes | ? | +| JSON Event Format | yes | yes | ? | ### What we can do -| **What** | **v0.1** | **v0.2** | -|-------------------------------------|----------|----------| -| Create events | yes | yes | -| Emit Structured events over HTTP | yes | yes | -| Emit Binary events over HTTP | yes | yes | -| JSON Event Format | yes | yes | -| Receice Structured events over HTTP | no | yes | -| Receice Binary events over HTTP | no | yes | +| **What** | **v0.1** | **v0.2** | **v0.3** | +|-------------------------------------|----------|----------|----------| +| Create events | yes | yes | yes | +| Emit Structured events over HTTP | yes | yes | ? | +| Emit Binary events over HTTP | yes | yes | ? | +| JSON Event Format | yes | yes | ? | +| Receice Structured events over HTTP | no | yes | ? | +| Receice Binary events over HTTP | no | yes | ? | ## How to use @@ -80,6 +80,8 @@ Cloudevent(spec, format); ```js var Cloudevent = require("cloudevents-sdk"); +var Spec02 = require("cloudevents-sdk/v02") + /* * Constructs a default instance with: * - Spec 0.1 @@ -95,8 +97,8 @@ cloudevent01 .source("urn:event:from:myapi/resourse/123"); /* - * Backward compatibility to spec 0.1 by injecting methods from spec implementation - * to Cloudevent + * Backward compatibility to spec 0.1 by injecting methods from spec + * implementation to Cloudevent */ cloudevent01 .eventTypeVersion("1.0"); diff --git a/v02/index.js b/v02/index.js new file mode 100644 index 0000000..aecc122 --- /dev/null +++ b/v02/index.js @@ -0,0 +1,5 @@ +const Spec = require("../lib/specs/spec_0_2.js"); + +module.exports = { + Spec +};