@owvision/station-interface-ts 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,39 @@
1
1
  import { GetSensorStateRequest, GetStationDefinitionRequest, SensorState, StationDefinition } from "./generated/recorder.js";
2
2
  export * from "./generated/recorder.js";
3
+ export declare enum UnitId {
4
+ humidity_percent = "hum_percent",
5
+ length_m = "m",
6
+ length_cm = "cm",
7
+ length_ft = "ft",
8
+ length_in = "in",
9
+ precipation_rate_mmph = "mmph",
10
+ precipation_rate_inph = "inph",
11
+ precipation_mm = "mm",
12
+ precipation_lpm2 = "lpm2",
13
+ precipation_inch = "inch",
14
+ pressure_hpa = "hpa",
15
+ pressure_inhg = "inhg",
16
+ temperature_celsius = "celsius",
17
+ temperature_kelvin = "kelvin",
18
+ temperature_fahrenheit = "fahrenheit",
19
+ winddir_degrees = "degrees",
20
+ winddir_radians = "radians",
21
+ windspeed_kmh = "kmh",
22
+ windspeed_ms = "ms",
23
+ windspeed_bft = "bft",
24
+ windspeed_mph = "mph",
25
+ windspeed_kn = "kn"
26
+ }
27
+ export declare enum SensorElement {
28
+ precipationAccumulated = "precipationAccumulated",
29
+ precipationRate = "precipationRate",
30
+ snowHeight = "snowHeight",
31
+ pressure = "pressure",
32
+ temperature = "temperature",
33
+ windSpeed = "windSpeed",
34
+ windDirection = "windDirection",
35
+ humidity = "humidity"
36
+ }
3
37
  interface StationInterface {
4
38
  /** Should read a value from the passed sensor. */
5
39
  getSensorState(request: GetSensorStateRequest): Promise<SensorState>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,EACrB,2BAA2B,EAC3B,WAAW,EACX,iBAAiB,EAGpB,MAAM,yBAAyB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AAExC,UAAU,gBAAgB;IACtB,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AAoB,CAChB,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACjC;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAC1B,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,SAAQ,iBAgCf"}
package/dist/index.js CHANGED
@@ -1,6 +1,42 @@
1
1
  import * as grpc from "@grpc/grpc-js";
2
2
  import { GetSensorStateRequest, GetStationDefinitionRequest, SensorState, StationDefinition, StationInterfaceService, } from "./generated/recorder.js";
3
3
  export * from "./generated/recorder.js";
4
+ export var UnitId;
5
+ (function (UnitId) {
6
+ UnitId["humidity_percent"] = "hum_percent";
7
+ UnitId["length_m"] = "m";
8
+ UnitId["length_cm"] = "cm";
9
+ UnitId["length_ft"] = "ft";
10
+ UnitId["length_in"] = "in";
11
+ UnitId["precipation_rate_mmph"] = "mmph";
12
+ UnitId["precipation_rate_inph"] = "inph";
13
+ UnitId["precipation_mm"] = "mm";
14
+ UnitId["precipation_lpm2"] = "lpm2";
15
+ UnitId["precipation_inch"] = "inch";
16
+ UnitId["pressure_hpa"] = "hpa";
17
+ UnitId["pressure_inhg"] = "inhg";
18
+ UnitId["temperature_celsius"] = "celsius";
19
+ UnitId["temperature_kelvin"] = "kelvin";
20
+ UnitId["temperature_fahrenheit"] = "fahrenheit";
21
+ UnitId["winddir_degrees"] = "degrees";
22
+ UnitId["winddir_radians"] = "radians";
23
+ UnitId["windspeed_kmh"] = "kmh";
24
+ UnitId["windspeed_ms"] = "ms";
25
+ UnitId["windspeed_bft"] = "bft";
26
+ UnitId["windspeed_mph"] = "mph";
27
+ UnitId["windspeed_kn"] = "kn";
28
+ })(UnitId || (UnitId = {}));
29
+ export var SensorElement;
30
+ (function (SensorElement) {
31
+ SensorElement["precipationAccumulated"] = "precipationAccumulated";
32
+ SensorElement["precipationRate"] = "precipationRate";
33
+ SensorElement["snowHeight"] = "snowHeight";
34
+ SensorElement["pressure"] = "pressure";
35
+ SensorElement["temperature"] = "temperature";
36
+ SensorElement["windSpeed"] = "windSpeed";
37
+ SensorElement["windDirection"] = "windDirection";
38
+ SensorElement["humidity"] = "humidity";
39
+ })(SensorElement || (SensorElement = {}));
4
40
  /** Starts the station interface (by default on grpc port `50051`). */
5
41
  export function startInterface(stationInterface, port = 50051) {
6
42
  const server = new grpc.Server();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EACH,qBAAqB,EACrB,2BAA2B,EAC3B,WAAW,EACX,iBAAiB,EACjB,uBAAuB,GAE1B,MAAM,yBAAyB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AAYxC,sEAAsE;AACtE,MAAM,UAAU,cAAc,CAC1B,gBAAkC,EAClC,IAAI,GAAG,KAAK;IAEZ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;IAEjC,MAAM,WAAW,GAA2B;QACxC,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ;YAC/B,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,cAAc,CACrD,IAAI,CAAC,OAAO,CACf,CAAC;YACF,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,oBAAoB,CAAC,IAAI,EAAE,QAAQ;YACrC,MAAM,iBAAiB,GACnB,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9D,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QACtC,CAAC;KACJ,CAAC;IAEF,MAAM,CAAC,UAAU,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC;IAExD,OAAO,IAAI,OAAO,CAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAClC,MAAM,CAAC,SAAS,CACZ,aAAa,IAAI,EAAE,EACn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B,CAAA;AACzB,CAAC,EATW,aAAa,KAAb,aAAa,QASxB;AAYD,sEAAsE;AACtE,MAAM,UAAU,cAAc,CAC1B,gBAAkC,EAClC,IAAI,GAAG,KAAK;IAEZ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;IAEjC,MAAM,WAAW,GAA2B;QACxC,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ;YAC/B,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,cAAc,CACrD,IAAI,CAAC,OAAO,CACf,CAAC;YACF,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,oBAAoB,CAAC,IAAI,EAAE,QAAQ;YACrC,MAAM,iBAAiB,GACnB,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9D,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QACtC,CAAC;KACJ,CAAC;IAEF,MAAM,CAAC,UAAU,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC;IAExD,OAAO,IAAI,OAAO,CAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAClC,MAAM,CAAC,SAAS,CACZ,aAAa,IAAI,EAAE,EACnB,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,EACvC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACZ,IAAI,KAAK,EAAE,CAAC;gBACR,GAAG,CAAC,KAAK,CAAC,CAAC;YACf,CAAC;YACD,GAAG,EAAE,CAAC;QACV,CAAC,CACJ,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@owvision/station-interface-ts",
3
- "version": "0.0.1",
4
- "description": "gRPC client to communicate with the owvision local recorder.",
3
+ "version": "0.0.2",
4
+ "description": "Support package thats helps you to write a station interface that gets automatically detected by the owvision recorder.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "update": "protoc --plugin=protoc-gen-ts_proto=\"node_modules\\.bin\\protoc-gen-ts_proto.cmd\" --ts_proto_out=\"src\\generated\" --ts_proto_opt=outputServices=grpc-js,esModuleInterop=true -I \"..\\..\\..\\shared\\protos\" \"..\\..\\..\\shared\\protos\\recorder.proto\" && tsc",
9
- "build": "tsc",
10
- "publish": ""
9
+ "build": "tsc"
11
10
  },
12
11
  "keywords": [
13
12
  "grpc",
@@ -25,6 +24,7 @@
25
24
  "typescript": "^5.9.3"
26
25
  },
27
26
  "dependencies": {
27
+ "@bufbuild/protobuf": "^2.10.2",
28
28
  "@grpc/grpc-js": "^1.14.3"
29
29
  },
30
30
  "publishConfig": {
package/src/index.ts CHANGED
@@ -9,6 +9,42 @@ import {
9
9
  } from "./generated/recorder.js";
10
10
  export * from "./generated/recorder.js";
11
11
 
12
+ export enum UnitId {
13
+ humidity_percent = "hum_percent",
14
+ length_m = "m",
15
+ length_cm = "cm",
16
+ length_ft = "ft",
17
+ length_in = "in",
18
+ precipation_rate_mmph = "mmph",
19
+ precipation_rate_inph = "inph",
20
+ precipation_mm = "mm",
21
+ precipation_lpm2 = "lpm2",
22
+ precipation_inch = "inch",
23
+ pressure_hpa = "hpa",
24
+ pressure_inhg = "inhg",
25
+ temperature_celsius = "celsius",
26
+ temperature_kelvin = "kelvin",
27
+ temperature_fahrenheit = "fahrenheit",
28
+ winddir_degrees = "degrees",
29
+ winddir_radians = "radians",
30
+ windspeed_kmh = "kmh",
31
+ windspeed_ms = "ms",
32
+ windspeed_bft = "bft",
33
+ windspeed_mph = "mph",
34
+ windspeed_kn = "kn",
35
+ }
36
+
37
+ export enum SensorElement {
38
+ precipationAccumulated = "precipationAccumulated",
39
+ precipationRate = "precipationRate",
40
+ snowHeight = "snowHeight",
41
+ pressure = "pressure",
42
+ temperature = "temperature",
43
+ windSpeed = "windSpeed",
44
+ windDirection = "windDirection",
45
+ humidity = "humidity",
46
+ }
47
+
12
48
  interface StationInterface {
13
49
  /** Should read a value from the passed sensor. */
14
50
  getSensorState(request: GetSensorStateRequest): Promise<SensorState>;