Commit Graph

524 Commits

Author SHA1 Message Date
Lance Ball d9e9ae6bdc
fix: make application/json the default content type in binary mode (#118)
The Knative Kafka event source does not include a `Content-Type` header when
sending binary events. The CE HTTP binding specification doesn't address how
a receiver should handle this situation.

This commit makes `application/json` the default.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/117
Ref: https://github.com/cloudevents/spec/issues/614

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-05 18:02:39 -04:00
Grant Timmerman 79ec3ef126
chore: es6 unmarshaller (#108)
* chore: es6 unmarshaller
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-05-05 13:02:43 -07:00
Daniel Bevenius e329d9ac00
lib: use specversion from schema (#116)
This commit updates the 0.1 and 0.3 sources to use the specversion
available in schema definitions.

Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-05-04 17:44:16 -07:00
Grant Timmerman 07323e078f
docs: organize README badges and remove TS example (#112)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-05-04 10:33:40 -07:00
Grant Timmerman 223a7c6f03
docs: remove repo structure docs (#111)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-05-04 10:25:48 -07:00
Helio Frota cd6a3eec7d
fix: misspelled word (#113)
Signed-off-by: Helio Frota <00hf11@gmail.com>
2020-05-02 08:31:07 -07:00
Helio Frota 53524acb0e
fix: misspelled word (#115)
Signed-off-by: Helio Frota <00hf11@gmail.com>
2020-05-02 08:30:01 -07:00
Grant Timmerman f30c814a09
chore: remove note with bad link and non SDK docs (#109)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-05-01 10:59:21 -07:00
Grant Timmerman 05ecbdea4f
feat: use CloudEvents not cloudevents everywhere (#101)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-30 16:14:13 -07:00
Grant Timmerman cd6decd749
chore: es6 parser (#98)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-30 15:32:37 -07:00
Lance Ball e83db297ae chore: update eslint rules to disallow var usage
Enforce the use of `let` and `const` by using elsint rules.
When creating the eslint configuration, I had assumed that
`extends: eslint:recommended` would have covered this, but
apparently not!

Existing usage of `var` fixed with `npm run lint -- --fix`.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/97

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-30 12:36:04 -03:00
Helio Frota 42246ce36b chore: Update uuid dependency
Signed-off-by: Helio Frota <00hf11@gmail.com>
2020-04-30 12:34:30 -03:00
Grant Timmerman 56036b09dd docs: remove 0.1, 0.2 spec support from README
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-30 12:31:08 -03:00
Helio Frota fbcbcec4e8 fix: protects the consts from being changed in other parts of the code.
Signed-off-by: Helio Frota <00hf11@gmail.com>
2020-04-30 12:19:24 -03:00
Grant Timmerman 005d5327e4
chore: add npm fix command (#74)
* feat: add npm fix command

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* feat: add npm fix command

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-29 13:36:21 -07:00
Grant Timmerman 12ac181300
chore: use es6 for cloudevents.js (#73)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-29 13:17:51 -07:00
Grant Timmerman d042ef1dbb
chore: es6 base64 parser (#75)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-29 13:15:00 -07:00
Grant Timmerman 6c223e2c34
fix: remove d.ts types. Fixes #83 (#84)
Fixes: https://github.com/cloudevents/sdk-javascript/issues/83

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-29 16:06:57 -04:00
Grant Timmerman c36f1949d0
feat: formatter.js es6 (#87)
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-29 12:47:41 -07:00
Helio Frota bb8e0f9e0c
fix: Fix Express example installation (#77)
Signed-off-by: Helio Frota <00hf11@gmail.com>
2020-04-29 10:44:02 -07:00
Lance Ball 8fb0ddf6eb
chore: fix CI code coverage publishing (#78)
The code coverage publishing in package.json works fine on non-ubuntu systems.
However, in Ubuntu `/bin/sh` is symlinked to `/bin/dash` which doesn't support
everything supported by `/bin/bash` - specifically `-o pipefail`.

This commit changes the code coverage script to explicitly use `bash` instead.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/81

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-29 12:10:25 -04:00
Lance Ball f47bca4ff0 chore: add standard-version and release script
This commit adds the `standard-version` module for managing releases.
When running `npm run release` the following steps are taken.

1. Retreive the current version of your repository by looking at package.json.
2. Bump the version in package.json based on the commits.
3. Prepends to the CHANGELOG based on the commits (uses conventional-changelog under the hood).
4. Create a new commit including the package.json and updated CHANGELOG.
5. Create a new tag with the new version number.

This works best if all commits follow the Conventional Commits specification.
https://www.conventionalcommits.org/en/v1.0.0/

Fixes: https://github.com/cloudevents/sdk-javascript/issues/56

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-29 08:50:52 -03:00
Daniel Bevenius e0878055a2
test: use header constants in unmarshaller tests (#60)
This commit updates the http unmarshaller tests to use the constants
available in lib/bindings/http/constants.js.

Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-04-28 21:14:39 -07:00
Lance Ball 5110ad4c67 src,fix: drop support for v0.2 and clean up contenttype
This commit removes support for the v0.2 specification. It also removes the
`contenttype` attribute from the `CloudEvent` object. While the HTTP protocol
binding specifies that in binary mode, the `datacontenttype` attribute should
map to the HTTP Content-Type header, that doesn't mean that the `CloudEvent`
object should have a `contenttype` property.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/61
Fixes: https://github.com/cloudevents/sdk-javascript/issues/66

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-28 17:37:49 -03:00
Fabio José 1a4bdce192
Merge pull request #55 from lance/54-add-linter
src: add eslint configuration and npm script
2020-04-28 13:01:03 -03:00
Fabio José bb9b2118f5
Merge pull request #63 from grant/patch-1
Delete OLDOCS.md
2020-04-27 15:24:04 -03:00
Grant Timmerman fc1cb7fb69 Delete OLDOCS.md
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
2020-04-24 17:27:53 -07:00
Lance Ball 3f238a0124
src: add eslint configuration and npm script
Automatically fixed > 2000 issues. The remaining 200+ issues need
to be fixed by hand. Additionally, all strings are double quotes
which is not typically standard and I wonder about fixing that too.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-22 10:15:05 -04:00
Fabio José b03a243b20
Merge pull request #49 from lance/dependency-updates
deps: update old and remove unused dependencies
2020-04-22 09:23:25 -03:00
Lance Ball aa2cef6e3c
deps: update old and remove unused dependencies
This commit updates all of the dependencies in package.json to
their most recent versions. It also removes dependencies that were
specified in package.json but not used - or only used in a
`require()` statement.

These changes have some ripple effects. Istanbul has not been
supported for some time, so it has been replaced with nyc.
The code coverage reporting tool from codacy has been updated
as well. This could not be tested without having the API token.

Finally, the CI job has been modified to run tests on Node.js
versions 10x and 12x. All older versions of Node.js are no longer
maintained.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-20 14:53:53 -04:00
Fabio José e7343b7993
Merge pull request #58 from danbev/use-const
Use const instead of var where applicable
2020-04-20 09:57:56 -03:00
Fabio José 23426fc4ec
Merge pull request #57 from danbev/formatter-comment
Fix minor typo in JSONFormatter comment
2020-04-20 09:53:43 -03:00
Daniel Bevenius 704c497771 Fix minor typo in JSONFormatter comment
Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-04-20 09:54:58 +02:00
Daniel Bevenius df85189a64 Use const instead of var where applicable
Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-04-20 09:54:25 +02:00
Fabio José 02edfb9c2d
Merge pull request #53 from lance/48-fix-emitters
fix: support mTLS in 1.0 Binary and Structured emitters
2020-04-16 15:45:13 -03:00
Lance Ball 388c1fc1f7
squash: add changes to CHANGELOG.md
Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-15 09:18:11 -04:00
Fabio José 362c4d6829
Merge pull request #52 from lance/ci-pull-requests
ci: run test suite for pull requests
2020-04-15 09:13:00 -03:00
Lance Ball 71a32d4e89
squash: fix linting error
Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-13 10:10:26 -04:00
Fabio José 0b068acdd1
Merge pull request #47 from duglin/addemail
add link to email
2020-04-10 12:30:04 -03:00
Lance Ball 3a063d7245
fix: support mTLS in 1.0 Binary and Structured emitters
This commit modifies both of the 1.0 emitters so that they may
accept typed objects as a part of the configuration. When using
mTLS in Node, you need to provide an `Agent` to the underlying
HTTP handler. In this case, Axios will pass this object along to
Node.js when it is provided.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/48

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-08 16:13:57 -04:00
Lance Ball 10f093a952
ci: run test suite for pull requests
This commit modifies the Travis-CI configuration so that the tests
are run for pull requests.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-03 11:37:36 -04:00
Doug Davis b48b720974 add link to email
Signed-off-by: Doug Davis <dug@us.ibm.com>
2020-03-20 14:48:19 +00:00
Fabio José 4a199d4623
Merge pull request #44 from duglin/editreadme
add helpful text to README
2020-01-28 17:28:10 -03:00
Doug Davis 716854d39b add helpful text to README
Signed-off-by: Doug Davis <dug@us.ibm.com>
2020-01-28 18:53:23 +00:00
Fabio José 98e476d82c
Merge pull request #43 from danbev/readme-fromString
Remove non-existing fromString from README API doc
2019-11-29 08:22:35 -03:00
Daniel Bevenius 041aed4bad Remove non-existing fromString from README API doc
This commit removes the API documentation for the fromString Cloudevent
function as it does not seem to exist.

Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-11-18 08:32:34 +01:00
Fabio José d70274d404 Merge branch 'develop'
Typo fixing
2019-11-12 14:39:04 -03:00
Fabio José 627e31bb97
Merge pull request #42 from danbev/readme-typo
Fix typo in "What we can do" table
2019-11-12 14:36:33 -03:00
Fabio José b0d6dff1c0
Merge pull request #39 from cloudevents/develop
Support for Spec v1.0
2019-11-12 14:35:37 -03:00
Daniel Bevenius 2c7d2a5b41 Fix typo in "What we can do" table
Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-11-11 14:26:54 +01:00