The github action that generates the documentation fails currently due
to the fact that it's expecting the generated schema to exist, but it
does not exist unless it's explicitly built.
This commit adds `npm run build:schema` to the workflow action.
Signed-off-by: Lance Ball <lball@redhat.com>
The id of release was left out, so the checks to see if there needs to be a publish were being skipped
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
* fix: handle big integers in incoming events
An event may have data that contains a BigInt. The builtin `JSON` parser
for JavaScript does not handle the `BigInt` types. The introduced
`json-bigint` dependency (34k) does.
Fixes: https://github.com/cloudevents/sdk-javascript/issues/489
Signed-off-by: Lance Ball <lball@redhat.com>
* feat!: remove node 12 and node 14
Node 12 has been EOL since the end of April 2022 and Node 14 just became EOL at the end of April 2023
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
This small change allows a developer to just run npm install and then npm test without having to run the build step separately, which compiles the schema that is needed to run the tests successfully.
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
* Update CI action to node 18.x
Signed-off-by: Jordan Moore <1930631+OneCricketeer@users.noreply.github.com>
* doc: update README
Signed-off-by: Jordan Moore <1930631+OneCricketeer@users.noreply.github.com>
---------
Signed-off-by: Jordan Moore <1930631+OneCricketeer@users.noreply.github.com>
* fix: improve validation on extension attribute
Fixes: https://github.com/cloudevents/sdk-javascript/issues/500
Adds a regular expression check to the attribute name validation code to
ensure that attribute names only use a-z0-9 (except for `data_base64`,
which apparently is an exception to the rule.
Signed-off-by: Lance Ball <lball@redhat.com>
* fix: allow `Uint16|8Array` for binary data
Previously we only considered `Uint32Array` binary data. This was an
oversight. This fixes that issue.
Fixes: https://github.com/cloudevents/sdk-javascript/issues/491
Signed-off-by: Lance Ball <lball@redhat.com>
* fix: HTTP headers for extensions with false values
CloudEvent objects may include extensions that have a defined key and a
`false` value. This change ensures that HTTP messages for CloudEvents
containing these extension values include the appropriate headers.
Signed-off-by: Lance Ball <lball@redhat.com>
* 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>
* 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>
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>