Skip to content

Commit

Permalink
feat: change contenttype to contentType
Browse files Browse the repository at this point in the history
  • Loading branch information
mkovatsc committed Nov 4, 2018
1 parent 1f13743 commit 2c889b5
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"command": {
"publish": {
"message": "%s"
Expand Down
8 changes: 4 additions & 4 deletions packages/binding-coap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/binding-coap",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "CoAP client & server protocol binding for node-wot",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -16,7 +16,7 @@
"devDependencies": {
"@types/chai": "4.0.4",
"@types/node": "10.9.4",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.0",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.2",
"chai": "4.1.2",
"mocha": "3.5.3",
"mocha-typescript": "1.1.8",
Expand All @@ -25,8 +25,8 @@
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"rxjs": "5.4.3",
"coap": "0.21.0",
"node-coap-client": "1.0.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/binding-coap/src/coap-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class CoapClient implements ProtocolClient {

// FIXME does not work with blockwise because of node-coap
let contentType = res.headers["Content-Format"];
if (!contentType) contentType = form.contenttype;
if (!contentType) contentType = form.contentType;

resolve({ type: contentType, body: res.payload });
});
Expand Down Expand Up @@ -186,9 +186,9 @@ export default class CoapClient implements ProtocolClient {
let req = this.agent.request(options);

// apply form data
if (typeof form.contenttype === "string") {
console.log("CoapClient got Form 'contenttype'", form.contenttype);
req.setOption("Accept", form.contenttype);
if (typeof form.contentType === "string") {
console.log("CoapClient got Form 'contentType'", form.contentType);
req.setOption("Accept", form.contentType);
}
if (Array.isArray(form["coap:options"])) {
console.log("CoapClient got Form 'options'", form["coap:options"]);
Expand Down
4 changes: 2 additions & 2 deletions packages/binding-coap/src/coaps-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class CoapsClient implements ProtocolClient {

// FIXME node-coap-client does not support options
let contentType; // = res.format[...]
if (!contentType) contentType = form.contenttype;
if (!contentType) contentType = form.contentType;

resolve({ type: contentType, body: res.payload });
})
Expand Down Expand Up @@ -74,7 +74,7 @@ export default class CoapsClient implements ProtocolClient {

// FIXME node-coap-client does not support options
let contentType; // = res.format[...]
if (!contentType) contentType = form.contenttype;
if (!contentType) contentType = form.contentType;

resolve({ type: contentType, body: res.payload });
})
Expand Down
6 changes: 3 additions & 3 deletions packages/binding-file/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/binding-file",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "File client protocol binding for node-wot",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -19,8 +19,8 @@
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.3"
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"@node-wot/core": "0.6.0-SNAPSHOT.4"
},
"scripts": {
"build": "tsc",
Expand Down
6 changes: 3 additions & 3 deletions packages/binding-fujitsu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/binding-fujitsu",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "Fujitsu Remote Proxy bridge for node-wot",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -17,7 +17,7 @@
"@types/chai": "4.0.4",
"@types/node": "10.9.4",
"@types/ws": "5.1.2",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"chai": "4.1.2",
"mocha": "3.5.3",
"mocha-typescript": "1.1.8",
Expand All @@ -26,7 +26,7 @@
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"ws": "5.1.1"
},
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions packages/binding-http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/binding-http",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "HTTP client & server protocol binding for node-wot",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -18,7 +18,7 @@
"@types/chai": "4.0.4",
"@types/node": "10.9.4",
"@types/request-promise": "4.1.41",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.0",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.2",
"chai": "4.1.2",
"mocha": "3.5.3",
"mocha-typescript": "1.1.8",
Expand All @@ -29,8 +29,8 @@
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"basic-auth": "2.0.1",
"rxjs": "5.4.3"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/binding-http/src/http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ export default class HttpClient implements ProtocolClient {
//console.dir(form);

// apply form data
if (options.method === "GET" && typeof form.contenttype === "string") {
console.debug("HttpClient got Form 'contenttype'", form.contenttype);
req.setHeader("Accept", form.contenttype);
if (options.method === "GET" && typeof form.contentType === "string") {
console.debug("HttpClient got Form 'contentType'", form.contentType);
req.setHeader("Accept", form.contentType);
}
if (Array.isArray(form["http:headers"])) {
console.debug("HttpClient got Form 'headers'", form["http:headers"]);
Expand Down
8 changes: 4 additions & 4 deletions packages/binding-mqtt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/binding-mqtt",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "MQTT binding for node-wot",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -17,7 +17,7 @@
"@types/chai": "4.0.4",
"@types/node": "10.9.4",
"@types/request-promise": "4.1.41",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.0",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.2",
"chai": "4.1.2",
"mocha": "3.5.3",
"mocha-typescript": "1.1.8",
Expand All @@ -28,8 +28,8 @@
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"rxjs": "5.4.3",
"mqtt": "2.18.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/binding-mqtt/src/mqtt-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class MqttClient implements ProtocolClient {
public subscribeResource(form: MqttForm, next: ((value: any) => void), error?: (error: any) => void, complete?: () => void): any {

// get MQTT-based metadata
let contentType = form.contenttype;
let contentType = form.contentType;
let retain = form["mqtt:retain"]; // TODO: is this needed here?
let qos = form["mqtt:qos"]; // TODO: is this needed here?
let requestUri = url.parse(form['href']);
Expand Down
4 changes: 2 additions & 2 deletions packages/binding-oracle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/binding-oracle",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"private": true,
"description": "Oracle IoT Cloud Service protocol binding for node-wot",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
Expand All @@ -21,7 +21,7 @@
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"iotcs-csl-js": "18.3.2"
},
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions packages/binding-websockets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/binding-websockets",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "WebSockets client & server protocol binding for node-wot",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -17,10 +17,10 @@
"@types/chai": "4.0.4",
"@types/node": "10.9.4",
"@types/ws": "5.1.2",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.0",
"@node-wot/binding-http": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.2",
"@node-wot/binding-http": "0.6.0-SNAPSHOT.4",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"chai": "4.1.2",
"mocha": "3.5.3",
"mocha-typescript": "1.1.8",
Expand Down
18 changes: 9 additions & 9 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/cli",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "servient command line interface",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -18,19 +18,19 @@
},
"devDependencies": {
"@types/node": "10.9.4",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.0",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.2",
"ts-node": "3.3.0",
"typescript": "2.9.2",
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/binding-coap": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-file": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-http": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-websockets": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-mqtt": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3"
"@node-wot/binding-coap": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-file": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-http": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-websockets": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-mqtt": "0.6.0-SNAPSHOT.4",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4"
},
"scripts": {
"build": "tsc",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/core",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"description": "W3C Web of Things (WoT) Servient framework",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
"license": "EPL-2.0 OR W3C-20150513",
Expand All @@ -16,7 +16,7 @@
"devDependencies": {
"@types/chai": "4.0.4",
"@types/node": "10.9.4",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.0",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.2",
"chai": "4.1.2",
"mocha": "3.5.3",
"mocha-typescript": "1.1.8",
Expand All @@ -25,7 +25,7 @@
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"uuid": "3.3.2",
"rxjs": "5.4.3"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/consumed-thing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ConsumedThingProperty extends TD.ThingProperty implements WoT.ThingPropert
} else {
console.log(`ConsumedThing '${this.getThing().name}' reading ${form.href}`);
client.readResource(form).then((content) => {
if (!content.type) content.type = form.contenttype;
if (!content.type) content.type = form.contentType;
try {
let value = ContentManager.contentToValue(content, <any>this);
resolve(value);
Expand All @@ -159,7 +159,7 @@ class ConsumedThingProperty extends TD.ThingProperty implements WoT.ThingPropert
reject(new Error(`ConsumedThing '${this.getThing().name}' did not get suitable client for ${form.href}`));
} else {
console.log(`ConsumedThing '${this.getThing().name}' writing ${form.href} with '${value}'`);
let content = ContentManager.valueToContent(value, <any>this, form.contenttype);
let content = ContentManager.valueToContent(value, <any>this, form.contentType);

client.writeResource(form, content).then(() => {
resolve();
Expand Down Expand Up @@ -202,12 +202,12 @@ class ConsumedThingAction extends TD.ThingAction implements WoT.ThingAction {
let input;

if (parameter!== undefined) {
input = ContentManager.valueToContent(parameter, <any>this, form.contenttype);
input = ContentManager.valueToContent(parameter, <any>this, form.contentType);
}

client.invokeResource(form, input).then((content) => {
// infer media type from form if not in response metadata
if (!content.type) content.type = form.contenttype;
if (!content.type) content.type = form.contentType;
try {
let value = ContentManager.contentToValue(content, this.output);
resolve(value);
Expand Down Expand Up @@ -246,7 +246,7 @@ class ConsumedThingEvent extends TD.ThingEvent implements Subscribable<any> {

return client.subscribeResource(form,
(content) => {
if (!content.type) content.type = form.contenttype;
if (!content.type) content.type = form.contentType;
try {
let value = ContentManager.contentToValue(content, <any>this);
next(value);
Expand Down
18 changes: 9 additions & 9 deletions packages/demo-servients/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-wot/demo-servients",
"version": "0.6.0-SNAPSHOT.3",
"version": "0.6.0-SNAPSHOT.4",
"private": true,
"description": "W3C WoT demo Servient for the unpublished version of the monorepo",
"author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",
Expand All @@ -15,19 +15,19 @@
},
"devDependencies": {
"@types/node": "10.9.4",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.0",
"wot-typescript-definitions": "0.6.0-SNAPSHOT.2",
"ts-node": "3.3.0",
"typescript": "2.9.2",
"typescript-standard": "0.3.30"
},
"dependencies": {
"@node-wot/binding-coap": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-file": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-http": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-oracle": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-fujitsu": "0.6.0-SNAPSHOT.3",
"@node-wot/core": "0.6.0-SNAPSHOT.3",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.3",
"@node-wot/binding-coap": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-file": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-http": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-oracle": "0.6.0-SNAPSHOT.4",
"@node-wot/binding-fujitsu": "0.6.0-SNAPSHOT.4",
"@node-wot/core": "0.6.0-SNAPSHOT.4",
"@node-wot/td-tools": "0.6.0-SNAPSHOT.4",
"rxjs": "5.4.3"
},
"scripts": {
Expand Down
Loading

0 comments on commit 2c889b5

Please sign in to comment.