Merge pull request #34 from cloudevents/develop

Fixies and Changelog
This commit is contained in:
Fabio José 2019-08-23 08:57:39 -03:00 committed by GitHub
commit 5ba6cf7cb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 4 deletions

13
CHANGELOG.md Normal file
View File

@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [0.3.1]
### Fixed
- Axios version to `0.18.1` due the CVE-2019-10742
- Fix the `subject` attribute unmarshal error: issue
[#32](https://github.com/cloudevents/sdk-javascript/issues/32)

View File

@ -12,6 +12,11 @@ ahead of `master`.
- [Gitflow](https://nvie.com/posts/a-successful-git-branching-model/) by @nvie - [Gitflow](https://nvie.com/posts/a-successful-git-branching-model/) by @nvie
## Changelog
Always update the [CHANGELOG.md](./CHANGELOG.md), following
[this semantics](https://keepachangelog.com/en/1.0.0/).
## Pull Requests ## Pull Requests
Guidelines about how to perform pull requests. Guidelines about how to perform pull requests.

View File

@ -5,6 +5,7 @@
[![downloads](https://img.shields.io/npm/dy/cloudevents-sdk.svg)](https://www.npmjs.com/package/cloudevents-sdk) [![downloads](https://img.shields.io/npm/dy/cloudevents-sdk.svg)](https://www.npmjs.com/package/cloudevents-sdk)
[![npm version](https://img.shields.io/npm/v/cloudevents-sdk.svg)](https://www.npmjs.com/package/cloudevents-sdk) [![npm version](https://img.shields.io/npm/v/cloudevents-sdk.svg)](https://www.npmjs.com/package/cloudevents-sdk)
[![dependencies](https://david-dm.org/cloudevents/sdk-javascript.svg)](https://david-dm.org/cloudevents/sdk-javascript) [![dependencies](https://david-dm.org/cloudevents/sdk-javascript.svg)](https://david-dm.org/cloudevents/sdk-javascript)
[![vulnerabilities](https://snyk.io/test/github/cloudevents/sdk-javascript/badge.svg)](https://snyk.io/test/github/cloudevents/sdk-javascript)
# sdk-javascript # sdk-javascript
@ -12,6 +13,8 @@ Official CloudEvents' SDK for JavaScript.
<img src="https://github.com/cncf/artwork/blob/master/projects/cloudevents/horizontal/color/cloudevents-horizontal-color.png" width="300" height="58" alt="CloudEvents logo"> <img src="https://github.com/cncf/artwork/blob/master/projects/cloudevents/horizontal/color/cloudevents-horizontal-color.png" width="300" height="58" alt="CloudEvents logo">
__Checkout the [changelog](./CHANGELOG.md) to see what's going on!__
## Contributing ## Contributing
Before create an awesome PR, please read our [guidelines](./CONTRIBUTING.md). Before create an awesome PR, please read our [guidelines](./CONTRIBUTING.md).

View File

@ -51,6 +51,10 @@ setterByAttribute[Constants.STRUCTURED_ATTRS_03.CONTENT_TYPE] = {
name: "dataContentType", name: "dataContentType",
parser: (v) => v parser: (v) => v
}; };
setterByAttribute[Constants.STRUCTURED_ATTRS_03.SUBJECT] = {
name: "subject",
parser: (v) => v
};
setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = { setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = {
name: "data", name: "data",
parser: (v) => v parser: (v) => v

View File

@ -1,6 +1,6 @@
{ {
"name": "cloudevents-sdk", "name": "cloudevents-sdk",
"version": "0.3.0", "version": "0.3.1",
"description": "CloudEvents SDK for JavaScript", "description": "CloudEvents SDK for JavaScript",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -32,7 +32,7 @@
"homepage": "https://github.com/cloudevents/sdk-javascript#readme", "homepage": "https://github.com/cloudevents/sdk-javascript#readme",
"dependencies": { "dependencies": {
"ajv": "^6.7.0", "ajv": "^6.7.0",
"axios": "0.18.0", "axios": "0.18.1",
"is-empty": "1.2.0", "is-empty": "1.2.0",
"uri-js": "4.2.2", "uri-js": "4.2.2",
"uuid": "3.3.2" "uuid": "3.3.2"

View File

@ -9,7 +9,7 @@ const webhook = "https://cloudevents.io/webhook";
const contentType = "application/cloudevents+json; charset=utf-8"; const contentType = "application/cloudevents+json; charset=utf-8";
const now = new Date(); const now = new Date();
const schemaurl = "http://cloudevents.io/schema.json"; const schemaurl = "http://cloudevents.io/schema.json";
const subject = "subject.ext";
const ceContentType = "application/json"; const ceContentType = "application/json";
const data = { const data = {
@ -118,9 +118,10 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => {
new Cloudevent(v03.Spec) new Cloudevent(v03.Spec)
.type(type) .type(type)
.source(source) .source(source)
.contenttype(ceContentType) .dataContentType(ceContentType)
.time(now) .time(now)
.schemaurl(schemaurl) .schemaurl(schemaurl)
.subject(subject)
.data(data) .data(data)
.toString(); .toString();