Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add td utils #32

Merged
merged 9 commits into from
Jul 12, 2024
33 changes: 33 additions & 0 deletions node/td-utils/test/examples/httpAndMqtt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "urn:simple",
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"title": "MyLampThing",
"description": "Valid TD copied from the spec's first example",
"securityDefinitions": {
"basic_sc": { "scheme": "basic", "in": "header" }
},
"security": ["basic_sc"],
"properties": {
"status": {
"type": "string",
"forms": [{ "href": "http://mylamp.example.com:1234/status" }]
}
},
"actions": {
"toggle": {
"forms": [{ "href": "mqtt://mylamp.example.com:1234/toggle" }]
}
},
"protocolSchemes": [
{
"protocol": "http",
"hostname": "mylamp.example.com",
"port": 1234
},
{
"protocol": "mqtt",
"hostname": "mylamp.example.com",
"port": 1234
}
]
egekorkan marked this conversation as resolved.
Show resolved Hide resolved
}
14 changes: 14 additions & 0 deletions node/td-utils/test/examples/noProtocol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "urn:simple",
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"title": "MyLampThing",
"description": "Valid TD copied from the spec's first example",
"securityDefinitions": {
"basic_sc": { "scheme": "basic", "in": "header" }
},
"security": ["basic_sc"],
"properties": {},
"actions": {},
"events": {},
"protocolSchemes": []
}
44 changes: 44 additions & 0 deletions node/td-utils/test/examples/onlyHttp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"id": "urn:simple",
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"title": "MyLampThing",
"description": "Valid TD copied from the spec's first example",
"securityDefinitions": {
"basic_sc": { "scheme": "basic", "in": "header" }
},
"security": ["basic_sc"],
"properties": {
"status": {
"type": "string",
"forms": [{ "href": "http://mylamp.example.com:4212/status" }]
}
},
"actions": {
"toggle": {
"forms": [{ "href": "http://mylamp.example.com:4212/toggle" }]
}
},
"events": {
"overheating": {
"data": { "type": "string" },
"forms": [
{
"href": "http://mylamp.example.com:4214/oh",
"subprotocol": "longpoll"
}
]
}
},
"protocolSchemes": [
{
"protocol": "http",
"hostname": "mylamp.example.com",
"port": 4212
},
{
"protocol": "http",
"hostname": "mylamp.example.com",
"port": 4214
}
]
}
38 changes: 38 additions & 0 deletions node/td-utils/test/examples/onlyMqtt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"id": "urn:simple",
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"title": "MyLampThing",
"description": "Valid TD copied from the spec's first example",
"securityDefinitions": {
"basic_sc": { "scheme": "basic", "in": "header" }
},
"security": ["basic_sc"],
"properties": {
"status": {
"type": "string",
"forms": [{ "href": "mqtt://mylamp.example.com/status" }]
}
},
"actions": {
"toggle": {
"forms": [{ "href": "mqtt://mylamp.example.com/toggle" }]
}
},
"events": {
"overheating": {
"data": { "type": "string" },
"forms": [
{
"href": "mqtt://mylamp.example.com/oh",
"subprotocol": "longpoll"
egekorkan marked this conversation as resolved.
Show resolved Hide resolved
}
]
}
},
"protocolSchemes": [
{
"protocol": "mqtt",
"hostname": "mylamp.example.com"
}
]
}
32 changes: 32 additions & 0 deletions node/td-utils/test/examples/secureProtocols.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"id": "urn:simple",
"@context": "https://www.w3.org/2022/wot/td/v1.1",
"title": "MyLampThing",
"description": "Valid TD copied from the spec's first example",
"securityDefinitions": {
"basic_sc": { "scheme": "basic", "in": "header" }
},
"security": ["basic_sc"],
"base": "mqtts://mylamp.example.com/status",
"events": {
"overheating": {
"data": { "type": "string" },
"forms": [
{
"href": "https://mylamp.example.com/oh",
"subprotocol": "longpoll"
}
]
}
},
"protocolSchemes": [
{
"protocol": "https",
"hostname": "mylamp.example.com"
},
{
"protocol": "mqtts",
"hostname": "mylamp.example.com"
}
]
}
178 changes: 0 additions & 178 deletions node/td-utils/test/protocol-detection-examples.ts
egekorkan marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

Loading
Loading