diff --git a/.gitignore b/.gitignore index a19537f..5340fa6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,10 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -# Generated typedefs +# Generated files *.d.ts +index.js +lib # Runtime data pids diff --git a/.jsdoc.json b/.jsdoc.json deleted file mode 100644 index cb69f6f..0000000 --- a/.jsdoc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "tags": { - "allowUnknownTags": true, - "dictionaries": ["jsdoc"] - }, - "source": { - "include": ["lib", "package.json", "README.md"], - "includePattern": ".js$", - "excludePattern": "(node_modules/|docs|examples|coverage|test)" - }, - "plugins": [ - "plugins/markdown", - "plugins/ignore-typedef" - ], - "templates": { - "referenceTitle": "cloudevents-sdk", - "disableSort": false, - "collapse": true, - "resources": { - "Concepts": "concepts.html" - } - }, - "opts": { - "destination": "./docs/", - "encoding": "utf8", - "private": true, - "recurse": true, - "template": "node_modules/jsdoc-fresh" - } -} \ No newline at end of file diff --git a/docs/BinaryHTTPEmitter.html b/docs/BinaryHTTPEmitter.html deleted file mode 100644 index 1a30adb..0000000 --- a/docs/BinaryHTTPEmitter.html +++ /dev/null @@ -1,535 +0,0 @@ - - - - - - - - - BinaryHTTPEmitter - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- BinaryHTTPEmitter -

- - - - -
-
- -

- - BinaryHTTPEmitter - -

- - -
-

A class to emit binary CloudEvents over HTTP.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new BinaryHTTPEmitter(version) -

-
- - - - - -
-

Create a new {BinaryHTTPEmitter} for the provided CloudEvent specification version. -Once an instance is created for a given spec version, it may only be used to send -events for that version. -Default version is 1.0

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
version - - - - string - - - - - - - -

the CloudEvent HTTP specification version. -Default: 1.0

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Methods

- - - - - - - - - - - - - -

- (async) emit(options, cloudevent) → {Promise} -

-
- - - - - -
-

Sends this cloud event to a receiver over HTTP.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
options - - - - Object - - - - - - - -

The configuration options for this event. Options -provided other than url will be passed along to Node.js http.request. -https://nodejs.org/api/http.html#http_http_request_options_callback

- -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
url - - - - URL - - - - - - - -

The HTTP/S url that should receive this event

- -
- - -
cloudevent - - - - Object - - - - - - - -

the CloudEvent to be sent

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/BinaryHTTPReceiver.html b/docs/BinaryHTTPReceiver.html deleted file mode 100644 index daa518f..0000000 --- a/docs/BinaryHTTPReceiver.html +++ /dev/null @@ -1,716 +0,0 @@ - - - - - - - - - BinaryHTTPReceiver - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- BinaryHTTPReceiver -

- - - - -
-
- -

- - BinaryHTTPReceiver - -

- - -
-

/** -A class that receives binary CloudEvents over HTTP. This class can be used -if you know that all incoming events will be using binary transport. If -events can come as either binary or structured, use {HTTPReceiver}.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new BinaryHTTPReceiver(version) -

-
- - - - - -
-

Creates a new BinaryHTTPReceiver to accept events over HTTP.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
version - - - - string - - - - - - - -

the Cloud Event specification version to use. Default "1.0"

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Methods

- - - - - - - - - - - - - -

- check(payload, headers) → {boolean} -

-
- - - - - -
-

Checks an incoming HTTP request to determine if it conforms to the -Cloud Event specification for this receiver.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
payload - - - - Object - - - - - - - -

the HTTP request body

- -
headers - - - - Object - - - - - - - -

the HTTP request headers

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

if the event does not conform to the spec

-
-
-
-
-
-
Type
-
- - - ValidationError - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - -

- parse(payload, headers) → {CloudEvent} -

-
- - - - - -
-

Parses an incoming HTTP request, converting it to a {CloudEvent} -instance if it conforms to the Cloud Event specification for this receiver.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
payload - - - - Object - - - - - - - -

the HTTP request body

- -
headers - - - - Object - - - - - - - -

the HTTP request headers

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

of the event does not conform to the spec

-
-
-
-
-
-
Type
-
- - - ValidationError - - - - - -
-
-
-
-
- - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/CloudEvent.html b/docs/CloudEvent.html deleted file mode 100644 index 1e56065..0000000 --- a/docs/CloudEvent.html +++ /dev/null @@ -1,2130 +0,0 @@ - - - - - - - - - CloudEvent - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- CloudEvent -

- - - - -
-
- -

- - CloudEvent - -

- - -
-

An CloudEvent describes event data in common formats to provide -interopability across services, platforms and systems.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new CloudEvent(options) -

-
- - - - - -
-

Creates a new CloudEvent instance

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
options - - - - object - - - - - - - -

CloudEvent properties as a simple object

- -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
source - - - - string - - - - - - - - - - - - - -

Identifies the context in which an event happened as a URI reference

- -
type - - - - string - - - - - - - - - - - - - -

Describes the type of event related to the originating occurrence

- -
id - - - - string - - - - - - - - - <optional>
- - - - - -
-

A unique ID for this event - if not supplied, will be autogenerated

- -
time - - - - string - - - - - - - - - <optional>
- - - - - -
-

A timestamp for this event. May also be provided as a Date

- -
subject - - - - string - - - - - - - - - <optional>
- - - - - -
-

Describes the subject of the event in the context of the event producer

- -
dataContentType - - - - string - - - - - - - - - <optional>
- - - - - -
-

The mime content type for the event data

- -
dataSchema - - - - string - - - - - - - - - <optional>
- - - - - -
-

The URI of the schema that the event data adheres to (v1.0 events)

- -
schemaURL - - - - string - - - - - - - - - <optional>
- - - - - -
-

The URI of the schema that the event data adheres to (v0.3 events)

- -
dataContentEncoding - - - - string - - - - - - - - - <optional>
- - - - - -
-

The content encoding for the event data (v0.3 events)

- -
specversion - - - - string - - - - - - - - - <optional>
- - - - - -
-

The CloudEvent specification version for this event - default: 1.0

- -
data - - - - * - - - - - - - - - <optional>
- - - - - -
-

The event payload

- -
- - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - -

Members

- - - - -

- data :* -

- - - - -
-

Gets or sets the data for this event

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- dataContentEncoding :string -

- - - - -
-

Gets or sets the event's data content encoding

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- dataContentType :string -

- - - - -
-

Gets or sets the content type of the data value for this event

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- dataSchema :string -

- - - - -
-

Gets or sets the event's data schema

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- id :string -

- - - - -
-

Gets or sets the event id. Source + id must be unique for each distinct event.

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- schemaURL :string -

- - - - -
-

DEPRECATED: Gets or sets the schema URL for this event. Throws {TypeError} -if this is a version 1.0 event.

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- source :string -

- - - - -
-

Gets or sets the origination source of this event as a URI.

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- specversion :string -

- - - - -
-

Gets the CloudEvent specification version

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- subject :string -

- - - - -
-

Gets or sets the event subject

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- time :string -

- - - - -
-

Gets or sets the timestamp for this event as an ISO formatted date string

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - -

- type :string -

- - - - -
-

Gets or sets the event type

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - - -

Methods

- - - - - - - - - - - - - -

- addExtension(key, value) → {void} -

-
- - - - - -
-

Adds an extension attribute to this CloudEvent

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
key - - - - string - - - - - - - -

the name of the extension attribute

- -
value - - - - * - - - - - - - -

the value of the extension attribute

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

- format() → {JSON} -

-
- - - - - -
-

Formats the CloudEvent as JSON. Validates the event according -to the CloudEvent specification and throws an exception if -it's invalid.

-
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

if this event cannot be validated against the specification

-
-
-
-
-
-
Type
-
- - - ValidationError - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - -

- getExtensions() → {Object} -

-
- - - - - -
-

Gets the extension attributes, if any, associated with this event

-
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

- toString() → {string} -

-
- - - - - -
-

Formats the CloudEvent as JSON. No specification validation is performed.

-
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/HTTPEmitter.html b/docs/HTTPEmitter.html deleted file mode 100644 index 6baab8e..0000000 --- a/docs/HTTPEmitter.html +++ /dev/null @@ -1,923 +0,0 @@ - - - - - - - - - HTTPEmitter - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- HTTPEmitter -

- - - - -
-
- -

- - HTTPEmitter - -

- - -
-

const { -SPEC_V03, -SPEC_V1 -} = require("./constants");

-

/** -A class which is capable of sending binary and structured events using -the CloudEvents HTTP Protocol Binding specification.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new HTTPEmitter(optionsopt) -

-
- - - - - -
-

Creates a new instance of {HTTPEmitter}. The default emitter uses the 1.0 -protocol specification in binary mode.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
options - - - - Object - - - - - - - - - <optional>
- - - - - -
-

The configuration options for this event emitter

- -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
url - - - - URL - - - - - - - - - - - - - -

The endpoint that will receive the sent events.

- -
version - - - - string - - - - - - - - - <optional>
- - - - - -
-

The HTTP binding specification version. Default: "1.0"

- -
- - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
- -
- - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

if no options.url is provided or an unknown specification version is provided.

-
-
-
-
-
-
Type
-
- - - TypeError - - - - - -
-
-
-
-
- - - - - - - -
- - - - - - - - - - - - - - -

Methods

- - - - - - - - - - - - - -

- headers(event) → {Object} -

-
- - - - - -
-

Returns the HTTP headers that will be sent for this event when the HTTP transmission -mode is "binary". Events sent over HTTP in structured mode only have a single CE header -and that is "ce-id", corresponding to the event ID.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
event - - - - CloudEvent - - - - - - - -

a CloudEvent

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

- send(event, optionsopt) → {Promise} -

-
- - - - - -
-

Sends the {CloudEvent} to an event receiver over HTTP POST

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
event - - - - CloudEvent - - - - - - - - - - - - - -

the CloudEvent to be sent

- -
options - - - - Object - - - - - - - - - <optional>
- - - - - -
-

The configuration options for this event. Options -provided will be passed along to Node.js http.request(). -https://nodejs.org/api/http.html#http_http_request_options_callback

- -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
url - - - - URL - - - - - - - - - <optional>
- - - - - -
-

The HTTP/S url that should receive this event. -The URL is optional if one was provided when this emitter was constructed. -In that case, it will be used as the recipient endpoint. The endpoint can -be overridden by providing a URL here.

- -
mode - - - - string - - - - - - - - - <optional>
- - - - - -
-

the message mode for sending this event. -Possible values are "binary" and "structured". Default: structured

- -
- - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/HTTPReceiver.html b/docs/HTTPReceiver.html deleted file mode 100644 index cc774cb..0000000 --- a/docs/HTTPReceiver.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - - - - - HTTPReceiver - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- HTTPReceiver -

- - - - -
-
- -

- - HTTPReceiver - -

- - -
-

/** -A class to receive a CloudEvent from an HTTP POST request.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new HTTPReceiver() -

-
- - - - - -
-

Create an instance of an HTTPReceiver to accept incoming CloudEvents.

-
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Methods

- - - - - - - - - - - - - -

- accept(headers, body) → {CloudEvent} -

-
- - - - - -
-

Acceptor for an incoming HTTP CloudEvent POST. Can process -binary and structured incoming CloudEvents.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
headers - - - - Object - - - - - - - -

HTTP headers keyed by header name ("Content-Type")

- -
body - - - - Object - - - | - - - JSON - - - - - - - -

The body of the HTTP request

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/StructuredHTTPEmitter.html b/docs/StructuredHTTPEmitter.html deleted file mode 100644 index 04e0b12..0000000 --- a/docs/StructuredHTTPEmitter.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - - - - - - StructuredHTTPEmitter - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- StructuredHTTPEmitter -

- - - - -
-
- -

- - StructuredHTTPEmitter - -

- - -
-

const { -DATA_ATTRIBUTE, -DEFAULT_CE_CONTENT_TYPE, -HEADERS, -HEADER_CONTENT_TYPE -} = require("./constants.js");

-

const defaults = { -[HEADERS]: { -[HEADER_CONTENT_TYPE]: DEFAULT_CE_CONTENT_TYPE -}, -method: "POST" -};

-

/** -A class for sending {CloudEvent} instances over HTTP.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new StructuredHTTPEmitter() -

-
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Methods

- - - - - - - - - - - - - -

- (async) emit(options, cloudevent) → {Promise} -

-
- - - - - -
-

Sends the event over HTTP

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
options - - - - Object - - - - - - - -

The configuration options for this event. Options -provided will be passed along to Node.js http.request(). -https://nodejs.org/api/http.html#http_http_request_options_callback

- -
Properties
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
url - - - - URL - - - - - - - -

The HTTP/S url that should receive this event

- -
- - -
cloudevent - - - - CloudEvent - - - - - - - -

The CloudEvent to be sent

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/StructuredHTTPReceiver.html b/docs/StructuredHTTPReceiver.html deleted file mode 100644 index 7993007..0000000 --- a/docs/StructuredHTTPReceiver.html +++ /dev/null @@ -1,726 +0,0 @@ - - - - - - - - - StructuredHTTPReceiver - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- StructuredHTTPReceiver -

- - - - -
-
- -

- - StructuredHTTPReceiver - -

- - -
-

/** -A utility class used to receive structured CloudEvents -over HTTP.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new StructuredHTTPReceiver(version) -

-
- - - - - -
-

Creates a new StructuredHTTPReceiver. Supports Cloud Events specification -versions 0.3 and 1.0 (default).

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
version - - - - string - - - - - - - -

the Cloud Events specification version. Default: 1.0.

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - -
See:
-
-
    - -
  • - {StructuredReceiver} -
  • - -
-
- - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -

Methods

- - - - - - - - - - - - - -

- check(payload, headers) → {boolean} -

-
- - - - - -
-

Checks whether the provided payload and headers conform to the Cloud Events -specification version supported by this instance.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
payload - - - - object - - - - - - - -

the cloud event data payload

- -
headers - - - - object - - - - - - - -

the HTTP headers received for this cloud event

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

if the payload and header combination do not conform to the spec

-
-
-
-
-
-
Type
-
- - - ValidationError - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - -

- parse(payload, headers) → {CloudEvent} -

-
- - - - - -
-

Creates a new CloudEvent instance based on the provided payload and headers.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
payload - - - - object - - - - - - - -

the cloud event data payload

- -
headers - - - - object - - - - - - - -

the HTTP headers received for this cloud event

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - -
Throws:
- - - -
-
-
-

if the payload and header combination do not conform to the spec

-
-
-
-
-
-
Type
-
- - - ValidationError - - - - - -
-
-
-
-
- - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/ValidationError.html b/docs/ValidationError.html deleted file mode 100644 index 3f4f301..0000000 --- a/docs/ValidationError.html +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - - - ValidationError - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- ValidationError -

- - - - -
-
- -

- - ValidationError - -

- - -
-

A Error class that will be thrown when a CloudEvent -cannot be properly validated against a specification.

-
- - -
- -
-
- - - - - -

Constructor

- - - - - - - - -

- new ValidationError(message, errorsopt) -

-
- - - - - -
-

Constructs a new {ValidationError} with the message -and array of additional errors.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeAttributesDescription
message - - - - string - - - - - - - - - - - - - -

the error message

- -
errors - - - - Array.<string> - - - | - - - Array.<ErrorObject> - - - - - - - - - <optional>
- - - - - -
-

any additional errors related to validation

- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/bindings_http_emitter_binary.js.html b/docs/bindings_http_emitter_binary.js.html deleted file mode 100644 index 5827d25..0000000 --- a/docs/bindings_http_emitter_binary.js.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - bindings/http/emitter_binary.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/emitter_binary.js -

- - - - - -
-
-
const { default: Axios } = require("axios");
-const EmitterV1 = require("./v1").BinaryEmitter;
-const EmitterV3 = require("./v03").BinaryEmitter;
-
-const {
-  HEADERS,
-  BINARY_HEADERS_03,
-  BINARY_HEADERS_1,
-  HEADER_CONTENT_TYPE,
-  DEFAULT_CONTENT_TYPE,
-  DATA_ATTRIBUTE,
-  SPEC_V1,
-  SPEC_V03
-} = require("./constants.js");
-
-const defaults = {
-  [HEADERS]: {
-    [HEADER_CONTENT_TYPE]: DEFAULT_CONTENT_TYPE
-  },
-  method: "POST"
-};
-
-/**
- * A class to emit binary CloudEvents over HTTP.
- */
-class BinaryHTTPEmitter {
-  /**
-   * Create a new {BinaryHTTPEmitter} for the provided CloudEvent specification version.
-   * Once an instance is created for a given spec version, it may only be used to send
-   * events for that version.
-   * Default version is 1.0
-   * @param {string} version - the CloudEvent HTTP specification version.
-   * Default: 1.0
-   */
-  constructor(version) {
-    if (version === SPEC_V1) {
-      this.headerParserMap = EmitterV1;
-      this.extensionPrefix = BINARY_HEADERS_1.EXTENSIONS_PREFIX;
-    } else if (version === SPEC_V03) {
-      this.headerParserMap = EmitterV3;
-      this.extensionPrefix = BINARY_HEADERS_03.EXTENSIONS_PREFIX;
-    }
-  }
-
-  /**
-   * Sends this cloud event to a receiver over HTTP.
-   *
-   * @param {Object} options The configuration options for this event. Options
-   * provided other than `url` will be passed along to Node.js `http.request`.
-   * https://nodejs.org/api/http.html#http_http_request_options_callback
-   * @param {URL} options.url The HTTP/S url that should receive this event
-   * @param {Object} cloudevent the CloudEvent to be sent
-   * @returns {Promise} Promise with an eventual response from the receiver
-   */
-  async emit(options, cloudevent) {
-    const config = { ...options, ...defaults };
-    const headers = config[HEADERS];
-
-    this.headerParserMap.forEach((parser, getterName) => {
-      const value = cloudevent[getterName];
-      if (value) {
-        headers[parser.headerName] = parser.parse(value);
-      }
-    });
-
-    // Set the cloudevent payload
-    const formatted = cloudevent.format();
-    let data = formatted.data;
-    data = (formatted.data_base64 ? formatted.data_base64 : data);
-
-    // Have extensions?
-    const exts = cloudevent.getExtensions();
-    Object.keys(exts)
-      .filter((ext) => Object.hasOwnProperty.call(exts, ext))
-      .forEach((ext) => {
-        headers[this.extensionPrefix + ext] = exts[ext];
-      });
-
-    config[DATA_ATTRIBUTE] = data;
-    config[HEADERS] = headers;
-
-    // Return the Promise
-    // @ts-ignore  Types of property 'url' are incompatible. Type 'URL' is not assignable to type 'string'.
-    return Axios.request(config);
-  }
-}
-
-module.exports = BinaryHTTPEmitter;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_emitter_structured.js.html b/docs/bindings_http_emitter_structured.js.html deleted file mode 100644 index 53d53d0..0000000 --- a/docs/bindings_http_emitter_structured.js.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - bindings/http/emitter_structured.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/emitter_structured.js -

- - - - - -
-
-
const { default: Axios } = require("axios");
-
-/** @typedef {import("../../cloudevent")} CloudEvent */
-
-const {
-  DATA_ATTRIBUTE,
-  DEFAULT_CE_CONTENT_TYPE,
-  HEADERS,
-  HEADER_CONTENT_TYPE
-} = require("./constants.js");
-
-const defaults = {
-  [HEADERS]: {
-    [HEADER_CONTENT_TYPE]: DEFAULT_CE_CONTENT_TYPE
-  },
-  method: "POST"
-};
-
-/**
- * A class for sending {CloudEvent} instances over HTTP.
- */
-class StructuredHTTPEmitter {
-  // TODO: Do we really need a class here? There is no state maintenance
-
-  /**
-   * Sends the event over HTTP
-   * @param {Object} options The configuration options for this event. Options
-   * provided will be passed along to Node.js `http.request()`.
-   * https://nodejs.org/api/http.html#http_http_request_options_callback
-   * @param {URL} options.url The HTTP/S url that should receive this event
-   * @param {CloudEvent} cloudevent The CloudEvent to be sent
-   * @returns {Promise} Promise with an eventual response from the receiver
-   */
-  async emit(options, cloudevent) {
-    const config = { ...defaults, ...options };
-    config[DATA_ATTRIBUTE] = cloudevent.format();
-    // @ts-ignore Types of property 'url' are incompatible. Type 'URL' is not assignable to type 'string'.
-    return Axios.request(config);
-  }
-}
-
-module.exports = StructuredHTTPEmitter;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_http_emitter.js.html b/docs/bindings_http_http_emitter.js.html deleted file mode 100644 index e961db5..0000000 --- a/docs/bindings_http_http_emitter.js.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - bindings/http/http_emitter.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/http_emitter.js -

- - - - - -
-
-
const BinaryHTTPEmitter = require("./emitter_binary.js");
-const StructuredEmitter = require("./emitter_structured.js");
-
-/** @typedef {import("../../cloudevent")} CloudEvent */
-
-const {
-  SPEC_V03,
-  SPEC_V1
-} = require("./constants");
-
-/**
- * A class which is capable of sending binary and structured events using
- * the CloudEvents HTTP Protocol Binding specification.
- *
- * @see https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md
- * @see https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md#13-content-modes
- */
-class HTTPEmitter {
-  /**
-   * Creates a new instance of {HTTPEmitter}. The default emitter uses the 1.0
-   * protocol specification in binary mode.
-   *
-   * @param {Object} [options] The configuration options for this event emitter
-   * @param {URL} options.url The endpoint that will receive the sent events.
-   * @param {string} [options.version] The HTTP binding specification version. Default: "1.0"
-   * @throws {TypeError} if no options.url is provided or an unknown specification version is provided.
-   */
-  constructor({ url, version = SPEC_V1 } = { url: undefined }) {
-    if (version !== SPEC_V03 && version !== SPEC_V1) {
-      throw new TypeError(
-        `Unknown CloudEvent specification version: ${version}`);
-    }
-    if (!url) {
-      throw new TypeError("A default endpoint URL is required for a CloudEvent emitter");
-    }
-    this.binary = new BinaryHTTPEmitter(version);
-    this.structured = new StructuredEmitter();
-    this.url = url;
-  }
-
-  /**
-   * Sends the {CloudEvent} to an event receiver over HTTP POST
-   *
-   * @param {CloudEvent} event the CloudEvent to be sent
-   * @param {Object} [options] The configuration options for this event. Options
-   * provided will be passed along to Node.js `http.request()`.
-   * https://nodejs.org/api/http.html#http_http_request_options_callback
-   * @param {URL} [options.url] The HTTP/S url that should receive this event.
-   * The URL is optional if one was provided when this emitter was constructed.
-   * In that case, it will be used as the recipient endpoint. The endpoint can
-   * be overridden by providing a URL here.
-   * @param {string} [options.mode] the message mode for sending this event.
-   * Possible values are "binary" and "structured". Default: structured
-   * @returns {Promise} Promise with an eventual response from the receiver
-   */
-  send(event, { url, mode = "binary", ...httpOpts } = { url: undefined }) {
-    if (!url) { url = this.url; }
-    // @ts-ignore Property 'url' does not exist on type '{}'
-    httpOpts.url = url;
-    if (mode === "binary") {
-      // @ts-ignore Property 'url' is missing in type '{}' but required in type '{ url: URL; }'.
-      return this.binary.emit(httpOpts, event);
-    } else if (mode === "structured") {
-      // @ts-ignore Property 'url' is missing in type '{}' but required in type '{ url: URL; }'.
-      return this.structured.emit(httpOpts, event);
-    }
-    throw new TypeError(`Unknown transport mode ${mode}.`);
-  }
-
-  /**
-   * Returns the HTTP headers that will be sent for this event when the HTTP transmission
-   * mode is "binary". Events sent over HTTP in structured mode only have a single CE header
-   * and that is "ce-id", corresponding to the event ID.
-   * @param {CloudEvent} event a CloudEvent
-   * @returns {Object} the headers that will be sent for the event
-   */
-  headers(event) {
-    const headers = {};
-
-    this.binary.headerParserMap.forEach((parser, getterName) => {
-      const value = event[getterName];
-      if (value) {
-        headers[parser.headerName] = parser.parse(value);
-      }
-    });
-
-    return headers;
-  }
-}
-
-module.exports = HTTPEmitter;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_http_receiver.js.html b/docs/bindings_http_http_receiver.js.html deleted file mode 100644 index b508e52..0000000 --- a/docs/bindings_http_http_receiver.js.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - bindings/http/http_receiver.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/http_receiver.js -

- - - - - -
-
-
// const V03Binary = require("./receiver_binary_0_3.js");
-// const V03Structured = require("./v03/receiver_structured_0_3.js");
-// const V1Binary = require("./receiver_binary_1.js");
-// const V1Structured = require("./v1/receiver_structured_1.js");
-const BinaryReceiver = require("./receiver_binary.js");
-const StructuredReceiver = require("./receiver_structured.js");
-const ValidationError = require("./validation/validation_error.js");
-const {
-  BINARY,
-  STRUCTURED,
-  SPEC_V03,
-  SPEC_V1,
-  HEADER_CONTENT_TYPE,
-  MIME_CE,
-  BINARY_HEADERS_1,
-  DEFAULT_SPEC_VERSION_HEADER
-} = require("./constants");
-
-/** @typedef {import("../../cloudevent")} CloudEvent */
-
-/**
- * A class to receive a CloudEvent from an HTTP POST request.
- */
-class HTTPReceiver {
-  /**
-   * Create an instance of an HTTPReceiver to accept incoming CloudEvents.
-   */
-  constructor() {
-    this.receivers = {
-      v1: {
-        structured: new StructuredReceiver(SPEC_V1),
-        binary: new BinaryReceiver(SPEC_V1)
-      },
-      v03: {
-        structured: new StructuredReceiver(SPEC_V03),
-        binary: new BinaryReceiver(SPEC_V03)
-      }
-    };
-  }
-
-  /**
-   * Acceptor for an incoming HTTP CloudEvent POST. Can process
-   * binary and structured incoming CloudEvents.
-   *
-   * @param {Object} headers HTTP headers keyed by header name ("Content-Type")
-   * @param {Object|JSON} body The body of the HTTP request
-   * @return {CloudEvent} A new {CloudEvent} instance
-   */
-  accept(headers, body) {
-    const mode = getMode(headers);
-    const version = getVersion(mode, headers, body);
-    switch (version) {
-      case SPEC_V1:
-        return this.receivers.v1[mode].parse(body, headers);
-      case SPEC_V03:
-        return this.receivers.v03[mode].parse(body, headers);
-      default:
-        console.error(
-          `Unknown spec version ${version}. Default to ${SPEC_V1}`);
-        return this.receivers.v1[mode].parse(body, headers);
-    }
-  }
-}
-
-function getMode(headers) {
-  const contentType = headers[HEADER_CONTENT_TYPE];
-  if (contentType && contentType.startsWith(MIME_CE)) {
-    return STRUCTURED;
-  }
-  if (headers[BINARY_HEADERS_1.ID]) {
-    return BINARY;
-  }
-  throw new ValidationError("no cloud event detected");
-}
-
-function getVersion(mode, headers, body) {
-  if (mode === BINARY) {
-    // Check the headers for the version
-    const versionHeader = headers[DEFAULT_SPEC_VERSION_HEADER];
-    if (versionHeader) {
-      return versionHeader;
-    }
-  } else {
-    // structured mode - the version is in the body
-    return (typeof body === "string")
-      ? JSON.parse(body).specversion : body.specversion;
-  }
-  return SPEC_V1;
-}
-
-module.exports = HTTPReceiver;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_receiver_binary.js.html b/docs/bindings_http_receiver_binary.js.html deleted file mode 100644 index b0b05a9..0000000 --- a/docs/bindings_http_receiver_binary.js.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - bindings/http/receiver_binary.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/receiver_binary.js -

- - - - - -
-
-
const ReceiverV1 = require("./v1/receiver_binary_1.js");
-const ReceiverV3 = require("./v03/receiver_binary_0_3.js");
-
-const { SPEC_V03, SPEC_V1 } = require("./constants.js");
-const { check, parse } = require("./validation/binary.js");
-
-/** @typedef {import("../../cloudevent")} CloudEvent */
-
-/**
- * A class that receives binary CloudEvents over HTTP. This class can be used
- * if you know that all incoming events will be using binary transport. If
- * events can come as either binary or structured, use {HTTPReceiver}.
- */
-class BinaryHTTPReceiver {
-  /**
-   * Creates a new BinaryHTTPReceiver to accept events over HTTP.
-   *
-   * @param {string} version the Cloud Event specification version to use. Default "1.0"
-   */
-  constructor(version = SPEC_V1) {
-    if (version === SPEC_V1) {
-      this.receiver = new ReceiverV1();
-    } else if (version === SPEC_V03) {
-      this.receiver = new ReceiverV3();
-    }
-  }
-
-  /**
-   * Checks an incoming HTTP request to determine if it conforms to the
-   * Cloud Event specification for this receiver.
-   *
-   * @param {Object} payload the HTTP request body
-   * @param {Object} headers  the HTTP request headers
-   * @returns {boolean} true if the the provided payload and headers conform to the spec
-   * @throws {ValidationError} if the event does not conform to the spec
-   */
-  check(payload, headers) {
-    return check(payload, headers, this.receiver);
-  }
-
-  /**
-   * Parses an incoming HTTP request, converting it to a {CloudEvent}
-   * instance if it conforms to the Cloud Event specification for this receiver.
-   *
-   * @param {Object} payload the HTTP request body
-   * @param {Object} headers the HTTP request headers
-   * @returns {CloudEvent} an instance of CloudEvent representing the incoming request
-   * @throws {ValidationError} of the event does not conform to the spec
-   */
-  parse(payload, headers) {
-    return parse(payload, headers, this.receiver);
-  }
-}
-
-module.exports = BinaryHTTPReceiver;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_receiver_structured.js.html b/docs/bindings_http_receiver_structured.js.html deleted file mode 100644 index b1fcb6f..0000000 --- a/docs/bindings_http_receiver_structured.js.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - bindings/http/receiver_structured.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/receiver_structured.js -

- - - - - -
-
-
const ReceiverV1 = require("./v1/receiver_structured_1.js");
-const ReceiverV3 = require("./v03/receiver_structured_0_3.js");
-
-const { SPEC_V03, SPEC_V1 } = require("./constants.js");
-const { check, parse } = require("./validation/structured.js");
-
-/** @typedef {import("../../cloudevent")} CloudEvent */
-
-/**
- * A utility class used to receive structured CloudEvents
- * over HTTP.
- * @see {StructuredReceiver}
- */
-class StructuredHTTPReceiver {
-  /**
-   * Creates a new StructuredHTTPReceiver. Supports Cloud Events specification
-   * versions 0.3 and 1.0 (default).
-   *
-   * @param {string} version the Cloud Events specification version. Default: 1.0.
-   */
-  constructor(version = SPEC_V1) {
-    if (version === SPEC_V1) {
-      this.receiver = new ReceiverV1();
-    } else if (version === SPEC_V03) {
-      this.receiver = new ReceiverV3();
-    }
-  }
-
-  /**
-   * Checks whether the provided payload and headers conform to the Cloud Events
-   * specification version supported by this instance.
-   *
-   * @param {object} payload the cloud event data payload
-   * @param {object} headers the HTTP headers received for this cloud event
-   * @returns {boolean} true if the payload and header combination are valid
-   * @throws {ValidationError} if the payload and header combination do not conform to the spec
-   */
-  check(payload, headers) {
-    return check(payload, headers, this.receiver);
-  }
-
-  /**
-   * Creates a new CloudEvent instance based on the provided payload and headers.
-   *
-   * @param {object} payload the cloud event data payload
-   * @param {object} headers  the HTTP headers received for this cloud event
-   * @returns {CloudEvent} a new CloudEvent instance for the provided headers and payload
-   * @throws {ValidationError} if the payload and header combination do not conform to the spec
-   */
-  parse(payload, headers) {
-    return parse(payload, headers, this.receiver);
-  }
-}
-
-module.exports = StructuredHTTPReceiver;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_v03_emitter_binary_0_3.js.html b/docs/bindings_http_v03_emitter_binary_0_3.js.html deleted file mode 100644 index b8ebec5..0000000 --- a/docs/bindings_http_v03_emitter_binary_0_3.js.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - bindings/http/v03/emitter_binary_0_3.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/v03/emitter_binary_0_3.js -

- - - - - -
-
-
const {
-  HEADER_CONTENT_TYPE,
-  BINARY_HEADERS_03 : {
-   CONTENT_ENCODING,
-   SUBJECT,
-   TYPE,
-   SPEC_VERSION,
-   SOURCE,
-   ID,
-   TIME,
-   SCHEMA_URL
-  }
-} = require("../constants.js");
-
-function parser(header, parser = (v) => v) {
-  return { headerName: header, parse: parser };
-}
-const passThroughParser = parser;
-
-/**
- * A utility Map used to retrieve the header names for a CloudEvent
- * using the CloudEvent getter function.
- */
-const headerMap = new Map();
-headerMap.set("dataContentType", passThroughParser(HEADER_CONTENT_TYPE));
-headerMap.set("dataContentEncoding", passThroughParser(CONTENT_ENCODING));
-headerMap.set("subject", passThroughParser(SUBJECT));
-headerMap.set("type", passThroughParser(TYPE));
-headerMap.set("specversion", passThroughParser(SPEC_VERSION));
-headerMap.set("source", passThroughParser(SOURCE));
-headerMap.set("id", passThroughParser(ID));
-headerMap.set("time", passThroughParser(TIME));
-headerMap.set("schemaURL", passThroughParser(SCHEMA_URL));
-
-module.exports = headerMap;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_v1_emitter_binary_1.js.html b/docs/bindings_http_v1_emitter_binary_1.js.html deleted file mode 100644 index d8bc9cc..0000000 --- a/docs/bindings_http_v1_emitter_binary_1.js.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - bindings/http/v1/emitter_binary_1.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/v1/emitter_binary_1.js -

- - - - - -
-
-
const {
-  HEADER_CONTENT_TYPE,
-  BINARY_HEADERS_1 : {
-   SUBJECT,
-   TYPE,
-   SPEC_VERSION,
-   SOURCE,
-   ID,
-   TIME,
-   DATA_SCHEMA
- }
-} = require("../constants.js");
-
-function parser(header, parser = (v) => v) {
-  return { headerName: header, parse: parser };
-}
-const passThroughParser = parser;
-
-/**
- * A utility Map used to retrieve the header names for a CloudEvent
- * using the CloudEvent getter function.
- */
-const headerMap = new Map();
-headerMap.set("dataContentType", passThroughParser(HEADER_CONTENT_TYPE));
-headerMap.set("subject", passThroughParser(SUBJECT));
-headerMap.set("type", passThroughParser(TYPE));
-headerMap.set("specversion", passThroughParser(SPEC_VERSION));
-headerMap.set("source", passThroughParser(SOURCE));
-headerMap.set("id", passThroughParser(ID));
-headerMap.set("time", passThroughParser(TIME));
-headerMap.set("dataSchema", passThroughParser(DATA_SCHEMA));
-
-module.exports = headerMap;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_validation_validation_error.js.html b/docs/bindings_http_validation_validation_error.js.html deleted file mode 100644 index a981e78..0000000 --- a/docs/bindings_http_validation_validation_error.js.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - bindings/http/validation/validation_error.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/validation/validation_error.js -

- - - - - -
-
-
/**
- * @ignore
- * @typedef {import("ajv").ErrorObject} ErrorObject
- * */
-
-/**
- * A Error class that will be thrown when a CloudEvent
- * cannot be properly validated against a specification.
- */
-class ValidationError extends TypeError {
-  /**
-   * Constructs a new {ValidationError} with the message
-   * and array of additional errors.
-   * @param {string} message the error message
-   * @param {string[]|ErrorObject[]} [errors] any additional errors related to validation
-   */
-  constructor(message, errors) {
-    super(message);
-    this.errors = errors ? errors : [];
-  }
-}
-
-module.exports = ValidationError;
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/cloudevent.js.html b/docs/cloudevent.js.html deleted file mode 100644 index af4d093..0000000 --- a/docs/cloudevent.js.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - - - - - - cloudevent.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- cloudevent.js -

- - - - - -
-
-
const Spec1 = require("./bindings/http/v1/spec_1.js");
-const Spec03 = require("./bindings/http/v03/spec_0_3.js");
-const Formatter = require("./formats/json/formatter.js");
-
-const { SPEC_V1, SPEC_V03 } = require("./bindings/http/constants.js");
-const { isBinary } = require("./bindings/http/validation/fun.js");
-
-/**
- * An CloudEvent describes event data in common formats to provide
- * interopability across services, platforms and systems.
- * @see https://github.com/cloudevents/spec/blob/v1.0/spec.md
- */
-class CloudEvent {
-  /**
-   * Creates a new CloudEvent instance
-   * @param {object} options CloudEvent properties as a simple object
-   * @param {string} options.source Identifies the context in which an event happened as a URI reference
-   * @param {string} options.type Describes the type of event related to the originating occurrence
-   * @param {string} [options.id] A unique ID for this event - if not supplied, will be autogenerated
-   * @param {string} [options.time] A timestamp for this event. May also be provided as a Date
-   * @param {string} [options.subject] Describes the subject of the event in the context of the event producer
-   * @param {string} [options.dataContentType] The mime content type for the event data
-   * @param {string} [options.dataSchema] The URI of the schema that the event data adheres to (v1.0 events)
-   * @param {string} [options.schemaURL]  The URI of the schema that the event data adheres to (v0.3 events)
-   * @param {string} [options.dataContentEncoding] The content encoding for the event data (v0.3 events)
-   * @param {string} [options.specversion] The CloudEvent specification version for this event - default: 1.0
-   * @param {*} [options.data] The event payload
-   */
-  constructor({
-    id,
-    source,
-    type,
-    dataContentType,
-    time,
-    subject,
-    dataSchema,
-    schemaURL,
-    dataContentEncoding,
-    data,
-    specversion = SPEC_V1 } = {
-      id: undefined,
-      source: undefined,
-      type: undefined,
-      dataContentType: undefined,
-      time: undefined,
-      subject: undefined,
-      dataSchema: undefined,
-      schemaURL: undefined,
-      dataContentEncoding: undefined,
-      data: undefined
-    }) {
-
-    if (!type || !source) {
-      throw new TypeError("event type and source are required");
-    }
-
-    switch (specversion) {
-      case SPEC_V1:
-        this.spec = new Spec1();
-        break;
-      case SPEC_V03:
-        this.spec = new Spec03();
-        break;
-      default:
-        throw new TypeError(`unknown specification version ${specversion}`);
-    }
-    this.source = source;
-    this.type = type;
-    this.dataContentType = dataContentType;
-    this.data = data;
-    this.subject = subject;
-
-    if (dataSchema) {
-      this.dataSchema = dataSchema;
-    }
-
-    // TODO: Deprecated in 1.0
-    if (dataContentEncoding) {
-      this.dataContentEncoding = dataContentEncoding;
-    }
-
-    // TODO: Deprecated in 1.0
-    if (schemaURL) {
-      this.schemaURL = schemaURL;
-    }
-
-    if (id) {
-      this.id = id;
-    }
-
-    if (time) {
-      this.time = time;
-    }
-    this.formatter = new Formatter();
-  }
-
-  /**
-   * Gets or sets the event id. Source + id must be unique for each distinct event.
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#id
-   * @type {string}
-  */
-  get id() {
-    return this.spec.id;
-  }
-
-  set id(id) {
-    this.spec.id = id;
-  }
-
-  /**
-   * Gets or sets the origination source of this event as a URI.
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#source-1
-   */
-  get source() {
-    return this.spec.source;
-  }
-
-  set source(source) {
-    this.spec.source = source;
-  }
-
-  /**
-   * Gets the CloudEvent specification version
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#specversion
-   */
-  get specversion() {
-    return this.spec.specversion;
-  }
-
-  /**
-   * Gets or sets the event type
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#type
-   */
-  get type() {
-    return this.spec.type;
-  }
-
-  set type(type) {
-    this.spec.type = type;
-  }
-
-  /**
-   * Gets or sets the content type of the data value for this event
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#datacontenttype
-   */
-  get dataContentType() {
-    return this.spec.dataContentType;
-  }
-
-  set dataContentType(contenttype) {
-    this.spec.dataContentType = contenttype;
-  }
-
-  /**
-   * Gets or sets the event's data schema
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/v1.0/spec.md#dataschema
-   */
-  get dataSchema() {
-    if (this.spec instanceof Spec1) {
-      return this.spec.dataSchema;
-    }
-    throw new TypeError("cannot get dataSchema from version 0.3 event");
-  }
-
-  set dataSchema(dataschema) {
-    if (this.spec instanceof Spec1) {
-      this.spec.dataSchema = dataschema;
-    } else {
-      throw new TypeError("cannot set dataSchema on version 0.3 event");
-    }
-  }
-
-  /**
-   * Gets or sets the event's data content encoding
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/v0.3/spec.md#datacontentencoding
-   */
-  get dataContentEncoding() {
-    if (this.spec instanceof Spec03) {
-      return this.spec.dataContentEncoding;
-    }
-    throw new TypeError("cannot get dataContentEncoding from version 1.0 event");
-  }
-
-  set dataContentEncoding(dataContentEncoding) {
-    if (this.spec instanceof Spec03) {
-      this.spec.dataContentEncoding = dataContentEncoding;
-    } else {
-      throw new TypeError("cannot set dataContentEncoding on version 1.0 event");
-    }
-  }
-
-  /**
-   * Gets or sets the event subject
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/v1.0/spec.md#subject
-   */
-  get subject() {
-    return this.spec.subject;
-  }
-
-  set subject(subject) {
-    this.spec.subject = subject;
-  }
-
-  /**
-   * Gets or sets the timestamp for this event as an ISO formatted date string
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#time
-   */
-  get time() {
-    return this.spec.time;
-  }
-
-  set time(time) {
-    this.spec.time = new Date(time).toISOString();
-  }
-
-  /**
-   * DEPRECATED: Gets or sets the schema URL for this event. Throws {TypeError}
-   * if this is a version 1.0 event.
-   * @type {string}
-   * @see https://github.com/cloudevents/spec/blob/v0.3/spec.md#schemaurl
-   */
-  get schemaURL() {
-    if (this.spec instanceof Spec03) {
-      return this.spec.schemaURL;
-    }
-    throw new TypeError("cannot get schemaURL from version 1.0 event");
-  }
-
-  // TODO: Deprecated in 1.0
-  set schemaURL(schemaurl) {
-    if (schemaurl && (this.spec instanceof Spec03)) {
-      this.spec.schemaURL = schemaurl;
-    } else if (schemaurl) {
-      throw new TypeError("cannot set schemaURL on version 1.0 event");
-    }
-  }
-
-
-  /**
-   * Gets or sets the data for this event
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#event-data
-   * @type {*}
-   */
-  get data() {
-    return this.spec.data;
-  }
-
-  set data(data) {
-    this.spec.data = data;
-  }
-
-  /**
-   * Formats the CloudEvent as JSON. Validates the event according
-   * to the CloudEvent specification and throws an exception if
-   * it's invalid.
-   * @returns {JSON} the CloudEvent in JSON form
-   * @throws {ValidationError} if this event cannot be validated against the specification
-   */
-  format() {
-    this.spec.check();
-    const payload = {
-      data: undefined,
-      data_base64: undefined,
-      ...this.spec.payload
-    };
-
-    // Handle when is binary, creating the data_base64
-    if (isBinary(payload.data)) {
-      // TODO: The call to this.spec.data formats the binary data
-      // I think having a side effect like this is an anti-pattern.
-      // FIXIT
-      payload.data_base64 = this.spec.data;
-      delete payload.data;
-    } else {
-      delete payload.data_base64;
-    }
-    return this.formatter.format(payload);
-  }
-
-  /**
-   * Formats the CloudEvent as JSON. No specification validation is performed.
-   * @returns {string} the CloudEvent as a JSON string
-   */
-  toString() {
-    return this.formatter.toString(this.spec.payload);
-  }
-
-  /**
-   * Adds an extension attribute to this CloudEvent
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes
-   * @param {string} key the name of the extension attribute
-   * @param {*} value the value of the extension attribute
-   * @returns {void}
-   */
-  addExtension(key, value) {
-    this.spec.addExtension(key, value);
-    this.extensions = { [key]: value, ...this.extensions };
-  }
-
-  /**
-   * Gets the extension attributes, if any, associated with this event
-   * @see https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes
-   * @returns {Object} the extensions attributes - if none exist will will be {}
-   */
-  getExtensions() {
-    return this.extensions;
-  }
-}
-
-module.exports = CloudEvent;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/fonts/OpenSans-Bold-webfont.eot b/docs/fonts/OpenSans-Bold-webfont.eot deleted file mode 100644 index 5d20d91..0000000 Binary files a/docs/fonts/OpenSans-Bold-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-Bold-webfont.svg b/docs/fonts/OpenSans-Bold-webfont.svg deleted file mode 100644 index 3ed7be4..0000000 --- a/docs/fonts/OpenSans-Bold-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-Bold-webfont.woff b/docs/fonts/OpenSans-Bold-webfont.woff deleted file mode 100644 index 1205787..0000000 Binary files a/docs/fonts/OpenSans-Bold-webfont.woff and /dev/null differ diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.eot b/docs/fonts/OpenSans-BoldItalic-webfont.eot deleted file mode 100644 index 1f639a1..0000000 Binary files a/docs/fonts/OpenSans-BoldItalic-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.svg b/docs/fonts/OpenSans-BoldItalic-webfont.svg deleted file mode 100644 index 6a2607b..0000000 --- a/docs/fonts/OpenSans-BoldItalic-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.woff b/docs/fonts/OpenSans-BoldItalic-webfont.woff deleted file mode 100644 index ed760c0..0000000 Binary files a/docs/fonts/OpenSans-BoldItalic-webfont.woff and /dev/null differ diff --git a/docs/fonts/OpenSans-Italic-webfont.eot b/docs/fonts/OpenSans-Italic-webfont.eot deleted file mode 100644 index 0c8a0ae..0000000 Binary files a/docs/fonts/OpenSans-Italic-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-Italic-webfont.svg b/docs/fonts/OpenSans-Italic-webfont.svg deleted file mode 100644 index e1075dc..0000000 --- a/docs/fonts/OpenSans-Italic-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-Italic-webfont.woff b/docs/fonts/OpenSans-Italic-webfont.woff deleted file mode 100644 index ff652e6..0000000 Binary files a/docs/fonts/OpenSans-Italic-webfont.woff and /dev/null differ diff --git a/docs/fonts/OpenSans-Light-webfont.eot b/docs/fonts/OpenSans-Light-webfont.eot deleted file mode 100644 index 1486840..0000000 Binary files a/docs/fonts/OpenSans-Light-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-Light-webfont.svg b/docs/fonts/OpenSans-Light-webfont.svg deleted file mode 100644 index 11a472c..0000000 --- a/docs/fonts/OpenSans-Light-webfont.svg +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-Light-webfont.woff b/docs/fonts/OpenSans-Light-webfont.woff deleted file mode 100644 index e786074..0000000 Binary files a/docs/fonts/OpenSans-Light-webfont.woff and /dev/null differ diff --git a/docs/fonts/OpenSans-LightItalic-webfont.eot b/docs/fonts/OpenSans-LightItalic-webfont.eot deleted file mode 100644 index 8f44592..0000000 Binary files a/docs/fonts/OpenSans-LightItalic-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-LightItalic-webfont.svg b/docs/fonts/OpenSans-LightItalic-webfont.svg deleted file mode 100644 index 431d7e3..0000000 --- a/docs/fonts/OpenSans-LightItalic-webfont.svg +++ /dev/null @@ -1,1835 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-LightItalic-webfont.woff b/docs/fonts/OpenSans-LightItalic-webfont.woff deleted file mode 100644 index 43e8b9e..0000000 Binary files a/docs/fonts/OpenSans-LightItalic-webfont.woff and /dev/null differ diff --git a/docs/fonts/OpenSans-Regular-webfont.eot b/docs/fonts/OpenSans-Regular-webfont.eot deleted file mode 100644 index 6bbc3cf..0000000 Binary files a/docs/fonts/OpenSans-Regular-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-Regular-webfont.svg b/docs/fonts/OpenSans-Regular-webfont.svg deleted file mode 100644 index 25a3952..0000000 --- a/docs/fonts/OpenSans-Regular-webfont.svg +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-Regular-webfont.woff b/docs/fonts/OpenSans-Regular-webfont.woff deleted file mode 100644 index e231183..0000000 Binary files a/docs/fonts/OpenSans-Regular-webfont.woff and /dev/null differ diff --git a/docs/fonts/OpenSans-Semibold-webfont.eot b/docs/fonts/OpenSans-Semibold-webfont.eot deleted file mode 100755 index d8375dd..0000000 Binary files a/docs/fonts/OpenSans-Semibold-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-Semibold-webfont.svg b/docs/fonts/OpenSans-Semibold-webfont.svg deleted file mode 100755 index eec4db8..0000000 --- a/docs/fonts/OpenSans-Semibold-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-Semibold-webfont.ttf b/docs/fonts/OpenSans-Semibold-webfont.ttf deleted file mode 100755 index b329084..0000000 Binary files a/docs/fonts/OpenSans-Semibold-webfont.ttf and /dev/null differ diff --git a/docs/fonts/OpenSans-Semibold-webfont.woff b/docs/fonts/OpenSans-Semibold-webfont.woff deleted file mode 100755 index 28d6ade..0000000 Binary files a/docs/fonts/OpenSans-Semibold-webfont.woff and /dev/null differ diff --git a/docs/fonts/OpenSans-SemiboldItalic-webfont.eot b/docs/fonts/OpenSans-SemiboldItalic-webfont.eot deleted file mode 100755 index 0ab1db2..0000000 Binary files a/docs/fonts/OpenSans-SemiboldItalic-webfont.eot and /dev/null differ diff --git a/docs/fonts/OpenSans-SemiboldItalic-webfont.svg b/docs/fonts/OpenSans-SemiboldItalic-webfont.svg deleted file mode 100755 index 7166ec1..0000000 --- a/docs/fonts/OpenSans-SemiboldItalic-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf b/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf deleted file mode 100755 index d2d6318..0000000 Binary files a/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf and /dev/null differ diff --git a/docs/fonts/OpenSans-SemiboldItalic-webfont.woff b/docs/fonts/OpenSans-SemiboldItalic-webfont.woff deleted file mode 100755 index d4dfca4..0000000 Binary files a/docs/fonts/OpenSans-SemiboldItalic-webfont.woff and /dev/null differ diff --git a/docs/formats_json_parser.js.html b/docs/formats_json_parser.js.html deleted file mode 100644 index a4b1a1d..0000000 --- a/docs/formats_json_parser.js.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - formats/json/parser.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- formats/json/parser.js -

- - - - - -
-
-
const {
-  isString,
-  isDefinedOrThrow,
-  isStringOrObjectOrThrow
-} = require("../../bindings/http/validation/fun.js");
-const ValidationError = require("../../bindings/http/validation/validation_error.js");
-
-const invalidPayloadTypeError = new ValidationError("invalid payload type, allowed are: string or object");
-const nullOrUndefinedPayload = new ValidationError("null or undefined payload");
-
-const asJSON = (v) => (isString(v) ? JSON.parse(v) : v);
-
-class JSONParser {
-  constructor(decorator) {
-    this.decorator = decorator;
-  }
-
-  /**
-   * Parses the payload with an optional decorator
-   * @param {object|string} payload the JSON payload
-   * @return {object} the parsed JSON payload.
-   */
-  parse(payload) {
-    if (this.decorator) {
-      payload = this.decorator.parse(payload);
-    }
-
-    isDefinedOrThrow(payload, nullOrUndefinedPayload);
-    isStringOrObjectOrThrow(payload, invalidPayloadTypeError);
-    return asJSON(payload);
-  }
-}
-
-module.exports = JSONParser;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/global.html b/docs/global.html deleted file mode 100644 index 755a008..0000000 --- a/docs/global.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - - - - Global - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- Global -

- - - - -
-
- -

- - - -

- - - -
- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - -

Members

- - - - -

- (constant) headerMap -

- - - - -
-

A utility Map used to retrieve the header names for a CloudEvent -using the CloudEvent getter function.

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - -

- (constant) headerMap -

- - - - -
-

A utility Map used to retrieve the header names for a CloudEvent -using the CloudEvent getter function.

-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- -
- - - - - - - -
- - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/icons/home.svg b/docs/icons/home.svg deleted file mode 100644 index 676d2d3..0000000 --- a/docs/icons/home.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/docs/icons/search.svg b/docs/icons/search.svg deleted file mode 100644 index ccc84b6..0000000 --- a/docs/icons/search.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 71cc7fe..0000000 --- a/docs/index.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - - - - Home - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - - - - - - - - - - -
-
-

JavaScript SDK for CloudEvents

-

Codacy Badge -Codacy Badge -Build Status -npm version -vulnerabilities -licence

-

The CloudEvents SDK for JavaScript.

-

This module will help you to:

- -

Note: Supported -CloudEvents specification: 0.3, 1.0

-

A Note on Versioning

-

The CloudEvents protocol version is distinct from this module's version number. -For example, this module may be versioned as v2.0.0 but support the v0.3 and v1.0 -versions of the CloudEvent specification.

-

Usage

-

See the full working example: here.

-

Installation

-

The CloudEvents SDK requires a current LTS version of Node.js. At the moment -those are Node.js 10.x and Node.js 12.x. To install in your Node.js project:

-
npm install --save cloudevents-sdk
-
-

Receiving and Emitting Events

-

Receiving Events

-

You can choose almost any popular web framework for port binding. Use an -HTTPReceiver to process the incoming HTTP request. The receiver accepts -binary and structured events in either the 1.0 or 0.3 protocol formats.

-
const {
-  CloudEvent,
-  HTTPReceiever
-} = require("cloudevents-sdk");
-
-// Create a receiver to accept events over HTTP
-const receiver = new HTTPReceiver();
-
-// body and headers come from an incoming HTTP request, e.g. express.js
-const receivedEvent = receiver.accept(req.body, req.headers);
-console.log(receivedEvent.format());
-
-

Emitting Events

-

To emit events, you'll need to decide whether the event should be sent in -binary or structured format, and determine what version of the CloudEvents -specification you want to send the event as.

-

By default, the HTTPEmitter will emit events over HTTP POST using the -1.0 specification, in binary mode. You can emit 0.3 events by providing -the specication version in the constructor to HTTPEmitter. To send -structured events, add that string as a parameter to emitter.sent().

-
const { CloudEvent, HTTPEmitter } = require("cloudevents-sdk");
-
-// With only an endpoint URL, this creates a v1 emitter
-const v1Emitter = new HTTPEmitter({
-  url: "https://cloudevents.io/example"
-});
-const event = new CloudEvent({
-  type, source, data
-});
-
-// By default, the emitter will send binary events
-v1Emitter.send(event).then((response) => {
-    // handle the response
-  }).catch(console.error);
-
-// To send a structured event, just add that as an option
-v1Emitter.send(event, { mode: "structured" })
-  .then((response) => {
-    // handle the response
-  }).catch(console.error);
-
-// To send an event to an alternate URL, add that as an option
-v1Emitter.send(event, { url: "https://alternate.com/api" })
-  .then((response) => {
-    // handle the response
-  }).catch(console.error);
-
-// Sending a v0.3 event works the same, just let the emitter know when
-// you create it that you are working with the 0.3 spec
-const v03Emitter = new HTTPEmitter({
-  url: "https://cloudevents.io/example",
-  version: "0.3"
-});
-
-// Again, the default is to send binary events
-// To send a structured event or to an alternate URL, provide those
-// as parameters in a options object as above
-v3Emitter.send(event)
-  .then((response) => {
-    // handle the response
-  }).catch(console.error);
-
-
-

Supported specification features

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
v0.3v1.0
CloudEvents Core:heavy_check_mark::heavy_check_mark:
AMQP Protocol Binding:x::x:
AVRO Event Format:x::x:
HTTP Protocol Binding:heavy_check_mark::heavy_check_mark:
JSON Event Format:heavy_check_mark::heavy_check_mark:
Kafka Protocol Binding:x::x:
NATS Protocol Binding:x::x:
STAN Protocol Binding:x::x:
-

Community

-
    -
  • There are bi-weekly calls immediately following the Serverless/CloudEvents -call at -9am PT (US Pacific). Which means they will typically start at 10am PT, but -if the other call ends early then the SDK call will start early as well. -See the CloudEvents meeting minutes -to determine which week will have the call.
  • -
  • Slack: #cloudeventssdk channel under -CNCF's Slack workspace.
  • -
  • Email: https://lists.cncf.io/g/cncf-cloudevents-sdk
  • -
  • Contact for additional information: Fabio José (@fabiojose on slack).
  • -
-

Contributing

-

We love contributions from the community! Please check the -Contributor's Guide -for information on how to get involved.

-
-
- - - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/docs/scripts/linenumber.js b/docs/scripts/linenumber.js deleted file mode 100644 index 7cb917c..0000000 --- a/docs/scripts/linenumber.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -(function () { - var lineId, lines, totalLines, anchorHash; - var source = document.getElementsByClassName('prettyprint source linenums'); - var i = 0; - var lineNumber = 0; - - if (source && source[0]) { - anchorHash = document.location.hash.substring(1); - lines = source[0].getElementsByTagName('li'); - totalLines = lines.length; - - for (; i < totalLines; i++) { - lineNumber++; - lineId = 'line' + lineNumber; - lines[i].id = lineId; - if (lineId === anchorHash) { - lines[i].className += ' selected'; - } - } - } -})(); diff --git a/docs/scripts/pagelocation.js b/docs/scripts/pagelocation.js deleted file mode 100644 index 82c7560..0000000 --- a/docs/scripts/pagelocation.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const $ = window.$; - -$(document).ready(function () { - var currentSectionNav, target; - - // If an anchor hash is in the URL highlight the menu item - highlightActiveHash(); - // If a specific page section is in the URL highlight the menu item - highlightActiveSection(); - - // If a specific page section is in the URL scroll that section up to the top - currentSectionNav = $('#' + getCurrentSectionName() + '-nav'); - - if (currentSectionNav.position()) { - $('nav').scrollTop(currentSectionNav.position().top); - } - - // function to scroll to anchor when clicking an anchor linl - $('a[href*="#"]:not([href="#"])').click(function () { - /* eslint-disable no-invalid-this */ - if (window.location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && window.location.hostname === this.hostname) { - target = $(this.hash); - target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); - if (target.length) { - $('html, body').animate({ - scrollTop: target.offset().top - }, 1000); - } - } - /* eslint-enable no-invalid-this */ - }); -}); - -// If a new anchor section is selected, change the hightlighted menu item -$(window).bind('hashchange', function (event) { - highlightActiveHash(event); -}); - -function highlightActiveHash (event) { - var oldUrl, oldSubSectionElement; - - // check for and remove old hash active state - if (event && event.originalEvent.oldURL) { - oldUrl = event.originalEvent.oldURL; - - if (oldUrl.indexOf('#') > -1) { - oldSubSectionElement = $('#' + getCurrentSectionName() + '-' + oldUrl.substring(oldUrl.indexOf('#') + 1) + '-nav'); - - if (oldSubSectionElement) { - oldSubSectionElement.removeClass('active'); - } - } - } - - if (getCurrentHashName()) { - $('#' + getCurrentSectionName() + '-' + getCurrentHashName() + '-nav').addClass('active'); - } -} - -function highlightActiveSection () { - var pageId = getCurrentSectionName(); - - $('#' + pageId + '-nav').addClass('active'); -} - -function getCurrentSectionName () { - var path = window.location.pathname; - var pageUrl = path.split('/').pop(); - - var sectionName = pageUrl.substring(0, pageUrl.indexOf('.')); - - // remove the wodr module- if its in the url - sectionName = sectionName.replace('module-', ''); - - return sectionName; -} - -function getCurrentHashName () { - var pageSubSectionId; - var pageSubSectionHash = window.location.hash; - - if (pageSubSectionHash) { - pageSubSectionId = pageSubSectionHash.substring(1).replace('.', ''); - - return pageSubSectionId; - } - - return false; -} diff --git a/docs/styles/collapse.css b/docs/styles/collapse.css deleted file mode 100644 index 4dc4121..0000000 --- a/docs/styles/collapse.css +++ /dev/null @@ -1,27 +0,0 @@ -@media only screen and (min-width: 681px) { - nav > ul > li:hover .methods, - .active .methods { - display: block; - } - - .methods { - display: none; - } - - nav > ul > li { - padding: 20px 0; - } - - nav > ul > li > a { - padding: 0; - } - - nav > ul > li.active a { - margin-bottom: 10px; - } - - nav > ul > li:hover > a, - nav > ul > li.active > a { - margin-bottom: 15px; - } -} diff --git a/docs/styles/jsdoc-default.css b/docs/styles/jsdoc-default.css deleted file mode 100644 index 140e61a..0000000 --- a/docs/styles/jsdoc-default.css +++ /dev/null @@ -1,900 +0,0 @@ -* { - box-sizing: border-box -} - -html, body { - height: 100%; - width: 100%; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - color: #3e3c42; - text-rendering: optimizeLegibility; - margin: 0; -} - -body { - color: #3e3c42; - background-color: #f3f3f3; - width: 100%; - font: 16px/1.875 "Avenir Next W01", "Avenir Next", "Helvetica Neue", Helvetica, sans-serif; - font-size: 16px; - line-height: 160%; -} - -a, a:active { - color: #0095dd; - text-decoration: none; -} - -a:hover { - text-decoration: underline -} - -p, ul, ol, blockquote { - margin-bottom: 1em; -} - -p { - max-width: 800px; -} - -h1, h2, h3, h4, h5, h6 { - color: #706d77; - font-weight: 500; - margin: 0; - line-height: 1; -} - -h1 { - color: #4b484f; - font-weight: 500; - font-size: 40px; - display: block; -} - -h1 span { - color: #999; - font-size: 32px; - display: block; - line-height: 1.5; -} - -h1.page-title { - border-bottom: 1px dashed #ccc; - margin-bottom: 20px; - padding-bottom: 30px; -} - -h2 { - font-size: 30px; - margin: 1.5em 0 0; -} - -h3 { - font-size: 20px; - margin: 1.5em 0 0; - text-transform: uppercase; -} - -h3.reference-title { - display: block; - font-weight: 400; - margin-top: 2em; - max-width: 200px; -} - -h3.reference-title small { - display: inline-block; - color: #0095dd; - margin-left: 5px; - font-weight: 500; -} - -h3.subsection-title { - border-bottom: 1px solid #ececec; - padding-bottom: 20px; - margin-top: 3em; - margin-bottom: 1em; -} - -h4 { - font-size: 16px; - margin: 1em 0 0; - font-weight: bold; -} - -h4.name { - font-size: 20px; - margin-top: 0; - font-weight: 500; -} - -h5 { - margin: 2em 0 0.5em 0; - font-size: 14px; - font-weight: 500; - text-transform: uppercase; -} - -.container-overview .subsection-title { - font-size: 14px; - text-transform: uppercase; - margin: 8px 0 15px 0; - font-weight: bold; - color: #4D4E53; - padding-top: 10px; -} - -h6 { - font-size: 100%; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; - font-style: italic; - text-transform: uppercase; - font-weight: 500; -} - -tt, code, kbd, samp { - font-family: "Source Code Pro", monospace; - background: #f4f4f4; - padding: 1px 5px; - border-radius: 5px; -} - -.class-description { - margin-bottom: 1em; - margin-top: 1em; - padding: 10px 20px; - background-color: rgba(26, 159, 224, 0.1); -} - -.class-description:empty { - margin: 0 -} - -#main { - background-color: white; - float: right; - min-width: 360px; - width: calc(100% - 300px); - padding: 30px; - z-index: 100; -} - -header { - display: block; - max-width: 1400px; -} - -section { - display: block; - max-width: 1400px; - background-color: #fff; -} - -.variation { - display: none -} - -.signature-attributes { - font-size: 60%; - color: #aaa; - font-style: italic; - font-weight: lighter; -} - -.rule { - width: 100%; - margin-top: 20px; - display: block; - border-top: 1px solid #ccc; -} - -ul { - list-style-type: none; - padding-left: 0; -} - -ul li a { - font-weight: 500; -} - -ul ul { - padding-top: 5px; -} - -ul li ul { - padding-left: 20px; -} - -ul li ul li a { - font-weight: normal; -} - -nav { - float: left; - display: block; - width: 300px; - background: #f7f7f7; - overflow-x: visible; - overflow-y: auto; - height: 100%; - padding: 0px 30px 100px 30px; - height: 100%; - position: fixed; - transition: left 0.2s; - z-index: 998; - margin-top: 0px; - top: 43px; -} - -.navicon-button { - display: inline-block; - position: fixed; - bottom: 1.5em; - right: 1.5em; - z-index: 2; -} - -nav h3 { - font-size: 13px; - text-transform: uppercase; - letter-spacing: 1px; - font-weight: bold; - line-height: 24px; - margin: 40px 0 10px 0; - padding: 0; -} - -nav ul { - font-size: 100%; - line-height: 17px; - padding: 0; - margin: 0; - list-style-type: none; - border: none; - padding-left: 0; -} - -nav ul a { - font-size: 16px; -} - -nav ul a, nav ul a:active { - display: block; -} - -nav ul a:hover, nav ul a:active { - color: hsl(200, 100%, 43%); - text-decoration: none; -} - -nav>ul { - padding: 0 10px; -} - -nav>ul li:first-child { - padding-top: 0; -} - -nav ul li ul { - padding-left: 0; -} - -nav>ul>li { - border-bottom: 1px solid #e2e2e2; - padding: 10px 0 20px 0; -} - -nav>ul>li.active ul { - border-left: 3px solid #0095dd; - padding-left: 15px; -} - -nav>ul>li.active ul li.active a { - font-weight: bold; -} - -nav>ul>li.active a { - color: #0095dd; -} - -nav>ul>li>a { - color: #706d77; - padding: 20px 0; - font-size: 18px; -} - -nav ul ul { - margin-bottom: 10px; - padding-left: 0; -} - -nav ul ul a { - color: #5f5c63; -} - -nav ul ul a, nav ul ul a:active { - font-family: 'bt_mono', monospace; - font-size: 14px; - padding-left: 20px; - padding-top: 3px; - padding-bottom: 9px; -} - -nav h2 { - font-size: 12px; - margin: 0; - padding: 0; -} - -nav>h2>a { - color: hsl(202, 71%, 50%); - border-bottom: 1px solid hsl(202, 71%, 50%); - padding-bottom: 5px; -} - -nav>h2>a:hover { - font-weight: 500; - text-decoration: none; -} - -footer { - background-color: #fff; - color: hsl(0, 0%, 28%); - margin-left: 300px; - display: block; - font-style: italic; - font-size: 12px; - padding: 30px; - text-align: center; -} - -.ancestors { - color: #999; -} - -.ancestors a { - color: #999 !important; - text-decoration: none; -} - -.clear { - clear: both; -} - -.important { - font-weight: bold; - color: #950B02; -} - -.yes-def { - text-indent: -1000px; -} - -.type-signature { - color: #aaa; -} - -.name, .signature { - font-family: 'bt_mono', monospace; - word-wrap: break-word; -} - -.details { - margin-top: 14px; - font-size: 13px; - text-align: right; - background: #ffffff; - /* Old browsers */ - background: -moz-linear-gradient(left, #ffffff 0%, #fafafa 100%); - /* FF3.6-15 */ - background: -webkit-linear-gradient(left, #ffffff 0%, #fafafa 100%); - /* Chrome10-25,Safari5.1-6 */ - background: linear-gradient(to right, #ffffff 0%, #fafafa 100%); - /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ - filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fafafa', GradientType=1); - padding-right: 5px; -} - -.details dt { - display: inline-block; -} - -.details dd { - display: inline-block; - margin: 0; -} - -.details dd a { - font-style: italic; - font-weight: normal; - line-height: 1; -} - -.details ul { - list-style-type: none; - margin: 0; -} - -.details pre.prettyprint { - margin: 0 -} - -.details .object-value { - padding-top: 0 -} - -.description { - margin-bottom: 1em; - margin-top: 1em; -} - -.code-caption { - font-style: italic; - margin: 0; - font-size: 16px; - color: #545454; -} - -.prettyprint { - font-size: 13px; - border: 1px solid #ddd; - border-radius: 3px; - overflow: auto; - background-color: #fbfbfb; -} - -.prettyprint.source { - width: inherit; -} - -.prettyprint code { - font-size: 100%; - line-height: 18px; - display: block; - margin: 0 30px; - background-color: #fbfbfb; - color: #4D4E53; -} - -.prettyprint>code { - padding: 30px 15px; -} - -.prettyprint .linenums code { - padding: 0 15px; -} - -.prettyprint .linenums li:first-of-type code { - padding-top: 15px; -} - -.prettyprint code span.line { - display: inline-block; -} - -.prettyprint.linenums { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.prettyprint.linenums ol { - padding-left: 0 -} - -.prettyprint.linenums li { - border-left: 3px #ddd solid -} - -.prettyprint.linenums li.selected, .prettyprint.linenums li.selected * { - background-color: lightyellow -} - -.prettyprint.linenums li * { - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; -} - -.readme .prettyprint { - max-width: 800px; -} - -.params, .props { - border-spacing: 0; - border: 1px solid #ddd; - border-radius: 3px; - width: 100%; - font-size: 14px; -} - -.params .name, .props .name, .name code { - color: #4D4E53; - font-family: 'bt_mono', monospace; - font-size: 100%; -} - -.params td, .params th, .props td, .props th { - margin: 0px; - text-align: left; - vertical-align: top; - padding: 10px; - display: table-cell; -} - -.params td { - border-top: 1px solid #eee; -} - -.params thead tr, .props thead tr { - background-color: #fff; - font-weight: bold; -} - -.params .params thead tr, .props .props thead tr { - background-color: #fff; - font-weight: bold; -} - -.params td.description>p:first-child, .props td.description>p:first-child { - margin-top: 0; - padding-top: 0; -} - -.params td.description>p:last-child, .props td.description>p:last-child { - margin-bottom: 0; - padding-bottom: 0; -} - -dl.param-type { - margin-top: 5px; -} - -.param-type dt, .param-type dd { - display: inline-block -} - -.param-type dd { - font-family: Consolas, Monaco, 'Andale Mono', monospace -} - -.disabled { - color: #454545 -} - - -/* tag source style */ - -.tag-deprecated { - padding-right: 5px; -} - -.tag-source { - border-bottom: 1px solid rgba(28, 160, 224, 0.35); -} - -.tag-source:first-child { - border-bottom: 1px solid rgba(28, 160, 224, 1); -} - - -/* navicon button */ - -.navicon-button { - position: relative; - transition: 0.25s; - cursor: pointer; - user-select: none; - opacity: .8; - background-color: white; - border-radius: 100%; - width: 50px; - height: 50px; - -webkit-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.31); - -moz-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.31); - box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.31); -} - -.navicon-button .navicon:before, .navicon-button .navicon:after { - transition: 0.25s; -} - -.navicon-button:hover { - transition: 0.5s; - opacity: 1; -} - -.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after { - transition: 0.25s; -} - -.navicon-button:hover .navicon:before { - top: .425rem; -} - -.navicon-button:hover .navicon:after { - top: -.425rem; -} - - -/* navicon */ - -.navicon { - position: relative; - width: 1.5em; - height: .195rem; - background: #000; - top: calc(50% - .09rem); - left: calc(50% - .75rem); - transition: 0.3s; - border-radius: 5px; -} - -.navicon:before, .navicon:after { - display: block; - content: ""; - height: .195rem; - width: 1.5rem; - background: #000; - position: absolute; - z-index: -1; - transition: 0.3s 0.25s; -} - -.navicon:before { - top: 0.425rem; - height: .195rem; - border-radius: 5px; -} - -.navicon:after { - top: -0.425rem; - border-radius: 5px; -} - - -/* open */ - -.nav-trigger:checked+label:not(.steps) .navicon:before, .nav-trigger:checked+label:not(.steps) .navicon:after { - top: 0 !important; -} - -.nav-trigger:checked+label .navicon:before, .nav-trigger:checked+label .navicon:after { - transition: 0.5s; -} - - -/* Minus */ - -.nav-trigger:checked+label { - transform: scale(0.75); -} - - -/* × and + */ - -.nav-trigger:checked+label.plus .navicon, .nav-trigger:checked+label.x .navicon { - background: transparent; -} - -.nav-trigger:checked+label.plus .navicon:before, .nav-trigger:checked+label.x .navicon:before { - transform: rotate(-45deg); - background: #000; -} - -.nav-trigger:checked+label.plus .navicon:after, .nav-trigger:checked+label.x .navicon:after { - transform: rotate(45deg); - background: #000; -} - -.nav-trigger:checked+label.plus { - transform: scale(0.75) rotate(45deg); -} - -.nav-trigger:checked~nav { - left: 0 !important; -} - -.nav-trigger:checked~.overlay { - display: block; -} - -.nav-trigger { - position: fixed; - top: 0; - clip: rect(0, 0, 0, 0); -} - -.overlay { - display: none; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - width: 100%; - height: 100%; - background: hsla(0, 0%, 0%, 0.5); - z-index: 1; -} - -table { - border-collapse: separate; - ; - display: block; - overflow-x: auto; - /*table-layout:fixed;*/ -} - -table tbody td { - border-top: 1px solid hsl(207, 10%, 86%); - border-right: 1px solid #eee; - padding: 5px; - /*word-wrap: break-word;*/ -} - -td table.params, td table.props { - border: 0; -} - -@media only screen and (min-width: 320px) and (max-width: 680px) { - body { - overflow-x: hidden; - } - #main { - padding: 30px 30px; - width: 100%; - min-width: 360px; - } - nav { - background: #FFF; - width: 300px; - height: 100%; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: -300px; - z-index: 3; - padding: 0 10px; - transition: left 0.2s; - margin-top: 0; - } - .navicon-button { - display: inline-block; - position: fixed; - bottom: 1.5em; - right: 20px; - z-index: 1000; - } - .top-nav-wrapper { - display: none; - } - #main h1.page-title { - margin: 0.5em 0; - } - footer { - margin-left: 0; - margin-bottom: 30px; - } -} - -.top-nav-wrapper { - background-color: #ececec; - position: fixed; - top: 0px; - left: 0px; - padding: 10px 10px 0 10px; - z-index: 999; - width: 300px; -} - -.top-nav-wrapper ul { - margin: 0; -} - -.top-nav-wrapper ul li { - display: inline-block; - padding: 0 10px; - vertical-align: top; -} - -.top-nav-wrapper ul li.active { - border-bottom: 2px solid rgba(28, 160, 224, 1); -} - -.search-wrapper { - display: inline-block; - position: relative; -} - -.search-wrapper svg { - position: absolute; - left: 0px; -} - -input.search-input { - background: transparent; - box-shadow: 0; - border: 0; - border-bottom: 1px solid #c7c7c7; - padding: 7px 15px 12px 35px; - margin: 0 auto; -} - - -/* Smooth outline with box-shadow: */ - -input.search-input:focus { - border-bottom: 2px solid rgba(28, 160, 224, 1); - outline: none; -} - - -/* Hightlight JS Paradiso Light Theme */ - -.hljs-comment, .hljs-quote { - color: #776e71 -} - -.hljs-variable, .hljs-template-variable, .hljs-tag, .hljs-name, .hljs-selector-id, .hljs-selector-class, .hljs-regexp, .hljs-link, .hljs-meta { - color: #ef6155 -} - -.hljs-number, .hljs-built_in, .hljs-builtin-name, .hljs-literal, .hljs-type, .hljs-params, .hljs-deletion { - color: #f99b15 -} - -.hljs-title, .hljs-section, .hljs-attribute { - color: #fec418 -} - -.hljs-string, .hljs-symbol, .hljs-bullet, .hljs-addition { - color: #48b685 -} - -.hljs-keyword, .hljs-selector-tag { - color: #815ba4 -} - -.hljs { - display: block; - overflow-x: auto; - background: #e7e9db; - color: #4f424c; - padding: 0.5em -} - -.hljs-emphasis { - font-style: italic -} - -.hljs-strong { - font-weight: bold -} - -.link-icon { - opacity: 0; - position: absolute; - margin-left: -25px; - padding-right: 5px; - padding-top: 2px; -} - -.example-container .link-icon { - margin-top: -6px; -} - -.example-container:hover .link-icon, -.name-container:hover .link-icon { - opacity: .5; -} - -.name-container { - display: flex; - padding-top: 1em; -} diff --git a/docs/styles/prettify-jsdoc.css b/docs/styles/prettify-jsdoc.css deleted file mode 100644 index 834a866..0000000 --- a/docs/styles/prettify-jsdoc.css +++ /dev/null @@ -1,111 +0,0 @@ -/* JSDoc prettify.js theme */ - -/* plain text */ -.pln { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* string content */ -.str { - color: hsl(104, 100%, 24%); - font-weight: normal; - font-style: normal; -} - -/* a keyword */ -.kwd { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a comment */ -.com { - font-weight: normal; - font-style: italic; -} - -/* a type name */ -.typ { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* a literal value */ -.lit { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* punctuation */ -.pun { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* lisp open bracket */ -.opn { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* lisp close bracket */ -.clo { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a markup tag name */ -.tag { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a markup attribute name */ -.atn { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a markup attribute value */ -.atv { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a declaration */ -.dec { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a variable name */ -.var { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* a function name */ -.fun { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin-top: 0; - margin-bottom: 0; -} diff --git a/docs/styles/prettify-tomorrow.css b/docs/styles/prettify-tomorrow.css deleted file mode 100644 index eaf1251..0000000 --- a/docs/styles/prettify-tomorrow.css +++ /dev/null @@ -1,138 +0,0 @@ -/* Tomorrow Theme */ -/* Original theme - https://github.com/chriskempson/tomorrow-theme */ -/* Pretty printing styles. Used with prettify.js. */ -/* SPAN elements with the classes below are added by prettyprint. */ -/* plain text */ -.pln { - color: #4d4d4c; } - -@media screen { - /* string content */ - .str { - color: hsl(104, 100%, 24%); } - - /* a keyword */ - .kwd { - color: hsl(240, 100%, 50%); } - - /* a comment */ - .com { - color: hsl(0, 0%, 60%); } - - /* a type name */ - .typ { - color: hsl(240, 100%, 32%); } - - /* a literal value */ - .lit { - color: hsl(240, 100%, 40%); } - - /* punctuation */ - .pun { - color: #000000; } - - /* lisp open bracket */ - .opn { - color: #000000; } - - /* lisp close bracket */ - .clo { - color: #000000; } - - /* a markup tag name */ - .tag { - color: #c82829; } - - /* a markup attribute name */ - .atn { - color: #f5871f; } - - /* a markup attribute value */ - .atv { - color: #3e999f; } - - /* a declaration */ - .dec { - color: #f5871f; } - - /* a variable name */ - .var { - color: #c82829; } - - /* a function name */ - .fun { - color: #4271ae; } } -/* Use higher contrast and text-weight for printable form. */ -@media print, projection { - .str { - color: #060; } - - .kwd { - color: #006; - font-weight: bold; } - - .com { - color: #600; - font-style: italic; } - - .typ { - color: #404; - font-weight: bold; } - - .lit { - color: #044; } - - .pun, .opn, .clo { - color: #440; } - - .tag { - color: #006; - font-weight: bold; } - - .atn { - color: #404; } - - .atv { - color: #060; } } -/* Style */ -/* -pre.prettyprint { - background: white; - font-family: Consolas, Monaco, 'Andale Mono', monospace; - font-size: 12px; - line-height: 1.5; - border: 1px solid #ccc; - padding: 10px; } -*/ - -/* Get LI elements to show when they are in the main article */ -article ul li { - list-style-type: circle; - margin-left: 25px; -} - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin-top: 0; - margin-bottom: 0; } - -/* IE indents via margin-left */ -li.L0, -li.L1, -li.L2, -li.L3, -li.L4, -li.L5, -li.L6, -li.L7, -li.L8, -li.L9 { - /* */ } - -/* Alternate shading for lines */ -li.L1, -li.L3, -li.L5, -li.L7, -li.L9 { - /* */ } diff --git a/examples/express-ex/index.js b/examples/express-ex/index.js index 88607d3..2efa97c 100644 --- a/examples/express-ex/index.js +++ b/examples/express-ex/index.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ const express = require("express"); -const { HTTPReceiver } = require("../../"); +const { HTTPReceiver } = require("../../src"); const app = express(); const receiver = new HTTPReceiver(); diff --git a/index.js b/index.js deleted file mode 100644 index eb404ef..0000000 --- a/index.js +++ /dev/null @@ -1,11 +0,0 @@ -const CloudEvent = require("./lib/cloudevent.js"); -const HTTPReceiver = require("./lib/bindings/http/http_receiver.js"); -const HTTPEmitter = require("./lib/bindings/http/http_emitter.js"); -const Constants = require("./lib/bindings/http/constants.js"); - -module.exports = { - CloudEvent, - HTTPReceiver, - HTTPEmitter, - Constants -}; diff --git a/package-lock.json b/package-lock.json index 9edbf63..0e2d7f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cloudevents-sdk", - "version": "1.0.0", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -318,6 +318,44 @@ "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, + "@paztis/typedoc": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@paztis/typedoc/-/typedoc-0.1.6.tgz", + "integrity": "sha512-C6ywLbqa81u0FV907QrUHxYbi6n4lJyD7vCcmpVXZvShTfALT8NmeLLhMaLuAd8h3kl4N/Kkr3MSJpeCFjy5yQ==", + "dev": true, + "requires": { + "@types/minimatch": "3.0.3", + "fs-extra": "^8.1.0", + "handlebars": "^4.7.2", + "highlight.js": "^9.18.0", + "lodash": "^4.17.15", + "marked": "^0.8.0", + "minimatch": "^3.0.0", + "progress": "^2.0.3", + "shelljs": "^0.8.3", + "typedoc-default-themes": "0.8.0-0" + }, + "dependencies": { + "highlight.js": { + "version": "9.18.1", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.1.tgz", + "integrity": "sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg==", + "dev": true + }, + "typedoc-default-themes": { + "version": "0.8.0-0", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.8.0-0.tgz", + "integrity": "sha512-blFWppm5aKnaPOa1tpGO9MLu+njxq7P3rtkXK4QxJBNszA+Jg7x0b+Qx0liXU1acErur6r/iZdrwxp5DUFdSXw==", + "dev": true, + "requires": { + "backbone": "^1.4.0", + "jquery": "^3.4.1", + "lunr": "^2.3.8", + "underscore": "^1.9.1" + } + } + } + }, "@types/ajv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/ajv/-/ajv-1.0.0.tgz", @@ -342,6 +380,12 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, "@types/minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", @@ -349,9 +393,9 @@ "dev": true }, "@types/node": { - "version": "13.13.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.6.tgz", - "integrity": "sha512-zqRj8ugfROCjXCNbmPBe2mmQ0fJWP9lQaN519hwunOgpHgVykme4G6FW95++dyNFDvJUk4rtExkVkL0eciu5NA==", + "version": "13.13.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.9.tgz", + "integrity": "sha512-EPZBIGed5gNnfWCiwEIwTE2Jdg4813odnG8iNPMQGrqVxrI+wL68SPtPeCX+ZxGBaA6pKAVc6jaKgP/Q0QzfdQ==", "dev": true }, "@types/normalize-package-data": { @@ -540,6 +584,15 @@ "follow-redirects": "1.5.10" } }, + "backbone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", + "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==", + "dev": true, + "requires": { + "underscore": ">=1.8.3" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -552,12 +605,6 @@ "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", "dev": true }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -624,15 +671,6 @@ "quick-lru": "^4.0.1" } }, - "catharsis": { - "version": "0.8.11", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", - "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -1518,12 +1556,6 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "entities": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.2.tgz", - "integrity": "sha512-dmD3AvJQBUjKpcNkoqr+x+IF0SdRtPz9Vk0uTy4yWqga9ibB6s4v++QFWNohjiUGoMlF552ZvNyXDxz5iW0qmw==", - "dev": true - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1569,12 +1601,6 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - }, "eslint": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", @@ -2203,6 +2229,17 @@ "null-check": "^1.0.0" } }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3417,6 +3454,12 @@ "istanbul-lib-report": "^3.0.0" } }, + "jquery": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", + "dev": true + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3433,54 +3476,6 @@ "esprima": "^4.0.0" } }, - "js2xmlparser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", - "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", - "dev": true, - "requires": { - "xmlcreate": "^2.0.3" - } - }, - "jsdoc": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.4.tgz", - "integrity": "sha512-3G9d37VHv7MFdheviDCjUfQoIjdv4TC5zTTf5G9VODLtOnVS6La1eoYBDlbWfsRT3/Xo+j2MIqki2EV12BZfwA==", - "dev": true, - "requires": { - "@babel/parser": "^7.9.4", - "bluebird": "^3.7.2", - "catharsis": "^0.8.11", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.1", - "klaw": "^3.0.0", - "markdown-it": "^10.0.0", - "markdown-it-anchor": "^5.2.7", - "marked": "^0.8.2", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "taffydb": "2.6.2", - "underscore": "~1.10.2" - } - }, - "jsdoc-fresh": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/jsdoc-fresh/-/jsdoc-fresh-1.0.2.tgz", - "integrity": "sha512-MXs+8QBaRw6Mzl9ofxKlIgG9Dh0cnpnjNRyo3vGBOVzIMi4Oqp0uyNeXGiayR8e2I5bvAKnaVLFreRlLd9ODlg==", - "dev": true, - "requires": { - "taffydb": "^2.7.3" - }, - "dependencies": { - "taffydb": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.7.3.tgz", - "integrity": "sha1-KtNxaWKUmPylvIQkMJbTzeDsOjQ=", - "dev": true - } - } - }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -3519,6 +3514,15 @@ "minimist": "^1.2.5" } }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -3541,15 +3545,6 @@ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, - "klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -3566,15 +3561,6 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, - "linkify-it": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", - "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, - "requires": { - "uc.micro": "^1.0.1" - } - }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -3668,6 +3654,12 @@ "signal-exit": "^3.0.0" } }, + "lunr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", + "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", + "dev": true + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -3691,37 +3683,12 @@ "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", "dev": true }, - "markdown-it": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", - "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "entities": "~2.0.0", - "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - } - }, - "markdown-it-anchor": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", - "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", - "dev": true - }, "marked": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==", "dev": true }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, "meow": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", @@ -3921,12 +3888,6 @@ } } }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - }, "mocha": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz", @@ -4888,15 +4849,6 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "requizzle": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", - "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -5606,12 +5558,6 @@ } } }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", - "dev": true - }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -5750,12 +5696,6 @@ "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", "dev": true }, - "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, "uglify-js": { "version": "3.9.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.3.tgz", @@ -5778,6 +5718,12 @@ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -5926,12 +5872,6 @@ "typedarray-to-buffer": "^3.1.5" } }, - "xmlcreate": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", - "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==", - "dev": true - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 9f77a2c..688fba6 100644 --- a/package.json +++ b/package.json @@ -4,20 +4,23 @@ "description": "CloudEvents SDK for JavaScript", "main": "index.js", "scripts": { - "type-check": "tsc --noEmitOnError --emitDeclarationOnly", - "prelint": "npm run type-check", - "lint": "standardx index.js lib examples", + "watch": "tsc --project tsconfig.json --watch", + "build": "tsc --project tsconfig.json", + "prelint": "npm run build", + "lint": "standardx src examples", "fix": "standardx --fix", "pretest": "npm run lint", "test": "mocha test/**/*.js", "coverage": "nyc --reporter=lcov --reporter=text npm run test", "coverage-publish": "wget -qO - https://coverage.codacy.com/get.sh | bash -s report -l JavaScript -r coverage/lcov.info", - "generate-docs": "jsdoc --configure .jsdoc.json --verbose", - "release": "standard-version" + "generate-docs": "typedoc --tsconfig ./tsconfig.json src", + "release": "standard-version", + "prepublish": "npm run build" }, "files": [ - "lib", - "index.d.ts" + "index.js", + "index.d.ts", + "lib" ], "standard-version": { "types": [ @@ -98,15 +101,14 @@ "uuid": "~8.0.0" }, "devDependencies": { + "@paztis/typedoc": "^0.1.6", "@types/ajv": "^1.0.0", "@types/axios": "^0.14.0", - "@types/node": "^13.13.5", + "@types/node": "^13.13.9", "chai": "~4.2.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", - "jsdoc": "^3.6.4", - "jsdoc-fresh": "^1.0.2", "mocha": "~7.1.1", "nock": "~12.0.3", "nyc": "~15.0.0", diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..09ef904 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,11 @@ +import { CloudEvent } from "./lib/cloudevent"; +import { HTTPReceiver } from "./lib/bindings/http/http_receiver"; +import { HTTPEmitter } from "./lib/bindings/http/http_emitter"; +const Constants = require("./lib/bindings/http/constants"); + +export = { + CloudEvent, + HTTPReceiver, + HTTPEmitter, + Constants +}; diff --git a/lib/bindings/http/constants.js b/src/lib/bindings/http/constants.ts similarity index 100% rename from lib/bindings/http/constants.js rename to src/lib/bindings/http/constants.ts diff --git a/lib/bindings/http/emitter_binary.js b/src/lib/bindings/http/emitter_binary.js similarity index 100% rename from lib/bindings/http/emitter_binary.js rename to src/lib/bindings/http/emitter_binary.js diff --git a/lib/bindings/http/emitter_structured.js b/src/lib/bindings/http/emitter_structured.js similarity index 100% rename from lib/bindings/http/emitter_structured.js rename to src/lib/bindings/http/emitter_structured.js diff --git a/lib/bindings/http/http_emitter.js b/src/lib/bindings/http/http_emitter.ts similarity index 83% rename from lib/bindings/http/http_emitter.js rename to src/lib/bindings/http/http_emitter.ts index cf1e445..8615083 100644 --- a/lib/bindings/http/http_emitter.js +++ b/src/lib/bindings/http/http_emitter.ts @@ -1,3 +1,5 @@ +import { CloudEvent } from "../../cloudevent.js"; + const BinaryHTTPEmitter = require("./emitter_binary.js"); const StructuredEmitter = require("./emitter_structured.js"); const EmitterV1 = require("./v1").BinaryEmitter; @@ -17,7 +19,12 @@ const { * @see https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md * @see https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md#13-content-modes */ -class HTTPEmitter { +export class HTTPEmitter { + url: URL | undefined; + binary: any; + structured: any; + static headers: Function; + /** * Creates a new instance of {HTTPEmitter}. The default emitter uses the 1.0 * protocol specification in binary mode. @@ -55,7 +62,8 @@ class HTTPEmitter { * Possible values are "binary" and "structured". Default: structured * @returns {Promise} Promise with an eventual response from the receiver */ - send(event, { url, mode = "binary", ...httpOpts } = { url: undefined }) { + send(event: CloudEvent, { url, mode = "binary", ...httpOpts } = { url: undefined }) { + // @ts-ignore Type 'URL | undefined' is not assignable to type 'undefined'. Type 'URL' is not assignable to type 'undefined'.ts(2322) if (!url) { url = this.url; } // @ts-ignore Property 'url' does not exist on type '{}' httpOpts.url = url; @@ -63,7 +71,6 @@ class HTTPEmitter { // @ts-ignore Property 'url' is missing in type '{}' but required in type '{ url: URL; }'. return this.binary.emit(httpOpts, event); } else if (mode === "structured") { - // @ts-ignore Property 'url' is missing in type '{}' but required in type '{ url: URL; }'. return this.structured.emit(httpOpts, event); } throw new TypeError(`Unknown transport mode ${mode}.`); @@ -78,7 +85,7 @@ class HTTPEmitter { * @param {string} [version] spec version number - default 1.0 * @returns {Object} the headers that will be sent for the event */ -function headers(event, version = SPEC_V1) { +function headers(event: CloudEvent, version = SPEC_V1) { const headers = {}; let headerMap; if (version === SPEC_V1) { @@ -86,9 +93,12 @@ function headers(event, version = SPEC_V1) { } else if (version === SPEC_V03) { headerMap = EmitterV03; } - headerMap.forEach((parser, getterName) => { + headerMap.forEach((parser: any, getterName: string) => { + // @ts-ignore No index signature with a parameter of type 'string' was found on type 'CloudEvent'. const value = event[getterName]; if (value) { + // @ts-ignore Element implicitly has an 'any' type because expression of type 'any' + // can't be used to index type '{ } '. headers[parser.headerName] = parser.parse(value); } }); @@ -97,4 +107,3 @@ function headers(event, version = SPEC_V1) { } HTTPEmitter.headers = headers; -module.exports = HTTPEmitter; diff --git a/lib/bindings/http/http_receiver.js b/src/lib/bindings/http/http_receiver.ts similarity index 66% rename from lib/bindings/http/http_receiver.js rename to src/lib/bindings/http/http_receiver.ts index f128d5e..7bf3a25 100644 --- a/lib/bindings/http/http_receiver.js +++ b/src/lib/bindings/http/http_receiver.ts @@ -1,27 +1,26 @@ -// const V03Binary = require("./receiver_binary_0_3.js"); -// const V03Structured = require("./v03/receiver_structured_0_3.js"); -// const V1Binary = require("./receiver_binary_1.js"); -// const V1Structured = require("./v1/receiver_structured_1.js"); -const BinaryReceiver = require("./receiver_binary.js"); -const StructuredReceiver = require("./receiver_structured.js"); -const ValidationError = require("./validation/validation_error.js"); -const { - BINARY, - STRUCTURED, - SPEC_V03, - SPEC_V1, - HEADER_CONTENT_TYPE, - MIME_CE, - BINARY_HEADERS_1, - DEFAULT_SPEC_VERSION_HEADER -} = require("./constants"); +import BinaryReceiver = require("./receiver_binary.js"); +import StructuredReceiver = require("./receiver_structured.js"); +import ValidationError = require("./validation/validation_error.js"); +const { BINARY, STRUCTURED, SPEC_V03, SPEC_V1, HEADER_CONTENT_TYPE, MIME_CE, BINARY_HEADERS_1, DEFAULT_SPEC_VERSION_HEADER } = require("./constants"); /** @typedef {import("../../cloudevent")} CloudEvent */ - /** * A class to receive a CloudEvent from an HTTP POST request. */ -class HTTPReceiver { +export class HTTPReceiver { + receivers: { + v1: { + structured: any, + binary: any, + [key: string]: any + }, + v03: { + structured: any, + binary: any, + [key: string]: any + } + }; + /** * Create an instance of an HTTPReceiver to accept incoming CloudEvents. */ @@ -37,7 +36,6 @@ class HTTPReceiver { } }; } - /** * Acceptor for an incoming HTTP CloudEvent POST. Can process * binary and structured incoming CloudEvents. @@ -46,8 +44,8 @@ class HTTPReceiver { * @param {Object|JSON} body The body of the HTTP request * @return {CloudEvent} A new {CloudEvent} instance */ - accept(headers, body) { - const mode = getMode(headers); + accept(headers: {}, body: { specversion: string }) { + const mode: string = getMode(headers); const version = getVersion(mode, headers, body); switch (version) { case SPEC_V1: @@ -55,14 +53,13 @@ class HTTPReceiver { case SPEC_V03: return this.receivers.v03[mode].parse(body, headers); default: - console.error( - `Unknown spec version ${version}. Default to ${SPEC_V1}`); + console.error(`Unknown spec version ${version}. Default to ${SPEC_V1}`); return this.receivers.v1[mode].parse(body, headers); } } } -function getMode(headers) { +function getMode(headers: { [key: string]: string }) { const contentType = headers[HEADER_CONTENT_TYPE]; if (contentType && contentType.startsWith(MIME_CE)) { return STRUCTURED; @@ -73,19 +70,18 @@ function getMode(headers) { throw new ValidationError("no cloud event detected"); } -function getVersion(mode, headers, body) { +function getVersion(mode: string, headers: { [key: string]: string }, body: string | { specversion: string }) { if (mode === BINARY) { // Check the headers for the version const versionHeader = headers[DEFAULT_SPEC_VERSION_HEADER]; if (versionHeader) { return versionHeader; } - } else { + } + else { // structured mode - the version is in the body return (typeof body === "string") ? JSON.parse(body).specversion : body.specversion; } return SPEC_V1; } - -module.exports = HTTPReceiver; diff --git a/lib/bindings/http/receiver_binary.js b/src/lib/bindings/http/receiver_binary.js similarity index 100% rename from lib/bindings/http/receiver_binary.js rename to src/lib/bindings/http/receiver_binary.js diff --git a/lib/bindings/http/receiver_structured.js b/src/lib/bindings/http/receiver_structured.js similarity index 100% rename from lib/bindings/http/receiver_structured.js rename to src/lib/bindings/http/receiver_structured.js diff --git a/lib/bindings/http/v03/emitter_binary_0_3.js b/src/lib/bindings/http/v03/emitter_binary_0_3.js similarity index 100% rename from lib/bindings/http/v03/emitter_binary_0_3.js rename to src/lib/bindings/http/v03/emitter_binary_0_3.js diff --git a/lib/bindings/http/v03/index.js b/src/lib/bindings/http/v03/index.js similarity index 100% rename from lib/bindings/http/v03/index.js rename to src/lib/bindings/http/v03/index.js diff --git a/lib/bindings/http/v03/receiver_binary_0_3.js b/src/lib/bindings/http/v03/receiver_binary_0_3.js similarity index 100% rename from lib/bindings/http/v03/receiver_binary_0_3.js rename to src/lib/bindings/http/v03/receiver_binary_0_3.js diff --git a/lib/bindings/http/v03/receiver_structured_0_3.js b/src/lib/bindings/http/v03/receiver_structured_0_3.js similarity index 100% rename from lib/bindings/http/v03/receiver_structured_0_3.js rename to src/lib/bindings/http/v03/receiver_structured_0_3.js diff --git a/lib/bindings/http/v03/spec_0_3.js b/src/lib/bindings/http/v03/spec_0_3.js similarity index 100% rename from lib/bindings/http/v03/spec_0_3.js rename to src/lib/bindings/http/v03/spec_0_3.js diff --git a/lib/bindings/http/v1/emitter_binary_1.js b/src/lib/bindings/http/v1/emitter_binary_1.js similarity index 100% rename from lib/bindings/http/v1/emitter_binary_1.js rename to src/lib/bindings/http/v1/emitter_binary_1.js diff --git a/lib/bindings/http/v1/index.js b/src/lib/bindings/http/v1/index.js similarity index 100% rename from lib/bindings/http/v1/index.js rename to src/lib/bindings/http/v1/index.js diff --git a/lib/bindings/http/v1/receiver_binary_1.js b/src/lib/bindings/http/v1/receiver_binary_1.js similarity index 98% rename from lib/bindings/http/v1/receiver_binary_1.js rename to src/lib/bindings/http/v1/receiver_binary_1.js index df0c681..a5570c6 100644 --- a/lib/bindings/http/v1/receiver_binary_1.js +++ b/src/lib/bindings/http/v1/receiver_binary_1.js @@ -5,7 +5,7 @@ const { ENCODING_BASE64, BINARY_HEADERS_1, HEADER_CONTENT_TYPE -} = require("../constants.js"); +} = require("../constants"); const Spec = require("./spec_1.js"); const JSONParser = require("../../../formats/json/parser.js"); diff --git a/lib/bindings/http/v1/receiver_structured_1.js b/src/lib/bindings/http/v1/receiver_structured_1.js similarity index 100% rename from lib/bindings/http/v1/receiver_structured_1.js rename to src/lib/bindings/http/v1/receiver_structured_1.js diff --git a/lib/bindings/http/v1/spec_1.js b/src/lib/bindings/http/v1/spec_1.js similarity index 100% rename from lib/bindings/http/v1/spec_1.js rename to src/lib/bindings/http/v1/spec_1.js diff --git a/lib/bindings/http/validation/binary.js b/src/lib/bindings/http/validation/binary.js similarity index 98% rename from lib/bindings/http/validation/binary.js rename to src/lib/bindings/http/validation/binary.js index 42e3b2d..4db5ff4 100644 --- a/lib/bindings/http/validation/binary.js +++ b/src/lib/bindings/http/validation/binary.js @@ -1,4 +1,4 @@ -const CloudEvent = require("../../../cloudevent.js"); +const { CloudEvent } = require("../../../cloudevent"); const { sanityAndClone, diff --git a/lib/bindings/http/validation/commons.js b/src/lib/bindings/http/validation/commons.js similarity index 100% rename from lib/bindings/http/validation/commons.js rename to src/lib/bindings/http/validation/commons.js diff --git a/lib/bindings/http/validation/fun.js b/src/lib/bindings/http/validation/fun.js similarity index 100% rename from lib/bindings/http/validation/fun.js rename to src/lib/bindings/http/validation/fun.js diff --git a/lib/bindings/http/validation/structured.js b/src/lib/bindings/http/validation/structured.js similarity index 93% rename from lib/bindings/http/validation/structured.js rename to src/lib/bindings/http/validation/structured.js index 6bc1557..a768802 100644 --- a/lib/bindings/http/validation/structured.js +++ b/src/lib/bindings/http/validation/structured.js @@ -1,4 +1,4 @@ -const CloudEvent = require("../../../cloudevent.js"); +const { CloudEvent } = require("../../../cloudevent"); const ValidationError = require("./validation_error.js"); const { sanityAndClone, diff --git a/lib/bindings/http/validation/validation_error.js b/src/lib/bindings/http/validation/validation_error.js similarity index 100% rename from lib/bindings/http/validation/validation_error.js rename to src/lib/bindings/http/validation/validation_error.js diff --git a/lib/cloudevent.js b/src/lib/cloudevent.ts similarity index 71% rename from lib/cloudevent.js rename to src/lib/cloudevent.ts index 3788508..1c89119 100644 --- a/lib/cloudevent.js +++ b/src/lib/cloudevent.ts @@ -1,95 +1,84 @@ -const Spec1 = require("./bindings/http/v1/spec_1.js"); -const Spec03 = require("./bindings/http/v03/spec_0_3.js"); -const Formatter = require("./formats/json/formatter.js"); +import { CloudEventV1, CloudEventV1Attributes } from "./v1"; +import { CloudEventV03, CloudEventV03Attributes } from "./v03"; + +import Spec1 from "./bindings/http/v1/spec_1.js"; +import Spec03 from "./bindings/http/v03/spec_0_3.js"; +import Formatter from "./formats/json/formatter.js"; +import { isBinary } from "./bindings/http/validation/fun.js"; const { SPEC_V1, SPEC_V03 } = require("./bindings/http/constants.js"); -const { isBinary } = require("./bindings/http/validation/fun.js"); + +export type CE = CloudEventV1 | CloudEventV1Attributes | CloudEventV03 | CloudEventV03Attributes /** - * An CloudEvent describes event data in common formats to provide + * A CloudEvent describes event data in common formats to provide * interoperability across services, platforms and systems. * @see https://github.com/cloudevents/spec/blob/v1.0/spec.md */ -class CloudEvent { +export class CloudEvent { + spec: any; + formatter: any; + extensions: {}; + /** * Creates a new CloudEvent instance - * @param {object} options CloudEvent properties as a simple object - * @param {string} options.source Identifies the context in which an event happened as a URI reference - * @param {string} options.type Describes the type of event related to the originating occurrence - * @param {string} [options.id] A unique ID for this event - if not supplied, will be autogenerated - * @param {string} [options.time] A timestamp for this event. May also be provided as a Date - * @param {string} [options.subject] Describes the subject of the event in the context of the event producer - * @param {string} [options.dataContentType] The mime content type for the event data - * @param {string} [options.dataSchema] The URI of the schema that the event data adheres to (v1.0 events) - * @param {string} [options.schemaURL] The URI of the schema that the event data adheres to (v0.3 events) - * @param {string} [options.dataContentEncoding] The content encoding for the event data (v0.3 events) - * @param {string} [options.specversion] The CloudEvent specification version for this event - default: 1.0 - * @param {*} [options.data] The event payload + * @param {object} event CloudEvent properties as a simple object + * @param {string} event.source Identifies the context in which an event happened as a URI reference + * @param {string} event.type Describes the type of event related to the originating occurrence + * @param {string} [event.id] A unique ID for this event - if not supplied, will be autogenerated + * @param {string} [event.time] A timestamp for this event. May also be provided as a Date + * @param {string} [event.subject] Describes the subject of the event in the context of the event producer + * @param {string} [event.dataContentType] The mime content type for the event data + * @param {string} [event.dataSchema] The URI of the schema that the event data adheres to (v1.0 events) + * @param {string} [event.schemaURL] The URI of the schema that the event data adheres to (v0.3 events) + * @param {string} [event.dataContentEncoding] The content encoding for the event data (v0.3 events) + * @param {string} [event.specversion] The CloudEvent specification version for this event - default: 1.0 + * @param {*} [event.data] The event payload */ - constructor({ - id, - source, - type, - dataContentType, - time, - subject, - dataSchema, - schemaURL, - dataContentEncoding, - data, - specversion = SPEC_V1 } = { - id: undefined, - source: undefined, - type: undefined, - dataContentType: undefined, - time: undefined, - subject: undefined, - dataSchema: undefined, - schemaURL: undefined, - dataContentEncoding: undefined, - data: undefined - }) { - - if (!type || !source) { + constructor(event: CE) { + if (!event || !event.type || !event.source) { throw new TypeError("event type and source are required"); } - switch (specversion) { + switch (event.specversion) { case SPEC_V1: this.spec = new Spec1(); break; case SPEC_V03: this.spec = new Spec03(); break; + case undefined: + this.spec = new Spec1(); + break; default: - throw new TypeError(`unknown specification version ${specversion}`); + throw new TypeError(`unknown specification version ${event.specversion}`); } - this.source = source; - this.type = type; - this.dataContentType = dataContentType; - this.data = data; - this.subject = subject; + this.source = event.source; + this.type = event.type; + this.dataContentType = event.dataContentType; + this.data = event.data; + this.subject = event.subject; - if (dataSchema) { - this.dataSchema = dataSchema; + if (event.dataSchema) { + this.dataSchema = event.dataSchema; } // TODO: Deprecated in 1.0 - if (dataContentEncoding) { - this.dataContentEncoding = dataContentEncoding; + if (event.dataContentEncoding) { + this.dataContentEncoding = event.dataContentEncoding; } // TODO: Deprecated in 1.0 - if (schemaURL) { - this.schemaURL = schemaURL; + if (event.schemaURL) { + this.schemaURL = event.schemaURL; } - if (id) { - this.id = id; + if (event.id) { + this.id = event.id; } - if (time) { - this.time = time; + if (event.time) { + this.time = event.time; } this.formatter = new Formatter(); this.extensions = []; @@ -301,7 +290,7 @@ class CloudEvent { * @param {*} value the value of the extension attribute * @returns {void} */ - addExtension(key, value) { + addExtension(key: string, value: any) { this.spec.addExtension(key, value); this.extensions = { [key]: value, ...this.extensions }; } @@ -315,5 +304,3 @@ class CloudEvent { return this.extensions; } } - -module.exports = CloudEvent; diff --git a/lib/formats/base64.js b/src/lib/formats/base64.js similarity index 100% rename from lib/formats/base64.js rename to src/lib/formats/base64.js diff --git a/lib/formats/json/formatter.js b/src/lib/formats/json/formatter.js similarity index 100% rename from lib/formats/json/formatter.js rename to src/lib/formats/json/formatter.js diff --git a/lib/formats/json/parser.js b/src/lib/formats/json/parser.js similarity index 100% rename from lib/formats/json/parser.js rename to src/lib/formats/json/parser.js diff --git a/src/lib/v03/index.ts b/src/lib/v03/index.ts new file mode 100644 index 0000000..b2c4671 --- /dev/null +++ b/src/lib/v03/index.ts @@ -0,0 +1,135 @@ +/** + * The object interface for CloudEvents 0.3. + * @see https://github.com/cloudevents/spec/blob/v0.3/spec.md + */ + +export interface CloudEventV03 extends CloudEventV03Attributes { + // REQUIRED Attributes + /** + * [REQUIRED] Identifies the event. Producers MUST ensure that `source` + `id` + * is unique for each distinct event. If a duplicate event is re-sent (e.g. due + * to a network error) it MAY have the same `id`. Consumers MAY assume that + * Events with identical `source` and `id` are duplicates. + * @required Non-empty string. Unique within producer. + * @example An event counter maintained by the producer + * @example A UUID + */ + id: string; + /** + * [REQUIRED] The version of the CloudEvents specification which the event + * uses. This enables the interpretation of the context. Compliant event + * producers MUST use a value of `1.0` when referring to this version of the + * specification. + * @required MUST be a non-empty string. + */ + specversion: string; +} + +export interface CloudEventV03Attributes { + /** + * [REQUIRED] Identifies the context in which an event happened. Often this + * will include information such as the type of the event source, the + * organization publishing the event or the process that produced the event. The + * exact syntax and semantics behind the data encoded in the URI is defined by + * the event producer. + * Producers MUST ensure that `source` + `id` is unique for each distinct event. + * An application MAY assign a unique `source` to each distinct producer, which + * makes it easy to produce unique IDs since no other producer will have the same + * source. The application MAY use UUIDs, URNs, DNS authorities or an + * application-specific scheme to create unique `source` identifiers. + * A source MAY include more than one producer. In that case the producers MUST + * collaborate to ensure that `source` + `id` is unique for each distinct event. + * @required Non-empty URI-reference + */ + source: string; + /** + * [REQUIRED] This attribute contains a value describing the type of event + * related to the originating occurrence. Often this attribute is used for + * routing, observability, policy enforcement, etc. The format of this is + * producer defined and might include information such as the version of the + * `type` - see + * [Versioning of Attributes in the Primer](primer.md#versioning-of-attributes) + * for more information. + * @required MUST be a non-empty string + * @should SHOULD be prefixed with a reverse-DNS name. The prefixed domain dictates the + * organization which defines the semantics of this event type. + * @example com.github.pull.create + * @example com.example.object.delete.v2 + */ + type: string; + + /** + * The following fields are optional. + */ + + /** + * [OPTIONAL] Describes the content encoding for the data attribute for when the + * data field MUST be encoded as a string, like with structured transport binding + * modes using the JSON event format, but the datacontenttype indicates a non-string + * media type. When the data field's effective data type is not String, this attribute + * MUST NOT be set and MUST be ignored when set. + */ + dataContentEncoding?: string; + + /** + * [OPTIONAL] Content type of `data` value. This attribute enables `data` to + * carry any type of content, whereby format and encoding might differ from that + * of the chosen event format. For example, an event rendered using the + * [JSON envelope](./json-format.md#3-envelope) format might carry an XML payload + * in `data`, and the consumer is informed by this attribute being set to + * "application/xml". The rules for how `data` content is rendered for different + * `datacontenttype` values are defined in the event format specifications; for + * example, the JSON event format defines the relationship in + * [section 3.1](./json-format.md#31-handling-of-data). + */ + dataContentType?: string; + /** + * [OPTIONAL] A link to the schema that the data attribute adheres to. + * Incompatible changes to the schema SHOULD be reflected by a different URL. + * If present, MUST be a non-empty URI. + */ + schemaURL?: string; + /** + * [OPTIONAL] This describes the subject of the event in the context of the + * event producer (identified by `source`). In publish-subscribe scenarios, a + * subscriber will typically subscribe to events emitted by a `source`, but the + * `source` identifier alone might not be sufficient as a qualifier for any + * specific event if the `source` context has internal sub-structure. + * + * Identifying the subject of the event in context metadata (opposed to only in + * the `data` payload) is particularly helpful in generic subscription filtering + * scenarios where middleware is unable to interpret the `data` content. In the + * above example, the subscriber might only be interested in blobs with names + * ending with '.jpg' or '.jpeg' and the `subject` attribute allows for + * constructing a simple and efficient string-suffix filter for that subset of + * events. + * + * If present, MUST be a non-empty string. + * @example "https://example.com/storage/tenant/container" + * @example "mynewfile.jpg" + */ + subject?: string; + /** + * [OPTIONAL] Timestamp of when the occurrence happened. If the time of the + * occurrence cannot be determined then this attribute MAY be set to some other + * time (such as the current time) by the CloudEvents producer, however all + * producers for the same `source` MUST be consistent in this respect. In other + * words, either they all use the actual time of the occurrence or they all use + * the same algorithm to determine the value used. + * @example "2020-08-08T14:48:09.769Z" + */ + time?: Date | string; + /** + * [OPTIONAL] The event payload. This specification does not place any restriction + * on the type of this information. It is encoded into a media format which is + * specified by the datacontenttype attribute (e.g. application/json), and adheres + * to the dataschema format when those respective attributes are present. + */ + // tslint:disable-next-line:no-any + data?: any | string | number | boolean | null; + /** + * [OPTIONAL] CloudEvents extension attributes. + */ + // tslint:disable-next-line:no-any + [key: string]: any; +} \ No newline at end of file diff --git a/src/lib/v1/index.ts b/src/lib/v1/index.ts new file mode 100644 index 0000000..47fe913 --- /dev/null +++ b/src/lib/v1/index.ts @@ -0,0 +1,129 @@ +/** + * The object interface for CloudEvents 1.0. + * @see https://github.com/cloudevents/spec/blob/v1.0/spec.md + */ +export interface CloudEventV1 extends CloudEventV1Attributes { + // REQUIRED Attributes + /** + * [REQUIRED] Identifies the event. Producers MUST ensure that `source` + `id` + * is unique for each distinct event. If a duplicate event is re-sent (e.g. due + * to a network error) it MAY have the same `id`. Consumers MAY assume that + * Events with identical `source` and `id` are duplicates. + * @required Non-empty string. Unique within producer. + * @example An event counter maintained by the producer + * @example A UUID + */ + id: string; + + /** + * [REQUIRED] The version of the CloudEvents specification which the event + * uses. This enables the interpretation of the context. Compliant event + * producers MUST use a value of `1.0` when referring to this version of the + * specification. + * @required MUST be a non-empty string. + */ + specversion: string; +} + +export interface CloudEventV1Attributes { + /** + * [REQUIRED] Identifies the context in which an event happened. Often this + * will include information such as the type of the event source, the + * organization publishing the event or the process that produced the event. The + * exact syntax and semantics behind the data encoded in the URI is defined by + * the event producer. + * Producers MUST ensure that `source` + `id` is unique for each distinct event. + * An application MAY assign a unique `source` to each distinct producer, which + * makes it easy to produce unique IDs since no other producer will have the same + * source. The application MAY use UUIDs, URNs, DNS authorities or an + * application-specific scheme to create unique `source` identifiers. + * A source MAY include more than one producer. In that case the producers MUST + * collaborate to ensure that `source` + `id` is unique for each distinct event. + * @required Non-empty URI-reference + */ + source: string; + + /** + * [REQUIRED] This attribute contains a value describing the type of event + * related to the originating occurrence. Often this attribute is used for + * routing, observability, policy enforcement, etc. The format of this is + * producer defined and might include information such as the version of the + * `type` - see + * [Versioning of Attributes in the Primer](primer.md#versioning-of-attributes) + * for more information. + * @required MUST be a non-empty string + * @should SHOULD be prefixed with a reverse-DNS name. The prefixed domain dictates the + * organization which defines the semantics of this event type. + * @example com.github.pull.create + * @example com.example.object.delete.v2 + */ + type: string; + + /** + * The following fields are optional. + */ + + /** + * [OPTIONAL] Content type of `data` value. This attribute enables `data` to + * carry any type of content, whereby format and encoding might differ from that + * of the chosen event format. For example, an event rendered using the + * [JSON envelope](./json-format.md#3-envelope) format might carry an XML payload + * in `data`, and the consumer is informed by this attribute being set to + * "application/xml". The rules for how `data` content is rendered for different + * `datacontenttype` values are defined in the event format specifications; for + * example, the JSON event format defines the relationship in + * [section 3.1](./json-format.md#31-handling-of-data). + */ + dataContentType?: string; + /** + * [OPTIONAL] Identifies the schema that `data` adheres to. Incompatible + * changes to the schema SHOULD be reflected by a different URI. See + * [Versioning of Attributes in the Primer](primer.md#versioning-of-attributes) + * for more information. + * If present, MUST be a non-empty URI. + */ + dataSchema?: string; + /** + * [OPTIONAL] This describes the subject of the event in the context of the + * event producer (identified by `source`). In publish-subscribe scenarios, a + * subscriber will typically subscribe to events emitted by a `source`, but the + * `source` identifier alone might not be sufficient as a qualifier for any + * specific event if the `source` context has internal sub-structure. + * + * Identifying the subject of the event in context metadata (opposed to only in + * the `data` payload) is particularly helpful in generic subscription filtering + * scenarios where middleware is unable to interpret the `data` content. In the + * above example, the subscriber might only be interested in blobs with names + * ending with '.jpg' or '.jpeg' and the `subject` attribute allows for + * constructing a simple and efficient string-suffix filter for that subset of + * events. + * + * If present, MUST be a non-empty string. + * @example "https://example.com/storage/tenant/container" + * @example "mynewfile.jpg" + */ + subject?: string; + /** + * [OPTIONAL] Timestamp of when the occurrence happened. If the time of the + * occurrence cannot be determined then this attribute MAY be set to some other + * time (such as the current time) by the CloudEvents producer, however all + * producers for the same `source` MUST be consistent in this respect. In other + * words, either they all use the actual time of the occurrence or they all use + * the same algorithm to determine the value used. + * @example "2020-08-08T14:48:09.769Z" + */ + time?: Date | string; + /** + * [OPTIONAL] The event payload. This specification does not place any restriction + * on the type of this information. It is encoded into a media format which is + * specified by the datacontenttype attribute (e.g. application/json), and adheres + * to the dataschema format when those respective attributes are present. + */ + // tslint:disable-next-line:no-any + data?: any | string | number | boolean | null; + /** + * [OPTIONAL] CloudEvents extension attributes. + */ + // tslint:disable-next-line:no-any + [key: string]: any; +} \ No newline at end of file diff --git a/test/bindings/http/receiver_binary_0_3_tests.js b/test/bindings/http/receiver_binary_0_3_tests.js index 13aa5e9..864075b 100644 --- a/test/bindings/http/receiver_binary_0_3_tests.js +++ b/test/bindings/http/receiver_binary_0_3_tests.js @@ -1,6 +1,6 @@ const expect = require("chai").expect; -const CloudEvent = require("../../../lib/cloudevent.js"); +const { CloudEvent } = require("../../../lib/cloudevent.js"); const BinaryHTTPReceiver = require("../../../lib/bindings/http/receiver_binary.js"); const ValidationError = require("../../../lib/bindings/http/validation/validation_error.js"); const { diff --git a/test/bindings/http/receiver_binary_1_tests.js b/test/bindings/http/receiver_binary_1_tests.js index 473922c..ac941ff 100644 --- a/test/bindings/http/receiver_binary_1_tests.js +++ b/test/bindings/http/receiver_binary_1_tests.js @@ -6,7 +6,7 @@ const { HEADER_CONTENT_TYPE } = require("../../../lib/bindings/http/constants.js"); const ValidationError = require("../../../lib/bindings/http/validation/validation_error.js"); -const CloudEvent = require("../../../lib/cloudevent.js"); +const { CloudEvent } = require("../../../lib/cloudevent.js"); const BinaryHTTPReceiver = require("../../../lib/bindings/http/receiver_binary.js"); const receiver = new BinaryHTTPReceiver(SPEC_V1); diff --git a/test/bindings/http/receiver_structured_0_3_test.js b/test/bindings/http/receiver_structured_0_3_test.js index 562971f..8dd7c58 100644 --- a/test/bindings/http/receiver_structured_0_3_test.js +++ b/test/bindings/http/receiver_structured_0_3_test.js @@ -1,7 +1,7 @@ const expect = require("chai").expect; const ValidationError = require("../../../lib/bindings/http/validation/validation_error.js"); const HTTPStructuredReceiver = require("../../../lib/bindings/http/receiver_structured.js"); -const CloudEvent = require("../../../lib/cloudevent.js"); +const { CloudEvent } = require("../../../index.js"); const { SPEC_V03 } = require("../../../lib/bindings/http/constants.js"); const receiver = new HTTPStructuredReceiver(SPEC_V03); diff --git a/test/cloud_event_test.js b/test/cloud_event_test.js index 89a6279..8a232c4 100644 --- a/test/cloud_event_test.js +++ b/test/cloud_event_test.js @@ -1,4 +1,4 @@ -const CloudEvent = require("../lib/cloudevent.js"); +const { CloudEvent } = require("../"); const { SPEC_V1, SPEC_V03 } = require("../lib/bindings/http/constants.js"); const { expect } = require("chai"); diff --git a/test/http_binding_0_3.js b/test/http_binding_0_3.js index cea8f39..10b876f 100644 --- a/test/http_binding_0_3.js +++ b/test/http_binding_0_3.js @@ -2,7 +2,7 @@ const expect = require("chai").expect; const nock = require("nock"); const BinaryHTTPEmitter = require("../lib/bindings/http/emitter_binary.js"); const StructuredHTTPEmitter = require("../lib/bindings/http/emitter_structured.js"); -const CloudEvent = require("../lib/cloudevent.js"); +const { CloudEvent } = require("../"); const { SPEC_V03 } = require("../lib/bindings/http/constants.js"); diff --git a/test/http_binding_1.js b/test/http_binding_1.js index cf120ea..4251860 100644 --- a/test/http_binding_1.js +++ b/test/http_binding_1.js @@ -3,7 +3,7 @@ const nock = require("nock"); const https = require("https"); const { asBase64 } = require("../lib/bindings/http/validation/fun.js"); const { SPEC_V1 } = require("../lib/bindings/http/constants.js"); -const CloudEvent = require("../lib/cloudevent.js"); +const { CloudEvent } = require("../"); const BinaryHTTPEmitter = require("../lib/bindings/http/emitter_binary.js"); const StructuredHTTPEmitter = require("../lib/bindings/http/emitter_structured.js"); const type = "com.github.pull.create"; diff --git a/test/sdk_test.js b/test/sdk_test.js index acce1c2..fba72b3 100644 --- a/test/sdk_test.js +++ b/test/sdk_test.js @@ -1,7 +1,6 @@ const expect = require("chai").expect; const { CloudEvent, HTTPReceiver, HTTPEmitter } = require("../"); -const SpecV03 = require("../lib/bindings/http/v03").Spec; -const SpecV1 = require("../lib/bindings/http/v1").Spec; + const { SPEC_V03, SPEC_V1 diff --git a/test/spec_0_3_tests.js b/test/spec_0_3_tests.js index 22c1c5a..b42a2ec 100644 --- a/test/spec_0_3_tests.js +++ b/test/spec_0_3_tests.js @@ -1,5 +1,4 @@ const expect = require("chai").expect; -const Spec03 = require("../lib/bindings/http/v03/spec_0_3.js"); const { CloudEvent } = require("../index.js"); const { MIME_JSON, diff --git a/tsconfig.json b/tsconfig.json index 780c870..6755497 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,14 +3,22 @@ "target": "ES2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ "allowJs": true, /* Allow javascript files to be compiled. */ - "checkJs": true, /* Report errors in .js files. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - "strict": false, /* Enable all strict type-checking options. */ + "checkJs": false, /* Report errors in .js files. */ + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ + "outDir": "./", + "declaration": true }, - "files": [ - "index.js" - ] + "compileOnSave": true, + "include": [ + "src/**/*.ts" + ], + "exclude": [], + "typedocOptions": { + "out": "docs", + "mode": "library" + } }