@azohra/meteo.station 0.1.1 → 0.1.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.
Files changed (44) hide show
  1. package/dist/client/index.d.ts +2 -1
  2. package/dist/client/index.js +2 -1
  3. package/dist/client/live.d.ts +37 -0
  4. package/dist/client/live.js +241 -0
  5. package/dist/client/stores.d.ts +1 -0
  6. package/dist/client/stores.js +41 -6
  7. package/dist/contract.d.ts +237 -1
  8. package/dist/contract.js +57 -3
  9. package/dist/endpoints.d.ts +2 -1
  10. package/dist/endpoints.js +4 -1
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +3 -3
  13. package/dist/react/hooks/useStation.d.ts +1 -0
  14. package/dist/react/hooks/useStation.js +25 -5
  15. package/dist/react/hooks/useStationLive.d.ts +20 -0
  16. package/dist/react/hooks/useStationLive.js +33 -0
  17. package/dist/react/index.d.ts +2 -1
  18. package/dist/react/index.js +2 -1
  19. package/dist/server/adapter.d.ts +3 -1
  20. package/dist/server/adapter.js +3 -1
  21. package/dist/server/adapters/windnerd-live.d.ts +21 -0
  22. package/dist/server/adapters/windnerd-live.js +179 -0
  23. package/dist/server/adapters/windnerd.d.ts +36 -5
  24. package/dist/server/adapters/windnerd.js +177 -15
  25. package/dist/server/config.d.ts +2 -0
  26. package/dist/server/config.js +2 -1
  27. package/dist/server/environment.d.ts +25 -5
  28. package/dist/server/environment.js +65 -21
  29. package/dist/server/feed.d.ts +20 -2
  30. package/dist/server/feed.js +28 -1
  31. package/dist/server/handler.d.ts +1 -1
  32. package/dist/server/handler.js +37 -3
  33. package/dist/server/index.d.ts +6 -4
  34. package/dist/server/index.js +6 -4
  35. package/dist/server/live.d.ts +15 -0
  36. package/dist/server/live.js +19 -0
  37. package/dist/sse.js +56 -0
  38. package/package.json +1 -1
  39. package/schema/README.md +1 -1
  40. package/schema/example-feed.json +26 -1
  41. package/schema/example-live.json +74 -0
  42. package/schema/stationcurrent.schema.json +115 -0
  43. package/schema/stationfeed.schema.json +115 -0
  44. package/schema/stationlive.schema.json +868 -0
@@ -128,6 +128,26 @@
128
128
  "type": "null"
129
129
  }
130
130
  ]
131
+ },
132
+ "telemetry": {
133
+ "anyOf": [
134
+ {
135
+ "$ref": "#/$defs/StationTelemetry"
136
+ },
137
+ {
138
+ "type": "null"
139
+ }
140
+ ]
141
+ },
142
+ "samples": {
143
+ "anyOf": [
144
+ {
145
+ "$ref": "#/$defs/LiveSamples"
146
+ },
147
+ {
148
+ "type": "null"
149
+ }
150
+ ]
131
151
  }
132
152
  },
133
153
  "required": [
@@ -289,6 +309,28 @@
289
309
  },
290
310
  "history": {
291
311
  "type": "boolean"
312
+ },
313
+ "live": {
314
+ "description": "The station has a live sample stream; absent or null reads as false.",
315
+ "anyOf": [
316
+ {
317
+ "type": "boolean"
318
+ },
319
+ {
320
+ "type": "null"
321
+ }
322
+ ]
323
+ },
324
+ "battery": {
325
+ "description": "The station reports battery telemetry; absent or null reads as false.",
326
+ "anyOf": [
327
+ {
328
+ "type": "boolean"
329
+ },
330
+ {
331
+ "type": "null"
332
+ }
333
+ ]
292
334
  }
293
335
  },
294
336
  "required": [
@@ -636,6 +678,79 @@
636
678
  "windDirectionDeg",
637
679
  "temperatureC"
638
680
  ]
681
+ },
682
+ "StationTelemetry": {
683
+ "type": "object",
684
+ "properties": {
685
+ "batteryVoltage": {
686
+ "anyOf": [
687
+ {
688
+ "type": "number"
689
+ },
690
+ {
691
+ "type": "null"
692
+ }
693
+ ],
694
+ "description": "Station supply volts. null means 'not reported here', never a dead battery."
695
+ }
696
+ },
697
+ "required": [
698
+ "batteryVoltage"
699
+ ],
700
+ "description": "Device telemetry. The station-level battery capability gates whether a client allocates UI structure; a dark sensor keeps its structure and reports null."
701
+ },
702
+ "LiveSamples": {
703
+ "type": "object",
704
+ "properties": {
705
+ "intervalSeconds": {
706
+ "type": "number",
707
+ "exclusiveMinimum": 0,
708
+ "description": "Seconds between samples."
709
+ },
710
+ "points": {
711
+ "type": "array",
712
+ "items": {
713
+ "$ref": "#/$defs/LiveSample"
714
+ },
715
+ "description": "Oldest first. A dropout is an ABSENT sample, never a zeroed one."
716
+ }
717
+ },
718
+ "required": [
719
+ "intervalSeconds",
720
+ "points"
721
+ ]
722
+ },
723
+ "LiveSample": {
724
+ "type": "object",
725
+ "properties": {
726
+ "observedAt": {
727
+ "type": "string",
728
+ "format": "date-time"
729
+ },
730
+ "windMps": {
731
+ "type": "number",
732
+ "minimum": 0,
733
+ "description": "Instantaneous m/s — a single anemometer sample, not a period mean."
734
+ },
735
+ "windDirectionDeg": {
736
+ "anyOf": [
737
+ {
738
+ "type": "number",
739
+ "minimum": 0,
740
+ "exclusiveMaximum": 360
741
+ },
742
+ {
743
+ "type": "null"
744
+ }
745
+ ],
746
+ "description": "Degrees FROM; null exactly when calm (below 0.5 m/s)."
747
+ }
748
+ },
749
+ "required": [
750
+ "observedAt",
751
+ "windMps",
752
+ "windDirectionDeg"
753
+ ]
639
754
  }
640
755
  }
641
756
  }
@@ -143,6 +143,26 @@
143
143
  "type": "null"
144
144
  }
145
145
  ]
146
+ },
147
+ "telemetry": {
148
+ "anyOf": [
149
+ {
150
+ "$ref": "#/$defs/StationTelemetry"
151
+ },
152
+ {
153
+ "type": "null"
154
+ }
155
+ ]
156
+ },
157
+ "samples": {
158
+ "anyOf": [
159
+ {
160
+ "$ref": "#/$defs/LiveSamples"
161
+ },
162
+ {
163
+ "type": "null"
164
+ }
165
+ ]
146
166
  }
147
167
  },
148
168
  "required": [
@@ -304,6 +324,28 @@
304
324
  },
305
325
  "history": {
306
326
  "type": "boolean"
327
+ },
328
+ "live": {
329
+ "description": "The station has a live sample stream; absent or null reads as false.",
330
+ "anyOf": [
331
+ {
332
+ "type": "boolean"
333
+ },
334
+ {
335
+ "type": "null"
336
+ }
337
+ ]
338
+ },
339
+ "battery": {
340
+ "description": "The station reports battery telemetry; absent or null reads as false.",
341
+ "anyOf": [
342
+ {
343
+ "type": "boolean"
344
+ },
345
+ {
346
+ "type": "null"
347
+ }
348
+ ]
307
349
  }
308
350
  },
309
351
  "required": [
@@ -651,6 +693,79 @@
651
693
  "windDirectionDeg",
652
694
  "temperatureC"
653
695
  ]
696
+ },
697
+ "StationTelemetry": {
698
+ "type": "object",
699
+ "properties": {
700
+ "batteryVoltage": {
701
+ "anyOf": [
702
+ {
703
+ "type": "number"
704
+ },
705
+ {
706
+ "type": "null"
707
+ }
708
+ ],
709
+ "description": "Station supply volts. null means 'not reported here', never a dead battery."
710
+ }
711
+ },
712
+ "required": [
713
+ "batteryVoltage"
714
+ ],
715
+ "description": "Device telemetry. The station-level battery capability gates whether a client allocates UI structure; a dark sensor keeps its structure and reports null."
716
+ },
717
+ "LiveSamples": {
718
+ "type": "object",
719
+ "properties": {
720
+ "intervalSeconds": {
721
+ "type": "number",
722
+ "exclusiveMinimum": 0,
723
+ "description": "Seconds between samples."
724
+ },
725
+ "points": {
726
+ "type": "array",
727
+ "items": {
728
+ "$ref": "#/$defs/LiveSample"
729
+ },
730
+ "description": "Oldest first. A dropout is an ABSENT sample, never a zeroed one."
731
+ }
732
+ },
733
+ "required": [
734
+ "intervalSeconds",
735
+ "points"
736
+ ]
737
+ },
738
+ "LiveSample": {
739
+ "type": "object",
740
+ "properties": {
741
+ "observedAt": {
742
+ "type": "string",
743
+ "format": "date-time"
744
+ },
745
+ "windMps": {
746
+ "type": "number",
747
+ "minimum": 0,
748
+ "description": "Instantaneous m/s — a single anemometer sample, not a period mean."
749
+ },
750
+ "windDirectionDeg": {
751
+ "anyOf": [
752
+ {
753
+ "type": "number",
754
+ "minimum": 0,
755
+ "exclusiveMaximum": 360
756
+ },
757
+ {
758
+ "type": "null"
759
+ }
760
+ ],
761
+ "description": "Degrees FROM; null exactly when calm (below 0.5 m/s)."
762
+ }
763
+ },
764
+ "required": [
765
+ "observedAt",
766
+ "windMps",
767
+ "windDirectionDeg"
768
+ ]
654
769
  }
655
770
  }
656
771
  }