From 7bc4361cf926a807c0dcb64e1b2c16eaecd89b9f Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Mon, 11 May 2020 10:38:04 -0400 Subject: [PATCH 1/4] build: add tsc type checking in the ci/test pipeline This commit introduces TypeScript checks and generates type declarations for the existing JavaScript codebase using `tsc` prior to running the linter task. Ref: https://github.com/cloudevents/sdk-javascript/issues/9 Signed-off-by: Lance Ball --- .gitignore | 3 + docs/BinaryHTTPEmitter.html | 12 + docs/BinaryHTTPReceiver.html | 2 +- docs/CloudEvent.html | 42 +- docs/HTTPEmitter.html | 8 +- docs/HTTPReceiver.html | 6 +- docs/StructuredHTTPEmitter.html | 6 +- docs/ValidationError.html | 4 +- docs/bindings_http_emitter_binary.js.html | 18 + docs/bindings_http_emitter_binary_0_3.js.html | 173 +++ docs/bindings_http_emitter_binary_1.js.html | 168 +++ docs/bindings_http_emitter_structured.js.html | 10 +- docs/bindings_http_http_emitter.js.html | 11 +- docs/bindings_http_http_receiver.js.html | 6 +- docs/bindings_http_receiver_binary.js.html | 2 +- ...s_http_validation_validation_error.js.html | 6 +- docs/cloudevent.js.html | 10 +- docs/formats_json_parser.js.html | 2 +- docs/global.html | 325 +++++ docs/index.html | 2 +- docs/validation_error.js.html | 13 + lib/bindings/http/emitter_binary.js | 7 +- lib/bindings/http/emitter_structured.js | 8 +- lib/bindings/http/http_emitter.js | 9 +- lib/bindings/http/http_receiver.js | 4 +- lib/bindings/http/v03/emitter_binary_0_3.js | 96 +- lib/bindings/http/v03/spec_0_3.js | 2 +- lib/bindings/http/v1/emitter_binary_1.js | 86 +- lib/bindings/http/v1/spec_1.js | 2 +- .../http/validation/validation_error.js | 2 + lib/cloudevent.js | 8 +- package-lock.json | 1086 +++++++++++++---- package.json | 8 +- tsconfig.json | 16 + 34 files changed, 1756 insertions(+), 407 deletions(-) create mode 100644 docs/bindings_http_emitter_binary_0_3.js.html create mode 100644 docs/bindings_http_emitter_binary_1.js.html create mode 100644 docs/global.html create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index d08c926e..a19537f2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +# Generated typedefs +*.d.ts + # Runtime data pids *.pid diff --git a/docs/BinaryHTTPEmitter.html b/docs/BinaryHTTPEmitter.html index a32a899b..c0bfa517 100644 --- a/docs/BinaryHTTPEmitter.html +++ b/docs/BinaryHTTPEmitter.html @@ -73,7 +73,11 @@

+<<<<<<< HEAD

Classes

+======= +

Classes

+>>>>>>> build: add tsc type checking in the ci/test pipeline
@@ -230,7 +234,11 @@
Parameters:
@@ -480,7 +488,11 @@
Properties
diff --git a/docs/BinaryHTTPReceiver.html b/docs/BinaryHTTPReceiver.html index 2e185d25..a50befe0 100644 --- a/docs/BinaryHTTPReceiver.html +++ b/docs/BinaryHTTPReceiver.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/CloudEvent.html b/docs/CloudEvent.html index a661f10f..5df98f18 100644 --- a/docs/CloudEvent.html +++ b/docs/CloudEvent.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

@@ -470,7 +470,7 @@
Parameters:
@@ -627,7 +627,7 @@
Parameters:
@@ -784,7 +784,7 @@
Parameters:
@@ -888,7 +888,7 @@

@@ -979,7 +979,7 @@

@@ -1081,7 +1081,7 @@

@@ -1183,7 +1183,7 @@

@@ -1285,7 +1285,7 @@

@@ -1376,7 +1376,7 @@

@@ -1467,7 +1467,7 @@

@@ -1569,7 +1569,7 @@

@@ -1671,7 +1671,7 @@

@@ -1773,7 +1773,7 @@

@@ -1930,7 +1930,7 @@

Parameters:
@@ -2029,7 +2029,7 @@
Parameters:
- URI + string @@ -2043,7 +2043,7 @@
Parameters:
-

the context in which the event happened

+

the context in which the event happened in URI form

@@ -2087,7 +2087,7 @@
Parameters:
@@ -2244,7 +2244,7 @@
Parameters:
@@ -2347,7 +2347,7 @@

@@ -2493,7 +2493,7 @@

Parameters:
diff --git a/docs/HTTPEmitter.html b/docs/HTTPEmitter.html index 0e10683f..c479f2e5 100644 --- a/docs/HTTPEmitter.html +++ b/docs/HTTPEmitter.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

@@ -344,7 +344,7 @@
Properties
@@ -556,7 +556,7 @@
Parameters:
@@ -863,7 +863,7 @@
Properties
diff --git a/docs/HTTPReceiver.html b/docs/HTTPReceiver.html index 82636f2a..1f1ab77e 100644 --- a/docs/HTTPReceiver.html +++ b/docs/HTTPReceiver.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

@@ -171,7 +171,7 @@

@@ -371,7 +371,7 @@

Parameters:
diff --git a/docs/StructuredHTTPEmitter.html b/docs/StructuredHTTPEmitter.html index e8e8dde7..c151cc1e 100644 --- a/docs/StructuredHTTPEmitter.html +++ b/docs/StructuredHTTPEmitter.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

@@ -167,7 +167,7 @@

@@ -417,7 +417,7 @@

Properties
diff --git a/docs/ValidationError.html b/docs/ValidationError.html index 827aaa4b..75943665 100644 --- a/docs/ValidationError.html +++ b/docs/ValidationError.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

@@ -283,7 +283,7 @@
Parameters:
diff --git a/docs/bindings_http_emitter_binary.js.html b/docs/bindings_http_emitter_binary.js.html index b06d979c..248c4a27 100644 --- a/docs/bindings_http_emitter_binary.js.html +++ b/docs/bindings_http_emitter_binary.js.html @@ -75,7 +75,11 @@

+<<<<<<< HEAD

Classes

+======= +

Classes

+>>>>>>> build: add tsc type checking in the ci/test pipeline
@@ -91,8 +95,11 @@

const axios = require("axios");
+<<<<<<< HEAD
 const EmitterV1 = require("./v1").BinaryEmitter;
 const EmitterV3 = require("./v03").BinaryEmitter;
+=======
+>>>>>>> build: add tsc type checking in the ci/test pipeline
 
 const {
   HEADERS,
@@ -126,10 +133,17 @@ 

*/ constructor(version) { if (version === SPEC_V1) { +<<<<<<< HEAD this.headerByGetter = EmitterV1; this.extensionPrefix = BINARY_HEADERS_1.EXTENSIONS_PREFIX; } else if (version === SPEC_V03) { this.headerByGetter = EmitterV3; +======= + this.headerByGetter = require("./emitter_binary_1.js"); + this.extensionPrefix = BINARY_HEADERS_1.EXTENSIONS_PREFIX; + } else if (version === SPEC_V03) { + this.headerByGetter = require("./emitter_binary_0_3.js"); +>>>>>>> build: add tsc type checking in the ci/test pipeline this.extensionPrefix = BINARY_HEADERS_03.EXTENSIONS_PREFIX; } } @@ -169,7 +183,11 @@

}); config[DATA_ATTRIBUTE] = data; +<<<<<<< HEAD config.headers = headers; +======= + config[HEADERS] = headers; +>>>>>>> build: add tsc type checking in the ci/test pipeline // Return the Promise return axios.request(config); diff --git a/docs/bindings_http_emitter_binary_0_3.js.html b/docs/bindings_http_emitter_binary_0_3.js.html new file mode 100644 index 00000000..9db9ea37 --- /dev/null +++ b/docs/bindings_http_emitter_binary_0_3.js.html @@ -0,0 +1,173 @@ + + + + + + + + + + + bindings/http/emitter_binary_0_3.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ bindings/http/emitter_binary_0_3.js +

+ + + + + +
+
+
const {
+  HEADER_CONTENT_TYPE,
+  BINARY_HEADERS_03
+} = require("./constants.js");
+
+const passThroughParser = (v) => v;
+
+/**
+ * A utility object used to retrieve the header names for a CloudEvent
+ * using the CloudEvent getter function.
+ */
+const headerByGetter = {
+  getDataContentType: {
+    name: HEADER_CONTENT_TYPE,
+    parser: passThroughParser
+  },
+
+  getDataContentEncoding: {
+    name: BINARY_HEADERS_03.CONTENT_ENCONDING,
+    parser: passThroughParser
+  },
+
+  getSubject: {
+    name: BINARY_HEADERS_03.SUBJECT,
+    parser: passThroughParser
+  },
+
+  getType: {
+    name: BINARY_HEADERS_03.TYPE,
+    parser: passThroughParser
+  },
+
+  getSpecversion: {
+    name: BINARY_HEADERS_03.SPEC_VERSION,
+    parser: passThroughParser
+  },
+
+  getSource: {
+    name: BINARY_HEADERS_03.SOURCE,
+    parser: passThroughParser
+  },
+
+  getId: {
+    name: BINARY_HEADERS_03.ID,
+    parser: passThroughParser
+  },
+
+  getTime: {
+    name: BINARY_HEADERS_03.TIME,
+    parser: passThroughParser
+  },
+
+  getSchemaurl: {
+    name: BINARY_HEADERS_03.SCHEMA_URL,
+    parser: passThroughParser
+  }
+};
+
+module.exports = headerByGetter;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + diff --git a/docs/bindings_http_emitter_binary_1.js.html b/docs/bindings_http_emitter_binary_1.js.html new file mode 100644 index 00000000..593d7e21 --- /dev/null +++ b/docs/bindings_http_emitter_binary_1.js.html @@ -0,0 +1,168 @@ + + + + + + + + + + + bindings/http/emitter_binary_1.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ bindings/http/emitter_binary_1.js +

+ + + + + +
+
+
const {
+  HEADER_CONTENT_TYPE,
+  BINARY_HEADERS_1
+} = require("./constants.js");
+
+const passThroughParser = (v) => v;
+
+/**
+ * A utility object used to retrieve the header names for a CloudEvent
+ * using the CloudEvent getter function.
+ */
+const headerByGetter = {
+  getDataContentType: {
+    name: HEADER_CONTENT_TYPE,
+    parser: passThroughParser
+  },
+
+  getSubject: {
+    name: BINARY_HEADERS_1.SUBJECT,
+    parser: passThroughParser
+  },
+
+  getType: {
+    name: BINARY_HEADERS_1.TYPE,
+    parser: passThroughParser
+  },
+
+  getSpecversion: {
+    name: BINARY_HEADERS_1.SPEC_VERSION,
+    parser: passThroughParser
+  },
+
+  getSource: {
+    name: BINARY_HEADERS_1.SOURCE,
+    parser: passThroughParser
+  },
+
+  getId: {
+    name: BINARY_HEADERS_1.ID,
+    parser: passThroughParser
+  },
+
+  getTime: {
+    name: BINARY_HEADERS_1.TIME,
+    parser: passThroughParser
+  },
+
+  getDataschema: {
+    name: BINARY_HEADERS_1.DATA_SCHEMA,
+    parser: passThroughParser
+  }
+};
+
+module.exports = headerByGetter;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + diff --git a/docs/bindings_http_emitter_structured.js.html b/docs/bindings_http_emitter_structured.js.html index 0e6144c8..2ab1619a 100644 --- a/docs/bindings_http_emitter_structured.js.html +++ b/docs/bindings_http_emitter_structured.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

@@ -90,7 +90,10 @@

-
const axios = require("axios");
+    
const { default: Axios } = require("axios");
+
+/** @typedef {import("../../cloudevent")} CloudEvent */
+
 const {
   DATA_ATTRIBUTE,
   DEFAULT_CE_CONTENT_TYPE,
@@ -123,7 +126,8 @@ 

async emit(options, cloudevent) { const config = { ...defaults, ...options }; config[DATA_ATTRIBUTE] = cloudevent.format(); - return axios.request(config); + // @ts-ignore Types of property 'url' are incompatible. Type 'URL' is not assignable to type 'string'. + return Axios.request(config); } } diff --git a/docs/bindings_http_http_emitter.js.html b/docs/bindings_http_http_emitter.js.html index 7947483d..9f85f51d 100644 --- a/docs/bindings_http_http_emitter.js.html +++ b/docs/bindings_http_http_emitter.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

@@ -93,6 +93,8 @@

const BinaryHTTPEmitter = require("./emitter_binary.js");
 const StructuredEmitter = require("./emitter_structured.js");
 
+/** @typedef {import("../../cloudevent")} CloudEvent */
+
 const {
   SPEC_V03,
   SPEC_V1
@@ -115,7 +117,7 @@ 

* @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 } = {}) { + constructor({ url, version = SPEC_V1 } = { url: undefined }) { if (version !== SPEC_V03 && version !== SPEC_V1) { throw new TypeError( `Unknown CloudEvent specification version: ${version}`); @@ -143,12 +145,15 @@

* Possible values are "binary" and "structured". Default: structured * @returns {Promise} Promise with an eventual response from the receiver */ - send(event, { url, mode = "binary", ...httpOpts } = {}) { + 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}.`); diff --git a/docs/bindings_http_http_receiver.js.html b/docs/bindings_http_http_receiver.js.html index 35c97036..d3299f74 100644 --- a/docs/bindings_http_http_receiver.js.html +++ b/docs/bindings_http_http_receiver.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

@@ -108,6 +108,8 @@

DEFAULT_SPEC_VERSION_HEADER } = require("./constants"); +/** @typedef {import("../../cloudevent")} CloudEvent */ + /** * A class to receive a CloudEvent from an HTTP POST request. */ @@ -172,7 +174,7 @@

} } else { // structured mode - the version is in the body - return body instanceof String + return (typeof body === "string") ? JSON.parse(body).specversion : body.specversion; } return SPEC_V1; diff --git a/docs/bindings_http_receiver_binary.js.html b/docs/bindings_http_receiver_binary.js.html index 2a8814d3..5538beb1 100644 --- a/docs/bindings_http_receiver_binary.js.html +++ b/docs/bindings_http_receiver_binary.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

diff --git a/docs/bindings_http_validation_validation_error.js.html b/docs/bindings_http_validation_validation_error.js.html index b6b71669..16662b49 100644 --- a/docs/bindings_http_validation_validation_error.js.html +++ b/docs/bindings_http_validation_validation_error.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

@@ -90,7 +90,9 @@

-
/**
+    
/** @typedef {import("ajv").ErrorObject} ErrorObject */
+
+/**
  * A Error class that will be thrown when a CloudEvent
  * cannot be properly validated against a specification.
  */
diff --git a/docs/cloudevent.js.html b/docs/cloudevent.js.html
index 03399742..0f240f9a 100644
--- a/docs/cloudevent.js.html
+++ b/docs/cloudevent.js.html
@@ -75,7 +75,7 @@ 

-

Classes

+

Classes

@@ -103,8 +103,10 @@

* @param {Formatter} [userFormatter] Converts the event into a readable string */ constructor(userSpec, userFormatter) { - this.spec = userSpec ? new userSpec(CloudEvent) : new Spec(CloudEvent); - this.formatter = userFormatter ? new userFormatter() : new Formatter(); + // @ts-ignore Type 'Spec1' has no construct signatures. + this.spec = (userSpec) ? new userSpec(CloudEvent) : new Spec(CloudEvent); + // @ts-ignore Type 'JSONFormatter' has no construct signatures. + this.formatter = (userFormatter) ? new userFormatter() : new Formatter(); // The map of extensions this.extensions = {}; @@ -185,7 +187,7 @@

/** * Sets the origination source of this event. * @see https://github.com/cloudevents/spec/blob/master/spec.md#source-1 - * @param {URI} source the context in which the event happened + * @param {string} source the context in which the event happened in URI form * @returns {CloudEvent} this CloudEvent instance */ source(source) { diff --git a/docs/formats_json_parser.js.html b/docs/formats_json_parser.js.html index 4783986a..dc8c360e 100644 --- a/docs/formats_json_parser.js.html +++ b/docs/formats_json_parser.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

diff --git a/docs/global.html b/docs/global.html new file mode 100644 index 00000000..355647b1 --- /dev/null +++ b/docs/global.html @@ -0,0 +1,325 @@ + + + + + + + + + Global - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Global +

+ + + + +
+
+ +

+ + + +

+ + + +
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + + +

+ (constant) headerByGetter +

+ + + + +
+

A utility object used to retrieve the header names for a CloudEvent +using the CloudEvent getter function.

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) headerByGetter +

+ + + + +
+

A utility object 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/index.html b/docs/index.html index 3dc53b0f..44ee5906 100644 --- a/docs/index.html +++ b/docs/index.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/validation_error.js.html b/docs/validation_error.js.html index 332a5154..c0e2e767 100644 --- a/docs/validation_error.js.html +++ b/docs/validation_error.js.html @@ -75,7 +75,11 @@

+<<<<<<< HEAD

Classes

+======= +

Classes

+>>>>>>> build: add tsc type checking in the ci/test pipeline
@@ -92,14 +96,23 @@

/**
  * A Error class that will be thrown when a CloudEvent
+<<<<<<< HEAD
  * cannot be properly validated against a the specification.
+=======
+ * cannot be properly validated against a specification.
+>>>>>>> build: add tsc type checking in the ci/test pipeline
  */
 class ValidationError extends TypeError {
   /**
    * Constructs a new {ValidationError} with the message
    * and array of additional errors.
    * @param {string} message the error message
+<<<<<<< HEAD
    * @param {string[]|ErrorObject[]} [errors] any additional errors related to validation
+=======
+   // @ts-ignore tsc can't find ErrorObject
+   * @param {[string]|[ErrorObject]} [errors] any additional errors related to validation
+>>>>>>> build: add tsc type checking in the ci/test pipeline
    */
   constructor(message, errors) {
     super(message);
diff --git a/lib/bindings/http/emitter_binary.js b/lib/bindings/http/emitter_binary.js
index ccd93330..17fcd7de 100644
--- a/lib/bindings/http/emitter_binary.js
+++ b/lib/bindings/http/emitter_binary.js
@@ -1,4 +1,4 @@
-const axios = require("axios");
+const { default: Axios } = require("axios");
 const EmitterV1 = require("./v1").BinaryEmitter;
 const EmitterV3 = require("./v03").BinaryEmitter;
 
@@ -77,10 +77,11 @@ class BinaryHTTPEmitter {
       });
 
     config[DATA_ATTRIBUTE] = data;
-    config.headers = headers;
+    config[HEADERS] = headers;
 
     // Return the Promise
-    return axios.request(config);
+    // @ts-ignore  Types of property 'url' are incompatible. Type 'URL' is not assignable to type 'string'.
+    return Axios.request(config);
   }
 }
 
diff --git a/lib/bindings/http/emitter_structured.js b/lib/bindings/http/emitter_structured.js
index 6c768ec5..7b237693 100644
--- a/lib/bindings/http/emitter_structured.js
+++ b/lib/bindings/http/emitter_structured.js
@@ -1,4 +1,7 @@
-const axios = require("axios");
+const { default: Axios } = require("axios");
+
+/** @typedef {import("../../cloudevent")} CloudEvent */
+
 const {
   DATA_ATTRIBUTE,
   DEFAULT_CE_CONTENT_TYPE,
@@ -31,7 +34,8 @@ class StructuredHTTPEmitter {
   async emit(options, cloudevent) {
     const config = { ...defaults, ...options };
     config[DATA_ATTRIBUTE] = cloudevent.format();
-    return axios.request(config);
+    // @ts-ignore Types of property 'url' are incompatible. Type 'URL' is not assignable to type 'string'.
+    return Axios.request(config);
   }
 }
 
diff --git a/lib/bindings/http/http_emitter.js b/lib/bindings/http/http_emitter.js
index c3d441ba..00aaf0d9 100644
--- a/lib/bindings/http/http_emitter.js
+++ b/lib/bindings/http/http_emitter.js
@@ -1,6 +1,8 @@
 const BinaryHTTPEmitter = require("./emitter_binary.js");
 const StructuredEmitter = require("./emitter_structured.js");
 
+/** @typedef {import("../../cloudevent")} CloudEvent */
+
 const {
   SPEC_V03,
   SPEC_V1
@@ -23,7 +25,7 @@ class HTTPEmitter {
    * @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 } = {}) {
+  constructor({ url, version = SPEC_V1 } = { url: undefined }) {
     if (version !== SPEC_V03 && version !== SPEC_V1) {
       throw new TypeError(
         `Unknown CloudEvent specification version: ${version}`);
@@ -51,12 +53,15 @@ 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 } = {}) {
+  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}.`);
diff --git a/lib/bindings/http/http_receiver.js b/lib/bindings/http/http_receiver.js
index 55537101..f128d5e7 100644
--- a/lib/bindings/http/http_receiver.js
+++ b/lib/bindings/http/http_receiver.js
@@ -16,6 +16,8 @@ const {
   DEFAULT_SPEC_VERSION_HEADER
 } = require("./constants");
 
+/** @typedef {import("../../cloudevent")} CloudEvent */
+
 /**
  * A class to receive a CloudEvent from an HTTP POST request.
  */
@@ -80,7 +82,7 @@ function getVersion(mode, headers, body) {
     }
   } else {
     // structured mode - the version is in the body
-    return body instanceof String
+    return (typeof body === "string")
       ? JSON.parse(body).specversion : body.specversion;
   }
   return SPEC_V1;
diff --git a/lib/bindings/http/v03/emitter_binary_0_3.js b/lib/bindings/http/v03/emitter_binary_0_3.js
index 4ebbff6e..421bf072 100644
--- a/lib/bindings/http/v03/emitter_binary_0_3.js
+++ b/lib/bindings/http/v03/emitter_binary_0_3.js
@@ -3,51 +3,57 @@ const {
   BINARY_HEADERS_03
 } = require("../constants.js");
 
-const headerByGetter = {};
-
-headerByGetter.getDataContentType = {
-  name: HEADER_CONTENT_TYPE,
-  parser: (v) => v
-};
-
-headerByGetter.getDataContentEncoding = {
-  name: BINARY_HEADERS_03.CONTENT_ENCODING,
-  parser: (v) => v
-};
-
-headerByGetter.getSubject = {
-  name: BINARY_HEADERS_03.SUBJECT,
-  parser: (v) => v
-};
-
-headerByGetter.getType = {
-  name: BINARY_HEADERS_03.TYPE,
-  parser: (v) => v
-};
-
-headerByGetter.getSpecversion = {
-  name: BINARY_HEADERS_03.SPEC_VERSION,
-  parser: (v) => v
-};
-
-headerByGetter.getSource = {
-  name: BINARY_HEADERS_03.SOURCE,
-  parser: (v) => v
-};
-
-headerByGetter.getId = {
-  name: BINARY_HEADERS_03.ID,
-  parser: (v) => v
-};
-
-headerByGetter.getTime = {
-  name: BINARY_HEADERS_03.TIME,
-  parser: (v) => v
-};
-
-headerByGetter.getSchemaurl = {
-  name: BINARY_HEADERS_03.SCHEMA_URL,
-  parser: (v) => v
+const passThroughParser = (v) => v;
+
+/**
+ * A utility object used to retrieve the header names for a CloudEvent
+ * using the CloudEvent getter function.
+ */
+const headerByGetter = {
+  getDataContentType: {
+    name: HEADER_CONTENT_TYPE,
+    parser: passThroughParser
+  },
+
+  getDataContentEncoding: {
+    name: BINARY_HEADERS_03.CONTENT_ENCODING,
+    parser: passThroughParser
+  },
+
+  getSubject: {
+    name: BINARY_HEADERS_03.SUBJECT,
+    parser: passThroughParser
+  },
+
+  getType: {
+    name: BINARY_HEADERS_03.TYPE,
+    parser: passThroughParser
+  },
+
+  getSpecversion: {
+    name: BINARY_HEADERS_03.SPEC_VERSION,
+    parser: passThroughParser
+  },
+
+  getSource: {
+    name: BINARY_HEADERS_03.SOURCE,
+    parser: passThroughParser
+  },
+
+  getId: {
+    name: BINARY_HEADERS_03.ID,
+    parser: passThroughParser
+  },
+
+  getTime: {
+    name: BINARY_HEADERS_03.TIME,
+    parser: passThroughParser
+  },
+
+  getSchemaurl: {
+    name: BINARY_HEADERS_03.SCHEMA_URL,
+    parser: passThroughParser
+  }
 };
 
 module.exports = headerByGetter;
diff --git a/lib/bindings/http/v03/spec_0_3.js b/lib/bindings/http/v03/spec_0_3.js
index 50368ec6..634123b2 100644
--- a/lib/bindings/http/v03/spec_0_3.js
+++ b/lib/bindings/http/v03/spec_0_3.js
@@ -169,7 +169,7 @@ Spec03.prototype.check = function(ce) {
   const toCheck = (!ce ? this.payload : ce);
 
   if (!isValidAgainstSchema(toCheck)) {
-    throw new ValidationError("invalid payload", [isValidAgainstSchema.errors]);
+    throw new ValidationError("invalid payload", isValidAgainstSchema.errors);
   }
 
   Array.of(toCheck)
diff --git a/lib/bindings/http/v1/emitter_binary_1.js b/lib/bindings/http/v1/emitter_binary_1.js
index c88ac6a2..a95d84cc 100644
--- a/lib/bindings/http/v1/emitter_binary_1.js
+++ b/lib/bindings/http/v1/emitter_binary_1.js
@@ -3,46 +3,52 @@ const {
   BINARY_HEADERS_1
 } = require("../constants.js");
 
-const headerByGetter = {};
-
-headerByGetter.getDataContentType = {
-  name: HEADER_CONTENT_TYPE,
-  parser: (v) => v
-};
-
-headerByGetter.getSubject = {
-  name: BINARY_HEADERS_1.SUBJECT,
-  parser: (v) => v
-};
-
-headerByGetter.getType = {
-  name: BINARY_HEADERS_1.TYPE,
-  parser: (v) => v
-};
-
-headerByGetter.getSpecversion = {
-  name: BINARY_HEADERS_1.SPEC_VERSION,
-  parser: (v) => v
-};
-
-headerByGetter.getSource = {
-  name: BINARY_HEADERS_1.SOURCE,
-  parser: (v) => v
-};
-
-headerByGetter.getId = {
-  name: BINARY_HEADERS_1.ID,
-  parser: (v) => v
-};
-
-headerByGetter.getTime = {
-  name: BINARY_HEADERS_1.TIME,
-  parser: (v) => v
-};
-
-headerByGetter.getDataschema = {
-  name: BINARY_HEADERS_1.DATA_SCHEMA,
-  parser: (v) => v
+const passThroughParser = (v) => v;
+
+/**
+ * A utility object used to retrieve the header names for a CloudEvent
+ * using the CloudEvent getter function.
+ */
+const headerByGetter = {
+  getDataContentType: {
+    name: HEADER_CONTENT_TYPE,
+    parser: passThroughParser
+  },
+
+  getSubject: {
+    name: BINARY_HEADERS_1.SUBJECT,
+    parser: passThroughParser
+  },
+
+  getType: {
+    name: BINARY_HEADERS_1.TYPE,
+    parser: passThroughParser
+  },
+
+  getSpecversion: {
+    name: BINARY_HEADERS_1.SPEC_VERSION,
+    parser: passThroughParser
+  },
+
+  getSource: {
+    name: BINARY_HEADERS_1.SOURCE,
+    parser: passThroughParser
+  },
+
+  getId: {
+    name: BINARY_HEADERS_1.ID,
+    parser: passThroughParser
+  },
+
+  getTime: {
+    name: BINARY_HEADERS_1.TIME,
+    parser: passThroughParser
+  },
+
+  getDataschema: {
+    name: BINARY_HEADERS_1.DATA_SCHEMA,
+    parser: passThroughParser
+  }
 };
 
 module.exports = headerByGetter;
diff --git a/lib/bindings/http/v1/spec_1.js b/lib/bindings/http/v1/spec_1.js
index 942f625c..e68c76a1 100644
--- a/lib/bindings/http/v1/spec_1.js
+++ b/lib/bindings/http/v1/spec_1.js
@@ -192,7 +192,7 @@ Spec1.prototype.check = function(ce) {
   const toCheck = (!ce ? this.payload : ce);
 
   if (!isValidAgainstSchema(toCheck)) {
-    throw new ValidationError("invalid payload", [isValidAgainstSchema.errors]);
+    throw new ValidationError("invalid payload", isValidAgainstSchema.errors);
   }
 };
 
diff --git a/lib/bindings/http/validation/validation_error.js b/lib/bindings/http/validation/validation_error.js
index 307c168e..0b60cee6 100644
--- a/lib/bindings/http/validation/validation_error.js
+++ b/lib/bindings/http/validation/validation_error.js
@@ -1,3 +1,5 @@
+/** @typedef {import("ajv").ErrorObject} ErrorObject */
+
 /**
  * A Error class that will be thrown when a CloudEvent
  * cannot be properly validated against a specification.
diff --git a/lib/cloudevent.js b/lib/cloudevent.js
index d5f85543..b4f84904 100644
--- a/lib/cloudevent.js
+++ b/lib/cloudevent.js
@@ -11,8 +11,10 @@ class CloudEvent {
    * @param {Formatter} [userFormatter] Converts the event into a readable string
    */
   constructor(userSpec, userFormatter) {
-    this.spec = userSpec ? new userSpec(CloudEvent) : new Spec(CloudEvent);
-    this.formatter = userFormatter ? new userFormatter() : new Formatter();
+    // @ts-ignore Type 'Spec1' has no construct signatures.
+    this.spec = (userSpec) ? new userSpec(CloudEvent) : new Spec(CloudEvent);
+    // @ts-ignore Type 'JSONFormatter' has no construct signatures.
+    this.formatter = (userFormatter) ? new userFormatter() : new Formatter();
 
     // The map of extensions
     this.extensions = {};
@@ -93,7 +95,7 @@ class CloudEvent {
   /**
    * Sets the origination source of this event.
    * @see https://github.com/cloudevents/spec/blob/master/spec.md#source-1
-   * @param {URI} source the context in which the event happened
+   * @param {string} source the context in which the event happened in URI form
    * @returns {CloudEvent} this CloudEvent instance
    */
   source(source) {
diff --git a/package-lock.json b/package-lock.json
index de37b6a9..9edbf638 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -318,12 +318,48 @@
       "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==",
       "dev": true
     },
+    "@types/ajv": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/@types/ajv/-/ajv-1.0.0.tgz",
+      "integrity": "sha1-T7JEB0Ly9sMOf7B5e4OfxvaWaCo=",
+      "dev": true,
+      "requires": {
+        "ajv": "*"
+      }
+    },
+    "@types/axios": {
+      "version": "0.14.0",
+      "resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz",
+      "integrity": "sha1-7CMA++fX3d1+udOr+HmZlkyvzkY=",
+      "dev": true,
+      "requires": {
+        "axios": "*"
+      }
+    },
     "@types/color-name": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
       "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
       "dev": true
     },
+    "@types/minimist": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz",
+      "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=",
+      "dev": true
+    },
+    "@types/node": {
+      "version": "13.13.6",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.6.tgz",
+      "integrity": "sha512-zqRj8ugfROCjXCNbmPBe2mmQ0fJWP9lQaN519hwunOgpHgVykme4G6FW95++dyNFDvJUk4rtExkVkL0eciu5NA==",
+      "dev": true
+    },
+    "@types/normalize-package-data": {
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
+      "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
+      "dev": true
+    },
     "JSONStream": {
       "version": "1.3.5",
       "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
@@ -335,9 +371,9 @@
       }
     },
     "acorn": {
-      "version": "7.1.1",
-      "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz",
-      "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==",
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz",
+      "integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==",
       "dev": true
     },
     "acorn-jsx": {
@@ -479,9 +515,9 @@
       }
     },
     "arrify": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
-      "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
+      "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
       "dev": true
     },
     "assertion-error": {
@@ -578,22 +614,14 @@
       "dev": true
     },
     "camelcase-keys": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz",
-      "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=",
+      "version": "6.2.2",
+      "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz",
+      "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==",
       "dev": true,
       "requires": {
-        "camelcase": "^4.1.0",
-        "map-obj": "^2.0.0",
-        "quick-lru": "^1.0.0"
-      },
-      "dependencies": {
-        "camelcase": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
-          "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
-          "dev": true
-        }
+        "camelcase": "^5.3.1",
+        "map-obj": "^4.0.0",
+        "quick-lru": "^4.0.1"
       }
     },
     "catharsis": {
@@ -630,6 +658,12 @@
         "supports-color": "^5.3.0"
       },
       "dependencies": {
+        "escape-string-regexp": {
+          "version": "1.0.5",
+          "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+          "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+          "dev": true
+        },
         "supports-color": {
           "version": "5.5.0",
           "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
@@ -758,9 +792,9 @@
       "dev": true
     },
     "compare-func": {
-      "version": "1.3.2",
-      "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz",
-      "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=",
+      "version": "1.3.4",
+      "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz",
+      "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==",
       "dev": true,
       "requires": {
         "array-ify": "^1.0.0",
@@ -811,9 +845,9 @@
       }
     },
     "conventional-changelog-angular": {
-      "version": "5.0.6",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.6.tgz",
-      "integrity": "sha512-QDEmLa+7qdhVIv8sFZfVxU1VSyVvnXPsxq8Vam49mKUcO1Z8VTLEJk9uI21uiJUsnmm0I4Hrsdc9TgkOQo9WSA==",
+      "version": "5.0.10",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.10.tgz",
+      "integrity": "sha512-k7RPPRs0vp8+BtPsM9uDxRl6KcgqtCJmzRD1wRtgqmhQ96g8ifBGo9O/TZBG23jqlXS/rg8BKRDELxfnQQGiaA==",
       "dev": true,
       "requires": {
         "compare-func": "^1.3.1",
@@ -821,18 +855,18 @@
       }
     },
     "conventional-changelog-atom": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.3.tgz",
-      "integrity": "sha512-szZe2ut97qNO6vCCMkm1I/tWu6ol4Rr8a9Lx0y/VlpDnpY0PNp+oGpFgU55lplhx+I3Lro9Iv4/gRj0knfgjzg==",
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.7.tgz",
+      "integrity": "sha512-7dOREZwzB+tCEMjRTDfen0OHwd7vPUdmU0llTy1eloZgtOP4iSLVzYIQqfmdRZEty+3w5Jz+AbhfTJKoKw1JeQ==",
       "dev": true,
       "requires": {
         "q": "^1.5.1"
       }
     },
     "conventional-changelog-codemirror": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.3.tgz",
-      "integrity": "sha512-t2afackdgFV2yBdHhWPqrKbpaQeVnz2hSJKdWqjasPo5EpIB6TBL0er3cOP1mnGQmuzk9JSvimNSuqjWGDtU5Q==",
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.7.tgz",
+      "integrity": "sha512-Oralk1kiagn3Gb5cR5BffenWjVu59t/viE6UMD/mQa1hISMPkMYhJIqX+CMeA1zXgVBO+YHQhhokEj99GP5xcg==",
       "dev": true,
       "requires": {
         "q": "^1.5.1"
@@ -856,27 +890,38 @@
       }
     },
     "conventional-changelog-core": {
-      "version": "4.1.4",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.1.4.tgz",
-      "integrity": "sha512-LO58ZbEpp1Ul+y/vOI8rJRsWkovsYkCFbOCVgi6UnVfU8WC0F8K8VQQwaBZWWUpb6JvEiN4GBR5baRP2txZ+Vg==",
+      "version": "4.1.7",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.1.7.tgz",
+      "integrity": "sha512-UBvSrQR2RdKbSQKh7RhueiiY4ZAIOW3+CSWdtKOwRv+KxIMNFKm1rOcGBFx0eA8AKhGkkmmacoTWJTqyz7Q0VA==",
       "dev": true,
       "requires": {
         "add-stream": "^1.0.0",
-        "conventional-changelog-writer": "^4.0.11",
-        "conventional-commits-parser": "^3.0.8",
+        "conventional-changelog-writer": "^4.0.16",
+        "conventional-commits-parser": "^3.1.0",
         "dateformat": "^3.0.0",
         "get-pkg-repo": "^1.0.0",
         "git-raw-commits": "2.0.0",
         "git-remote-origin-url": "^2.0.0",
-        "git-semver-tags": "^3.0.1",
+        "git-semver-tags": "^4.0.0",
         "lodash": "^4.17.15",
         "normalize-package-data": "^2.3.5",
         "q": "^1.5.1",
         "read-pkg": "^3.0.0",
         "read-pkg-up": "^3.0.0",
+        "shelljs": "^0.8.3",
         "through2": "^3.0.0"
       },
       "dependencies": {
+        "git-semver-tags": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.0.0.tgz",
+          "integrity": "sha512-LajaAWLYVBff+1NVircURJFL8TQ3EMIcLAfHisWYX/nPoMwnTYfWAznQDmMujlLqoD12VtLmoSrF1sQ5MhimEQ==",
+          "dev": true,
+          "requires": {
+            "meow": "^7.0.0",
+            "semver": "^6.0.0"
+          }
+        },
         "load-json-file": {
           "version": "4.0.0",
           "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
@@ -934,31 +979,37 @@
             "find-up": "^2.0.0",
             "read-pkg": "^3.0.0"
           }
+        },
+        "semver": {
+          "version": "6.3.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+          "dev": true
         }
       }
     },
     "conventional-changelog-ember": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.4.tgz",
-      "integrity": "sha512-q1u73sO9uCnxN4TSw8xu6MRU8Y1h9kpwtcdJuNRwu/LSKI1IE/iuNSH5eQ6aLlQ3HTyrIpTfUuVybW4W0F17rA==",
+      "version": "2.0.8",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.8.tgz",
+      "integrity": "sha512-JEMEcUAMg4Q9yxD341OgWlESQ4gLqMWMXIWWUqoQU8yvTJlKnrvcui3wk9JvnZQyONwM2g1MKRZuAjKxr8hAXA==",
       "dev": true,
       "requires": {
         "q": "^1.5.1"
       }
     },
     "conventional-changelog-eslint": {
-      "version": "3.0.4",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.4.tgz",
-      "integrity": "sha512-CPwTUENzhLGl3auunrJxiIEWncAGaby7gOFCdj2gslIuOFJ0KPJVOUhRz4Da/I53sdo/7UncUJkiLg94jEsjxg==",
+      "version": "3.0.8",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.8.tgz",
+      "integrity": "sha512-5rTRltgWG7TpU1PqgKHMA/2ivjhrB+E+S7OCTvj0zM/QGg4vmnVH67Vq/EzvSNYtejhWC+OwzvDrLk3tqPry8A==",
       "dev": true,
       "requires": {
         "q": "^1.5.1"
       }
     },
     "conventional-changelog-express": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.1.tgz",
-      "integrity": "sha512-G6uCuCaQhLxdb4eEfAIHpcfcJ2+ao3hJkbLrw/jSK/eROeNfnxCJasaWdDAfFkxsbpzvQT4W01iSynU3OoPLIw==",
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.5.tgz",
+      "integrity": "sha512-pW2hsjKG+xNx/Qjof8wYlAX/P61hT5gQ/2rZ2NsTpG+PgV7Rc8RCfITvC/zN9K8fj0QmV6dWmUefCteD9baEAw==",
       "dev": true,
       "requires": {
         "q": "^1.5.1"
@@ -974,9 +1025,9 @@
       }
     },
     "conventional-changelog-jshint": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.3.tgz",
-      "integrity": "sha512-Pc2PnMPcez634ckzr4EOWviwRSpZcURaK7bjyD9oK6N5fsC/a+3G7LW5m/JpcHPhA9ZxsfIbm7uqZ3ZDGsQ/sw==",
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.7.tgz",
+      "integrity": "sha512-qHA8rmwUnLiIxANJbz650+NVzqDIwNtc0TcpIa0+uekbmKHttidvQ1dGximU3vEDdoJVKFgR3TXFqYuZmYy9ZQ==",
       "dev": true,
       "requires": {
         "compare-func": "^1.3.1",
@@ -984,24 +1035,24 @@
       }
     },
     "conventional-changelog-preset-loader": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.0.tgz",
-      "integrity": "sha512-/rHb32J2EJnEXeK4NpDgMaAVTFZS3o1ExmjKMtYVgIC4MQn0vkNSbYpdGRotkfGGRWiqk3Ri3FBkiZGbAfIfOQ==",
+      "version": "2.3.4",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz",
+      "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==",
       "dev": true
     },
     "conventional-changelog-writer": {
-      "version": "4.0.11",
-      "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.11.tgz",
-      "integrity": "sha512-g81GQOR392I+57Cw3IyP1f+f42ME6aEkbR+L7v1FBBWolB0xkjKTeCWVguzRrp6UiT1O6gBpJbEy2eq7AnV1rw==",
+      "version": "4.0.16",
+      "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.16.tgz",
+      "integrity": "sha512-jmU1sDJDZpm/dkuFxBeRXvyNcJQeKhGtVcFFkwTphUAzyYWcwz2j36Wcv+Mv2hU3tpvLMkysOPXJTLO55AUrYQ==",
       "dev": true,
       "requires": {
         "compare-func": "^1.3.1",
-        "conventional-commits-filter": "^2.0.2",
+        "conventional-commits-filter": "^2.0.6",
         "dateformat": "^3.0.0",
-        "handlebars": "^4.4.0",
+        "handlebars": "^4.7.6",
         "json-stringify-safe": "^5.0.1",
         "lodash": "^4.17.15",
-        "meow": "^5.0.0",
+        "meow": "^7.0.0",
         "semver": "^6.0.0",
         "split": "^1.0.0",
         "through2": "^3.0.0"
@@ -1016,9 +1067,9 @@
       }
     },
     "conventional-commits-filter": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz",
-      "integrity": "sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ==",
+      "version": "2.0.6",
+      "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz",
+      "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==",
       "dev": true,
       "requires": {
         "lodash.ismatch": "^4.4.0",
@@ -1026,15 +1077,15 @@
       }
     },
     "conventional-commits-parser": {
-      "version": "3.0.8",
-      "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.8.tgz",
-      "integrity": "sha512-YcBSGkZbYp7d+Cr3NWUeXbPDFUN6g3SaSIzOybi8bjHL5IJ5225OSCxJJ4LgziyEJ7AaJtE9L2/EU6H7Nt/DDQ==",
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz",
+      "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==",
       "dev": true,
       "requires": {
         "JSONStream": "^1.0.4",
         "is-text-path": "^1.0.1",
         "lodash": "^4.17.15",
-        "meow": "^5.0.0",
+        "meow": "^7.0.0",
         "split2": "^2.0.0",
         "through2": "^3.0.0",
         "trim-off-newlines": "^1.0.0"
@@ -1054,6 +1105,165 @@
         "git-semver-tags": "^3.0.1",
         "meow": "^5.0.0",
         "q": "^1.5.1"
+      },
+      "dependencies": {
+        "arrify": {
+          "version": "1.0.1",
+          "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+          "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+          "dev": true
+        },
+        "camelcase": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+          "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+          "dev": true
+        },
+        "camelcase-keys": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz",
+          "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=",
+          "dev": true,
+          "requires": {
+            "camelcase": "^4.1.0",
+            "map-obj": "^2.0.0",
+            "quick-lru": "^1.0.0"
+          }
+        },
+        "indent-string": {
+          "version": "3.2.0",
+          "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
+          "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=",
+          "dev": true
+        },
+        "load-json-file": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+          "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
+          "dev": true,
+          "requires": {
+            "graceful-fs": "^4.1.2",
+            "parse-json": "^4.0.0",
+            "pify": "^3.0.0",
+            "strip-bom": "^3.0.0"
+          }
+        },
+        "map-obj": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz",
+          "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=",
+          "dev": true
+        },
+        "meow": {
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz",
+          "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==",
+          "dev": true,
+          "requires": {
+            "camelcase-keys": "^4.0.0",
+            "decamelize-keys": "^1.0.0",
+            "loud-rejection": "^1.0.0",
+            "minimist-options": "^3.0.1",
+            "normalize-package-data": "^2.3.4",
+            "read-pkg-up": "^3.0.0",
+            "redent": "^2.0.0",
+            "trim-newlines": "^2.0.0",
+            "yargs-parser": "^10.0.0"
+          }
+        },
+        "minimist-options": {
+          "version": "3.0.2",
+          "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz",
+          "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==",
+          "dev": true,
+          "requires": {
+            "arrify": "^1.0.1",
+            "is-plain-obj": "^1.1.0"
+          }
+        },
+        "parse-json": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+          "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+          "dev": true,
+          "requires": {
+            "error-ex": "^1.3.1",
+            "json-parse-better-errors": "^1.0.1"
+          }
+        },
+        "path-type": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+          "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+          "dev": true,
+          "requires": {
+            "pify": "^3.0.0"
+          }
+        },
+        "pify": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+          "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+          "dev": true
+        },
+        "quick-lru": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
+          "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=",
+          "dev": true
+        },
+        "read-pkg": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
+          "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
+          "dev": true,
+          "requires": {
+            "load-json-file": "^4.0.0",
+            "normalize-package-data": "^2.3.2",
+            "path-type": "^3.0.0"
+          }
+        },
+        "read-pkg-up": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz",
+          "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=",
+          "dev": true,
+          "requires": {
+            "find-up": "^2.0.0",
+            "read-pkg": "^3.0.0"
+          }
+        },
+        "redent": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz",
+          "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=",
+          "dev": true,
+          "requires": {
+            "indent-string": "^3.0.0",
+            "strip-indent": "^2.0.0"
+          }
+        },
+        "strip-indent": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
+          "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=",
+          "dev": true
+        },
+        "trim-newlines": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz",
+          "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=",
+          "dev": true
+        },
+        "yargs-parser": {
+          "version": "10.1.0",
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
+          "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
+          "dev": true,
+          "requires": {
+            "camelcase": "^4.1.0"
+          }
+        }
       }
     },
     "convert-source-map": {
@@ -1309,9 +1519,9 @@
       "dev": true
     },
     "entities": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz",
-      "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==",
+      "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": {
@@ -1360,9 +1570,9 @@
       "dev": true
     },
     "escape-string-regexp": {
-      "version": "1.0.5",
-      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
-      "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+      "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": {
@@ -1479,6 +1689,15 @@
           "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
           "dev": true
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "ms": {
           "version": "2.1.2",
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -1526,12 +1745,6 @@
           "requires": {
             "ansi-regex": "^4.1.0"
           }
-        },
-        "strip-json-comments": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz",
-          "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==",
-          "dev": true
         }
       }
     },
@@ -1590,9 +1803,9 @@
       }
     },
     "eslint-plugin-es": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.0.tgz",
-      "integrity": "sha512-6/Jb/J/ZvSebydwbBJO1R9E5ky7YeElfK56Veh7e4QGFHCXoIXGH9HhVz+ibJLM3XJ1XjP+T7rKBLUa/Y7eIng==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz",
+      "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==",
       "dev": true,
       "requires": {
         "eslint-utils": "^2.0.0",
@@ -1806,6 +2019,14 @@
       "dev": true,
       "requires": {
         "escape-string-regexp": "^1.0.5"
+      },
+      "dependencies": {
+        "escape-string-regexp": {
+          "version": "1.0.5",
+          "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+          "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+          "dev": true
+        }
       }
     },
     "file-entry-cache": {
@@ -2240,6 +2461,35 @@
         "through2": "^2.0.0"
       },
       "dependencies": {
+        "arrify": {
+          "version": "1.0.1",
+          "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+          "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+          "dev": true
+        },
+        "camelcase": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+          "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+          "dev": true
+        },
+        "camelcase-keys": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz",
+          "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=",
+          "dev": true,
+          "requires": {
+            "camelcase": "^4.1.0",
+            "map-obj": "^2.0.0",
+            "quick-lru": "^1.0.0"
+          }
+        },
+        "indent-string": {
+          "version": "3.2.0",
+          "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
+          "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=",
+          "dev": true
+        },
         "load-json-file": {
           "version": "4.0.0",
           "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
@@ -2252,6 +2502,12 @@
             "strip-bom": "^3.0.0"
           }
         },
+        "map-obj": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz",
+          "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=",
+          "dev": true
+        },
         "meow": {
           "version": "4.0.1",
           "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz",
@@ -2269,6 +2525,16 @@
             "trim-newlines": "^2.0.0"
           }
         },
+        "minimist-options": {
+          "version": "3.0.2",
+          "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz",
+          "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==",
+          "dev": true,
+          "requires": {
+            "arrify": "^1.0.1",
+            "is-plain-obj": "^1.1.0"
+          }
+        },
         "parse-json": {
           "version": "4.0.0",
           "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
@@ -2294,6 +2560,12 @@
           "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
           "dev": true
         },
+        "quick-lru": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
+          "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=",
+          "dev": true
+        },
         "read-pkg": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
@@ -2330,6 +2602,16 @@
             "util-deprecate": "~1.0.1"
           }
         },
+        "redent": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz",
+          "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=",
+          "dev": true,
+          "requires": {
+            "indent-string": "^3.0.0",
+            "strip-indent": "^2.0.0"
+          }
+        },
         "string_decoder": {
           "version": "1.1.1",
           "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
@@ -2339,43 +2621,212 @@
             "safe-buffer": "~5.1.0"
           }
         },
+        "strip-indent": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
+          "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=",
+          "dev": true
+        },
         "through2": {
           "version": "2.0.5",
           "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
           "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
           "dev": true,
           "requires": {
-            "readable-stream": "~2.3.6",
-            "xtend": "~4.0.1"
+            "readable-stream": "~2.3.6",
+            "xtend": "~4.0.1"
+          }
+        },
+        "trim-newlines": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz",
+          "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=",
+          "dev": true
+        }
+      }
+    },
+    "git-remote-origin-url": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz",
+      "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=",
+      "dev": true,
+      "requires": {
+        "gitconfiglocal": "^1.0.0",
+        "pify": "^2.3.0"
+      }
+    },
+    "git-semver-tags": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-3.0.1.tgz",
+      "integrity": "sha512-Hzd1MOHXouITfCasrpVJbRDg9uvW7LfABk3GQmXYZByerBDrfrEMP9HXpNT7RxAbieiocP6u+xq20DkvjwxnCA==",
+      "dev": true,
+      "requires": {
+        "meow": "^5.0.0",
+        "semver": "^6.0.0"
+      },
+      "dependencies": {
+        "arrify": {
+          "version": "1.0.1",
+          "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+          "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+          "dev": true
+        },
+        "camelcase": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+          "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+          "dev": true
+        },
+        "camelcase-keys": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz",
+          "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=",
+          "dev": true,
+          "requires": {
+            "camelcase": "^4.1.0",
+            "map-obj": "^2.0.0",
+            "quick-lru": "^1.0.0"
+          }
+        },
+        "indent-string": {
+          "version": "3.2.0",
+          "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
+          "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=",
+          "dev": true
+        },
+        "load-json-file": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+          "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
+          "dev": true,
+          "requires": {
+            "graceful-fs": "^4.1.2",
+            "parse-json": "^4.0.0",
+            "pify": "^3.0.0",
+            "strip-bom": "^3.0.0"
+          }
+        },
+        "map-obj": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz",
+          "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=",
+          "dev": true
+        },
+        "meow": {
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz",
+          "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==",
+          "dev": true,
+          "requires": {
+            "camelcase-keys": "^4.0.0",
+            "decamelize-keys": "^1.0.0",
+            "loud-rejection": "^1.0.0",
+            "minimist-options": "^3.0.1",
+            "normalize-package-data": "^2.3.4",
+            "read-pkg-up": "^3.0.0",
+            "redent": "^2.0.0",
+            "trim-newlines": "^2.0.0",
+            "yargs-parser": "^10.0.0"
+          }
+        },
+        "minimist-options": {
+          "version": "3.0.2",
+          "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz",
+          "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==",
+          "dev": true,
+          "requires": {
+            "arrify": "^1.0.1",
+            "is-plain-obj": "^1.1.0"
+          }
+        },
+        "parse-json": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+          "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+          "dev": true,
+          "requires": {
+            "error-ex": "^1.3.1",
+            "json-parse-better-errors": "^1.0.1"
+          }
+        },
+        "path-type": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+          "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+          "dev": true,
+          "requires": {
+            "pify": "^3.0.0"
+          }
+        },
+        "pify": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+          "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+          "dev": true
+        },
+        "quick-lru": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
+          "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=",
+          "dev": true
+        },
+        "read-pkg": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
+          "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
+          "dev": true,
+          "requires": {
+            "load-json-file": "^4.0.0",
+            "normalize-package-data": "^2.3.2",
+            "path-type": "^3.0.0"
+          }
+        },
+        "read-pkg-up": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz",
+          "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=",
+          "dev": true,
+          "requires": {
+            "find-up": "^2.0.0",
+            "read-pkg": "^3.0.0"
+          }
+        },
+        "redent": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz",
+          "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=",
+          "dev": true,
+          "requires": {
+            "indent-string": "^3.0.0",
+            "strip-indent": "^2.0.0"
           }
-        }
-      }
-    },
-    "git-remote-origin-url": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz",
-      "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=",
-      "dev": true,
-      "requires": {
-        "gitconfiglocal": "^1.0.0",
-        "pify": "^2.3.0"
-      }
-    },
-    "git-semver-tags": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-3.0.1.tgz",
-      "integrity": "sha512-Hzd1MOHXouITfCasrpVJbRDg9uvW7LfABk3GQmXYZByerBDrfrEMP9HXpNT7RxAbieiocP6u+xq20DkvjwxnCA==",
-      "dev": true,
-      "requires": {
-        "meow": "^5.0.0",
-        "semver": "^6.0.0"
-      },
-      "dependencies": {
+        },
         "semver": {
           "version": "6.3.0",
           "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
           "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
           "dev": true
+        },
+        "strip-indent": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
+          "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=",
+          "dev": true
+        },
+        "trim-newlines": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz",
+          "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=",
+          "dev": true
+        },
+        "yargs-parser": {
+          "version": "10.1.0",
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
+          "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
+          "dev": true,
+          "requires": {
+            "camelcase": "^4.1.0"
+          }
         }
       }
     },
@@ -2450,6 +2901,12 @@
         }
       }
     },
+    "hard-rejection": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz",
+      "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==",
+      "dev": true
+    },
     "has": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -2677,6 +3134,12 @@
         }
       }
     },
+    "interpret": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz",
+      "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
+      "dev": true
+    },
     "is-arrayish": {
       "version": "0.2.1",
       "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
@@ -2840,15 +3303,12 @@
       }
     },
     "istanbul-lib-instrument": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz",
-      "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==",
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz",
+      "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==",
       "dev": true,
       "requires": {
         "@babel/core": "^7.7.5",
-        "@babel/parser": "^7.7.5",
-        "@babel/template": "^7.7.4",
-        "@babel/traverse": "^7.7.4",
         "@istanbuljs/schema": "^0.1.2",
         "istanbul-lib-coverage": "^3.0.0",
         "semver": "^6.3.0"
@@ -3002,26 +3462,6 @@
         "strip-json-comments": "^3.1.0",
         "taffydb": "2.6.2",
         "underscore": "~1.10.2"
-      },
-      "dependencies": {
-        "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
-        },
-        "mkdirp": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
-          "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
-          "dev": true
-        },
-        "strip-json-comments": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz",
-          "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==",
-          "dev": true
-        }
       }
     },
     "jsdoc-fresh": {
@@ -3095,6 +3535,12 @@
         "object.assign": "^4.1.0"
       }
     },
+    "kind-of": {
+      "version": "6.0.3",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+      "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",
@@ -3114,6 +3560,12 @@
         "type-check": "~0.3.2"
       }
     },
+    "lines-and-columns": {
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
+      "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",
@@ -3234,9 +3686,9 @@
       }
     },
     "map-obj": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz",
-      "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=",
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz",
+      "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==",
       "dev": true
     },
     "markdown-it": {
@@ -3253,9 +3705,9 @@
       }
     },
     "markdown-it-anchor": {
-      "version": "5.2.7",
-      "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.2.7.tgz",
-      "integrity": "sha512-REFmIaSS6szaD1bye80DMbp7ePwsPNvLTR5HunsUcZ0SG0rWJQ+Pz24R4UlTKtjKBPhxo0v0tOBDYjZQQknW8Q==",
+      "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": {
@@ -3271,93 +3723,154 @@
       "dev": true
     },
     "meow": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz",
-      "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==",
-      "dev": true,
-      "requires": {
-        "camelcase-keys": "^4.0.0",
-        "decamelize-keys": "^1.0.0",
-        "loud-rejection": "^1.0.0",
-        "minimist-options": "^3.0.1",
-        "normalize-package-data": "^2.3.4",
-        "read-pkg-up": "^3.0.0",
-        "redent": "^2.0.0",
-        "trim-newlines": "^2.0.0",
-        "yargs-parser": "^10.0.0"
+      "version": "7.0.1",
+      "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz",
+      "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==",
+      "dev": true,
+      "requires": {
+        "@types/minimist": "^1.2.0",
+        "arrify": "^2.0.1",
+        "camelcase": "^6.0.0",
+        "camelcase-keys": "^6.2.2",
+        "decamelize-keys": "^1.1.0",
+        "hard-rejection": "^2.1.0",
+        "minimist-options": "^4.0.2",
+        "normalize-package-data": "^2.5.0",
+        "read-pkg-up": "^7.0.1",
+        "redent": "^3.0.0",
+        "trim-newlines": "^3.0.0",
+        "type-fest": "^0.13.1",
+        "yargs-parser": "^18.1.3"
       },
       "dependencies": {
         "camelcase": {
-          "version": "4.1.0",
-          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
-          "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+          "version": "6.0.0",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz",
+          "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==",
           "dev": true
         },
-        "load-json-file": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
-          "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
+        "find-up": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+          "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
           "dev": true,
           "requires": {
-            "graceful-fs": "^4.1.2",
-            "parse-json": "^4.0.0",
-            "pify": "^3.0.0",
-            "strip-bom": "^3.0.0"
+            "locate-path": "^5.0.0",
+            "path-exists": "^4.0.0"
           }
         },
-        "parse-json": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
-          "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+        "locate-path": {
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+          "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
           "dev": true,
           "requires": {
-            "error-ex": "^1.3.1",
-            "json-parse-better-errors": "^1.0.1"
+            "p-locate": "^4.1.0"
           }
         },
-        "path-type": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
-          "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+        "p-limit": {
+          "version": "2.3.0",
+          "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+          "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
           "dev": true,
           "requires": {
-            "pify": "^3.0.0"
+            "p-try": "^2.0.0"
           }
         },
-        "pify": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
-          "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+        "p-locate": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+          "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+          "dev": true,
+          "requires": {
+            "p-limit": "^2.2.0"
+          }
+        },
+        "p-try": {
+          "version": "2.2.0",
+          "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+          "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+          "dev": true
+        },
+        "parse-json": {
+          "version": "5.0.0",
+          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz",
+          "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==",
+          "dev": true,
+          "requires": {
+            "@babel/code-frame": "^7.0.0",
+            "error-ex": "^1.3.1",
+            "json-parse-better-errors": "^1.0.1",
+            "lines-and-columns": "^1.1.6"
+          }
+        },
+        "path-exists": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+          "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
           "dev": true
         },
         "read-pkg": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
-          "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
+          "version": "5.2.0",
+          "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
+          "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==",
           "dev": true,
           "requires": {
-            "load-json-file": "^4.0.0",
-            "normalize-package-data": "^2.3.2",
-            "path-type": "^3.0.0"
+            "@types/normalize-package-data": "^2.4.0",
+            "normalize-package-data": "^2.5.0",
+            "parse-json": "^5.0.0",
+            "type-fest": "^0.6.0"
+          },
+          "dependencies": {
+            "type-fest": {
+              "version": "0.6.0",
+              "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
+              "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==",
+              "dev": true
+            }
           }
         },
         "read-pkg-up": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz",
-          "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=",
+          "version": "7.0.1",
+          "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz",
+          "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==",
           "dev": true,
           "requires": {
-            "find-up": "^2.0.0",
-            "read-pkg": "^3.0.0"
+            "find-up": "^4.1.0",
+            "read-pkg": "^5.2.0",
+            "type-fest": "^0.8.1"
+          },
+          "dependencies": {
+            "type-fest": {
+              "version": "0.8.1",
+              "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
+              "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
+              "dev": true
+            }
           }
         },
+        "type-fest": {
+          "version": "0.13.1",
+          "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
+          "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
+          "dev": true
+        },
         "yargs-parser": {
-          "version": "10.1.0",
-          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
-          "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
+          "version": "18.1.3",
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
+          "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
           "dev": true,
           "requires": {
-            "camelcase": "^4.1.0"
+            "camelcase": "^5.0.0",
+            "decamelize": "^1.2.0"
+          },
+          "dependencies": {
+            "camelcase": {
+              "version": "5.3.1",
+              "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+              "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+              "dev": true
+            }
           }
         }
       }
@@ -3368,6 +3881,12 @@
       "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
       "dev": true
     },
+    "min-indent": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz",
+      "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=",
+      "dev": true
+    },
     "minimatch": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@@ -3384,23 +3903,29 @@
       "dev": true
     },
     "minimist-options": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz",
-      "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==",
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz",
+      "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==",
       "dev": true,
       "requires": {
         "arrify": "^1.0.1",
-        "is-plain-obj": "^1.1.0"
+        "is-plain-obj": "^1.1.0",
+        "kind-of": "^6.0.3"
+      },
+      "dependencies": {
+        "arrify": {
+          "version": "1.0.1",
+          "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+          "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+          "dev": true
+        }
       }
     },
     "mkdirp": {
-      "version": "0.5.5",
-      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
-      "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
-      "dev": true,
-      "requires": {
-        "minimist": "^1.2.5"
-      }
+      "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",
@@ -3443,6 +3968,12 @@
             "ms": "^2.1.1"
           }
         },
+        "escape-string-regexp": {
+          "version": "1.0.5",
+          "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+          "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+          "dev": true
+        },
         "find-up": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
@@ -3462,6 +3993,15 @@
             "path-exists": "^3.0.0"
           }
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "ms": {
           "version": "2.1.1",
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
@@ -3491,6 +4031,12 @@
           "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
           "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
           "dev": true
+        },
+        "strip-json-comments": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+          "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+          "dev": true
         }
       }
     },
@@ -4235,9 +4781,9 @@
       "dev": true
     },
     "quick-lru": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
-      "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=",
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz",
+      "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==",
       "dev": true
     },
     "react-is": {
@@ -4287,22 +4833,23 @@
         "picomatch": "^2.0.4"
       }
     },
+    "rechoir": {
+      "version": "0.6.2",
+      "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
+      "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
+      "dev": true,
+      "requires": {
+        "resolve": "^1.1.6"
+      }
+    },
     "redent": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz",
-      "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=",
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
+      "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
       "dev": true,
       "requires": {
-        "indent-string": "^3.0.0",
-        "strip-indent": "^2.0.0"
-      },
-      "dependencies": {
-        "indent-string": {
-          "version": "3.2.0",
-          "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
-          "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=",
-          "dev": true
-        }
+        "indent-string": "^4.0.0",
+        "strip-indent": "^3.0.0"
       }
     },
     "regexpp": {
@@ -4444,6 +4991,17 @@
       "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
       "dev": true
     },
+    "shelljs": {
+      "version": "0.8.4",
+      "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
+      "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
+      "dev": true,
+      "requires": {
+        "glob": "^7.0.0",
+        "interpret": "^1.0.0",
+        "rechoir": "^0.6.2"
+      }
+    },
     "signal-exit": {
       "version": "3.0.3",
       "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@@ -4509,9 +5067,9 @@
       "dev": true
     },
     "spdx-expression-parse": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
-      "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
+      "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
       "dev": true,
       "requires": {
         "spdx-exceptions": "^2.1.0",
@@ -4585,13 +5143,13 @@
       "dev": true
     },
     "standard": {
-      "version": "14.3.3",
-      "resolved": "https://registry.npmjs.org/standard/-/standard-14.3.3.tgz",
-      "integrity": "sha512-HBEAD5eVXrr2o/KZ3kU8Wwaxw90wzoq4dOQe6vlRnPoQ6stn4LCLRLBBDp0CjH/aOTL9bDZJbRUOZcBaBnNJ0A==",
+      "version": "14.3.4",
+      "resolved": "https://registry.npmjs.org/standard/-/standard-14.3.4.tgz",
+      "integrity": "sha512-+lpOkFssMkljJ6eaILmqxHQ2n4csuEABmcubLTb9almFi1ElDzXb1819fjf/5ygSyePCq4kU2wMdb2fBfb9P9Q==",
       "dev": true,
       "requires": {
         "eslint": "~6.8.0",
-        "eslint-config-standard": "14.1.0",
+        "eslint-config-standard": "14.1.1",
         "eslint-config-standard-jsx": "8.1.0",
         "eslint-plugin-import": "~2.18.0",
         "eslint-plugin-node": "~10.0.0",
@@ -4610,12 +5168,6 @@
             "ms": "2.0.0"
           }
         },
-        "eslint-config-standard": {
-          "version": "14.1.0",
-          "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz",
-          "integrity": "sha512-EF6XkrrGVbvv8hL/kYa/m6vnvmUT+K82pJJc4JJVMM6+Qgqh0pnwprSxdduDLB9p/7bIxD+YV5O0wfb8lmcPbA==",
-          "dev": true
-        },
         "eslint-plugin-es": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-2.0.0.tgz",
@@ -4677,14 +5229,14 @@
       }
     },
     "standard-engine": {
-      "version": "12.0.0",
-      "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-12.0.0.tgz",
-      "integrity": "sha512-gJIIRb0LpL7AHyGbN9+hJ4UJns37lxmNTnMGRLC8CFrzQ+oB/K60IQjKNgPBCB2VP60Ypm6f8DFXvhVWdBOO+g==",
+      "version": "12.0.1",
+      "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-12.0.1.tgz",
+      "integrity": "sha512-XtR9NfoTqvHkWQCwL1aLMwXw1Qxy5s4rdSIqetgBNw+8faNbQ+BbB49hPhKXjxxfC4yg+fpH0lx/T5fuUbpDcQ==",
       "dev": true,
       "requires": {
-        "deglob": "^4.0.0",
+        "deglob": "^4.0.1",
         "get-stdin": "^7.0.0",
-        "minimist": "^1.1.0",
+        "minimist": "^1.2.5",
         "pkg-conf": "^3.1.0"
       },
       "dependencies": {
@@ -4962,9 +5514,9 @@
       },
       "dependencies": {
         "safe-buffer": {
-          "version": "5.2.0",
-          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
-          "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
+          "version": "5.2.1",
+          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
           "dev": true
         }
       }
@@ -4991,15 +5543,18 @@
       "dev": true
     },
     "strip-indent": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
-      "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=",
-      "dev": true
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
+      "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
+      "dev": true,
+      "requires": {
+        "min-indent": "^1.0.0"
+      }
     },
     "strip-json-comments": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
-      "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz",
+      "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==",
       "dev": true
     },
     "supports-color": {
@@ -5136,9 +5691,9 @@
       }
     },
     "trim-newlines": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz",
-      "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=",
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz",
+      "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==",
       "dev": true
     },
     "trim-off-newlines": {
@@ -5148,9 +5703,9 @@
       "dev": true
     },
     "tslib": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
-      "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==",
+      "version": "1.13.0",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
+      "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==",
       "dev": true
     },
     "type-check": {
@@ -5189,6 +5744,12 @@
         "is-typedarray": "^1.0.0"
       }
     },
+    "typescript": {
+      "version": "3.9.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz",
+      "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",
@@ -5196,9 +5757,9 @@
       "dev": true
     },
     "uglify-js": {
-      "version": "3.9.1",
-      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz",
-      "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==",
+      "version": "3.9.3",
+      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.3.tgz",
+      "integrity": "sha512-r5ImcL6QyzQGVimQoov3aL2ZScywrOgBXGndbWrdehKoSvGe/RmiE5Jpw/v+GvxODt6l2tpBXwA7n+qZVlHBMA==",
       "dev": true,
       "optional": true,
       "requires": {
@@ -5340,6 +5901,17 @@
       "dev": true,
       "requires": {
         "mkdirp": "^0.5.1"
+      },
+      "dependencies": {
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        }
       }
     },
     "write-file-atomic": {
diff --git a/package.json b/package.json
index e472aa68..e1d2468f 100644
--- a/package.json
+++ b/package.json
@@ -4,6 +4,8 @@
   "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",
     "fix": "standardx --fix",
     "pretest": "npm run lint",
@@ -96,6 +98,9 @@
     "uuid": "~8.0.0"
   },
   "devDependencies": {
+    "@types/ajv": "^1.0.0",
+    "@types/axios": "^0.14.0",
+    "@types/node": "^13.13.5",
     "chai": "~4.2.0",
     "eslint-config-standard": "^14.1.1",
     "eslint-plugin-import": "^2.20.2",
@@ -106,7 +111,8 @@
     "nock": "~12.0.3",
     "nyc": "~15.0.0",
     "standard-version": "^7.1.0",
-    "standardx": "^5.0.0"
+    "standardx": "^5.0.0",
+    "typescript": "^3.8.3"
   },
   "publishConfig": {
     "access": "public"
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 00000000..780c8708
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,16 @@
+{
+  "compilerOptions": {
+    "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. */
+    "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. */
+  },
+  "files": [
+    "index.js"
+  ]
+}

From 6ef89b546520347bb1f9d303105d8b1d6be37997 Mon Sep 17 00:00:00 2001
From: Lance Ball 
Date: Mon, 18 May 2020 08:52:20 -0400
Subject: [PATCH 2/4] fixup: add index.d.ts to package.json files property

Signed-off-by: Lance Ball 
---
 package.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package.json b/package.json
index e1d2468f..f62797f0 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,8 @@
     "release": "standard-version"
   },
   "files": [
-    "lib"
+    "lib",
+    "index.d.ts"
   ],
   "standard-version": {
     "types": [

From e6cc099ab1b99cf440b3dd19f888da8fd653b583 Mon Sep 17 00:00:00 2001
From: Lance Ball 
Date: Mon, 18 May 2020 12:15:10 -0400
Subject: [PATCH 3/4] squash: update documentation

Signed-off-by: Lance Ball 
---
 docs/BinaryHTTPEmitter.html                   |  14 +-
 docs/BinaryHTTPReceiver.html                  |   8 +-
 docs/CloudEvent.html                          |   2 +-
 docs/Gemfile                                  |  30 -
 docs/Gemfile.lock                             | 263 -------
 docs/HTTPEmitter.html                         |   2 +-
 docs/HTTPReceiver.html                        |   2 +-
 docs/StructuredHTTPEmitter.html               |   2 +-
 docs/StructuredHTTPReceiver.html              | 725 ++++++++++++++++++
 docs/ValidationError.html                     |   4 +-
 docs/bindings_http_emitter_binary.js.html     |  25 +-
 docs/bindings_http_emitter_binary_0_3.js.html | 173 -----
 docs/bindings_http_emitter_binary_1.js.html   | 168 ----
 docs/bindings_http_emitter_structured.js.html |   2 +-
 docs/bindings_http_http_emitter.js.html       |   2 +-
 docs/bindings_http_http_receiver.js.html      |   2 +-
 docs/bindings_http_receiver_binary.js.html    |   9 +-
 .../bindings_http_receiver_structured.js.html | 167 ++++
 ...ndings_http_v03_emitter_binary_0_3.js.html | 173 +++++
 .../bindings_http_v1_emitter_binary_1.js.html | 168 ++++
 ...s_http_validation_validation_error.js.html |   7 +-
 docs/cloudevent.js.html                       |   2 +-
 docs/concepts.md                              |   2 +-
 docs/formats_json_parser.js.html              |   2 +-
 docs/global.html                              |   2 +-
 docs/images/Makefile                          |   6 -
 docs/images/forwarder.dot                     |   9 -
 docs/images/forwarder.svg                     |  43 --
 docs/images/mutator.dot                       |   7 -
 docs/images/mutator.svg                       |  32 -
 docs/images/receiver.dot                      |   6 -
 docs/images/receiver.svg                      |  31 -
 docs/images/sender.dot                        |   7 -
 docs/images/sender.svg                        |  31 -
 docs/images/stack.dot                         |   7 -
 docs/images/stack.svg                         |  58 --
 docs/index.html                               |   2 +-
 docs/validation_error.js.html                 | 144 ----
 lib/bindings/http/receiver_binary.js          |   7 +-
 lib/bindings/http/receiver_structured.js      |  28 +
 lib/bindings/http/validation/structured.js    |   1 +
 .../http/validation/validation_error.js       |   5 +-
 42 files changed, 1301 insertions(+), 1079 deletions(-)
 delete mode 100644 docs/Gemfile
 delete mode 100644 docs/Gemfile.lock
 create mode 100644 docs/StructuredHTTPReceiver.html
 delete mode 100644 docs/bindings_http_emitter_binary_0_3.js.html
 delete mode 100644 docs/bindings_http_emitter_binary_1.js.html
 create mode 100644 docs/bindings_http_receiver_structured.js.html
 create mode 100644 docs/bindings_http_v03_emitter_binary_0_3.js.html
 create mode 100644 docs/bindings_http_v1_emitter_binary_1.js.html
 delete mode 100644 docs/images/Makefile
 delete mode 100644 docs/images/forwarder.dot
 delete mode 100644 docs/images/forwarder.svg
 delete mode 100644 docs/images/mutator.dot
 delete mode 100644 docs/images/mutator.svg
 delete mode 100644 docs/images/receiver.dot
 delete mode 100644 docs/images/receiver.svg
 delete mode 100644 docs/images/sender.dot
 delete mode 100644 docs/images/sender.svg
 delete mode 100644 docs/images/stack.dot
 delete mode 100644 docs/images/stack.svg
 delete mode 100644 docs/validation_error.js.html

diff --git a/docs/BinaryHTTPEmitter.html b/docs/BinaryHTTPEmitter.html
index c0bfa517..c37b40aa 100644
--- a/docs/BinaryHTTPEmitter.html
+++ b/docs/BinaryHTTPEmitter.html
@@ -73,11 +73,7 @@ 

-<<<<<<< HEAD -

Classes

-======= -

Classes

->>>>>>> build: add tsc type checking in the ci/test pipeline +

Classes

@@ -234,11 +230,7 @@
Parameters:
@@ -488,11 +480,7 @@
Properties
diff --git a/docs/BinaryHTTPReceiver.html b/docs/BinaryHTTPReceiver.html index a50befe0..0e212250 100644 --- a/docs/BinaryHTTPReceiver.html +++ b/docs/BinaryHTTPReceiver.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

@@ -285,7 +285,7 @@

Methods

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

@@ -422,7 +422,7 @@
Parameters:
@@ -629,7 +629,7 @@
Parameters:
diff --git a/docs/CloudEvent.html b/docs/CloudEvent.html index 5df98f18..421f1e96 100644 --- a/docs/CloudEvent.html +++ b/docs/CloudEvent.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/Gemfile b/docs/Gemfile deleted file mode 100644 index 041606f1..00000000 --- a/docs/Gemfile +++ /dev/null @@ -1,30 +0,0 @@ -source "https://rubygems.org" -# Hello! This is where you manage which Jekyll version is used to run. -# When you want to use a different version, change it below, save the -# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: -# -# bundle exec jekyll serve -# -# This will help ensure the proper Jekyll version is running. -# Happy Jekylling! - -gem "jekyll", "~> 3.8.5" -gem "github-pages", group: :jekyll_plugins - -gem "just-the-docs" - -# If you have any plugins, put them here! -group :jekyll_plugins do - gem "jekyll-feed", "~> 0.12" -end - -# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem -# and associated library. -install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do - gem "tzinfo", "~> 1.2" - gem "tzinfo-data" -end - -# Performance-booster for watching directories on Windows -gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform? - diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock deleted file mode 100644 index 2d6dbd81..00000000 --- a/docs/Gemfile.lock +++ /dev/null @@ -1,263 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (6.0.2.2) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.11.1) - colorator (1.1.0) - commonmarker (0.17.13) - ruby-enum (~> 0.5) - concurrent-ruby (1.1.6) - dnsruby (1.61.3) - addressable (~> 2.5) - em-websocket (0.5.1) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - ethon (0.12.0) - ffi (>= 1.3.0) - eventmachine (1.2.7) - execjs (2.7.0) - faraday (1.0.1) - multipart-post (>= 1.2, < 3) - ffi (1.12.2) - forwardable-extended (2.6.0) - gemoji (3.0.1) - github-pages (204) - github-pages-health-check (= 1.16.1) - jekyll (= 3.8.5) - jekyll-avatar (= 0.7.0) - jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.1.6) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.13.0) - jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.13.0) - jekyll-mentions (= 1.5.1) - jekyll-optional-front-matter (= 0.3.2) - jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.3.0) - jekyll-redirect-from (= 0.15.0) - jekyll-relative-links (= 0.6.1) - jekyll-remote-theme (= 0.4.1) - jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.6.1) - jekyll-sitemap (= 1.4.0) - jekyll-swiss (= 1.0.0) - jekyll-theme-architect (= 0.1.1) - jekyll-theme-cayman (= 0.1.1) - jekyll-theme-dinky (= 0.1.1) - jekyll-theme-hacker (= 0.1.1) - jekyll-theme-leap-day (= 0.1.1) - jekyll-theme-merlot (= 0.1.1) - jekyll-theme-midnight (= 0.1.1) - jekyll-theme-minimal (= 0.1.1) - jekyll-theme-modernist (= 0.1.1) - jekyll-theme-primer (= 0.5.4) - jekyll-theme-slate (= 0.1.1) - jekyll-theme-tactile (= 0.1.1) - jekyll-theme-time-machine (= 0.1.1) - jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.11.1) - kramdown (= 1.17.0) - liquid (= 4.0.3) - mercenary (~> 0.3) - minima (= 2.5.1) - nokogiri (>= 1.10.4, < 2.0) - rouge (= 3.13.0) - terminal-table (~> 1.4) - github-pages-health-check (1.16.1) - addressable (~> 2.3) - dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (~> 3.0) - typhoeus (~> 1.3) - html-pipeline (2.12.3) - activesupport (>= 2) - nokogiri (>= 1.4) - http_parser.rb (0.6.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.8.5) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (~> 1.14) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-avatar (0.7.0) - jekyll (>= 3.0, < 5.0) - jekyll-coffeescript (1.1.1) - coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.3.1) - commonmarker (~> 0.14) - jekyll (>= 3.7, < 5.0) - jekyll-commonmark-ghpages (0.1.6) - commonmarker (~> 0.17.6) - jekyll-commonmark (~> 1.2) - rouge (>= 2.0, < 4.0) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.13.0) - jekyll (>= 3.7, < 5.0) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.13.0) - jekyll (>= 3.4, < 5.0) - octokit (~> 4.0, != 4.4.0) - jekyll-mentions (1.5.1) - html-pipeline (~> 2.3) - jekyll (>= 3.7, < 5.0) - jekyll-optional-front-matter (0.3.2) - jekyll (>= 3.0, < 5.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.3.0) - jekyll (>= 3.0, < 5.0) - jekyll-redirect-from (0.15.0) - jekyll (>= 3.3, < 5.0) - jekyll-relative-links (0.6.1) - jekyll (>= 3.3, < 5.0) - jekyll-remote-theme (0.4.1) - addressable (~> 2.0) - jekyll (>= 3.5, < 5.0) - rubyzip (>= 1.3.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.6.1) - jekyll (>= 3.3, < 5.0) - jekyll-sitemap (1.4.0) - jekyll (>= 3.7, < 5.0) - jekyll-swiss (1.0.0) - jekyll-theme-architect (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.5.4) - jekyll (> 3.5, < 5.0) - jekyll-github-metadata (~> 2.9) - jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.3) - jekyll (>= 3.3, < 5.0) - jekyll-watch (2.2.1) - listen (~> 3.0) - jemoji (0.11.1) - gemoji (~> 3.0) - html-pipeline (~> 2.2) - jekyll (>= 3.0, < 5.0) - just-the-docs (0.2.8) - bundler (~> 2.1.4) - jekyll (>= 3.8.5, < 4.1.0) - jekyll-seo-tag (~> 2.0) - rake (>= 12.3.1, < 13.1.0) - kramdown (1.17.0) - liquid (4.0.3) - listen (3.2.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - mini_portile2 (2.4.0) - minima (2.5.1) - jekyll (>= 3.5, < 5.0) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - minitest (5.14.0) - multipart-post (2.1.1) - nokogiri (1.10.9) - mini_portile2 (~> 2.4.0) - octokit (4.18.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (3.1.1) - rake (13.0.1) - rb-fsevent (0.10.4) - rb-inotify (0.10.1) - ffi (~> 1.0) - rouge (3.13.0) - ruby-enum (0.8.0) - i18n - rubyzip (2.3.0) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - typhoeus (1.3.1) - ethon (>= 0.9.0) - tzinfo (1.2.7) - thread_safe (~> 0.1) - tzinfo-data (1.2020.1) - tzinfo (>= 1.0.0) - unicode-display_width (1.7.0) - wdm (0.1.1) - zeitwerk (2.3.0) - -PLATFORMS - ruby - -DEPENDENCIES - github-pages - jekyll (~> 3.8.5) - jekyll-feed (~> 0.12) - just-the-docs - tzinfo (~> 1.2) - tzinfo-data - wdm (~> 0.1.1) - -BUNDLED WITH - 2.1.4 diff --git a/docs/HTTPEmitter.html b/docs/HTTPEmitter.html index c479f2e5..79dcc00e 100644 --- a/docs/HTTPEmitter.html +++ b/docs/HTTPEmitter.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/HTTPReceiver.html b/docs/HTTPReceiver.html index 1f1ab77e..bd7f2d44 100644 --- a/docs/HTTPReceiver.html +++ b/docs/HTTPReceiver.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/StructuredHTTPEmitter.html b/docs/StructuredHTTPEmitter.html index c151cc1e..613379d8 100644 --- a/docs/StructuredHTTPEmitter.html +++ b/docs/StructuredHTTPEmitter.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/StructuredHTTPReceiver.html b/docs/StructuredHTTPReceiver.html new file mode 100644 index 00000000..9c61df38 --- /dev/null +++ b/docs/StructuredHTTPReceiver.html @@ -0,0 +1,725 @@ + + + + + + + + + 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 index 75943665..b2815373 100644 --- a/docs/ValidationError.html +++ b/docs/ValidationError.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

@@ -283,7 +283,7 @@
Parameters:
diff --git a/docs/bindings_http_emitter_binary.js.html b/docs/bindings_http_emitter_binary.js.html index 248c4a27..1a000dcc 100644 --- a/docs/bindings_http_emitter_binary.js.html +++ b/docs/bindings_http_emitter_binary.js.html @@ -75,11 +75,7 @@

-<<<<<<< HEAD -

Classes

-======= -

Classes

->>>>>>> build: add tsc type checking in the ci/test pipeline +

Classes

@@ -94,12 +90,9 @@

-
const axios = require("axios");
-<<<<<<< HEAD
+    
const { default: Axios } = require("axios");
 const EmitterV1 = require("./v1").BinaryEmitter;
 const EmitterV3 = require("./v03").BinaryEmitter;
-=======
->>>>>>> build: add tsc type checking in the ci/test pipeline
 
 const {
   HEADERS,
@@ -133,17 +126,10 @@ 

*/ constructor(version) { if (version === SPEC_V1) { -<<<<<<< HEAD this.headerByGetter = EmitterV1; this.extensionPrefix = BINARY_HEADERS_1.EXTENSIONS_PREFIX; } else if (version === SPEC_V03) { this.headerByGetter = EmitterV3; -======= - this.headerByGetter = require("./emitter_binary_1.js"); - this.extensionPrefix = BINARY_HEADERS_1.EXTENSIONS_PREFIX; - } else if (version === SPEC_V03) { - this.headerByGetter = require("./emitter_binary_0_3.js"); ->>>>>>> build: add tsc type checking in the ci/test pipeline this.extensionPrefix = BINARY_HEADERS_03.EXTENSIONS_PREFIX; } } @@ -183,14 +169,11 @@

}); config[DATA_ATTRIBUTE] = data; -<<<<<<< HEAD - config.headers = headers; -======= config[HEADERS] = headers; ->>>>>>> build: add tsc type checking in the ci/test pipeline // Return the Promise - return axios.request(config); + // @ts-ignore Types of property 'url' are incompatible. Type 'URL' is not assignable to type 'string'. + return Axios.request(config); } } diff --git a/docs/bindings_http_emitter_binary_0_3.js.html b/docs/bindings_http_emitter_binary_0_3.js.html deleted file mode 100644 index 9db9ea37..00000000 --- a/docs/bindings_http_emitter_binary_0_3.js.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - bindings/http/emitter_binary_0_3.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/emitter_binary_0_3.js -

- - - - - -
-
-
const {
-  HEADER_CONTENT_TYPE,
-  BINARY_HEADERS_03
-} = require("./constants.js");
-
-const passThroughParser = (v) => v;
-
-/**
- * A utility object used to retrieve the header names for a CloudEvent
- * using the CloudEvent getter function.
- */
-const headerByGetter = {
-  getDataContentType: {
-    name: HEADER_CONTENT_TYPE,
-    parser: passThroughParser
-  },
-
-  getDataContentEncoding: {
-    name: BINARY_HEADERS_03.CONTENT_ENCONDING,
-    parser: passThroughParser
-  },
-
-  getSubject: {
-    name: BINARY_HEADERS_03.SUBJECT,
-    parser: passThroughParser
-  },
-
-  getType: {
-    name: BINARY_HEADERS_03.TYPE,
-    parser: passThroughParser
-  },
-
-  getSpecversion: {
-    name: BINARY_HEADERS_03.SPEC_VERSION,
-    parser: passThroughParser
-  },
-
-  getSource: {
-    name: BINARY_HEADERS_03.SOURCE,
-    parser: passThroughParser
-  },
-
-  getId: {
-    name: BINARY_HEADERS_03.ID,
-    parser: passThroughParser
-  },
-
-  getTime: {
-    name: BINARY_HEADERS_03.TIME,
-    parser: passThroughParser
-  },
-
-  getSchemaurl: {
-    name: BINARY_HEADERS_03.SCHEMA_URL,
-    parser: passThroughParser
-  }
-};
-
-module.exports = headerByGetter;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_emitter_binary_1.js.html b/docs/bindings_http_emitter_binary_1.js.html deleted file mode 100644 index 593d7e21..00000000 --- a/docs/bindings_http_emitter_binary_1.js.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - bindings/http/emitter_binary_1.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- bindings/http/emitter_binary_1.js -

- - - - - -
-
-
const {
-  HEADER_CONTENT_TYPE,
-  BINARY_HEADERS_1
-} = require("./constants.js");
-
-const passThroughParser = (v) => v;
-
-/**
- * A utility object used to retrieve the header names for a CloudEvent
- * using the CloudEvent getter function.
- */
-const headerByGetter = {
-  getDataContentType: {
-    name: HEADER_CONTENT_TYPE,
-    parser: passThroughParser
-  },
-
-  getSubject: {
-    name: BINARY_HEADERS_1.SUBJECT,
-    parser: passThroughParser
-  },
-
-  getType: {
-    name: BINARY_HEADERS_1.TYPE,
-    parser: passThroughParser
-  },
-
-  getSpecversion: {
-    name: BINARY_HEADERS_1.SPEC_VERSION,
-    parser: passThroughParser
-  },
-
-  getSource: {
-    name: BINARY_HEADERS_1.SOURCE,
-    parser: passThroughParser
-  },
-
-  getId: {
-    name: BINARY_HEADERS_1.ID,
-    parser: passThroughParser
-  },
-
-  getTime: {
-    name: BINARY_HEADERS_1.TIME,
-    parser: passThroughParser
-  },
-
-  getDataschema: {
-    name: BINARY_HEADERS_1.DATA_SCHEMA,
-    parser: passThroughParser
-  }
-};
-
-module.exports = headerByGetter;
-
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/docs/bindings_http_emitter_structured.js.html b/docs/bindings_http_emitter_structured.js.html index 2ab1619a..05e16d1d 100644 --- a/docs/bindings_http_emitter_structured.js.html +++ b/docs/bindings_http_emitter_structured.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

diff --git a/docs/bindings_http_http_emitter.js.html b/docs/bindings_http_http_emitter.js.html index 9f85f51d..318e88ac 100644 --- a/docs/bindings_http_http_emitter.js.html +++ b/docs/bindings_http_http_emitter.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

diff --git a/docs/bindings_http_http_receiver.js.html b/docs/bindings_http_http_receiver.js.html index d3299f74..1559693b 100644 --- a/docs/bindings_http_http_receiver.js.html +++ b/docs/bindings_http_http_receiver.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

diff --git a/docs/bindings_http_receiver_binary.js.html b/docs/bindings_http_receiver_binary.js.html index 5538beb1..e8465d73 100644 --- a/docs/bindings_http_receiver_binary.js.html +++ b/docs/bindings_http_receiver_binary.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

@@ -119,11 +119,10 @@

* Checks an incoming HTTP request to determine if it conforms to the * Cloud Event specification for this receiver. * - * @throws {ValidationError} if the event does not conform to the spec * @param {Object} payload the HTTP request body * @param {Object} headers the HTTP request headers - * - * @returns {void} + * @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); @@ -133,10 +132,10 @@

* Parses an incoming HTTP request, converting it to a {CloudEvent} * instance if it conforms to the Cloud Event specification for this receiver. * - * @throws {ValidationError} of the event does not conform to the spec * @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); diff --git a/docs/bindings_http_receiver_structured.js.html b/docs/bindings_http_receiver_structured.js.html new file mode 100644 index 00000000..f0c3fb01 --- /dev/null +++ b/docs/bindings_http_receiver_structured.js.html @@ -0,0 +1,167 @@ + + + + + + + + + + + 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");
+
+/**
+ * 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 new file mode 100644 index 00000000..49fdfcdf --- /dev/null +++ b/docs/bindings_http_v03_emitter_binary_0_3.js.html @@ -0,0 +1,173 @@ + + + + + + + + + + + bindings/http/v03/emitter_binary_0_3.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ bindings/http/v03/emitter_binary_0_3.js +

+ + + + + +
+
+
const {
+  HEADER_CONTENT_TYPE,
+  BINARY_HEADERS_03
+} = require("../constants.js");
+
+const passThroughParser = (v) => v;
+
+/**
+ * A utility object used to retrieve the header names for a CloudEvent
+ * using the CloudEvent getter function.
+ */
+const headerByGetter = {
+  getDataContentType: {
+    name: HEADER_CONTENT_TYPE,
+    parser: passThroughParser
+  },
+
+  getDataContentEncoding: {
+    name: BINARY_HEADERS_03.CONTENT_ENCODING,
+    parser: passThroughParser
+  },
+
+  getSubject: {
+    name: BINARY_HEADERS_03.SUBJECT,
+    parser: passThroughParser
+  },
+
+  getType: {
+    name: BINARY_HEADERS_03.TYPE,
+    parser: passThroughParser
+  },
+
+  getSpecversion: {
+    name: BINARY_HEADERS_03.SPEC_VERSION,
+    parser: passThroughParser
+  },
+
+  getSource: {
+    name: BINARY_HEADERS_03.SOURCE,
+    parser: passThroughParser
+  },
+
+  getId: {
+    name: BINARY_HEADERS_03.ID,
+    parser: passThroughParser
+  },
+
+  getTime: {
+    name: BINARY_HEADERS_03.TIME,
+    parser: passThroughParser
+  },
+
+  getSchemaurl: {
+    name: BINARY_HEADERS_03.SCHEMA_URL,
+    parser: passThroughParser
+  }
+};
+
+module.exports = headerByGetter;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + diff --git a/docs/bindings_http_v1_emitter_binary_1.js.html b/docs/bindings_http_v1_emitter_binary_1.js.html new file mode 100644 index 00000000..51d58bfb --- /dev/null +++ b/docs/bindings_http_v1_emitter_binary_1.js.html @@ -0,0 +1,168 @@ + + + + + + + + + + + bindings/http/v1/emitter_binary_1.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ bindings/http/v1/emitter_binary_1.js +

+ + + + + +
+
+
const {
+  HEADER_CONTENT_TYPE,
+  BINARY_HEADERS_1
+} = require("../constants.js");
+
+const passThroughParser = (v) => v;
+
+/**
+ * A utility object used to retrieve the header names for a CloudEvent
+ * using the CloudEvent getter function.
+ */
+const headerByGetter = {
+  getDataContentType: {
+    name: HEADER_CONTENT_TYPE,
+    parser: passThroughParser
+  },
+
+  getSubject: {
+    name: BINARY_HEADERS_1.SUBJECT,
+    parser: passThroughParser
+  },
+
+  getType: {
+    name: BINARY_HEADERS_1.TYPE,
+    parser: passThroughParser
+  },
+
+  getSpecversion: {
+    name: BINARY_HEADERS_1.SPEC_VERSION,
+    parser: passThroughParser
+  },
+
+  getSource: {
+    name: BINARY_HEADERS_1.SOURCE,
+    parser: passThroughParser
+  },
+
+  getId: {
+    name: BINARY_HEADERS_1.ID,
+    parser: passThroughParser
+  },
+
+  getTime: {
+    name: BINARY_HEADERS_1.TIME,
+    parser: passThroughParser
+  },
+
+  getDataschema: {
+    name: BINARY_HEADERS_1.DATA_SCHEMA,
+    parser: passThroughParser
+  }
+};
+
+module.exports = headerByGetter;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + diff --git a/docs/bindings_http_validation_validation_error.js.html b/docs/bindings_http_validation_validation_error.js.html index 16662b49..1b1ce3fa 100644 --- a/docs/bindings_http_validation_validation_error.js.html +++ b/docs/bindings_http_validation_validation_error.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

@@ -90,7 +90,10 @@

-
/** @typedef {import("ajv").ErrorObject} ErrorObject */
+    
/**
+ * @typedef {import("ajv").ErrorObject} ErrorObject
+ * @ignore
+ * */
 
 /**
  * A Error class that will be thrown when a CloudEvent
diff --git a/docs/cloudevent.js.html b/docs/cloudevent.js.html
index 0f240f9a..556757eb 100644
--- a/docs/cloudevent.js.html
+++ b/docs/cloudevent.js.html
@@ -75,7 +75,7 @@ 

-

Classes

+

Classes

diff --git a/docs/concepts.md b/docs/concepts.md index 2386aea8..5a0d1495 100644 --- a/docs/concepts.md +++ b/docs/concepts.md @@ -92,4 +92,4 @@ continued the message to one or more Consumers. Mutator, when a Producer or Intermediary blocks on a response from a Consumer, replacing the original Event. -![mutator](./images/mutator.svg "Mutator") \ No newline at end of file +![mutator](./images/mutator.svg "Mutator") diff --git a/docs/formats_json_parser.js.html b/docs/formats_json_parser.js.html index dc8c360e..a8bd5c70 100644 --- a/docs/formats_json_parser.js.html +++ b/docs/formats_json_parser.js.html @@ -75,7 +75,7 @@

-

Classes

+

Classes

diff --git a/docs/global.html b/docs/global.html index 355647b1..6ea62a62 100644 --- a/docs/global.html +++ b/docs/global.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/images/Makefile b/docs/images/Makefile deleted file mode 100644 index 8c05b541..00000000 --- a/docs/images/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -.PHONY: all - -all: $(patsubst %.dot,%.svg,$(wildcard *.dot)) - -%.svg: %.dot - dot -Tsvg $< -o $@ \ No newline at end of file diff --git a/docs/images/forwarder.dot b/docs/images/forwarder.dot deleted file mode 100644 index 4d04b3d7..00000000 --- a/docs/images/forwarder.dot +++ /dev/null @@ -1,9 +0,0 @@ -digraph { - rankdir=LR; - - Forwarder[shape=box] - - downstream -> Forwarder; - - Forwarder -> upstream; -} \ No newline at end of file diff --git a/docs/images/forwarder.svg b/docs/images/forwarder.svg deleted file mode 100644 index b564b87c..00000000 --- a/docs/images/forwarder.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - -%3 - - - -Forwarder - -Forwarder - - - -upstream - -upstream - - - -Forwarder->upstream - - - - - -downstream - -downstream - - - -downstream->Forwarder - - - - - diff --git a/docs/images/mutator.dot b/docs/images/mutator.dot deleted file mode 100644 index be49b922..00000000 --- a/docs/images/mutator.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph { - rankdir=LR; - - Mutator[shape=box] - - Mutator -> upstream[dir=both]; -} \ No newline at end of file diff --git a/docs/images/mutator.svg b/docs/images/mutator.svg deleted file mode 100644 index 54ba625f..00000000 --- a/docs/images/mutator.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -%3 - - - -Mutator - -Mutator - - - -upstream - -upstream - - - -Mutator->upstream - - - - - - diff --git a/docs/images/receiver.dot b/docs/images/receiver.dot deleted file mode 100644 index c486ac51..00000000 --- a/docs/images/receiver.dot +++ /dev/null @@ -1,6 +0,0 @@ -digraph { - rankdir=LR; - - Receiver[shape=box] - downstream -> Receiver; -} \ No newline at end of file diff --git a/docs/images/receiver.svg b/docs/images/receiver.svg deleted file mode 100644 index a98ad903..00000000 --- a/docs/images/receiver.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - -%3 - - - -Receiver - -Receiver - - - -downstream - -downstream - - - -downstream->Receiver - - - - - diff --git a/docs/images/sender.dot b/docs/images/sender.dot deleted file mode 100644 index 8d66a374..00000000 --- a/docs/images/sender.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph { - rankdir=LR; - - Sender[shape=box] - - Sender -> upstream; -} \ No newline at end of file diff --git a/docs/images/sender.svg b/docs/images/sender.svg deleted file mode 100644 index f0196b5d..00000000 --- a/docs/images/sender.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - -%3 - - - -Sender - -Sender - - - -upstream - -upstream - - - -Sender->upstream - - - - - diff --git a/docs/images/stack.dot b/docs/images/stack.dot deleted file mode 100644 index db793d8d..00000000 --- a/docs/images/stack.dot +++ /dev/null @@ -1,7 +0,0 @@ -digraph { - rankdir=LR; - - Client -> ProtocolBinding [label="[Event]"] - ProtocolBinding -> ProtocolBindingImpl [label="[Event, Message]"] - ProtocolBindingImpl -> Protocol [label="[Message]"] -} \ No newline at end of file diff --git a/docs/images/stack.svg b/docs/images/stack.svg deleted file mode 100644 index c3765ec6..00000000 --- a/docs/images/stack.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - -%3 - - - -Client - -Client - - - -ProtocolBinding - -ProtocolBinding - - - -Client->ProtocolBinding - - -[Event] - - - -ProtocolBindingImpl - -ProtocolBindingImpl - - - -ProtocolBinding->ProtocolBindingImpl - - -[Event, Message] - - - -Protocol - -Protocol - - - -ProtocolBindingImpl->Protocol - - -[Message] - - - diff --git a/docs/index.html b/docs/index.html index 44ee5906..951ab6e9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -73,7 +73,7 @@

-

Classes

+

Classes

diff --git a/docs/validation_error.js.html b/docs/validation_error.js.html deleted file mode 100644 index c0e2e767..00000000 --- a/docs/validation_error.js.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - validation_error.js - Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- validation_error.js -

- - - - - -
-
-
/**
- * A Error class that will be thrown when a CloudEvent
-<<<<<<< HEAD
- * cannot be properly validated against a the specification.
-=======
- * cannot be properly validated against a specification.
->>>>>>> build: add tsc type checking in the ci/test pipeline
- */
-class ValidationError extends TypeError {
-  /**
-   * Constructs a new {ValidationError} with the message
-   * and array of additional errors.
-   * @param {string} message the error message
-<<<<<<< HEAD
-   * @param {string[]|ErrorObject[]} [errors] any additional errors related to validation
-=======
-   // @ts-ignore tsc can't find ErrorObject
-   * @param {[string]|[ErrorObject]} [errors] any additional errors related to validation
->>>>>>> build: add tsc type checking in the ci/test pipeline
-   */
-  constructor(message, errors) {
-    super(message);
-    this.errors = errors ? errors : [];
-  }
-}
-
-module.exports = ValidationError;
-
-
- - - - -
- -
- - - - - - - - - - diff --git a/lib/bindings/http/receiver_binary.js b/lib/bindings/http/receiver_binary.js index f37ccd5a..7b668224 100644 --- a/lib/bindings/http/receiver_binary.js +++ b/lib/bindings/http/receiver_binary.js @@ -27,11 +27,10 @@ class BinaryHTTPReceiver { * Checks an incoming HTTP request to determine if it conforms to the * Cloud Event specification for this receiver. * - * @throws {ValidationError} if the event does not conform to the spec * @param {Object} payload the HTTP request body * @param {Object} headers the HTTP request headers - * - * @returns {void} + * @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); @@ -41,10 +40,10 @@ class BinaryHTTPReceiver { * Parses an incoming HTTP request, converting it to a {CloudEvent} * instance if it conforms to the Cloud Event specification for this receiver. * - * @throws {ValidationError} of the event does not conform to the spec * @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); diff --git a/lib/bindings/http/receiver_structured.js b/lib/bindings/http/receiver_structured.js index 453786b2..81924f29 100644 --- a/lib/bindings/http/receiver_structured.js +++ b/lib/bindings/http/receiver_structured.js @@ -4,7 +4,18 @@ const ReceiverV3 = require("./v03/receiver_structured_0_3.js"); const { SPEC_V03, SPEC_V1 } = require("./constants.js"); const { check, parse } = require("./validation/structured.js"); +/** + * 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(); @@ -13,10 +24,27 @@ class StructuredHTTPReceiver { } } + /** + * 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); } diff --git a/lib/bindings/http/validation/structured.js b/lib/bindings/http/validation/structured.js index ba9b7bd7..493d5740 100644 --- a/lib/bindings/http/validation/structured.js +++ b/lib/bindings/http/validation/structured.js @@ -18,6 +18,7 @@ function check(payload, headers, receiver) { .includes(sanityHeaders[HEADER_CONTENT_TYPE])) { throw new ValidationError("invalid content type", [sanityHeaders[HEADER_CONTENT_TYPE]]); } + return true; } function parse(payload, headers, receiver) { diff --git a/lib/bindings/http/validation/validation_error.js b/lib/bindings/http/validation/validation_error.js index 0b60cee6..7e91a54e 100644 --- a/lib/bindings/http/validation/validation_error.js +++ b/lib/bindings/http/validation/validation_error.js @@ -1,4 +1,7 @@ -/** @typedef {import("ajv").ErrorObject} ErrorObject */ +/** + * @typedef {import("ajv").ErrorObject} ErrorObject + * @ignore + * */ /** * A Error class that will be thrown when a CloudEvent From 9c101c5e9dc03aff73d99f4235efd7b4013958b1 Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Mon, 18 May 2020 13:42:15 -0400 Subject: [PATCH 4/4] squash: fix tsc errors in some JS source Signed-off-by: Lance Ball --- docs/concepts.md | 95 -------------------- lib/bindings/http/receiver_binary.js | 2 + lib/bindings/http/receiver_structured.js | 2 + lib/bindings/http/v03/receiver_binary_0_3.js | 62 ++++--------- lib/bindings/http/v03/spec_0_3.js | 8 ++ lib/bindings/http/v1/receiver_binary_1.js | 27 +++--- lib/bindings/http/v1/spec_1.js | 8 ++ lib/bindings/http/validation/binary.js | 1 + 8 files changed, 56 insertions(+), 149 deletions(-) delete mode 100644 docs/concepts.md diff --git a/docs/concepts.md b/docs/concepts.md deleted file mode 100644 index 5a0d1495..00000000 --- a/docs/concepts.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Architecture and Concepts -nav_order: 2 ---- - -# Architecture and Concepts -{: .no_toc } - -1. TOC -{:toc} - -## Spec and SDK Terms - -- [Event](https://github.com/cloudevents/spec/blob/master/spec.md#event): - The canonical form of the attributes and payload of the occurrence. -- [Protocol](https://github.com/cloudevents/spec/blob/master/spec.md#protocol): - Protocol is the messaging protocol used to send/receive events. In sdk-javascript - the HTTP protocol is supported. -- [Protocol Binding](https://github.com/cloudevents/spec/blob/master/spec.md#protocol-binding): - Definition of how Events are mapped into Messages for the given Protocol. In sdk-javascript - the HTTP Protocol binding is implemented in the [`HTTPReceiver`](HTTPReceiver.html). -- [Message](https://github.com/cloudevents/spec/blob/master/spec.md#message): - The encoded form of an Event for a given encoding and protocol. - When a message is received in the sdk-javascript, the protocol implementation wraps it in a - [`CloudEvent`](CloudEvent.html). -- Message Writer: Logic required to take in a `Message` in a specific encoding and write out to a - given Protocol (request, message). A Message Writer can be a - [`StructuredWriter`](../lib/bindings/http/emitter_structured.js), - a [`BinaryWriter`](../lib/bindings/http/emitter_binary_1.js) or both, depending on what encodings a - Protocol supports. -- [`Client`](../lib/bindings/http/http_receiver.js): Interface to interact with a Protocol implementation - to send/receive Events. Clients also provide protocol agnostic features that can be - applied to events, such as extensions. -- Extensions: Anything that extends the base requirements from the CloudEvents spec. - There are several - [CloudEvents supported extensions](https://github.com/cloudevents/spec/tree/master/extensions). - -## Investment Level - -The amount of the SDK adopters would like to use is up to the adopter. We -support the following: - -- [Resource Level](event_data_structure.md): An adopter could use the Event data structure to interact with CloudEvents - and marshal/unmarshal it to JSON. -- [Message Level](protocol_implementations.md): An adopter could use directly `Message`s implementations and `Write*` functions - to read and write CloudEvents messages from/to the wire, handling by hand the connection, the - consumption and the production of messages from/to the protocol specific APIs. -- [Protocol Level](protocol_implementations.md): An adopter could use Protocol implementations directly to consume/produce `Message`s - without interacting with the protocol specific APIs. -- [Client Level](../v2/client/client.go): An adopter selects a Protocol implementation and Events can - be directly sent and received without requiring interactions with `Message`s. - -## Personas - -- [Producer](https://github.com/cloudevents/spec/blob/master/spec.md#producer), - the "producer" is a specific instance, process or device that creates the data - structure describing the CloudEvent. -- [Consumer](https://github.com/cloudevents/spec/blob/master/spec.md#consumer), - a "consumer" receives the event and acts upon it. It uses the context and data - to execute some logic, which might lead to the occurrence of new events. -- [Intermediary](https://github.com/cloudevents/spec/blob/master/spec.md#intermediary), - An "intermediary" receives a message containing an event for the purpose of - forwarding it to the next receiver, which might be another intermediary or a - Consumer. A typical task for an intermediary is to route the event to - receivers based on the information in the Context. - -## Interaction Models - -The SDK enables the following interaction models. - -### Sender - -Sender, when a Producer is creating new events. - -![sender](./images/sender.svg "Sender") - -### Receiver - -Receiver, when a Consumer is accepting events. - -![receiver](./images/receiver.svg "Receiver") - -### Forwarder - -Forwarder, when a Intermediary accepts an event only after it has successfully -continued the message to one or more Consumers. - -![forwarder](./images/forwarder.svg "Forwarder") - -### Mutator - -Mutator, when a Producer or Intermediary blocks on a response from a Consumer, -replacing the original Event. - -![mutator](./images/mutator.svg "Mutator") diff --git a/lib/bindings/http/receiver_binary.js b/lib/bindings/http/receiver_binary.js index 7b668224..664e3fec 100644 --- a/lib/bindings/http/receiver_binary.js +++ b/lib/bindings/http/receiver_binary.js @@ -4,6 +4,8 @@ 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 diff --git a/lib/bindings/http/receiver_structured.js b/lib/bindings/http/receiver_structured.js index 81924f29..2d8f7d9b 100644 --- a/lib/bindings/http/receiver_structured.js +++ b/lib/bindings/http/receiver_structured.js @@ -4,6 +4,8 @@ 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. diff --git a/lib/bindings/http/v03/receiver_binary_0_3.js b/lib/bindings/http/v03/receiver_binary_0_3.js index e6dcb4cb..a19e2cc9 100644 --- a/lib/bindings/http/v03/receiver_binary_0_3.js +++ b/lib/bindings/http/v03/receiver_binary_0_3.js @@ -20,14 +20,12 @@ const parserByType = { const parsersByEncoding = { null: parserByType, - undefined: parserByType -}; - -// base64 -parsersByEncoding[ENCODING_BASE64] = { - [MIME_JSON]: new JSONParser(new Base64Parser()), - [MIME_OCTET_STREAM]: { - parse(payload) { return payload; } + undefined: parserByType, + [ENCODING_BASE64]: { + [MIME_JSON]: new JSONParser(new Base64Parser()), + [MIME_OCTET_STREAM]: { + parse(payload) { return payload; } + } } }; @@ -42,42 +40,18 @@ const requiredHeaders = [ BINARY_HEADERS_03.ID ]; -const setterByHeader = {}; -setterByHeader[BINARY_HEADERS_03.TYPE] = { - name: "type", - parser: (v) => v -}; -setterByHeader[BINARY_HEADERS_03.SPEC_VERSION] = { - name: "specversion", - parser: () => "0.3" -}; -setterByHeader[BINARY_HEADERS_03.SOURCE] = { - name: "source", - parser: (v) => v -}; -setterByHeader[BINARY_HEADERS_03.ID] = { - name: "id", - parser: (v) => v -}; -setterByHeader[BINARY_HEADERS_03.TIME] = { - name: "time", - parser: (v) => new Date(Date.parse(v)) -}; -setterByHeader[BINARY_HEADERS_03.SCHEMA_URL] = { - name: "schemaurl", - parser: (v) => v -}; -setterByHeader[HEADER_CONTENT_TYPE] = { - name: "dataContentType", - parser: (v) => v -}; -setterByHeader[BINARY_HEADERS_03.CONTENT_ENCONDING] = { - name: "dataContentEncoding", - parser: (v) => v -}; -setterByHeader[BINARY_HEADERS_03.SUBJECT] = { - name: "subject", - parser: (v) => v +const passThroughParser = (v) => v; + +const setterByHeader = { + [BINARY_HEADERS_03.TYPE] : { name: "type", parser: passThroughParser }, + [BINARY_HEADERS_03.SPEC_VERSION] : { name: "specversion", parser: () => "0.3" }, + [BINARY_HEADERS_03.SOURCE] : { name: "source", parser: passThroughParser }, + [BINARY_HEADERS_03.ID] : { name: "id", parser: passThroughParser }, + [BINARY_HEADERS_03.TIME] : { name: "time", parser: (v) => new Date(Date.parse(v)) }, + [BINARY_HEADERS_03.SCHEMA_URL] : { name: "schemaurl", parser: passThroughParser }, + [HEADER_CONTENT_TYPE]: { name: "dataContentType", parser: passThroughParser }, + [BINARY_HEADERS_03.CONTENT_ENCONDING]: { name: "dataContentEncoding", parser: passThroughParser }, + [BINARY_HEADERS_03.SUBJECT] : { name: "subject", parser: passThroughParser } }; class Receiver { diff --git a/lib/bindings/http/v03/spec_0_3.js b/lib/bindings/http/v03/spec_0_3.js index 634123b2..43b58f5a 100644 --- a/lib/bindings/http/v03/spec_0_3.js +++ b/lib/bindings/http/v03/spec_0_3.js @@ -119,6 +119,14 @@ const ajv = new Ajv({ const isValidAgainstSchema = ajv.compile(schema); +/** @typedef {import("../../../cloudevent")} CloudEvent */ + +/** + * Decorates a CloudEvent with the 0.3 specification getters and setters + * @param {object} [_caller] a CloudEvent class to decorate with the 0.3 spec + * @returns {void} + * @ignore + */ function Spec03(_caller) { this.payload = { specversion: schema.definitions.specversion.const, diff --git a/lib/bindings/http/v1/receiver_binary_1.js b/lib/bindings/http/v1/receiver_binary_1.js index 4052337d..039258f5 100644 --- a/lib/bindings/http/v1/receiver_binary_1.js +++ b/lib/bindings/http/v1/receiver_binary_1.js @@ -16,10 +16,15 @@ const parserByType = { [MIME_OCTET_STREAM] : { parse(payload) { return payload; } } }; -const parsersByEncoding = { [null] : parserByType, [undefined] : parserByType, [ENCODING_BASE64] : {} }; -parsersByEncoding[ENCODING_BASE64][MIME_JSON] = new JSONParser(new Base64Parser()); -parsersByEncoding[ENCODING_BASE64][MIME_OCTET_STREAM] = { - parse(payload) { return payload; } +const parsersByEncoding = { + null: parserByType, + undefined: parserByType, + [ENCODING_BASE64]: { + [MIME_JSON]: new JSONParser(new Base64Parser()), + [MIME_OCTET_STREAM]: { + parse(payload) { return payload; } + } + } }; const allowedContentTypes = [MIME_JSON, MIME_OCTET_STREAM]; @@ -27,15 +32,17 @@ const allowedContentTypes = [MIME_JSON, MIME_OCTET_STREAM]; const requiredHeaders = [BINARY_HEADERS_1.TYPE, BINARY_HEADERS_1.SPEC_VERSION, BINARY_HEADERS_1.SOURCE, BINARY_HEADERS_1.ID]; +const passThroughParser = (v) => v; + const setterByHeader = { - [BINARY_HEADERS_1.TYPE] : { name: "type", parser: (v) => v }, + [BINARY_HEADERS_1.TYPE] : { name: "type", parser: passThroughParser }, [BINARY_HEADERS_1.SPEC_VERSION] : { name: "specversion", parser: () => "1.0" }, - [BINARY_HEADERS_1.SOURCE] : { name: "source", parser: (v) => v }, - [BINARY_HEADERS_1.ID] : { name: "id", parser: (v) => v }, + [BINARY_HEADERS_1.SOURCE] : { name: "source", parser: passThroughParser }, + [BINARY_HEADERS_1.ID] : { name: "id", parser: passThroughParser }, [BINARY_HEADERS_1.TIME] : { name: "time", parser: (v) => new Date(Date.parse(v)) }, - [BINARY_HEADERS_1.DATA_SCHEMA] : { name: "dataschema", parser: (v) => v }, - [HEADER_CONTENT_TYPE] : { name: "dataContentType", parser: (v) => v }, - [BINARY_HEADERS_1.SUBJECT] : { name: "subject", parser: (v) => v } + [BINARY_HEADERS_1.DATA_SCHEMA] : { name: "dataschema", parser: passThroughParser }, + [HEADER_CONTENT_TYPE] : { name: "dataContentType", parser: passThroughParser }, + [BINARY_HEADERS_1.SUBJECT] : { name: "subject", parser: passThroughParser } }; class Receiver { diff --git a/lib/bindings/http/v1/spec_1.js b/lib/bindings/http/v1/spec_1.js index e68c76a1..610fb28c 100644 --- a/lib/bindings/http/v1/spec_1.js +++ b/lib/bindings/http/v1/spec_1.js @@ -115,6 +115,14 @@ const ajv = new Ajv({ const isValidAgainstSchema = ajv.compile(schema); +/** @typedef {import("../../../cloudevent")} CloudEvent */ + +/** + * Decorates a CloudEvent with the 1.0 specification getters and setters + * @param {object} [_caller] a CloudEvent class to decorate with the 1.0 spec + * @returns {void} + * @ignore + */ function Spec1(_caller) { this.payload = { specversion: schema.definitions.specversion.const, diff --git a/lib/bindings/http/validation/binary.js b/lib/bindings/http/validation/binary.js index c97ff174..6a07985d 100644 --- a/lib/bindings/http/validation/binary.js +++ b/lib/bindings/http/validation/binary.js @@ -44,6 +44,7 @@ function check(payload, headers, receiver) { if (sanityHeaders[DEFAULT_SPEC_VERSION_HEADER] !== receiver.specversion) { throw new ValidationError("invalid spec version", [sanityHeaders[DEFAULT_SPEC_VERSION_HEADER]]); } + return true; } function parse(payload, headers, receiver) {