diff --git a/node/code-gen/README.md b/node/code-gen/README.md index 736dfbf..750b0e6 100644 --- a/node/code-gen/README.md +++ b/node/code-gen/README.md @@ -9,6 +9,21 @@ Generates code snippets for interacting with [Thing Descriptions (TD)](https://w ```js import { generateCode, isProtocolSupported } from "@thingweb/code-gen"; +const td = { + "@context": "https://www.w3.org/2022/wot/td/v1.1", + title: "MyTemperatureThing", + securityDefinitions: { + basic_sc: { scheme: "basic", in: "header" }, + }, + security: "basic_sc", + properties: { + status: { + type: "integer", + forms: [{ href: "https://mytemp.example.com/temperature" }], + }, + }, +}; + const result = generateCode({ td, affordanceType: "properties",