Commit Graph

20 Commits

Author SHA1 Message Date
Lance Ball d836b06ffe
lib: expose constants as a top-level export (#161)
This commit pulls the constants up from the lib/bindings/http/constants.js
and exports them in the top level index.js. There are some elements of the API
where we expect users to provide constant values, and this makes it easier for
them to be sure the values they provide are what is expected.

I've also added two new constants: `BINARY` and `STRUCTURED`.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-18 08:30:28 -04: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
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
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é 8c7de33ca8 Constants for binary receiver spec 1.0
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-04 09:45:05 -03:00
Fabio José 456eb919b0 Constants for spec 1.0
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-11-02 07:04:54 -03:00
Fabio José 7d47b96273 Headers for binary mode spec v1.0
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-10-29 21:15:08 -03:00
Fabio José 25217fb69a Add constant for base64 string
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-08-06 11:14:25 -03:00
Fabio José b42f6f3bc8 Constants for version number and default header specversion
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-08-04 13:26:56 -03:00
Fabio José f19b52a0ef Contants for structured v03
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-08-04 09:36:35 -03:00
Fabio José b3a63aa749 Constants for v0.3 binary headers
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-08-02 10:16:36 -03:00
Fabio José 145bd2973f A generic structured http emitter for reusable purposes
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-07-29 14:33:59 -03:00
Fabio José a7a62c442a Default content encoding
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-07-29 14:15:42 -03:00
Fabio José f3a6dbd960 HTTP Headers name for configuration, CloudEvents data attribute
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-07-29 13:47:56 -03:00
Jingwen Peng 8418f77a6b Support receiving "application/octet-stream" content in binary transport mode
Signed-off-by: Jingwen Peng <pengsrc@outlook.com>
2019-07-28 15:11:40 +08:00
Fabio José 2cb26395eb Add structured attributes
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-25 10:52:55 -03:00
Fabio José a1e2381dc9 terminator
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-16 18:47:51 -03:00
Fabio José e17f9aafbd HTTP Binary headers
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-11 21:51:22 -03:00
Fabio José 6de756d102 New contants + usage
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-11 12:37:49 -03:00
Fabio José f1e1f942e1 To concentrate the constants
Signed-off-by: Fabio José <fabiojose@gmail.com>
2019-06-11 11:35:54 -03:00