Skip to content

Commit a494687

Browse files
authored
Merge pull request #1165 from danielpeintner/npm-versions-2023-11
chore: update Scripting API and TD/TM NPM versions
2 parents 49546bc + 9a55bd2 commit a494687

8 files changed

Lines changed: 34 additions & 70 deletions

File tree

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@
7777
"tslint": "5.12.1",
7878
"typescript": "4.7.4",
7979
"typescript-standard": "^0.3.36",
80-
"wot-typescript-definitions": "0.8.0-SNAPSHOT.27"
80+
"wot-typescript-definitions": "0.8.0-SNAPSHOT.29"
8181
}
8282
}

packages/binding-coap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"node-coap-client": "1.0.8",
2323
"rxjs": "5.5.11",
2424
"slugify": "^1.4.5",
25-
"wot-typescript-definitions": "0.8.0-SNAPSHOT.27"
25+
"wot-typescript-definitions": "0.8.0-SNAPSHOT.29"
2626
},
2727
"scripts": {
2828
"build": "tsc -b",

packages/binding-mbus/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@node-wot/core": "0.8.11",
1818
"@node-wot/td-tools": "0.8.11",
1919
"node-mbus": "^2.1.0",
20-
"wot-typescript-definitions": "0.8.0-SNAPSHOT.27"
20+
"wot-typescript-definitions": "0.8.0-SNAPSHOT.29"
2121
},
2222
"scripts": {
2323
"build": "tsc -b",

packages/binding-modbus/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@node-wot/td-tools": "0.8.11",
2222
"modbus-serial": "8.0.3",
2323
"rxjs": "5.5.11",
24-
"wot-typescript-definitions": "0.8.0-SNAPSHOT.27"
24+
"wot-typescript-definitions": "0.8.0-SNAPSHOT.29"
2525
},
2626
"scripts": {
2727
"build": "tsc -b",

packages/core/src/wot-impl.ts

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,24 @@ import { createLoggers } from "./logger";
2323

2424
const { debug } = createLoggers("core", "wot-impl");
2525

26-
export class ThingDiscoveryImpl implements WoT.ThingDiscovery {
27-
filter?: WoT.ThingFilter;
28-
active: boolean;
29-
done: boolean;
30-
error?: Error;
31-
constructor(filter?: WoT.ThingFilter) {
32-
this.filter = filter;
33-
this.active = false;
34-
this.done = false;
35-
this.error = new Error("not implemented");
36-
}
37-
38-
start(): void {
39-
this.active = true;
40-
}
41-
42-
next(): Promise<WoT.ThingDescription> {
43-
return new Promise<WoT.ThingDescription>((resolve, reject) => {
44-
reject(this.error); // not implemented
45-
});
46-
}
47-
48-
stop(): void {
49-
this.active = false;
50-
this.done = false;
51-
}
52-
}
53-
/**
54-
* wot-type-definitions does not contain a implementation of Discovery method enums
55-
* so we need to create them here. Sadly, we should keep this enum in sync with
56-
* WoT.DiscoveryMethod
57-
*/
58-
export enum DiscoveryMethod {
59-
/** does not provide any restriction */
60-
"any",
61-
/** for discovering Things defined in the same device */
62-
"local",
63-
/** for discovery based on a service provided by a directory or repository of Things */
64-
"directory",
65-
/** for discovering Things in the device's network by using a supported multicast protocol */
66-
"multicast",
67-
}
6826
export default class WoTImpl {
6927
private srv: Servient;
70-
DiscoveryMethod: typeof WoT.DiscoveryMethod;
7128
constructor(srv: Servient) {
7229
this.srv = srv;
73-
// force casting cause tsc does not allow to use DiscoveryMethod as WoT.DiscoveryMethod even if they are the same
74-
this.DiscoveryMethod = DiscoveryMethod as unknown as typeof WoT.DiscoveryMethod;
7530
}
7631

7732
/** @inheritDoc */
78-
discover(filter?: WoT.ThingFilter): WoT.ThingDiscovery {
79-
return new ThingDiscoveryImpl(filter);
33+
async discover(filter?: WoT.ThingFilter): Promise<WoT.ThingDiscoveryProcess> {
34+
throw new Error("not implemented");
35+
}
36+
37+
/** @inheritDoc */
38+
async exploreDirectory(url: string, filter?: WoT.ThingFilter): Promise<WoT.ThingDiscoveryProcess> {
39+
throw new Error("not implemented");
40+
}
41+
42+
async requestThingDescription(url: string): Promise<WoT.ThingDescription> {
43+
throw new Error("not implemented");
8044
}
8145

8246
/** @inheritDoc */

packages/examples/src/security/oauth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
"ts-node": "10.1.0",
2020
"typescript": "4.7.4",
2121
"typescript-standard": "^0.3.36",
22-
"wot-typescript-definitions": "0.8.0-SNAPSHOT.27"
22+
"wot-typescript-definitions": "0.8.0-SNAPSHOT.29"
2323
}
2424
}

packages/td-tools/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"is-absolute-url": "3.0.3",
2121
"json-placeholder-replacer": "^1.0.35",
2222
"url-toolkit": "2.1.6",
23-
"wot-thing-model-types": "1.1.0-05-July-2023",
24-
"wot-typescript-definitions": "0.8.0-SNAPSHOT.27"
23+
"wot-thing-model-types": "1.1.0-09-November-2023",
24+
"wot-typescript-definitions": "0.8.0-SNAPSHOT.29"
2525
},
2626
"scripts": {
2727
"build": "tsc -b && webpack",

0 commit comments

Comments
 (0)