@atmosx/event-product-parser 3.0.51 → 3.0.53

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 (140) hide show
  1. package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +9 -9
  2. package/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +29 -29
  3. package/{LICENSE → .github/LICENSE} +17 -17
  4. package/{README.md → .github/README.md} +466 -444
  5. package/{SECURITY.md → .github/SECURITY.md} +20 -20
  6. package/{SUPPORTED_EVENTS.md → .github/SUPPORTED_EVENTS.md} +369 -368
  7. package/.vscode/settings.json +3 -3
  8. package/dist/cjs/index.cjs +243 -213
  9. package/dist/esm/index.mjs +242 -212
  10. package/package.json +52 -52
  11. package/src/@building/building.attachments.ts +82 -82
  12. package/src/@building/building.clean.ts +29 -29
  13. package/src/@building/building.create.ts +55 -55
  14. package/src/@building/building.enhance.ts +59 -59
  15. package/src/@building/building.geometry.ts +47 -47
  16. package/src/@building/building.headers.ts +36 -36
  17. package/src/@building/building.office.ts +42 -42
  18. package/src/@building/building.polygon.ts +69 -69
  19. package/src/@building/building.properties.ts +95 -95
  20. package/src/@building/building.signature.ts +60 -60
  21. package/src/@building/building.tags.ts +23 -23
  22. package/src/@building/building.tracking.ts +67 -67
  23. package/src/@building/building.validate.ts +152 -151
  24. package/src/@core/core.clearEvents.ts +30 -30
  25. package/src/@core/core.createListener.ts +23 -23
  26. package/src/@core/core.getEvents.ts +23 -23
  27. package/src/@core/core.getNodes.ts +23 -23
  28. package/src/@core/core.getRandomEvent.ts +23 -23
  29. package/src/@core/core.getVersion.ts +23 -23
  30. package/src/@core/core.manualEvent.ts +38 -0
  31. package/src/@core/core.query.ts +38 -38
  32. package/src/@core/core.setNode.ts +80 -80
  33. package/src/@core/core.start.ts +60 -60
  34. package/src/@core/core.stop.ts +31 -31
  35. package/src/@dictionaries/dictionaries.actions.ts +27 -27
  36. package/src/@dictionaries/dictionaries.awips.ts +363 -363
  37. package/src/@dictionaries/dictionaries.cancellation.ts +30 -30
  38. package/src/@dictionaries/dictionaries.causes.ts +35 -35
  39. package/src/@dictionaries/dictionaries.correlations.ts +42 -42
  40. package/src/@dictionaries/dictionaries.enhanced.ts +66 -109
  41. package/src/@dictionaries/dictionaries.events.ts +82 -82
  42. package/src/@dictionaries/dictionaries.expressions.ts +28 -28
  43. package/src/@dictionaries/dictionaries.global.ts +24 -0
  44. package/src/@dictionaries/dictionaries.hail.ts +35 -35
  45. package/src/@dictionaries/dictionaries.icao.ts +258 -258
  46. package/src/@dictionaries/dictionaries.matches.ts +54 -35
  47. package/src/@dictionaries/dictionaries.products.ts +24 -24
  48. package/src/@dictionaries/dictionaries.records.ts +25 -25
  49. package/src/@dictionaries/dictionaries.severity.ts +27 -27
  50. package/src/@dictionaries/dictionaries.shapefiles.ts +35 -35
  51. package/src/@dictionaries/dictionaries.states.ts +71 -71
  52. package/src/@dictionaries/dictionaries.status.ts +30 -30
  53. package/src/@dictionaries/dictionaries.tags.ts +92 -92
  54. package/src/@dictionaries/dictionaries.testing.ts +24 -24
  55. package/src/@events/events.api.ts +116 -116
  56. package/src/@events/events.text.ts +84 -80
  57. package/src/@events/events.ugc.ts +89 -85
  58. package/src/@events/events.vtec.ts +86 -86
  59. package/src/@manager/manager.mkEvent.ts +97 -93
  60. package/src/@manager/manager.rmEvent.ts +56 -51
  61. package/src/@manager/manager.setHash.ts +35 -35
  62. package/src/@manager/manager.updateEvents.ts +32 -32
  63. package/src/@manager/manager.updateListener.ts +179 -154
  64. package/src/@manager/manager.updateNodes.ts +53 -53
  65. package/src/@modules/@database/database.broadcastify.ts +66 -66
  66. package/src/@modules/@database/database.cache.ts +49 -49
  67. package/src/@modules/@database/database.init.ts +58 -58
  68. package/src/@modules/@database/database.shapefiles.ts +92 -92
  69. package/src/@modules/@database/database.stanza.ts +46 -46
  70. package/src/@modules/@eas/eas.getCleanDescription.ts +91 -91
  71. package/src/@modules/@eas/eas.getFloatPCM16.ts +29 -29
  72. package/src/@modules/@eas/eas.getMergedPCM16.ts +32 -32
  73. package/src/@modules/@eas/eas.getPCM16.ts +52 -52
  74. package/src/@modules/@eas/eas.getPCMToFloat.ts +26 -26
  75. package/src/@modules/@eas/eas.getSampledPCM16.ts +36 -36
  76. package/src/@modules/@eas/eas.getTTS.ts +54 -54
  77. package/src/@modules/@eas/eas.getWavPCM16.ts +52 -52
  78. package/src/@modules/@eas/eas.setAFSK.ts +51 -51
  79. package/src/@modules/@eas/eas.setAsciiToBits.ts +31 -31
  80. package/src/@modules/@eas/eas.setAttentionTone.ts +40 -40
  81. package/src/@modules/@eas/eas.setEasTone.ts +151 -151
  82. package/src/@modules/@eas/eas.setNoise.ts +32 -32
  83. package/src/@modules/@eas/eas.setRadioEffect.ts +50 -50
  84. package/src/@modules/@eas/eas.setSameHeader.ts +44 -44
  85. package/src/@modules/@stanza/stanza.getAwipsType.ts +45 -45
  86. package/src/@modules/@stanza/stanza.validate.ts +49 -49
  87. package/src/@modules/@utilities/utilities.createHttp.ts +83 -70
  88. package/src/@modules/@utilities/utilities.getFormattedTime.ts +43 -43
  89. package/src/@modules/@utilities/utilities.getLatestIssuance.ts +32 -32
  90. package/src/@modules/@utilities/utilities.getMatched.ts +33 -33
  91. package/src/@modules/@utilities/utilities.getSettings.ts +25 -25
  92. package/src/@modules/@utilities/utilities.getShapeNearestPoint.ts +114 -114
  93. package/src/@modules/@utilities/utilities.setCronSchedule.ts +94 -94
  94. package/src/@modules/@utilities/utilities.setDebug.ts +38 -38
  95. package/src/@modules/@utilities/utilities.setEventEmit.ts +41 -41
  96. package/src/@modules/@utilities/utilities.setListener.ts +30 -30
  97. package/src/@modules/@utilities/utilities.setSettings.ts +42 -42
  98. package/src/@modules/@utilities/utilities.setSleep.ts +33 -33
  99. package/src/@modules/@utilities/utilities.setTimeoutAction.ts +62 -62
  100. package/src/@modules/@utilities/utilities.setWarning.ts +34 -34
  101. package/src/@modules/@xmpp/xmpp.xDeploy.ts +57 -57
  102. package/src/@modules/@xmpp/xmpp.xError.ts +26 -26
  103. package/src/@modules/@xmpp/xmpp.xOffline.ts +36 -36
  104. package/src/@modules/@xmpp/xmpp.xOnline.ts +45 -44
  105. package/src/@modules/@xmpp/xmpp.xReconnect.ts +64 -64
  106. package/src/@modules/@xmpp/xmpp.xStanza.ts +62 -62
  107. package/src/@parsers/@hvtec/hvtec.extract.ts +39 -39
  108. package/src/@parsers/@pvtec/pvtec.expires.ts +25 -25
  109. package/src/@parsers/@pvtec/pvtec.extract.ts +48 -48
  110. package/src/@parsers/@text/text.getDescriptionFromProduct.ts +52 -52
  111. package/src/@parsers/@text/text.getEmbed.ts +55 -55
  112. package/src/@parsers/@text/text.getPolygonFromProduct.ts +53 -32
  113. package/src/@parsers/@text/text.getRaw.ts +54 -0
  114. package/src/@parsers/@text/text.getTextFromProduct.ts +42 -42
  115. package/src/@parsers/@text/text.getXML.ts +60 -60
  116. package/src/@parsers/@ugc/ugc.coordinates.ts +110 -110
  117. package/src/@parsers/@ugc/ugc.expiry.ts +31 -31
  118. package/src/@parsers/@ugc/ugc.extract.ts +36 -36
  119. package/src/@parsers/@ugc/ugc.getCache.ts +23 -23
  120. package/src/@parsers/@ugc/ugc.header.ts +29 -29
  121. package/src/@parsers/@ugc/ugc.locations.ts +56 -56
  122. package/src/@parsers/@ugc/ugc.setCache.ts +27 -27
  123. package/src/@parsers/@ugc/ugc.zones.ts +51 -51
  124. package/src/@types/type.attributes.ts +28 -28
  125. package/src/@types/type.compiled.ts +34 -34
  126. package/src/@types/type.event.ts +69 -69
  127. package/src/@types/type.hash.ts +24 -24
  128. package/src/@types/type.hvtec.ts +25 -25
  129. package/src/@types/type.listener.ts +37 -32
  130. package/src/@types/type.properties.ts +77 -77
  131. package/src/@types/type.pvtec.ts +30 -30
  132. package/src/@types/type.settings.ts +93 -84
  133. package/src/@types/type.stanza.ts +37 -37
  134. package/src/@types/type.ugc.ts +24 -24
  135. package/src/bootstrap.ts +124 -115
  136. package/src/index.ts +74 -74
  137. package/{test.js → testing/init.js} +105 -92
  138. package/tsconfig.json +13 -13
  139. package/tsup.config.ts +15 -15
  140. package/src/@core/core.createEvent.ts +0 -82
@@ -1,444 +1,466 @@
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: `shapefiles.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: 5000,
43
- MaxRetentionHistory: 555,
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
- BroadcastifyTags: [`Public Safety`, `Amateur Radio`, `Other`, `Rail`, `Aviation`, `Marine`, `Disaster Event`, `Special Event`]
58
- },
59
- ListenerSettings: [
60
- {
61
- events: [`*Thunderstorm Warning*`, `* Watch`],
62
- webhook: {
63
- enabled: true,
64
- destination: "https://discord.com/api/XXXXXXXXXX/XXXXXXXXXXX",
65
- title: "AtmosphericX - (Thunderstorm Warnings and Watches)",
66
- message: "<@&XXXXXXXXXXXXXXXXXXXXX>",
67
- ratelimit: 1
68
- },
69
- uploads: {
70
- eas: true,
71
- file: true,
72
- event: true
73
- }
74
- }
75
- ],
76
- GlobalSettings: {
77
- EventManagement: true,
78
- BetterEventNames: true,
79
- DisableGeometryParsing: false,
80
- UseShapefileCoordinates: true,
81
- SPCWatchesOnly: true,
82
- ShapefileSkipPoints: 0,
83
- NodeTTL: 60,
84
- NodeMinDistance: 120,
85
- EventFiltering: {
86
- ListeningEvents: [
87
- "*Severe Thunderstorm Warning*",
88
- "*Blizzard*", "*Ice Storm*", "*Winter Storm*", "*Snow Squall*",
89
- "Tornado Emergency", "*Tornado Warning*",
90
- "Special Weather Statement", "Marine Weather Statement",
91
- "*Tsunami*", "*Hurricane*", "*Tropical Storm*", "*Special Marine*",
92
- "*Flash Flood Warning*", "*Flash Flood Watch*", "*Flash Flood Advisory*",
93
- "Mesoscale Discussion",
94
- "SPC Day 1 Outlook", "SPC Day 2 Outlook", "SPC Day 3 Outlook",
95
- "PDS Tornado Watch", "Tornado Watch", "Severe Thunderstorm Watch", "Flash Flood Watch", "PDS Severe Thunderstorm Watch",
96
- "*Administrative*", "National Weather Service Policy",
97
- "Fire Weather Warning", "Fire Weather Watch", "Fire Weather Advisory",
98
- ],
99
- ListeningICAO: [`KLOT`],
100
- IgnoredICAO: [],
101
- IgnoredEvents: [],
102
- ListeningUGC: [`WIC001`],
103
- ListeningStates: [`MO`, `IA`],
104
- NodeLocationFiltering: false,
105
- IgnoreTestProducts: true,
106
- },
107
- ArchiveSettings: {
108
- TTL: 600,
109
- EventDirectory: `Storage/EventProducts`,
110
- TextDirectory: `Storage/TextProducts`,
111
- EasDirectory: `Storage/EasScenarios`,
112
- EasToneout: `tone.wav`,
113
- }
114
- }
115
- })
116
- ```
117
- ### General Settings
118
- - **Database**: The database file name and location, please make sure to include the `.db` extension.
119
- - **EnableWireService**: Whether to enable `NOAA Weather Wire Service` within the parser. This requires credentials from [NOAA Weather Wire Service](https://www.weather.gov/nwws/).
120
- - **EnableJournal**: Whether to output logs without requiring event `listeners`.
121
-
122
- ### NOAAWeatherWireServiceSettings
123
- - **ReconnectionSettings**: When the XMPP client gets disconnected or has an error, choose to reconnect to the service again. This contains a reconnection check interval.
124
- - **CredentialSettings**: The username (nickname) and password that is required for using `NOAA Weather Wire Service`.
125
- - **CacheSettings**: The ability to use the cache system so when you relaunch the parser, it will have a event retention history of all the stanzas collected.
126
- - **StanzaSettings**: Modify what type of products metadata you'd like to receive. (UGC, VTEC, RawText)
127
-
128
- ### NationalWeatherServiceSettings
129
- - **CallbackInterval**: The interval at which the parser will check for new alerts from the National Weather Service API.
130
- - **EventsEndpoint**: The URL that directs to the API.
131
-
132
- ## BroadcastifySettings
133
- - **BroadcastifyAttachments**: Whether to enable broadcastify attachments for events.
134
- - **BroadcastifyDatabase**: The download url to point to for the collection of broadcastify feeds. (Stored locally once downloaded)
135
- - **BroadcastifyTags**: An array of tags to filter broadcastify feeds. (`Public Safety`, `Amateur Radio`, `Other`, `Rail`, `Aviation`, `Marine`, `Disaster Event`, `Special Event`)
136
-
137
- ### ListenerSettings
138
- - **events**: An array of event types that will trigger the listener when they are received by the parser. If this array is empty, the listener will be triggered for all events.
139
-
140
- #### Webhook
141
- - **enabled**: If the webhook is enabled or not
142
- - **destination**: Webhook URL
143
- - **title**: The title of the webhook
144
- - **message**: The message you'd like to use for the webhook
145
- - **ratelimit**: How many messages can it send before being ratelimited
146
-
147
- #### Uploads
148
- - **eas**: Whether to enable auto eas generated audio files
149
- - **file**: Wheather to generate text files
150
-
151
-
152
- ### GlobalSettings
153
- - **EventManagement**: Whether to enable the event management system which includes filtering, tracking nodes, and custom messages.
154
- - **BetterEventNames**: Changes events to a more specific version depending on parameters, message types, etc. `(Ex. "Tornado Warning" -> "Observed Tornado Warning")`
155
- - **DisableGeometryParsing**: Disable automatically appending GeoJSON geometry data to the events to save on memory consumption.
156
- - **UseShapefileCoordinates**: Whether to use the shapefile database to obtain the coordinates for events with specified UGC zones.
157
- - **SPCWatchesOnly**: Whether to only listen for SPC watches only (TOR/SVR) (If using the API, this is ignored).
158
- - **ShapefileSkipPoints**: When using the shapefile database to obtain coordinates, you can choose to skip a certain amount of points to reduce the number of coordinates for large events. (Ex. If an event has 1000 coordinates and you set this to `2`, it will only use every other coordinate, therefore using 500 coordinates instead of 1000).
159
- - **NodeTTL**: How often nodes should be checked per event. (Tracking/Filtering)
160
- - **NodeMinDistance**: The minimum distance to filter events from the node (Miles)
161
- - **ListeningEvents**: Events you'd like to listen for. If this array is left empty, it will listen for **ALL** events and products.
162
- - **ListeningICAO**: ICAO codes for the weather stations you'd like to listen for. Filtering all events that do not contain the codes. `(Ex. ["KLOT", "TORD"])`
163
- - **IgnoredICAO**: Ignored ICAO codes `(Ex. ["KWNS"])`
164
- - **IgnoredEvents**: Ignored events / products.
165
- - **ListeningUGC**: Zones you'd like to listen to `(Ex. ["ILZ001"])`
166
- - **ListeningStates**: States you'd like to listen to `(Ex. ["IL"])`
167
- - **NodeLocationFiltering**: If you want tracking nodes to filter out events based on radius. (Miles)\
168
- - **IgnoreTextProducts**: If you want to ignore test products and events.
169
- - **TTL**: How long files live for before getting automatically deleted
170
- - **TextDirectory**: The location to store text products that are generated.
171
- - **EasDirectory**: The location to store audio eas files that are generated.
172
- - **EasToneout**: The toneout prefix to use for generated eas messages.
173
-
174
-
175
- ## How do custom listeners work?
176
-
177
- Custom listeners are case insensitive rules used by `ListeningEvents`, `IgnoredEvents`, and ListenerSettings `events` to determine whether an input matches.
178
-
179
- They support:
180
- - Exact matches (e.g. `"Tornado Watch"`)
181
- - Global wildcard (`"*"` matches everything)
182
- - Partial wildcards (`*text*` matches anything containing that text)
183
-
184
- Example rules:
185
- ```json
186
- ["*Severe Thunderstorm Warning*", "Tornado Watch", "*Flash Flood Warning*"]
187
- ```
188
-
189
- Example Results:
190
- - Considerable Severe Thunderstorm Warning: ✅
191
- - Tornado Warning: ❌
192
- - Severe Thunderstorm Warning (TPROB): ✅
193
- - Flash Flood Emergency: ❌
194
-
195
- ## Events and Listeners
196
-
197
- ### Event `*`
198
- Triggers for every event and product received by the parser. This is useful if you want to handle all events with a single listener.
199
- ```ts
200
- Client.on(`*`, (data: any) => {
201
- /*
202
- event: string
203
- data: object
204
- */
205
- })
206
- ```
207
-
208
- ### Event `onServiceStatus`
209
- Triggers when an update to the XMPP / API service status occurs.
210
- ```ts
211
- Client.on(`onServiceStatus`, (xmpp) => {
212
- /*
213
- message: string
214
- data: object
215
- type: string
216
- error: boolean
217
- */
218
- })
219
- ```
220
-
221
- ### Event `onTestProduct`
222
- Triggers when a event is labeled as a **test message**. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
223
- ```ts
224
- Client.on(`onTestProduct`, (product: TypeEvent) => {})
225
- ```
226
-
227
- ### Event `onExpiredProduct`
228
- Triggers when a event is cancelled, expired, or terminated. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
229
- ```ts
230
- Client.on(`onExpiredProduct`, (product: TypeEvent) => {})
231
- ```
232
-
233
- ### Event `onProductType`
234
- Supports all events and product, simply append the event name to the end like `onProductTypeRadarIndicatedTornadoWarning` and you will receive the event in the listener.
235
- This listener returns [`types.event.ts`](./src/@types/type.event.ts).
236
- ```ts
237
- Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
238
- ```
239
-
240
- ### Event `onFilteredEvent`, `onIgnoredEvent`, `onFilteredICAO`, `onIgnoredICAO`, `onFilteredUGC`, `onFilteredState`
241
- 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.
242
- ```ts
243
- Client.on(`onFilteredEvent`, (product: TypeEvent) => {})
244
- ```
245
-
246
- ### Event `onEventCache`
247
- 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**)
248
- ```ts
249
- Client.on(`onEventCache`, (cache) => {})
250
- ```
251
-
252
- ### Event `onNodeAdd`, `onNodeUpdate`, `onNodeDelete`
253
- Triggers when a tracking node gets added, updated, or deleted.
254
- ```ts
255
- Client.on(`onNodeAdd`, (cache) => {
256
- /*
257
- type: string
258
- node: object
259
- */
260
- })
261
- ```
262
-
263
- ### Event `onStormPredictionWatch`, `onNonStormPredictionWatch`
264
- Triggers when a SPC watch gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
265
- ```ts
266
- Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
267
- ```
268
-
269
- ### Event `onEventStatus`
270
- Triggers when a single event gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
271
- ```ts
272
- Client.on(`onEventStatus`, (cache) => {
273
- /*
274
- type: string
275
- event: <TypeEvent>
276
- */
277
- })
278
- ```
279
-
280
- ### Event `debug`
281
- 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.
282
- ```ts
283
- Client.on(`debug`, (debug) => {
284
- /*
285
- message: string
286
- parent: string
287
- function: string
288
- */
289
- })
290
- ```
291
-
292
- ### Function `setSettings`
293
- Allows you to dynamically update parser settings without restarting the service.
294
- ```ts
295
- import { setSettings } from "@atmosx/event-product-parser"
296
- setSettings({
297
- Database: `NewDatabaseFile.db`
298
- })
299
- ```
300
-
301
- ### Function `getEventGeometry`
302
- Fetches the `events` geometry (GeoJSON) coordinates table.
303
- ```ts
304
- import { getEventGeometry } from "@atmosx/event-product-parser"
305
- const event = {...}
306
- const geometry = await getEventGeometry(event); // Returns GeoJSON
307
- ```
308
-
309
- ### Function `getRandomEvent`
310
- Fetches a random event from the cache
311
- ```ts
312
- import { getRandomEvent } from "@atmosx/event-product-parser"
313
- const event = getRandomEvent(event); // Returns GeoJSON of an event.
314
- ```
315
-
316
- ### Function `getVersion`
317
- Returns the current version of the parser.
318
- ```ts
319
- import { getVersion } from "@atmosx/event-product-parser"
320
- const version = getVersion(); // Returns the current version of the parser.
321
- ```
322
-
323
-
324
- ### Function `getCleanedEvent`
325
- Removed any `NULL` values from the event itself. Therefore cleaning it up from any properties that are `NULL`.
326
- ```ts
327
- import { getCleanedEvent } from "@atmosx/event-product-parser"
328
- const event = {...}
329
- const cleanedEvent = await getCleanedEvent(event); // Returns cleaned event object.
330
- ```
331
-
332
-
333
- ### Function `startService`
334
- Starts the event product parser service.
335
- ```ts
336
- import { startService } from "@atmosx/event-product-parser"
337
- startService()
338
- ```
339
-
340
-
341
- ### Function `setNode`
342
- Sets up a tracking node using an identifier, longitude, and latitude values.
343
- ```ts
344
- import { setNode } from "@atmosx/event-product-parser"
345
- setNode({
346
- identifier: `TestNode`,
347
- coordinates: {longitude: -122.4194, latitude: 37.7749},
348
- delete: false
349
- })
350
- ```
351
-
352
-
353
- ### Function `getEvents`
354
- Fetches the list of events from the parser.
355
- ```ts
356
- import { getEvents } from "@atmosx/event-product-parser"
357
- const events = getEvents() // Returns in GeoJSON (Similar to the onEventCache listener)
358
- console.log(events)
359
- ```
360
-
361
- ### Function `clearEvents`
362
- Clears the event cache of all events.
363
- ```ts
364
- import { clearEvents } from "@atmosx/event-product-parser"
365
- clearEvents() // Clears the event cache of all events.
366
- ```
367
-
368
- ### Function `getNodes`
369
- Fetches the list of tracking nodes from the parser.
370
- ```ts
371
- import { getNodes } from "@atmosx/event-product-parser"
372
- const nodes = getNodes()
373
- console.log(nodes)
374
- ```
375
-
376
- ### Function `createEvent`
377
- Creates a new event in the parser.
378
- ```ts
379
- import { createEvent } from "@atmosx/event-product-parser"
380
- createEvent({
381
- event: `PDS Ice Storm Warning`,
382
- status: `Upgraded`,
383
- issued: new Date(),
384
- expires: new Date(Date.now() + 3600000),
385
- locations: `Somewhere USA`,
386
- description: `This is a test event sample.`,
387
- coordinates: [
388
- [-122.4194, 37.7749],
389
- [-122.4194, 37.7749]
390
- ]
391
- })
392
- ```
393
-
394
- ### Function `query`
395
- Queries the event cache (datbase) for specific events based on text.
396
- ```ts
397
- import { query } from "@atmosx/event-product-parser"
398
- query({search: "Tornado Warning", limit: 3}).then(results => {
399
- console.log(results)
400
- })
401
- ````
402
-
403
- ### Function `setEasTone`
404
- Fetches an EAS audio message for an event (Simulated)
405
- ```ts
406
- import { setEasTone } from "@atmosx/event-product-parser"
407
- const event = {...}
408
- await setEasTone({message: event.properties.description, header: event.properties.metadata.header, title: `eas_audio_message`})
409
- ```
410
-
411
-
412
- ## Types
413
- [Event](./src/@types/type.event.ts) |
414
- [Properties](./src/@types/type.properties.ts) |
415
- [HVTec](./src/@types/type.hvtec.ts) |
416
- [PVTec](./src/@types/type.pvtec.ts) |\
417
- [UGC](./src/@types/type.ugc.ts) |
418
- [Stanzas](./src/@types/type.stanza.ts) |
419
- [Attributes](./src/@types/type.attributes.ts) |
420
-
421
- ## Supported Events
422
- `@atmosx/event-product-parser` natively supports and ingests **300+** NWS Text products using VTEC, UGC, and various text parsing techniues.
423
- If you wish to view all supported products, please see: [SUPPORTED_EVENTS.md](./SUPPORTED_EVENTS.md)
424
-
425
-
426
- ## Performance Recommendations
427
- - Enable cache retention
428
- - Disable geometry parsing if GeoJSON is unnecessary.
429
-
430
- ## References
431
- [NOAA NWWS Information](https://www.weather.gov/nwws/) |
432
- [NWS API Documentation](https://www.weather.gov/documentation/services-web-api) |
433
- [XMPP Protocol](https://xmpp.org/about/technology-overview/) |
434
- [AtmosphericX](https://github.com/k3yomi/AtmosphericX) |\
435
- [Documentation](https://atmosphericx.scriptkitty.cafe/documentation) |
436
- [Discord Server](https://atmosphericx-discord.scriptkitty.cafe) |
437
- [Project Board](https://github.com/users/AtmosphericX/projects/2) |\
438
- [Code of Conduct](/CODE_OF_CONDUCT.md) |
439
- [Contributing](/CONTRIBUTING.md) |
440
- [License](/LICENSE) |
441
- [Security](/SECURITY.md) |
442
-
443
- ## Acknowledgements
444
- - [k3yomi](https://github.com/k3yomi)
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: `shapefiles.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: 5000,
43
+ MaxRetentionHistory: 555,
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
+ BroadcastifyTags: [`Public Safety`, `Amateur Radio`, `Other`, `Rail`, `Aviation`, `Marine`, `Disaster Event`, `Special Event`]
58
+ },
59
+ NotifyServer: {
60
+ Enabled: false,
61
+ Server: "https://ntfy.domainname.com",
62
+ Attachments: "https://domainname.com/Storage/EasScenarios",
63
+ Credentials: {
64
+ Username: "username",
65
+ Password: "password"
66
+ }
67
+ },
68
+ ListenerSettings: [
69
+ {
70
+ events: [`*Thunderstorm Warning*`, `* Watch`],
71
+ webhook: {
72
+ enabled: true,
73
+ destination: "https://discord.com/api/XXXXXXXXXX/XXXXXXXXXXX",
74
+ title: "AtmosphericX - (Thunderstorm Warnings and Watches)",
75
+ message: "<@&XXXXXXXXXXXXXXXXXXXXX>",
76
+ ratelimit: 1
77
+ },
78
+ notify: {
79
+ enabled: false,
80
+ topic: "thunderstorm_events",
81
+ },
82
+ uploads: {
83
+ eas: true,
84
+ file: true,
85
+ event: true
86
+ }
87
+ }
88
+ ],
89
+ GlobalSettings: {
90
+ EventManagement: true,
91
+ BetterEventNames: true,
92
+ DisableGeometryParsing: false,
93
+ UseShapefileCoordinates: true,
94
+ SPCWatchesOnly: true,
95
+ ShapefileSkipPoints: 0,
96
+ NodeTTL: 60,
97
+ NodeMinDistance: 120,
98
+ EventFiltering: {
99
+ ListeningEvents: [
100
+ "*Severe Thunderstorm Warning*",
101
+ "*Blizzard*", "*Ice Storm*", "*Winter Storm*", "*Snow Squall*",
102
+ "Tornado Emergency", "*Tornado Warning*",
103
+ "Special Weather Statement", "Marine Weather Statement",
104
+ "*Tsunami*", "*Hurricane*", "*Tropical Storm*", "*Special Marine*",
105
+ "*Flash Flood Warning*", "*Flash Flood Watch*", "*Flash Flood Advisory*",
106
+ "Mesoscale Discussion",
107
+ "*Storm Prediction Center*",
108
+ "PDS Tornado Watch", "Tornado Watch", "Severe Thunderstorm Watch", "Flash Flood Watch", "PDS Severe Thunderstorm Watch",
109
+ "*Administrative*", "National Weather Service Policy",
110
+ "Fire Weather Warning", "Fire Weather Watch", "Fire Weather Advisory",
111
+ ],
112
+ ListeningICAO: [`KLOT`],
113
+ IgnoredICAO: [],
114
+ IgnoredEvents: [],
115
+ ListeningUGC: [`WIC001`],
116
+ ListeningStates: [`MO`, `IA`],
117
+ NodeLocationFiltering: false,
118
+ IgnoreTestProducts: true,
119
+ },
120
+ ArchiveSettings: {
121
+ TTL: 600,
122
+ EventDirectory: `Storage/EventProducts`,
123
+ TextDirectory: `Storage/TextProducts`,
124
+ EasDirectory: `Storage/EasScenarios`,
125
+ EasToneout: `tone.wav`,
126
+ }
127
+ }
128
+ })
129
+ ```
130
+ ### General Settings
131
+ - **Database**: The database file name and location, please make sure to include the `.db` extension.
132
+ - **EnableWireService**: Whether to enable `NOAA Weather Wire Service` within the parser. This requires credentials from [NOAA Weather Wire Service](https://www.weather.gov/nwws/).
133
+ - **EnableJournal**: Whether to output logs without requiring event `listeners`.
134
+
135
+ ### NOAAWeatherWireServiceSettings
136
+ - **ReconnectionSettings**: When the XMPP client gets disconnected or has an error, choose to reconnect to the service again. This contains a reconnection check interval.
137
+ - **CredentialSettings**: The username (nickname) and password that is required for using `NOAA Weather Wire Service`.
138
+ - **CacheSettings**: The ability to use the cache system so when you relaunch the parser, it will have a event retention history of all the stanzas collected.
139
+ - **StanzaSettings**: Modify what type of products metadata you'd like to receive. (UGC, VTEC, RawText)
140
+
141
+ ### NationalWeatherServiceSettings
142
+ - **CallbackInterval**: The interval at which the parser will check for new alerts from the National Weather Service API.
143
+ - **EventsEndpoint**: The URL that directs to the API.
144
+
145
+ ## BroadcastifySettings
146
+ - **BroadcastifyAttachments**: Whether to enable broadcastify attachments for events.
147
+ - **BroadcastifyDatabase**: The download url to point to for the collection of broadcastify feeds. (Stored locally once downloaded)
148
+ - **BroadcastifyTags**: An array of tags to filter broadcastify feeds. (`Public Safety`, `Amateur Radio`, `Other`, `Rail`, `Aviation`, `Marine`, `Disaster Event`, `Special Event`)
149
+
150
+ ## NotifyServer
151
+ - **Enabled**: Whether to enable the notify server for events. This uses the [ntfy.sh](https://ntfy.sh/) service to send notifications for events. This is optional and can be disabled if not needed.
152
+ - **Server**: The notify server URL (Ex. `https://ntfy.domainname.com`)
153
+ - **Attachments**: The URL to the attachments directory (Ex. `https://domainname.com/Storage/EasScenarios`)
154
+ - **Credentials**: The username and password for the notify server if required. (Optional)
155
+
156
+ ### ListenerSettings
157
+ - **events**: An array of event types that will trigger the listener when they are received by the parser. If this array is empty, the listener will be triggered for all events.
158
+
159
+ #### Webhook
160
+ - **enabled**: If the webhook is enabled or not
161
+ - **destination**: Webhook URL
162
+ - **title**: The title of the webhook
163
+ - **message**: The message you'd like to use for the webhook
164
+ - **ratelimit**: How many messages can it send before being ratelimited
165
+
166
+ #### Notify
167
+ - **enabled**: If the notify server is enabled or not
168
+ - **topic**: The topic you'd like to use for the notify server. This is used to send notifications for events. (Ex. `thunderstorm_events`)
169
+
170
+ #### Uploads
171
+ - **eas**: Whether to enable auto eas generated audio files
172
+ - **file**: Wheather to generate text files
173
+
174
+
175
+ ### GlobalSettings
176
+ - **EventManagement**: Whether to enable the event management system which includes filtering, tracking nodes, and custom messages.
177
+ - **BetterEventNames**: Changes events to a more specific version depending on parameters, message types, etc. `(Ex. "Tornado Warning" -> "Observed Tornado Warning")`
178
+ - **DisableGeometryParsing**: Disable automatically appending GeoJSON geometry data to the events to save on memory consumption.
179
+ - **UseShapefileCoordinates**: Whether to use the shapefile database to obtain the coordinates for events with specified UGC zones.
180
+ - **SPCWatchesOnly**: Whether to only listen for SPC watches only (TOR/SVR) (If using the API, this is ignored).
181
+ - **ShapefileSkipPoints**: When using the shapefile database to obtain coordinates, you can choose to skip a certain amount of points to reduce the number of coordinates for large events. (Ex. If an event has 1000 coordinates and you set this to `2`, it will only use every other coordinate, therefore using 500 coordinates instead of 1000).
182
+ - **NodeTTL**: How often nodes should be checked per event. (Tracking/Filtering)
183
+ - **NodeMinDistance**: The minimum distance to filter events from the node (Miles)
184
+ - **ListeningEvents**: Events you'd like to listen for. If this array is left empty, it will listen for **ALL** events and products.
185
+ - **ListeningICAO**: ICAO codes for the weather stations you'd like to listen for. Filtering all events that do not contain the codes. `(Ex. ["KLOT", "TORD"])`
186
+ - **IgnoredICAO**: Ignored ICAO codes `(Ex. ["KWNS"])`
187
+ - **IgnoredEvents**: Ignored events / products.
188
+ - **ListeningUGC**: Zones you'd like to listen to `(Ex. ["ILZ001"])`
189
+ - **ListeningStates**: States you'd like to listen to `(Ex. ["IL"])`
190
+ - **NodeLocationFiltering**: If you want tracking nodes to filter out events based on radius. (Miles)\
191
+ - **IgnoreTextProducts**: If you want to ignore test products and events.
192
+ - **TTL**: How long files live for before getting automatically deleted
193
+ - **TextDirectory**: The location to store text products that are generated.
194
+ - **EasDirectory**: The location to store audio eas files that are generated.
195
+ - **EasToneout**: The toneout prefix to use for generated eas messages.
196
+
197
+
198
+ ## How do custom listeners work?
199
+
200
+ Custom listeners are case insensitive rules used by `ListeningEvents`, `IgnoredEvents`, and ListenerSettings `events` to determine whether an input matches.
201
+
202
+ They support:
203
+ - Exact matches (e.g. `"Tornado Watch"`)
204
+ - Global wildcard (`"*"` matches everything)
205
+ - Partial wildcards (`*text*` matches anything containing that text)
206
+
207
+ Example rules:
208
+ ```json
209
+ ["*Severe Thunderstorm Warning*", "Tornado Watch", "*Flash Flood Warning*"]
210
+ ```
211
+
212
+ Example Results:
213
+ - Considerable Severe Thunderstorm Warning: ✅
214
+ - Tornado Warning: ❌
215
+ - Severe Thunderstorm Warning (TPROB): ✅
216
+ - Flash Flood Emergency: ❌
217
+
218
+ ## Events and Listeners
219
+
220
+ ### Event `*`
221
+ Triggers for every event and product received by the parser. This is useful if you want to handle all events with a single listener.
222
+ ```ts
223
+ Client.on(`*`, (data: any) => {
224
+ /*
225
+ event: string
226
+ data: object
227
+ */
228
+ })
229
+ ```
230
+
231
+ ### Event `onServiceStatus`
232
+ Triggers when an update to the XMPP / API service status occurs.
233
+ ```ts
234
+ Client.on(`onServiceStatus`, (xmpp) => {
235
+ /*
236
+ message: string
237
+ data: object
238
+ type: string
239
+ error: boolean
240
+ */
241
+ })
242
+ ```
243
+
244
+ ### Event `onTestProduct`
245
+ Triggers when a event is labeled as a **test message**. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
246
+ ```ts
247
+ Client.on(`onTestProduct`, (product: TypeEvent) => {})
248
+ ```
249
+
250
+ ### Event `onExpiredProduct`
251
+ Triggers when a event is cancelled, expired, or terminated. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
252
+ ```ts
253
+ Client.on(`onExpiredProduct`, (product: TypeEvent) => {})
254
+ ```
255
+
256
+ ### Event `onProductType`
257
+ Supports all events and product, simply append the event name to the end like `onProductTypeRadarIndicatedTornadoWarning` and you will receive the event in the listener.
258
+ **If the event has been filtered, it will not include attachments and coordinates.** See [`types.event.ts`](./src/@types/type.event.ts) for properties.
259
+
260
+ ```ts
261
+ This listener returns [`types.event.ts`](./src/@types/type.event.ts).
262
+ ```ts
263
+ Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
264
+ ```
265
+
266
+ ### Event `onFilteredEvent`, `onIgnoredEvent`, `onFilteredICAO`, `onIgnoredICAO`, `onFilteredUGC`, `onFilteredState`
267
+ 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.
268
+ ```ts
269
+ Client.on(`onFilteredEvent`, (product: TypeEvent) => {})
270
+ ```
271
+
272
+ ### Event `onEventCache`
273
+ 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**)
274
+ ```ts
275
+ Client.on(`onEventCache`, (cache) => {})
276
+ ```
277
+
278
+ ### Event `onNodeAdd`, `onNodeUpdate`, `onNodeDelete`
279
+ Triggers when a tracking node gets added, updated, or deleted.
280
+ ```ts
281
+ Client.on(`onNodeAdd`, (cache) => {
282
+ /*
283
+ type: string
284
+ node: object
285
+ */
286
+ })
287
+ ```
288
+
289
+ ### Event `onStormPredictionWatch`, `onNonStormPredictionWatch`
290
+ Triggers when a SPC watch gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
291
+ ```ts
292
+ Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
293
+ ```
294
+
295
+ ### Event `onEventStatus`
296
+ Triggers when a single event gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
297
+ ```ts
298
+ Client.on(`onEventStatus`, (cache) => {
299
+ /*
300
+ type: string
301
+ event: <TypeEvent>
302
+ */
303
+ })
304
+ ```
305
+
306
+ ### Event `debug`
307
+ 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.
308
+ ```ts
309
+ Client.on(`debug`, (debug) => {
310
+ /*
311
+ message: string
312
+ parent: string
313
+ function: string
314
+ */
315
+ })
316
+ ```
317
+
318
+ ### Function `setSettings`
319
+ Allows you to dynamically update parser settings without restarting the service.
320
+ ```ts
321
+ import { setSettings } from "@atmosx/event-product-parser"
322
+ setSettings({
323
+ Database: `NewDatabaseFile.db`
324
+ })
325
+ ```
326
+
327
+ ### Function `getEventGeometry`
328
+ Fetches the `events` geometry (GeoJSON) coordinates table.
329
+ ```ts
330
+ import { getEventGeometry } from "@atmosx/event-product-parser"
331
+ const event = {...}
332
+ const geometry = await getEventGeometry(event); // Returns GeoJSON
333
+ ```
334
+
335
+ ### Function `getRandomEvent`
336
+ Fetches a random event from the cache
337
+ ```ts
338
+ import { getRandomEvent } from "@atmosx/event-product-parser"
339
+ const event = getRandomEvent(event); // Returns GeoJSON of an event.
340
+ ```
341
+
342
+ ### Function `getVersion`
343
+ Returns the current version of the parser.
344
+ ```ts
345
+ import { getVersion } from "@atmosx/event-product-parser"
346
+ const version = getVersion(); // Returns the current version of the parser.
347
+ ```
348
+
349
+
350
+ ### Function `getCleanedEvent`
351
+ Removed any `NULL` values from the event itself. Therefore cleaning it up from any properties that are `NULL`.
352
+ ```ts
353
+ import { getCleanedEvent } from "@atmosx/event-product-parser"
354
+ const event = {...}
355
+ const cleanedEvent = await getCleanedEvent(event); // Returns cleaned event object.
356
+ ```
357
+
358
+
359
+ ### Function `startService`
360
+ Starts the event product parser service.
361
+ ```ts
362
+ import { startService } from "@atmosx/event-product-parser"
363
+ startService()
364
+ ```
365
+
366
+
367
+ ### Function `setNode`
368
+ Sets up a tracking node using an identifier, longitude, and latitude values.
369
+ ```ts
370
+ import { setNode } from "@atmosx/event-product-parser"
371
+ setNode({
372
+ identifier: `TestNode`,
373
+ coordinates: {longitude: -122.4194, latitude: 37.7749},
374
+ delete: false
375
+ })
376
+ ```
377
+
378
+
379
+ ### Function `getEvents`
380
+ Fetches the list of events from the parser.
381
+ ```ts
382
+ import { getEvents } from "@atmosx/event-product-parser"
383
+ const events = getEvents() // Returns in GeoJSON (Similar to the onEventCache listener)
384
+ console.log(events)
385
+ ```
386
+
387
+ ### Function `clearEvents`
388
+ Clears the event cache of all events.
389
+ ```ts
390
+ import { clearEvents } from "@atmosx/event-product-parser"
391
+ clearEvents() // Clears the event cache of all events.
392
+ ```
393
+
394
+ ### Function `getNodes`
395
+ Fetches the list of tracking nodes from the parser.
396
+ ```ts
397
+ import { getNodes } from "@atmosx/event-product-parser"
398
+ const nodes = getNodes()
399
+ console.log(nodes)
400
+ ```
401
+
402
+ ### Function `manualEvent`
403
+ Creates a new event in the parser.
404
+ ```ts
405
+ import { manualEvent } from "@atmosx/event-product-parser"
406
+ manualEvent({
407
+ message: `__DESCRIPTION__`,
408
+ attributes: {
409
+ "issue": new Date().toISOString(),
410
+ "cccc": "KLOT",
411
+ "awipsid": "TORLOT",
412
+ }
413
+ })
414
+ ```
415
+
416
+ ### Function `query`
417
+ Queries the event cache (datbase) for specific events based on text.
418
+ ```ts
419
+ import { query } from "@atmosx/event-product-parser"
420
+ query({search: "Tornado Warning", limit: 3}).then(results => {
421
+ console.log(results)
422
+ })
423
+ ````
424
+
425
+ ### Function `setEasTone`
426
+ Fetches an EAS audio message for an event (Simulated)
427
+ ```ts
428
+ import { setEasTone } from "@atmosx/event-product-parser"
429
+ const event = {...}
430
+ await setEasTone({message: event.properties.description, header: event.properties.metadata.header, title: `eas_audio_message`})
431
+ ```
432
+
433
+
434
+ ## Types
435
+ [Event](./src/@types/type.event.ts) |
436
+ [Properties](./src/@types/type.properties.ts) |
437
+ [HVTec](./src/@types/type.hvtec.ts) |
438
+ [PVTec](./src/@types/type.pvtec.ts) |\
439
+ [UGC](./src/@types/type.ugc.ts) |
440
+ [Stanzas](./src/@types/type.stanza.ts) |
441
+ [Attributes](./src/@types/type.attributes.ts) |
442
+
443
+ ## Supported Events
444
+ `@atmosx/event-product-parser` natively supports and ingests **300+** NWS Text products using VTEC, UGC, and various text parsing techniues.
445
+ If you wish to view all supported products, please see: [SUPPORTED_EVENTS.md](./SUPPORTED_EVENTS.md)
446
+
447
+
448
+ ## Performance Recommendations
449
+ - Enable cache retention
450
+ - Disable geometry parsing if GeoJSON is unnecessary.
451
+
452
+ ## References
453
+ [NOAA NWWS Information](https://www.weather.gov/nwws/) |
454
+ [NWS API Documentation](https://www.weather.gov/documentation/services-web-api) |
455
+ [XMPP Protocol](https://xmpp.org/about/technology-overview/) |
456
+ [AtmosphericX](https://github.com/k3yomi/AtmosphericX) |\
457
+ [Documentation](https://atmosphericx.scriptkitty.cafe/documentation) |
458
+ [Discord Server](https://atmosphericx-discord.scriptkitty.cafe) |
459
+ [Project Board](https://github.com/users/AtmosphericX/projects/2) |\
460
+ [Code of Conduct](/.github/CODE_OF_CONDUCT.md) |
461
+ [Contributing](/.github/CONTRIBUTING.md) |
462
+ [License](/.github/LICENSE) |
463
+ [Security](/.github/SECURITY.md) |
464
+
465
+ ## Acknowledgements
466
+ - [k3yomi](https://github.com/k3yomi)