Commit Graph

105 Commits

Author SHA1 Message Date
Lance Ball ce02e0a1f3
chore: bump ajv and remove old dep dependency (#496)
* chore: bump ajv and remove old dep dependency

This should allow the existing, meaningful PRs to pass CI validation if they get a rebase.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-06-14 17:30:29 -04:00
github-actions[bot] a512aad5d5
chore: release 6.0.1 (#485)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-21 15:40:44 -04:00
Lance Ball c0b1f7705a
chore: update dependencies to inlude ajv-formats (#484)
In this PR https://github.com/cloudevents/sdk-javascript/pull/471/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R128
it was not noticed that the addition of `ajv-formats` to devDependencies
is insufficient. Unfortunately, users of v6.0.0 will receive an error when
using the module, unless they explicitly install `ajv-formats` in their
project. This commit fixes that, and should result in an immediate release
of version 6.0.1.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-21 15:38:31 -04:00
github-actions[bot] 0164f72eaa
chore: release 6.0.0 (#482)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-21 14:19:43 -04:00
Lance Ball 0362a4f11c
feat!: add http transport and remove axios (#481)
* feat: add builtin HTTP emitter

Adds a builtin HTTP event emitter that can be used with `emitterFor()`
to send events over HTTP without pulling in any additional dependencies.

In the past we chose to keep this in our code base by considering axios a
peer dependency - users were required to include it in their projects
explicitly. In working on the HTTP emitter, it became more and more
apparent that the axios emitter was probably no longer needed, and in fact
I doubt it was really used at all. To use it, users would have been required
to do this, since it isn't exported at the top level.

const { axiosEmitter } = require("cloudevents/transport/http");

Based on this, I think the usage in the wild is probably very minimal,
and I like the idea of eliminating this dependency.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-18 13:36:12 -04:00
Lance Ball b4d7aa9adb
chore: add an npm test:once script (#480)
Adds a convenience npm script that allows you to run only a single test
file at a time. Example usage:

```
sdk-javascript on  lance/update-deps-package-json [!?] is 📦 v5.3.2 via  v16.14.0
❯ npm run test:one

> cloudevents@5.3.2 test:one
> mocha --require ts-node/register

Error: No test files found

sdk-javascript on  lance/update-deps-package-json [!?] is 📦 v5.3.2 via  v16.14.0
❯ npm run test:one -- ./test/integration/batch_test.ts

> cloudevents@5.3.2 test:one
> mocha --require ts-node/register "./test/integration/batch_test.ts"

  A batched CloudEvent message over HTTP
    ✔ Can be created with a typed Message

  A batched CloudEvent message over Kafka
    ✔ Can be created with a typed Message

  2 passing (5ms)

sdk-javascript on  lance/update-deps-package-json [!?] is 📦 v5.3.2 via  v16.14.0
```

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-17 23:10:30 -04:00
Lance Ball 6204805bfc
chore: update package.json format and deps (#479)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-17 23:09:29 -04:00
Lance Ball b13bde9b49
feat: precompile cloudevent schema (#471)
* feat: precompile cloudevent schema

This commit modifies the build pipleline so that the cloudevent schema is
precompiled for runtime validation. This eliminates the need to compile the
schema at runtime, improving both performance and security.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2022-02-15 14:06:42 -05:00
github-actions[bot] 9046b369cf
chore: release 5.3.2 (#470)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-11 15:42:37 -08:00
Lance Ball c3d9f39a53
chore: bump typedoc to remove vuln (#472) 2022-02-10 22:25:48 -06:00
github-actions[bot] f36a1f0428
chore: release 5.3.1 (#466)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-03 13:45:21 -05:00
Lance Ball cd4dea954b
fix: improve binary data detection in HTTP transport (#468) 2022-02-02 07:18:08 -05:00
Snyk bot ae8fa799af
fix: package.json & package-lock.json to reduce vulnerabilities (#462)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-NANOID-2332193

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2022-01-24 18:49:01 -05:00
github-actions[bot] 98009d910d
chore: release 5.3.0 (#458)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-18 14:07:12 -05:00
Lance Ball 5d1f744f50
feat: add support for kafka transport (#455)
This commit extends the `message` package to include Kafka transport.

Additionally, some of the type information has changed across the project
to more accurately reflect the type of `Message` (by including `T`).

Related: https://github.com/cloudevents/sdk-javascript/issues/390
Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-07 16:14:09 -05:00
Lance Ball 320354f750
chore: update cucumber dependency and remove prettier (#453)
The combination of prettier and eslint was causing some conflicting error
messages in formatting between VSCode and using npm in the CLI. For the most
part, there were only a couple of required formatting changes that prettier
was covering, so the change is minor.

The cucumber dependency had a major version bump and was carrying some unsafe
dependencies in the older version. This commit bumps to the new version and
makes appropriate configuration changes.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-12-22 10:45:35 -05:00
github-actions[bot] d4cb42f94b
chore: release 5.2.0 (#451)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-07 18:05:22 -05:00
github-actions[bot] d7e1c4178a
chore: release 5.1.0 (#449)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-02 08:36:34 -05:00
Snyk bot 0f5a4c0de2
fix: package.json & package-lock.json to reduce vulnerabilities (#439)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2021-12-01 09:55:58 -05:00
github-actions[bot] f7b2840f82
chore: release 5.0.0 (#430)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-10-05 13:21:01 -04:00
Snyk bot 2dc846c659
fix: package.json & package-lock.json to reduce vulnerabilities (#436)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2021-09-17 12:09:18 -04:00
Snyk bot 8814919923
fix: package.json & package-lock.json to reduce vulnerabilities (#434)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2021-09-17 12:08:59 -04:00
Snyk bot cf47248d25
fix: package.json & package-lock.json to reduce vulnerabilities (#433)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-AXIOS-1579269

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2021-09-13 11:33:16 -04:00
Lance Ball 2118488a14
chore: use git submodules for conformance tests (#427)
I don't think downloading to `/tmp` for each `npm test` is such a great
idea. This does mean that contributors to this repo will need to run the
following command once on their clone after this commit lands.

```
git submodule init
git submodule update
```

Signed-off-by: Lance Ball <lball@redhat.com>
2021-08-05 09:47:43 -04:00
Lance Ball 061c122b86
chore: update eslint and prettier dependencies (#424)
There were some minor changes that resulted in a few code style changes, but not much.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-08-04 15:51:37 -04:00
github-actions[bot] b5100566c6
chore: release 4.0.3 (#412)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-07-06 14:34:19 -04:00
Remi Cattiau 80d987c1f6
chore: add copyrights header and lint rules (#418)
Signed-off-by: Remi Cattiau <remi@cattiau.com>
2021-05-14 09:28:49 -04:00
Lance Ball d68b85a227
chore: add Lance Ball to maintainers in package.json (#411)
Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-27 12:12:07 -04:00
github-actions[bot] 1fe4f5b62a
chore: release 4.0.2 (#396)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-23 12:21:46 -04:00
Lance Ball a0009f6189
chore: remove @types/axios and add axios in dev (#408)
This commit removes @types/axios from the devDependencies and replaces
it with straight up axios. The @types package is deprecated and has not
been updated in four years. Plus it was raising a security alert. Plus
axios publishes their own types now.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-21 10:13:10 -04:00
Lance Ball 192c6a3a5c
chore: externalize remark-lint config (#406)
This way Codacy will use our configuration instead of its own.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-21 10:12:31 -04:00
Lance Ball fea5ac2d05
chore: add markdown linter (#403)
Also fixes a few minor linting issues from CHANGELOG.md.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-20 11:53:23 -04:00
Lance Ball edd3c7fbac
chore: remove standard-version (#402)
Now that we are using release-please, this is not necessary.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-16 15:08:14 -04:00
Lance Ball 447252e0c7
docs: fix 'npm run generate-docs' (#398)
Fixes: https://github.com/cloudevents/sdk-javascript/issues/392

This commit also removes the external doc theme, since the new version
generates decent looking docs.

After this lands, docs should be published.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-05 10:18:59 -04:00
github-actions[bot] 93f02130f6
chore: release 4.0.1 (#378)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-23 11:55:26 -04:00
Lance Ball 39812f77d0
fix: package.json & package-lock.json to reduce vulnerabilities (#384)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MARKED-1070800

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2021-03-08 18:32:41 -05:00
Lance Ball 1af3d43341 fix: Emitter should not extend EventEmitter
This change modifies Emitter so that it does not directly extend the Node.js
EventEmitter class. Instead, it holds a singleton instance of an EventEmitter
but is not an instance of EventEmitter itself.

This commit also updates the typescript example to use a modern version of
@types/node and typescript.

Finally there are a few minor formatting changes picked up by eslint.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2021-02-27 19:27:20 -05:00
github-actions[bot] 97cf2f7785
chore: release 4.0.0 (#368)
* chore: release 4.0.0

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lucas Holmquist <lholmqui@redhat.com>
2020-12-11 14:28:02 -05:00
snyk-bot 132f052f1f fix: package.json & package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-Y18N-1021887

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-11-25 11:31:12 -05:00
Lucas Holmquist 875f70017a
feat!: Remove All API's that are labeled "Remove in 4.0" (#362)
* feat!: remove all 4.0 deprecation.

* This removes all the APIs that were deprecated in the 3.x releases and marked as "remove in 4.0".

* Also removes any tests associated with those API's

* squash: remove axios as a dependecy


Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-11-13 14:12:26 -05:00
Snyk bot 8205bc96ae
chore(package): Upgrade mocha from 7.1.2 to 8.2.0 (#354)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-FLAT-596927

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-10-26 12:16:44 -04:00
Lance Ball e334b6eceb
feat: add emitterFactory and friends (#342)
* feat: add emitterFactory and friends

This commit adds an emitterFactory function that returns an EmitterFunction
object. The EmitterFunction may be used to emit events over a supported
network transport layer. Currently, only HTTP is supported.

Parameters provided to the emitterFactory are the transport Binding (only
HTTP supported), the encoding mode (Mode.BINARY or Mode.STRUCTURED), and
a TransportFunction.

The implementation for emitBinary and emitStructured has been replaced
with this simple pattern and those two functions have been removed.

Example:

```js
// The endpoint URL that will receive the event
const sink = 'https://my-event-sink';

// A function that uses Axios to send a message over HTTP
function axiosEmitter(message: Message, options?: Options): Promise<unknown> {
  return axios.post(sink, message.body, { headers: message.headers, ...options });
}

// Create an event emitter
const emit = emitterFactory(HTTP, Mode.BINARY, axiosEmitter);

// Emit an event, sending it to the endpoint URL
emit(new CloudEvent{ source: '/example', type: 'example' });
```

Signed-off-by: Lance Ball <lball@redhat.com>
2020-09-25 17:25:15 -04:00
Snyk bot eca43d9074
fix: package.json & package-lock.json to reduce vulnerabilities (#338)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-DOTPROP-543489
- https://snyk.io/vuln/SNYK-JS-MARKED-584281

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-09-09 09:46:13 -04:00
Lance Ball 17d4bc85df
chore: add cucumber.js to list of files to lint and /docs to .gitignore (#327)
Signed-off-by: Lance Ball <lball@redhat.com>
2020-08-25 16:38:17 -04:00
Snyk bot 6e2390ed6b fix: upgrade uuid from 8.2.0 to 8.3.0 (#317)
Snyk has created this PR to upgrade uuid from 8.2.0 to 8.3.0.

See this package in npm:
https://www.npmjs.com/package/uuid

See this project in Snyk:
https://app.snyk.io/org/lance/project/37afc620-45ad-41a3-9acc-1ac155caebc7?utm_source=github&utm_medium=upgrade-pr

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-08-18 18:50:51 -04:00
Lucas Holmquist 1cdf0f684b "chore(release): 3.1.0"
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-08-11 09:34:19 -04:00
Lucas Holmquist f3cc2b429b
chore: update the release script to signoff the commit (#307)
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-08-11 09:23:29 -04:00
Lance Ball 07e0bef696
"chore(release): 3.0.1" 2020-07-29 08:50:26 -04:00
Lucas Holmquist c76dda6d10
chore: move typedoc them to a dev dependency. (#279)
fixes #278

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2020-07-28 15:04:43 -04:00
Lance Ball 4a371b34de
"chore(release): 3.0.0" 2020-07-27 14:46:48 -04:00