Mercurial > code > home > repos > light9
diff web/collector/CollectorClient.ts @ 2422:62dc1b3644a0
collector client uses rdf types, not strings
author | drewp@bigasterisk.com |
---|---|
date | Tue, 21 May 2024 16:11:28 -0700 |
parents | ae4b90efb55a |
children |
line wrap: on
line diff
--- a/web/collector/CollectorClient.ts Tue May 21 16:10:39 2024 -0700 +++ b/web/collector/CollectorClient.ts Tue May 21 16:11:28 2024 -0700 @@ -1,4 +1,6 @@ -type Settings = Array<[string,string,string|number]>; +import { Literal, NamedNode } from "n3"; + +type Settings = Array<[NamedNode,NamedNode,Literal]>; export class CollectorClient { private settings: Settings; @@ -13,13 +15,14 @@ }, 1000); } private async put() { + // todo: WS await fetch("/service/collector/attrs", { method: "PUT", body: JSON.stringify({ client: this.clientName, clientSession: "unused", sendTime: Date.now() / 1000, - settings: this.settings, + settings: this.settings.map(([d,da,v]) => [d.value,da.value,v.value]) }), }); }