@atmosx/event-product-parser 3.0.55 → 3.0.62

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 (156) hide show
  1. package/.github/CODE_OF_CONDUCT.md +9 -9
  2. package/.github/CONTRIBUTING.md +29 -29
  3. package/.github/LICENSE +17 -17
  4. package/.github/SECURITY.md +20 -20
  5. package/.github/SUPPORTED_EVENTS.md +369 -369
  6. package/.github/docs/docs-functions.md +30 -0
  7. package/.github/docs/docs-general-configurations.md +209 -0
  8. package/.github/docs/docs-integrations.md +37 -0
  9. package/.github/docs/docs-listeners.md +28 -0
  10. package/.github/docs/docs-source-configuration.md +218 -0
  11. package/.github/docs/docs-technical.md +50 -0
  12. package/.github/logo.png +0 -0
  13. package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
  14. package/.github/samples/SAMPLE_GEOJSON.json +204 -0
  15. package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
  16. package/.vscode/settings.json +3 -3
  17. package/README.md +167 -0
  18. package/dist/cjs/index.cjs +1439 -1277
  19. package/dist/esm/index.mjs +1420 -1258
  20. package/package.json +47 -52
  21. package/src/@building/{building.create.ts → CreateEvent.ts} +55 -55
  22. package/src/@building/{building.clean.ts → GetCleanedEvent.ts} +29 -29
  23. package/src/@building/{building.attachments.ts → GetEventAttachments.ts} +85 -82
  24. package/src/@building/{building.enhance.ts → GetEventEnhancedName.ts} +54 -59
  25. package/src/@building/{building.geometry.ts → GetEventGeometry.ts} +47 -47
  26. package/src/@building/{building.headers.ts → GetEventHeader.ts} +36 -36
  27. package/src/@building/{building.polygon.ts → GetEventNodes.ts} +72 -69
  28. package/src/@building/{building.office.ts → GetEventOffice.ts} +42 -42
  29. package/src/@building/{building.properties.ts → GetEventProperties.ts} +95 -95
  30. package/src/@building/{building.signature.ts → GetEventSignature.ts} +60 -60
  31. package/src/@building/{building.tags.ts → GetEventTags.ts} +29 -24
  32. package/src/@building/{building.tracking.ts → GetEventTracking.ts} +67 -67
  33. package/src/@core/{core.clearEvents.ts → ClearEvents.ts} +30 -30
  34. package/src/@core/{core.createListener.ts → CreateListener.ts} +23 -23
  35. package/src/@core/{core.getEvents.ts → GetEvents.ts} +23 -23
  36. package/src/@core/{core.getNodes.ts → GetNodes.ts} +23 -23
  37. package/src/@core/{core.getRandomEvent.ts → GetRandomEvent.ts} +23 -23
  38. package/src/@core/{core.getVersion.ts → GetVersion.ts} +23 -23
  39. package/src/@core/{core.manualEvent.ts → ManualEvent.ts} +56 -38
  40. package/src/@core/{core.query.ts → QueryStanza.ts} +38 -38
  41. package/src/@core/{core.setNode.ts → SetNode.ts} +80 -80
  42. package/src/@core/{core.start.ts → StartService.ts} +60 -60
  43. package/src/@core/{core.stop.ts → StopService.ts} +31 -31
  44. package/src/@enums/AWIPS.ts +366 -0
  45. package/src/{@dictionaries/dictionaries.actions.ts → @enums/Actions.ts} +27 -27
  46. package/src/{@dictionaries/dictionaries.cancellation.ts → @enums/Cancellation.ts} +30 -30
  47. package/src/{@dictionaries/dictionaries.causes.ts → @enums/Causes.ts} +35 -35
  48. package/src/{@dictionaries/dictionaries.correlations.ts → @enums/Correlations.ts} +42 -42
  49. package/src/{@dictionaries/dictionaries.enhanced.ts → @enums/Enhanced.ts} +69 -69
  50. package/src/{@dictionaries/dictionaries.events.ts → @enums/Events.ts} +82 -82
  51. package/src/{@dictionaries/dictionaries.expressions.ts → @enums/Expressions.ts} +28 -28
  52. package/src/@enums/GlobalFilter.ts +24 -0
  53. package/src/{@dictionaries/dictionaries.hail.ts → @enums/Hail.ts} +37 -35
  54. package/src/{@dictionaries/dictionaries.icao.ts → @enums/ICAO.ts} +258 -258
  55. package/src/{@dictionaries/dictionaries.matches.ts → @enums/Matches.ts} +54 -54
  56. package/src/{@dictionaries/dictionaries.products.ts → @enums/Products.ts} +24 -24
  57. package/src/{@dictionaries/dictionaries.records.ts → @enums/Records.ts} +25 -25
  58. package/src/{@dictionaries/dictionaries.severity.ts → @enums/Severity.ts} +27 -27
  59. package/src/{@dictionaries/dictionaries.shapefiles.ts → @enums/Shapefiles.ts} +35 -35
  60. package/src/{@dictionaries/dictionaries.states.ts → @enums/States.ts} +71 -71
  61. package/src/{@dictionaries/dictionaries.status.ts → @enums/Status.ts} +30 -30
  62. package/src/{@dictionaries/dictionaries.global.ts → @enums/Strings.ts} +22 -24
  63. package/src/@enums/Tags.ts +167 -0
  64. package/src/{@dictionaries/dictionaries.testing.ts → @enums/Testing.ts} +24 -24
  65. package/src/@events/{events.api.ts → ParseAPI.ts} +116 -116
  66. package/src/@events/{events.text.ts → ParseText.ts} +87 -84
  67. package/src/@events/{events.ugc.ts → ParseUGC.ts} +93 -89
  68. package/src/@events/{events.vtec.ts → ParseVTEC.ts} +86 -86
  69. package/src/@manager/MakeEvents.ts +106 -0
  70. package/src/@manager/{manager.rmEvent.ts → RemoveEvent.ts} +69 -71
  71. package/src/@manager/{manager.setHash.ts → SetHash.ts} +35 -35
  72. package/src/@manager/Tasks.ts +246 -0
  73. package/src/@manager/{manager.updateEvents.ts → UpdateEvents.ts} +34 -34
  74. package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +61 -53
  75. package/src/{@building/building.validate.ts → @manager/ValidateEvents.ts} +141 -154
  76. package/src/@modules/@database/{database.cache.ts → GetCachedEvents.ts} +49 -49
  77. package/src/@modules/@database/{database.broadcastify.ts → ImportBroadcastify.ts} +69 -66
  78. package/src/@modules/@database/{database.shapefiles.ts → ImportShapefiles.ts} +92 -92
  79. package/src/@modules/@database/{database.stanza.ts → ImportStanza.ts} +46 -46
  80. package/src/@modules/@database/{database.init.ts → InitializeDatabase.ts} +58 -58
  81. package/src/@modules/@eas/{eas.setEasTone.ts → GenerateEASMessage.ts} +144 -151
  82. package/src/@modules/@eas/{eas.getCleanDescription.ts → GetCleanDescription.ts} +91 -91
  83. package/src/@modules/@eas/{eas.getFloatPCM16.ts → GetFloatPCM16.ts} +29 -29
  84. package/src/@modules/@eas/{eas.getMergedPCM16.ts → GetMergedPCM16.ts} +32 -32
  85. package/src/@modules/@eas/{eas.getPCM16.ts → GetPCM16.ts} +52 -52
  86. package/src/@modules/@eas/{eas.getPCMToFloat.ts → GetPCMToFloat.ts} +26 -26
  87. package/src/@modules/@eas/{eas.getSampledPCM16.ts → GetSampledPCM16.ts} +36 -36
  88. package/src/@modules/@eas/{eas.getTTS.ts → GetTTS.ts} +54 -54
  89. package/src/@modules/@eas/{eas.getWavPCM16.ts → GetWavPCM16.ts} +52 -52
  90. package/src/@modules/@eas/{eas.setAFSK.ts → SetAFSK.ts} +51 -51
  91. package/src/@modules/@eas/{eas.setAsciiToBits.ts → SetAsciiToBits.ts} +31 -31
  92. package/src/@modules/@eas/{eas.setAttentionTone.ts → SetAttentionTone.ts} +40 -40
  93. package/src/@modules/@eas/{eas.setNoise.ts → SetNoise.ts} +32 -32
  94. package/src/@modules/@eas/{eas.setRadioEffect.ts → SetRadioEffect.ts} +50 -50
  95. package/src/@modules/@eas/{eas.setSameHeader.ts → SetSameHeader.ts} +44 -44
  96. package/src/@modules/@stanza/{stanza.getAwipsType.ts → GetAwipsType.ts} +47 -45
  97. package/src/@modules/@stanza/{stanza.validate.ts → ValidateStanza.ts} +49 -49
  98. package/src/@modules/@utilities/{utilities.createHttp.ts → CreateHttp.ts} +83 -83
  99. package/src/@modules/@utilities/{utilities.getFormattedTime.ts → GetFormattedTime.ts} +43 -43
  100. package/src/@modules/@utilities/{utilities.getLatestIssuance.ts → GetLatestIssuance.ts} +32 -32
  101. package/src/@modules/@utilities/{utilities.getMatched.ts → GetMatched.ts} +33 -33
  102. package/src/@modules/@utilities/{utilities.getSettings.ts → GetSettings.ts} +25 -25
  103. package/src/@modules/@utilities/{utilities.getShapeNearestPoint.ts → GetShapeNearestPoint.ts} +114 -114
  104. package/src/@modules/@utilities/{utilities.setCronSchedule.ts → SetCronSchedule.ts} +94 -94
  105. package/src/@modules/@utilities/{utilities.setDebug.ts → SetDebug.ts} +37 -38
  106. package/src/@modules/@utilities/{utilities.setEventEmit.ts → SetEventEmit.ts} +41 -41
  107. package/src/@modules/@utilities/{utilities.setListener.ts → SetListener.ts} +30 -30
  108. package/src/@modules/@utilities/{utilities.setSettings.ts → SetSettings.ts} +42 -42
  109. package/src/@modules/@utilities/{utilities.setSleep.ts → SetSleep.ts} +33 -33
  110. package/src/@modules/@utilities/{utilities.setTimeoutAction.ts → SetTimeoutAction.ts} +63 -63
  111. package/src/@modules/@utilities/{utilities.setWarning.ts → SetWarning.ts} +34 -34
  112. package/src/@modules/@xmpp/{xmpp.xDeploy.ts → DeployXMPP.ts} +57 -57
  113. package/src/@modules/@xmpp/{xmpp.xError.ts → ErrorXMPP.ts} +26 -26
  114. package/src/@modules/@xmpp/{xmpp.xOffline.ts → OfflineXMPP.ts} +36 -36
  115. package/src/@modules/@xmpp/{xmpp.xOnline.ts → OnlineXMPP.ts} +45 -45
  116. package/src/@modules/@xmpp/{xmpp.xReconnect.ts → ReconnectXMPP.ts} +64 -64
  117. package/src/@modules/@xmpp/{xmpp.xStanza.ts → StanzaXMPP.ts} +62 -62
  118. package/src/@parsers/@hvtec/{hvtec.extract.ts → HVExtract.ts} +39 -39
  119. package/src/@parsers/@pvtec/{pvtec.expires.ts → GetExpiry.ts} +25 -25
  120. package/src/@parsers/@pvtec/{pvtec.extract.ts → VTECExtract.ts} +48 -48
  121. package/src/@parsers/@text/{text.getDescriptionFromProduct.ts → GetDescriptionFromProduct.ts} +59 -52
  122. package/src/@parsers/@text/{text.getEmbedText.ts → GetEmbededText.ts} +55 -55
  123. package/src/@parsers/@text/{text.getPolygonFromProduct.ts → GetPolygonFromProduct.ts} +52 -52
  124. package/src/@parsers/@text/{text.getStringText.ts → GetStringText.ts} +57 -53
  125. package/src/@parsers/@text/{text.getTextFromProduct.ts → GetTextFromProduct.ts} +42 -42
  126. package/src/@parsers/@text/{text.getXML.ts → GetXML.ts} +60 -60
  127. package/src/@parsers/@ugc/{ugc.getCache.ts → GetCache.ts} +23 -23
  128. package/src/@parsers/@ugc/{ugc.expiry.ts → GetExpiry.ts} +31 -31
  129. package/src/@parsers/@ugc/{ugc.locations.ts → GetLocations.ts} +56 -56
  130. package/src/@parsers/@ugc/{ugc.header.ts → GetUGCHeader.ts} +29 -29
  131. package/src/@parsers/@ugc/{ugc.coordinates.ts → GetZonePolygon.ts} +110 -110
  132. package/src/@parsers/@ugc/{ugc.zones.ts → GetZones.ts} +51 -51
  133. package/src/@parsers/@ugc/{ugc.setCache.ts → SetCache.ts} +27 -27
  134. package/src/@parsers/@ugc/{ugc.extract.ts → UGCExtract.ts} +36 -36
  135. package/src/@types/{type.listener.ts → Actions.ts} +37 -38
  136. package/src/@types/{type.attributes.ts → Attributes.ts} +28 -28
  137. package/src/@types/{type.event.ts → Event.ts} +69 -69
  138. package/src/@types/{type.hvtec.ts → HVTEC.ts} +25 -25
  139. package/src/@types/{type.hash.ts → Hash.ts} +24 -24
  140. package/src/@types/{type.properties.ts → Properties.ts} +77 -77
  141. package/src/@types/{type.settings.ts → Settings.ts} +99 -93
  142. package/src/@types/{type.stanza.ts → Stanza.ts} +37 -37
  143. package/src/@types/{type.compiled.ts → StanzaCompiled.ts} +35 -34
  144. package/src/@types/{type.ugc.ts → UGC.ts} +24 -24
  145. package/src/@types/{type.pvtec.ts → VTEC.ts} +30 -30
  146. package/src/bootstrap.ts +128 -124
  147. package/src/index.ts +74 -74
  148. package/tsconfig.json +13 -13
  149. package/tsup.config.ts +15 -15
  150. package/.github/README.md +0 -384
  151. package/src/@dictionaries/dictionaries.awips.ts +0 -364
  152. package/src/@dictionaries/dictionaries.strings.ts +0 -22
  153. package/src/@dictionaries/dictionaries.tags.ts +0 -93
  154. package/src/@manager/manager.mkEvent.ts +0 -98
  155. package/src/@manager/manager.updateListener.ts +0 -180
  156. package/testing/init.js +0 -91
package/.github/README.md DELETED
@@ -1,384 +0,0 @@
1
- # Project AtmosphericX - Event Product Parser (v3.0.0)
2
-
3
- <div align="center">
4
- <div align="center" style="border: none;">
5
- <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/AtmosphericX/event-product-parser">
6
- <img alt="GitHub forks" src="https://img.shields.io/github/forks/AtmosphericX/event-product-parser">
7
- <img alt="GitHub issues" src="https://img.shields.io/github/issues/AtmosphericX/event-product-parser">
8
- <img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/AtmosphericX/event-product-parser">
9
- </div>
10
- </div>
11
-
12
- ## What is `@atmosx/event-product-parser`
13
- This repository contains the primary function to obtain, parse, cache, and deliver products and events from the National Weather Service. There are two primary sources to obtain these products. By default, the repository uses the **National Weather Service API**. However, there is **FULL** support for **NOAA Weather Wire Service (Open Interface)**. This parser is intended for developers who want to integrate real-time weather alerts, watches, warnings, and forecast data from the NWS seamlessly into their applications or services without having to use external APIs from other sources / parsers. If you wish to access data without programming, consider using our end user project, which leverages this parser and provides an easy-to-use interface for tracking weather alerts. See [Documentation](https://atmosphericx.scriptkitty.cafe).
14
-
15
- ## Installation (NPM)
16
- ```bash
17
- npm install @atmosx/event-product-parser
18
- ```
19
-
20
- ## Configurations & Usage
21
- ```ts
22
- const { Manager } = require(`@atmosx/event-product-parser`) // CJS Importing
23
- import { Manager } from '@atmosx/event-product-parser' // EJS Importing
24
-
25
- const Client = new Manager({
26
- Database: `event-product-parser.db`,
27
- EnableWireService: false,
28
- EnableJournal: true,
29
- EnableDebugging: false,
30
- NOAAWeatherWireServiceSettings: {
31
- ReconnectionSettings: {
32
- Enabled: true,
33
- ReconnectionInterval: 60,
34
- },
35
- CredentialSettings: {
36
- Username: `username`,
37
- Password: `password`,
38
- Nickname: "nickname (@atmosx/event-product-parser/3.0)",
39
- },
40
- CacheSettings: {
41
- Enabled: true,
42
- MaxDatabaseHistory: 50000,
43
- MaxRetentionHistory: 1500,
44
- },
45
- StanzaSettings: {
46
- DisableUGC: false,
47
- DisableVTEC: false,
48
- DisableText: false,
49
- }
50
- },
51
- NationalWeatherServiceSettings: {
52
- CallbackInterval: 30,
53
- EventsEndpoint: `https://api.weather.gov/alerts/active`,
54
- },
55
- BroadcastifySettings: {
56
- BroadcastifyAttachments: true,
57
- BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
58
- BroadcastifyTags: [`Public Safety`, `Amateur Radio`, `Other`, `Rail`, `Aviation`, `Marine`, `Disaster Event`, `Special Event`]
59
- },
60
- NotifyServer: {
61
- Enabled: false,
62
- Server: "https://ntfy.scriptkitty.cafe",
63
- Attachments: "https://scriptkitty.cafe/ftp/@bucket/EAS/encoded",
64
- Credentials: {
65
- Username: "username",
66
- Password: "password"
67
- }
68
- },
69
- ListenerSettings: [
70
- {
71
- Events: ["*Extreme Heat Warning*"],
72
- NotificationServer: {
73
- Enabled: false,
74
- Topic: "heat-warnings",
75
- Priority: 5
76
- },
77
- Uploads: {
78
- EAS: true,
79
- File: true,
80
- JSON: true
81
- }
82
- }
83
- ],
84
- GlobalSettings: {
85
- EventManagement: true,
86
- BetterEventNames: true,
87
- DisableGeometryParsing: false,
88
- UseShapefileCoordinates: true,
89
- SPCWatchesOnly: true,
90
- ShapefileSkipPoints: 0,
91
- NodeTTL: 60,
92
- NodeMinDistance: 125,
93
- EventFiltering: {
94
- ListeningEvents: [
95
- "*Warning*"
96
- ],
97
- ListeningICAO: [],
98
- ListeningUGC: [],
99
- ListeningStates: [],
100
- IgnoredICAO: [],
101
- IgnoredEvents: [],
102
- NodeLocationFiltering: false,
103
- IgnoreTestProducts: true,
104
- },
105
- ArchiveSettings: {
106
- TTL: 30,
107
- EventDirectory: `@bucket/ParsedProducts`,
108
- TextDirectory: `@bucket/RawTextProducts`,
109
- EasDirectory: `@bucket/EAS`,
110
- EasToneout: `eas-toneout.wav`,
111
- }
112
- }
113
- })
114
- ```
115
-
116
- ## How do custom listeners work?
117
-
118
- Custom listeners are case insensitive rules used by `ListeningEvents`, `IgnoredEvents`, and ListenerSettings `events` to determine whether an input matches.
119
-
120
- They support:
121
- - Exact matches (e.g. `"Tornado Watch"`)
122
- - Global wildcard (`"*"` matches everything)
123
- - Partial wildcards (`*text*` matches anything containing that text)
124
-
125
- Example rules:
126
- ```json
127
- ["*Severe Thunderstorm Warning*", "Tornado Watch", "*Flash Flood Warning*"]
128
- ```
129
-
130
- Example Results:
131
- - Considerable Severe Thunderstorm Warning: ✅
132
- - Tornado Warning: ❌
133
- - Severe Thunderstorm Warning (TPROB): ✅
134
- - Flash Flood Emergency: ❌
135
-
136
- ## Events and Listeners
137
-
138
- ### Event `*`
139
- Triggers for every event and product received by the parser. This is useful if you want to handle all events with a single listener.
140
- ```ts
141
- Client.on(`*`, (data: any) => {
142
- /*
143
- event: string
144
- data: object
145
- */
146
- })
147
- ```
148
-
149
- ### Event `onServiceStatus`
150
- Triggers when an update to the XMPP / API service status occurs.
151
- ```ts
152
- Client.on(`onServiceStatus`, (xmpp) => {
153
- /*
154
- message: string
155
- data: object
156
- type: string
157
- error: boolean
158
- */
159
- })
160
- ```
161
-
162
- ### Event `onTestProduct`
163
- Triggers when a event is labeled as a **test message**. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
164
- ```ts
165
- Client.on(`onTestProduct`, (product: TypeEvent) => {})
166
- ```
167
-
168
- ### Event `onExpiredProduct`
169
- Triggers when a event is cancelled, expired, or terminated. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
170
- ```ts
171
- Client.on(`onExpiredProduct`, (product: TypeEvent) => {})
172
- ```
173
-
174
- ### Event `onProductType`
175
- Supports all events and product, simply append the event name to the end like `onProductTypeRadarIndicatedTornadoWarning` and you will receive the event in the listener.
176
- **If the event has been filtered, it will not include attachments and coordinates.** See [`types.event.ts`](./src/@types/type.event.ts) for properties.
177
-
178
- ```ts
179
- This listener returns [`types.event.ts`](./src/@types/type.event.ts).
180
- ```ts
181
- Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
182
- ```
183
-
184
- ### Event `onFilteredEvent`, `onIgnoredEvent`, `onFilteredICAO`, `onIgnoredICAO`, `onFilteredUGC`, `onFilteredState`
185
- These events all support [`types.event.ts`](./src/@types/type.event.ts) and are used to filter out events and products based on your settings.
186
- ```ts
187
- Client.on(`onFilteredEvent`, (product: TypeEvent) => {})
188
- ```
189
-
190
- ### Event `onEventCache`
191
- When all events in a batch have finished processing, a cache update will trigger allowing you to get a copy of all registered events in a listener. (**GeoJSON**)
192
- ```ts
193
- Client.on(`onEventCache`, (cache) => {})
194
- ```
195
-
196
- ### Event `onNodeAdd`, `onNodeUpdate`, `onNodeDelete`
197
- Triggers when a tracking node gets added, updated, or deleted.
198
- ```ts
199
- Client.on(`onNodeAdd`, (cache) => {
200
- /*
201
- type: string
202
- node: object
203
- */
204
- })
205
- ```
206
-
207
- ### Event `onStormPredictionWatch`, `onNonStormPredictionWatch`
208
- Triggers when a SPC watch gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
209
- ```ts
210
- Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
211
- ```
212
-
213
- ### Event `onEventStatus`
214
- Triggers when a single event gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
215
- ```ts
216
- Client.on(`onEventStatus`, (cache) => {
217
- /*
218
- type: string
219
- event: <TypeEvent>
220
- */
221
- })
222
- ```
223
-
224
- ### Event `debug`
225
- Triggers when a debug message gets emitted, this can automatically be used without the listener by enabling `EnableDebugger`. This also includes the `parent` and the `function` names.
226
- ```ts
227
- Client.on(`debug`, (debug) => {
228
- /*
229
- message: string
230
- parent: string
231
- function: string
232
- */
233
- })
234
- ```
235
-
236
- ### Function `setSettings`
237
- Allows you to dynamically update parser settings without restarting the service.
238
- ```ts
239
- import { setSettings } from "@atmosx/event-product-parser"
240
- setSettings({
241
- Database: `NewDatabaseFile.db`
242
- })
243
- ```
244
-
245
- ### Function `getEventGeometry`
246
- Fetches the `events` geometry (GeoJSON) coordinates table.
247
- ```ts
248
- import { getEventGeometry } from "@atmosx/event-product-parser"
249
- const event = {...}
250
- const geometry = await getEventGeometry(event); // Returns GeoJSON
251
- ```
252
-
253
- ### Function `getRandomEvent`
254
- Fetches a random event from the cache
255
- ```ts
256
- import { getRandomEvent } from "@atmosx/event-product-parser"
257
- const event = getRandomEvent(event); // Returns GeoJSON of an event.
258
- ```
259
-
260
- ### Function `getVersion`
261
- Returns the current version of the parser.
262
- ```ts
263
- import { getVersion } from "@atmosx/event-product-parser"
264
- const version = getVersion(); // Returns the current version of the parser.
265
- ```
266
-
267
-
268
- ### Function `getCleanedEvent`
269
- Removed any `NULL` values from the event itself. Therefore cleaning it up from any properties that are `NULL`.
270
- ```ts
271
- import { getCleanedEvent } from "@atmosx/event-product-parser"
272
- const event = {...}
273
- const cleanedEvent = await getCleanedEvent(event); // Returns cleaned event object.
274
- ```
275
-
276
-
277
- ### Function `startService`
278
- Starts the event product parser service.
279
- ```ts
280
- import { startService } from "@atmosx/event-product-parser"
281
- startService()
282
- ```
283
-
284
-
285
- ### Function `setNode`
286
- Sets up a tracking node using an identifier, longitude, and latitude values.
287
- ```ts
288
- import { setNode } from "@atmosx/event-product-parser"
289
- setNode({
290
- identifier: `TestNode`,
291
- coordinates: {longitude: -122.4194, latitude: 37.7749},
292
- delete: false
293
- })
294
- ```
295
-
296
-
297
- ### Function `getEvents`
298
- Fetches the list of events from the parser.
299
- ```ts
300
- import { getEvents } from "@atmosx/event-product-parser"
301
- const events = getEvents() // Returns in GeoJSON (Similar to the onEventCache listener)
302
- console.log(events)
303
- ```
304
-
305
- ### Function `clearEvents`
306
- Clears the event cache of all events.
307
- ```ts
308
- import { clearEvents } from "@atmosx/event-product-parser"
309
- clearEvents() // Clears the event cache of all events.
310
- ```
311
-
312
- ### Function `getNodes`
313
- Fetches the list of tracking nodes from the parser.
314
- ```ts
315
- import { getNodes } from "@atmosx/event-product-parser"
316
- const nodes = getNodes()
317
- console.log(nodes)
318
- ```
319
-
320
- ### Function `manualEvent`
321
- Creates a new event in the parser.
322
- ```ts
323
- import { manualEvent } from "@atmosx/event-product-parser"
324
- manualEvent({
325
- message: `__DESCRIPTION__`,
326
- attributes: {
327
- "issue": new Date().toISOString(),
328
- "cccc": "KLOT",
329
- "awipsid": "TORLOT",
330
- }
331
- })
332
- ```
333
-
334
- ### Function `query`
335
- Queries the event cache (datbase) for specific events based on text.
336
- ```ts
337
- import { query } from "@atmosx/event-product-parser"
338
- query({search: "Tornado Warning", limit: 3}).then(results => {
339
- console.log(results)
340
- })
341
- ````
342
-
343
- ### Function `setEasTone`
344
- Fetches an EAS audio message for an event (Simulated)
345
- ```ts
346
- import { setEasTone } from "@atmosx/event-product-parser"
347
- const event = {...}
348
- await setEasTone({message: event.properties.description, header: event.properties.metadata.header, title: `eas_audio_message`})
349
- ```
350
-
351
-
352
- ## Types
353
- [Event](./src/@types/type.event.ts) |
354
- [Properties](./src/@types/type.properties.ts) |
355
- [HVTec](./src/@types/type.hvtec.ts) |
356
- [PVTec](./src/@types/type.pvtec.ts) |\
357
- [UGC](./src/@types/type.ugc.ts) |
358
- [Stanzas](./src/@types/type.stanza.ts) |
359
- [Attributes](./src/@types/type.attributes.ts) |
360
-
361
- ## Supported Events
362
- `@atmosx/event-product-parser` natively supports and ingests **300+** NWS Text products using VTEC, UGC, and various text parsing techniues.
363
- If you wish to view all supported products, please see: [SUPPORTED_EVENTS.md](./SUPPORTED_EVENTS.md)
364
-
365
-
366
- ## Performance Recommendations
367
- - Enable cache retention
368
- - Disable geometry parsing if GeoJSON is unnecessary.
369
-
370
- ## References
371
- [NOAA NWWS Information](https://www.weather.gov/nwws/) |
372
- [NWS API Documentation](https://www.weather.gov/documentation/services-web-api) |
373
- [XMPP Protocol](https://xmpp.org/about/technology-overview/) |
374
- [AtmosphericX](https://github.com/k3yomi/AtmosphericX) |\
375
- [Documentation](https://atmosphericx.scriptkitty.cafe/documentation) |
376
- [Discord Server](https://atmosphericx-discord.scriptkitty.cafe) |
377
- [Project Board](https://github.com/users/AtmosphericX/projects/2) |\
378
- [Code of Conduct](/.github/CODE_OF_CONDUCT.md) |
379
- [Contributing](/.github/CONTRIBUTING.md) |
380
- [License](/.github/LICENSE) |
381
- [Security](/.github/SECURITY.md) |
382
-
383
- ## Acknowledgements
384
- - [k3yomi](https://github.com/k3yomi)