@atmosx/event-product-parser 3.0.4 → 3.0.7
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/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +1 -1
- package/.github/SUPPORTED_EVENTS.md +370 -0
- package/.github/docs/docs-functions.md +30 -0
- package/.github/docs/docs-general-configurations.md +199 -0
- package/.github/docs/docs-integrations.md +38 -0
- package/.github/docs/docs-listeners.md +28 -0
- package/.github/docs/docs-source-configuration.md +218 -0
- package/.github/docs/docs-technical.md +50 -0
- package/.github/logo.png +0 -0
- package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
- package/.github/samples/SAMPLE_GEOJSON.json +204 -0
- package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
- package/README.md +157 -337
- package/dist/cjs/index.cjs +24125 -15815
- package/dist/esm/index.mjs +24144 -15839
- package/package.json +56 -53
- package/pnpm-workspace.yaml +4 -0
- package/src/bootstrap.ts +83 -43
- package/src/building/CreateEvent.ts +54 -0
- package/src/{@building/building.clean.ts → building/GetCleanedEvent.ts} +4 -4
- package/src/building/GetEventAttachments.ts +88 -0
- package/src/building/GetEventDirection.ts +28 -0
- package/src/{@building/building.enhance.ts → building/GetEventEnhancedName.ts} +13 -17
- package/src/{@building/building.geometry.ts → building/GetEventGeometry.ts} +19 -13
- package/src/{@building/building.headers.ts → building/GetEventHeader.ts} +13 -13
- package/src/{@building/building.polygon.ts → building/GetEventNodes.ts} +26 -22
- package/src/{@building/building.office.ts → building/GetEventOffice.ts} +14 -14
- package/src/building/GetEventProperties.ts +105 -0
- package/src/{@building/building.signature.ts → building/GetEventSignature.ts} +16 -17
- package/src/{@core/core.createListener.ts → building/GetEventTags.ts} +11 -6
- package/src/building/GetEventTheme.ts +26 -0
- package/src/building/GetEventTracking.ts +64 -0
- package/src/components/audio/GenerateAudioMessage.ts +149 -0
- package/src/components/audio/components/GetCleanDescription.ts +91 -0
- package/src/{@modules/@eas/eas.getFloatPCM16.ts → components/audio/components/GetFloatPCM16.ts} +3 -3
- package/src/{@modules/@eas/eas.getMergedPCM16.ts → components/audio/components/GetMergedPCM16.ts} +3 -3
- package/src/{@modules/@eas/eas.getPCM16.ts → components/audio/components/GetPCM16.ts} +13 -8
- package/src/{@modules/@eas/eas.getPCMToFloat.ts → components/audio/components/GetPCMToFloat.ts} +3 -3
- package/src/{@modules/@eas/eas.getSampledPCM16.ts → components/audio/components/GetSampledPCM16.ts} +14 -8
- package/src/components/audio/components/GetTTS.ts +61 -0
- package/src/{@modules/@eas/eas.getWavPCM16.ts → components/audio/components/GetWavPCM16.ts} +8 -8
- package/src/{@modules/@eas/eas.setAFSK.ts → components/audio/components/SetAFSK.ts} +12 -8
- package/src/{@modules/@eas/eas.setAsciiToBits.ts → components/audio/components/SetAsciiToBits.ts} +3 -4
- package/src/{@modules/@eas/eas.setAttentionTone.ts → components/audio/components/SetAttentionTone.ts} +11 -6
- package/src/{@modules/@eas/eas.setNoise.ts → components/audio/components/SetNoise.ts} +14 -8
- package/src/{@modules/@eas/eas.setRadioEffect.ts → components/audio/components/SetRadioEffect.ts} +14 -8
- package/src/{@modules/@eas/eas.setSameHeader.ts → components/audio/components/SetSameHeader.ts} +22 -15
- package/src/{@modules/@utilities/utilities.setWarning.ts → components/database/CreateQuery.ts} +18 -13
- package/src/{@modules/@database/database.cache.ts → components/database/GetCachedEvents.ts} +19 -14
- package/src/components/database/ImportBoundaries.ts +168 -0
- package/src/components/database/ImportBroadcastify.ts +60 -0
- package/src/components/database/ImportCities.ts +87 -0
- package/src/{@modules/@database/database.shapefiles.ts → components/database/ImportShapefiles.ts} +31 -37
- package/src/components/database/ImportStanza.ts +43 -0
- package/src/components/database/InitializeDatabase.ts +71 -0
- package/src/components/images/GenerateGraphic.ts +234 -0
- package/src/components/images/components/CreateRectangle.ts +22 -0
- package/src/components/images/components/CreateText.ts +22 -0
- package/src/components/images/modules/CreateSVG.ts +37 -0
- package/src/components/images/modules/GetGeographicalBoundaries.ts +72 -0
- package/src/components/images/modules/GetGeographicalCities.ts +58 -0
- package/src/components/images/modules/GetGeographicalEvents.ts +48 -0
- package/src/components/images/modules/GetGeometryBounds.ts +82 -0
- package/src/components/images/modules/GetParsedBoundary.ts +58 -0
- package/src/components/images/modules/GetSVGPath.ts +53 -0
- package/src/components/images/modules/NormalizePolygon.ts +57 -0
- package/src/{@modules/@stanza/stanza.getAwipsType.ts → components/stanza/GetAwipsType.ts} +19 -18
- package/src/components/stanza/ValidateStanza.ts +62 -0
- package/src/components/utilities/CreateHttp.ts +83 -0
- package/src/{@modules/@utilities/utilities.getFormattedTime.ts → components/utilities/GetFormattedTime.ts} +3 -3
- package/src/components/utilities/GetLatestIssuance.ts +32 -0
- package/src/components/utilities/GetMatched.ts +38 -0
- package/src/{@modules/@utilities/utilities.getShapeNearestPoint.ts → components/utilities/GetShapeNearestPoint.ts} +24 -19
- package/src/components/utilities/GetUnionPolygon.ts +36 -0
- package/src/components/utilities/QueueManager.ts +70 -0
- package/src/components/utilities/SetCronSchedule.ts +98 -0
- package/src/{@core/core.clearEvents.ts → components/utilities/SetDebug.ts} +17 -12
- package/src/components/utilities/SetEventEmit.ts +42 -0
- package/src/{@modules/@utilities/utilities.setSettings.ts → components/utilities/SetSettings.ts} +7 -7
- package/src/{@modules/@utilities/utilities.setSleep.ts → components/utilities/SetSleep.ts} +5 -5
- package/src/components/utilities/SetTimeoutAction.ts +64 -0
- package/src/components/utilities/SetWarning.ts +47 -0
- package/src/{@modules/@xmpp/xmpp.xDeploy.ts → components/xmpp/DeployXMPP.ts} +26 -27
- package/src/components/xmpp/ErrorXMPP.ts +27 -0
- package/src/{@modules/@xmpp/xmpp.xError.ts → components/xmpp/OfflineXMPP.ts} +17 -9
- package/src/{@modules/@xmpp/xmpp.xOnline.ts → components/xmpp/OnlineXMPP.ts} +21 -20
- package/src/components/xmpp/ReconnectXMPP.ts +64 -0
- package/src/components/xmpp/StanzaXMPP.ts +63 -0
- package/src/{@building/building.tags.ts → core/ClearEvents.ts} +12 -5
- package/src/{@core/core.getVersion.ts → core/GetEvents.ts} +5 -6
- package/src/core/GetNodes.ts +24 -0
- package/src/{@core/core.getNodes.ts → core/GetRandomEvent.ts} +5 -6
- package/src/core/GetVersion.ts +24 -0
- package/src/core/ManualEvent.ts +55 -0
- package/src/core/QueryStanza.ts +40 -0
- package/src/core/SetNode.ts +87 -0
- package/src/core/StartService.ts +62 -0
- package/src/core/StopService.ts +32 -0
- package/src/enums/AWIPS.ts +366 -0
- package/src/{@dictionaries/dictionaries.eventActions.ts → enums/Actions.ts} +3 -3
- package/src/{@dictionaries/dictionaries.eventCancelMessages.ts → enums/Cancellation.ts} +4 -3
- package/src/{@dictionaries/dictionaries.eventCauses.ts → enums/Causes.ts} +3 -3
- package/src/{@dictionaries/dictionaries.statusCorrelationText.ts → enums/Correlations.ts} +3 -3
- package/src/enums/Enhanced.ts +70 -0
- package/src/{@dictionaries/dictionaries.eventTypes.ts → enums/Events.ts} +3 -3
- package/src/{@dictionaries/dictionaries.regExp.ts → enums/Expressions.ts} +5 -4
- package/src/{@core/core.getEvents.ts → enums/GlobalFilter.ts} +7 -8
- package/src/{@dictionaries/dictionaries.hailStrings.ts → enums/Hail.ts} +9 -4
- package/src/{@dictionaries/dictionaries.officeICAOs.ts → enums/ICAO.ts} +5 -3
- package/src/enums/Matches.ts +60 -0
- package/src/{@dictionaries/dictionaries.eventProducts.ts → enums/Products.ts} +3 -3
- package/src/{@dictionaries/dictionaries.eventRecords.ts → enums/Records.ts} +3 -3
- package/src/{@dictionaries/dictionaries.eventSeverity.ts → enums/Severity.ts} +3 -3
- package/src/{@dictionaries/dictionaries.shapefileLinks.ts → enums/Shapefiles.ts} +3 -3
- package/src/enums/States.ts +136 -0
- package/src/{@dictionaries/dictionaries.eventStatus.ts → enums/Status.ts} +3 -3
- package/src/enums/Strings.ts +22 -0
- package/src/enums/Tags.ts +172 -0
- package/src/{@dictionaries/dictionaries.testSignatures.ts → enums/Testing.ts} +5 -4
- package/src/enums/Themes.ts +70 -0
- package/src/events/ParseAPI.ts +129 -0
- package/src/{@events/events.text.ts → events/ParseText.ts} +32 -23
- package/src/{@events/events.ugc.ts → events/ParseUGC.ts} +36 -26
- package/src/events/ParseVTEC.ts +88 -0
- package/src/index.ts +60 -38
- package/src/manager/MakeEvents.ts +110 -0
- package/src/manager/RemoveEvent.ts +74 -0
- package/src/{@manager/manager.setHash.ts → manager/SetHash.ts} +19 -15
- package/src/manager/UpdateEvents.ts +35 -0
- package/src/manager/UpdateNode.ts +62 -0
- package/src/manager/ValidateEvents.ts +144 -0
- package/src/{@parsers/@hvtec/hvtec.extract.ts → parsers/hvtec/HVExtract.ts} +13 -13
- package/src/parsers/text/GetDescriptionFromProduct.ts +59 -0
- package/src/parsers/text/GetEmbededText.ts +57 -0
- package/src/parsers/text/GetPolygonFromProduct.ts +71 -0
- package/src/parsers/text/GetStringText.ts +58 -0
- package/src/{@parsers/@text/text.getTextFromProduct.ts → parsers/text/GetTextFromProduct.ts} +12 -12
- package/src/parsers/ugc/GetCache.ts +24 -0
- package/src/{@parsers/@ugc/ugc.expiry.ts → parsers/ugc/GetExpiry.ts} +3 -3
- package/src/{@parsers/@ugc/ugc.header.ts → parsers/ugc/GetHeader.ts} +6 -6
- package/src/parsers/ugc/GetLocations.ts +57 -0
- package/src/parsers/ugc/GetZonePolygon.ts +73 -0
- package/src/{@parsers/@ugc/ugc.zones.ts → parsers/ugc/GetZones.ts} +3 -3
- package/src/{@modules/@utilities/utilities.setListener.ts → parsers/ugc/SetCache.ts} +13 -10
- package/src/{@parsers/@ugc/ugc.extract.ts → parsers/ugc/UGCExtract.ts} +15 -15
- package/src/{@parsers/@pvtec/pvtec.expires.ts → parsers/vtec/GetExpiry.ts} +3 -3
- package/src/parsers/vtec/VTECExtract.ts +49 -0
- package/src/{@types/types.attributes.ts → static/Attributes.ts} +2 -3
- package/src/{@types/type.event.ts → static/Event.ts} +11 -8
- package/src/{@types/type.properties.ts → static/Properties.ts} +17 -10
- package/src/{@types/types.stanza.ts → static/Stanza.ts} +2 -2
- package/src/tasks/CreateTasks.ts +123 -0
- package/src/{@core/core.stop.ts → tasks/TaskGenerateJSON.ts} +14 -12
- package/src/tasks/TaskGenerateText.ts +34 -0
- package/src/tasks/TaskSendNTFY.ts +97 -0
- package/src/tasks/TaskSendWebhook.ts +107 -0
- package/src/types/Actions.ts +37 -0
- package/src/{@types/types.hvtec.ts → types/HVTEC.ts} +6 -6
- package/src/{@types/types.hash.ts → types/Hash.ts} +5 -5
- package/src/types/Nodes.ts +29 -0
- package/src/{@types/types.settings.ts → types/Settings.ts} +42 -10
- package/src/{@types/types.compiled.ts → types/StanzaCompiled.ts} +15 -14
- package/src/{@types/types.ugc.ts → types/UGC.ts} +5 -5
- package/src/{@modules/@utilities/utilities.getSettings.ts → types/VTEC.ts} +12 -7
- package/tools/build.js +47 -0
- package/tsconfig.json +28 -1
- package/dist/index.d.mts +0 -239
- package/dist/index.d.ts +0 -239
- package/src/@building/building.create.ts +0 -42
- package/src/@building/building.properties.ts +0 -89
- package/src/@building/building.tracking.ts +0 -68
- package/src/@building/building.validate.ts +0 -147
- package/src/@core/core.getRandomEvent.ts +0 -25
- package/src/@core/core.setNode.ts +0 -81
- package/src/@core/core.start.ts +0 -61
- package/src/@dictionaries/dictionaries.betterEventNames.ts +0 -99
- package/src/@dictionaries/dictionaries.eventAwipAbreviations.ts +0 -364
- package/src/@dictionaries/dictionaries.eventTags.ts +0 -93
- package/src/@dictionaries/dictionaries.eventsMatchText.ts +0 -36
- package/src/@dictionaries/dictionaries.transcribedMessageReplacements.ts +0 -68
- package/src/@events/events.api.ts +0 -113
- package/src/@events/events.vtec.ts +0 -87
- package/src/@manager/manager.mkEvent.ts +0 -96
- package/src/@manager/manager.rmEvent.ts +0 -49
- package/src/@manager/manager.updateEvents.ts +0 -35
- package/src/@manager/manager.updateNodes.ts +0 -55
- package/src/@manager/manager.updateWebhooks.ts +0 -50
- package/src/@modules/@database/database.init.ts +0 -45
- package/src/@modules/@database/database.stanza.ts +0 -48
- package/src/@modules/@eas/eas.setEasTone.ts +0 -137
- package/src/@modules/@stanza/stanza.validate.ts +0 -50
- package/src/@modules/@utilities/utilities.createHttp.ts +0 -85
- package/src/@modules/@utilities/utilities.createWebhook.ts +0 -115
- package/src/@modules/@utilities/utilities.setCronSchedule.ts +0 -65
- package/src/@modules/@utilities/utilities.setEventEmit.ts +0 -41
- package/src/@modules/@utilities/utilities.setTimeoutAction.ts +0 -59
- package/src/@modules/@xmpp/xmpp.xOffline.ts +0 -38
- package/src/@modules/@xmpp/xmpp.xReconnect.ts +0 -64
- package/src/@modules/@xmpp/xmpp.xStanza.ts +0 -63
- package/src/@parsers/@pvtec/pvtec.extract.ts +0 -49
- package/src/@parsers/@text/text.getDescriptionFromProduct.ts +0 -53
- package/src/@parsers/@text/text.getPolygonFromProduct.ts +0 -32
- package/src/@parsers/@text/text.getXML.ts +0 -61
- package/src/@parsers/@ugc/ugc.coordinates.ts +0 -110
- package/src/@parsers/@ugc/ugc.locations.ts +0 -29
- package/src/@types/types.pvtec.ts +0 -30
- package/src/@types/types.webhook.ts +0 -27
- package/test.js +0 -91
- package/tsup.config.ts +0 -16
- /package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +0 -0
- /package/{LICENSE → .github/LICENSE} +0 -0
- /package/{SECURITY.md → .github/SECURITY.md} +0 -0
package/README.md
CHANGED
|
@@ -1,349 +1,169 @@
|
|
|
1
|
-
# Project AtmosphericX - Event Product Parser (v3.0.0)
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
|
-
<
|
|
5
|
-
<img
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</
|
|
2
|
+
<a href="https://atmosphericx.scriptkitty.cafe">
|
|
3
|
+
<img src="https://scriptkitty.cafe/ftp/@atmosphericx/assets/logo-event-product-parser.png" alt="@atmosx/event-product-parser" width="800"/>
|
|
4
|
+
</a>
|
|
5
|
+
<br>
|
|
6
|
+
<p>A TypeScript/JavaScript library for parsing and ingesting NOAA and NWS Weather Text Products</p>
|
|
7
|
+
<small>A project built and maintained with ❤️ by the AtmosphericX team<br><i>Not affiliated with NOAA or NWS</i></small>
|
|
8
|
+
<br>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://atmosphericx.scriptkitty.cafe"><b>Documentation</b></a> |
|
|
11
|
+
<a href="https://github.com/AtmosphericX"><b>Repositories</b></a> |
|
|
12
|
+
<a href="https://www.npmjs.com/search?q=%40atmosx"><b>NPM Packages</b></a> |
|
|
13
|
+
<a href="https://atmosphericx-discord.scriptkitty.cafe"><b>Community Discord</b></a>
|
|
14
|
+
</p>
|
|
10
15
|
</div>
|
|
11
16
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
## Table of Contents
|
|
18
|
+
1. [Introduction](#introduction)
|
|
19
|
+
2. [Installation](#installation)
|
|
20
|
+
3. [Sources](/.github/docs/docs-source-configuration.md)
|
|
21
|
+
- 3.1 [NOAA Weather Wire Service](/.github/docs/docs-source-configuration.md#31---noaa-weather-wire-service)
|
|
22
|
+
- 3.2 [National Weather Service API](/.github/docs/docs-source-configuration.md#32---national-weather-service-api)
|
|
23
|
+
- 3.3 [NOAA Weather Wire Service vs NWS RESTful API](/.github/docs/docs-source-configuration.md#33---noaa-weather-wire-service-vs-nws-restful-api)
|
|
24
|
+
- 3.4 [GeoJSON & WMO Formatting](/.github/docs/docs-source-configuration.md#34-geojson---wmo-formatting)
|
|
25
|
+
- 3.4.1 [GeoJSON](/.github/docs/docs-source-configuration.md#341---geojson)
|
|
26
|
+
- 3.4.2 [WMO Format](/.github/docs/docs-source-configuration.md#342---wmo-format)
|
|
27
|
+
- 3.5 [Configuring NOAA Weather Wire Service](/.github/docs/docs-source-configuration.md#35---configuring-noaa-weather-wire-service)
|
|
28
|
+
- 3.5.1 [Auto Reconnecting](/.github/docs/docs-source-configuration.md#351---auto-reconnecting)
|
|
29
|
+
- 3.5.2 [Stanza Caching](/.github/docs/docs-source-configuration.md#352---stanza-caching)
|
|
30
|
+
- 3.5.3 [Stanza Processing Settings](/.github/docs/docs-source-configuration.md#353---stanza-processing-settings)
|
|
31
|
+
- 3.6 [Configuring National Weather Service API](/.github/docs/docs-source-configuration.md#36---configuring-national-weather-service-api)
|
|
32
|
+
4. [General Configurations](/.github/docs/docs-general-configurations.md)
|
|
33
|
+
- 4.1 [Event Management & History](/.github/docs/docs-general-configurations.md#41---event-management---history)
|
|
34
|
+
- 4.2 [Geometry Configurations](/.github/docs/docs-general-configurations.md#42---geometry-configurations)
|
|
35
|
+
- 4.2.1 [Disable Geometry Processing](/.github/docs/docs-general-configurations.md#421---disable-geometry-processing)
|
|
36
|
+
- 4.2.2 [Force Shapefile Coordinates](/.github/docs/docs-general-configurations.md#422---force-shapefile-coordinates)
|
|
37
|
+
- 4.3 [Tracking Node Settings](/.github/docs/docs-general-configurations.md#43---tracking-node-settings)
|
|
38
|
+
- 4.3.1 [NodeTTL](/.github/docs/docs-general-configurations.md#431---nodettl)
|
|
39
|
+
- 4.3.2 [Max Distance](/.github/docs/docs-general-configurations.md#432---max-distance)
|
|
40
|
+
- 4.3.3 [Tracking Node Properties](/.github/docs/docs-general-configurations.md#433---tracking-node-properties)
|
|
41
|
+
- 4.4 [Advanced Event Filters](/.github/docs/docs-general-configurations.md#44---advanced-event-filters)
|
|
42
|
+
- 4.4.1 [Events & Wildcards](/.github/docs/docs-general-configurations.md#441---events---wildcards)
|
|
43
|
+
- 4.4.2 [ICAOs](/.github/docs/docs-general-configurations.md#442---icaos)
|
|
44
|
+
- 4.4.3 [UGC](/.github/docs/docs-general-configurations.md#443---ugc)
|
|
45
|
+
- 4.4.4 [States](/.github/docs/docs-general-configurations.md#444---states)
|
|
46
|
+
- 4.4.5 [Ignoring Filters](/.github/docs/docs-general-configurations.md#445---ignoring-filters)
|
|
47
|
+
- 4.4.6 [Node Location Filtering](/.github/docs/docs-general-configurations.md#446---node-location-filtering)
|
|
48
|
+
- 4.4.7 [Test Products](/.github/docs/docs-general-configurations.md#447---test-products)
|
|
49
|
+
- 4.5 [Archive Configurations](/.github/docs/docs-general-configurations.md#45---archive-configurations)
|
|
50
|
+
- 4.5.1 [TTL (Time-to-Live)](/.github/docs/docs-general-configurations.md#451---ttl-time-to-live)
|
|
51
|
+
- 4.5.2 [Audio Toneout](/.github/docs/docs-general-configurations.md#452---audio-toneout)
|
|
52
|
+
5. [Actions / Integrations](/.github/docs/docs-integrations.md)
|
|
53
|
+
- 5.1 [Action Events & Wildcards](/.github/docs/docs-integrations.md#51---action-events---wildcards)
|
|
54
|
+
- 5.2 [Discord Webhooks](/.github/docs/docs-integrations.md#52---discord-webhooks)
|
|
55
|
+
- 5.2.1 [Ratelimiting](/.github/docs/docs-integrations.md#521---ratelimiting)
|
|
56
|
+
- 5.3 [NTFY Push Notifications](/.github/docs/docs-integrations.md#53---ntfy-push-notifications)
|
|
57
|
+
- 5.3.1 [Server Configuration](/.github/docs/docs-integrations.md#531---server-configuration)
|
|
58
|
+
- 5.3.2 [Action Configuration](/.github/docs/docs-integrations.md#532---action-configuration)
|
|
59
|
+
- 5.3.3 [Node Filtering & Local Events](./github/docs/docs-integrations.md#533---node-filtering---local-events)
|
|
60
|
+
- 5.4 [Broadcastify Feed Attachments](/.github/docs/docs-integrations.md#54---broadcastify-feed-attachments)
|
|
61
|
+
- 5.4.1 [Tag Filtering](/.github/docs/docs-integrations.md#541---tag-filtering)
|
|
62
|
+
- 5.5 [Audio Generation](/.github/docs/docs-integrations.md#55---audio-generation)
|
|
63
|
+
- 5.5.1 [Linux Prerequisites](/.github/docs/docs-integrations.md#551---linux-prerequisites)
|
|
64
|
+
- 5.5.2 [Limitations](/.github/docs/docs-integrations.md#552---limitations)
|
|
65
|
+
- 5.6 [Event Archiving](/.github/docs/docs-integrations.md#56---event-archiving)
|
|
66
|
+
- 5.6.1 [Raw Text Product Archiving](/.github/docs/docs-integrations.md#561---raw-text-product-archiving)
|
|
67
|
+
- 5.6.2 [GeoJSON Archiving](/.github/docs/docs-integrations.md#562---geojson-archiving)
|
|
68
|
+
- 5.7 [Graphic Generation](/.github/docs/docs-integrations.md#57---graphic-generation)
|
|
69
|
+
6. [Listeners](/.github/docs/docs-listeners.md)
|
|
70
|
+
- 6.1 [XMPP / NWS Status](/.github/docs/docs-listeners.md#61---xmpp---nws-status)
|
|
71
|
+
- 6.2 [Test Products](/.github/docs/docs-listeners.md#62---test-products)
|
|
72
|
+
- 6.3 [Expired Products](/.github/docs/docs-listeners.md#63---expired-products)
|
|
73
|
+
- 6.4 [Specific Product Types](/.github/docs/docs-listeners.md#64---specific-product-types)
|
|
74
|
+
- 6.5 [Filtered Products](/.github/docs/docs-listeners.md#65---filtered-products)
|
|
75
|
+
- 6.6 [Cache Updates](/.github/docs/docs-listeners.md#66---cache-updates)
|
|
76
|
+
- 6.7 [Tracking Node Updates](/.github/docs/docs-listeners.md#67---tracking-node-updates)
|
|
77
|
+
- 6.8 [Storm Prediction Center Products](/.github/docs/docs-listeners.md#68---storm-prediction-center-products)
|
|
78
|
+
- 6.9 [Debugging](/.github/docs/docs-listeners.md#69---debugging)
|
|
79
|
+
- 6.10 [Logs / Journal](/.github/docs/docs-listeners.md#610---logs---journal)
|
|
80
|
+
- 6.11 [Wildcard](/.github/docs/docs-listeners.md#611---wildcard)
|
|
81
|
+
7. [Functions](/.github/docs/docs-functions.md)
|
|
82
|
+
- 7.1 [Dynamic Configuration Setter](/.github/docs/docs-functions.md#71---dynamic-configuration-setter)
|
|
83
|
+
- 7.2 [Event Geometry Getter](/.github/docs/docs-functions.md#72---event-geometry-getter)
|
|
84
|
+
- 7.3 [Random Event Getter](/.github/docs/docs-functions.md#73---random-event-getter)
|
|
85
|
+
- 7.4 [Package Information Getter](/.github/docs/docs-functions.md#74---package-information-getter)
|
|
86
|
+
- 7.5 [Cleaned Event Getter](/.github/docs/docs-functions.md#75---cleaned-event-getter)
|
|
87
|
+
- 7.6 [Management Functions](/.github/docs/docs-functions.md#76---management-functions)
|
|
88
|
+
- 7.7 [Creating & Configuring Tracking Nodes](/.github/docs/docs-functions.md#77---creating---configuring-tracking-nodes)
|
|
89
|
+
- 7.8 [Event Cache Getter](/.github/docs/docs-functions.md#78---event-cache-getter)
|
|
90
|
+
- 7.9 [Tracking Node Cache Getter](/.github/docs/docs-functions.md#79---tracking-node-cache-getter)
|
|
91
|
+
- 7.10 [Creating Manual WMO Events](/.github/docs/docs-functions.md#710---creating-manual-wmo-events)
|
|
92
|
+
- 7.11 [Database Queries](/.github/docs/docs-functions.md#711---database-queries)
|
|
93
|
+
- 7.11.1 [Stanza Query](/.github/docs/docs-functions.md#7111---stanza-query)
|
|
94
|
+
- 7.12 [Manual Audio Generation](/.github/docs/docs-functions.md#712---manual-audio-generation)
|
|
95
|
+
8. [Technical Parser Documentation](/.github/docs/docs-technical.md)
|
|
96
|
+
- 8.1 [Workflow & Pipeline](/.github/docs/docs-technical.md#81---workflow---pipeline)
|
|
97
|
+
- 8.2 [Core Parsing Logic](/.github/docs/docs-technical.md#82---core-parsing-logic)
|
|
98
|
+
- 8.2.1 [VTEC](/.github/docs/docs-technical.md#821---vtec)
|
|
99
|
+
- 8.2.1.1 [Product Dictionary](/.github/docs/docs-technical.md#8211---product-dictionary)
|
|
100
|
+
- 8.2.1.2 [Tracking](/.github/docs/docs-technical.md#8212---tracking)
|
|
101
|
+
- 8.2.1.3 [Event Dictionary](/.github/docs/docs-technical.md#8213---event-dictionary)
|
|
102
|
+
- 8.2.1.4 [Status Dictionary](/.github/docs/docs-technical.md#8214---status-dictionary)
|
|
103
|
+
- 8.2.1.5 [Organization Sender](/.github/docs/docs-technical.md#8215---organization-sender)
|
|
104
|
+
- 8.2.1.6 [Expiry Parsing](/.github/docs/docs-technical.md#8216---expiry-parsing)
|
|
105
|
+
- 8.2.1.7 [Watch Parsing](/.github/docs/docs-technical.md#8217---watch-parsing)
|
|
106
|
+
- 8.2.1.8 [KWNS / SPC](/.github/docs/docs-technical.md#8218---kwns)
|
|
107
|
+
- 8.2.2 [UGC](/.github/docs/docs-technical.md#822---ugc)
|
|
108
|
+
- 8.2.2.1 [Extracting Headers](/.github/docs/docs-technical.md#8221---extracting-headers)
|
|
109
|
+
- 8.2.2.2 [Getting Zones](/.github/docs/docs-technical.md#8222---getting-zones)
|
|
110
|
+
- 8.2.2.3 [Extracting Expiry](/.github/docs/docs-technical.md#8223-extracting-expiry)
|
|
111
|
+
- 8.2.2.4 [UGC to Zones](/.github/docs/docs-technical.md#8224-ugc-to-zones)
|
|
112
|
+
- 8.2.3 [HVTEC](/.github/docs/docs-technical.md#823---hvtec)
|
|
113
|
+
- 8.2.3.1 [Flood Severity](/.github/docs/docs-technical.md#8231---flood-severity)
|
|
114
|
+
- 8.2.3.2 [Flood Causes](/.github/docs/docs-technical.md#8232---flood-causes)
|
|
115
|
+
- 8.2.3.3 [Flood Records](/.github/docs/docs-technical.md#8233---flood-records)
|
|
116
|
+
- 8.2.4 [Raw Text](/.github/docs/docs-technical.md#824---raw-text)
|
|
117
|
+
- 8.2.4.1 [Extracting Descriptions](/.github/docs/docs-technical.md#8241---extracting-descriptions)
|
|
118
|
+
- 8.2.4.2 [Extracting Coordinates](/.github/docs/docs-technical.md#8242---extracting-coordinates)
|
|
119
|
+
- 8.2.4.3 [Extracting String Specifics](/.github/docs/docs-technical.md#8243---extracting-string-specifics)
|
|
120
|
+
- 8.2.4.4 [Extracting XML](/.github/docs/docs-technical.md#8244---extracting-xml)
|
|
121
|
+
- 8.2.5 [Building Properties](/.github/docs/docs-technical.md#825---building-properties)
|
|
122
|
+
- 8.2.6 [Building Geometry](/.github/docs/docs-technical.md#826---building-geometry)
|
|
123
|
+
- 8.3 [Event Validation & Filtering](/.github/docs/docs-technical.md#83---event-validation---filtering)
|
|
124
|
+
- 8.3.1 [Enhanced Event Naming](/.github/docs/docs-technical.md#831---enhanced-event-naming)
|
|
125
|
+
- 8.3.2 [Appending Attachments](/.github/docs/docs-technical.md#832---appending-attachments)
|
|
126
|
+
- 8.3.3 [Generating Hashes](/.github/docs/docs-technical.md#833---generating-hashes)
|
|
127
|
+
- 8.4 [Event & History Management](/.github/docs/docs-technical.md#84---event---history-management)
|
|
128
|
+
- 8.5 [Action Workflow](/.github/docs/docs-technical.md#85---action-workflow)
|
|
129
|
+
9. [Workers & Performance](/.github/docs/docs-technical.md#9---workers---performance)
|
|
130
|
+
- 9.1 [Setting up Workers](/.github/docs/docs-technical.md#91---setting-up-workers)
|
|
131
|
+
- 9.2 [IO/CPU Issues](/.github/docs/docs-technical.md#92---iocpu-issues)
|
|
132
|
+
- 9.3 [Recommended Hardware Specifications](/.github/docs/docs-technical.md#93---recommended-hardware-specifications)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## Introduction
|
|
137
|
+
|
|
138
|
+
Formerly known as `atmosx-nwws-parser`, **`@atmosx/event-product-parser`** is an open-source [TypeScript](https://www.typescriptlang.org/)/[JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) library for ingesting, parsing, caching, and distributing [NOAA](https://www.noaa.gov/) and [NWS](https://www.weather.gov/) weather text products. The library handles event processing within [AtmosphericX](https://atmosxphericx.scriptkitty.cafe), providing a lightweight and extensible foundation for working with [GeoJSON](https://geojson.org/) and [WMO](https://www.wmo.int/) data. Built with simplicity and flexibility in mind, it is easy to integrate, straightforward to extend, and suitable for both standalone applications and larger services.
|
|
139
|
+
|
|
140
|
+
With support for the [NOAA Weather Wire Service Open Interface](https://www.weather.gov/nwws/) and the [National Weather Service API](https://www.weather.gov/documentation/services-web-api), the library enables reliable access to a wide range of operational weather products while providing a consistent interface for downstream processing and distribution.
|
|
141
|
+
|
|
142
|
+
Beyond core product processing, the library provides support for integrating [Storm Prediction Center](https://www.spc.noaa.gov) graphics, [Broadcastify](https://www.broadcastify.com) feeds, [NTFY](https://ntfy.sh) and [Discord Webhook](https://discord.com/developers/docs/resources/webhook) push notifications, as well as automated emergency audio generation.
|
|
143
|
+
|
|
144
|
+
**Note:** *This package is designed specifically for NOAA/NWS weather products and currently supports weather data originating from the United States and its territories.*
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## Installation
|
|
148
|
+
**NPM**:
|
|
16
149
|
```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
|
-
NOAAWeatherWireServiceSettings: {
|
|
30
|
-
ReconnectionSettings: {
|
|
31
|
-
Enabled: true,
|
|
32
|
-
ReconnectionInterval: 60,
|
|
33
|
-
},
|
|
34
|
-
CredentialSettings: {
|
|
35
|
-
Username: `username`,
|
|
36
|
-
Password: `password`,
|
|
37
|
-
Nickname: "nickname (@atmosx/event-product-parser/3.0)",
|
|
38
|
-
},
|
|
39
|
-
CacheSettings: {
|
|
40
|
-
Enabled: true,
|
|
41
|
-
MaxDatabaseHistory: 5000,
|
|
42
|
-
MaxRetentionHistory: 555,
|
|
43
|
-
},
|
|
44
|
-
StanzaSettings: {
|
|
45
|
-
DisableUGC: false,
|
|
46
|
-
DisableVTEC: false,
|
|
47
|
-
DisableText: false,
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
NationalWeatherServiceSettings: {
|
|
51
|
-
CallbackInterval: 30,
|
|
52
|
-
EventsEndpoint: `https://api.weather.gov/alerts/active`,
|
|
53
|
-
},
|
|
54
|
-
WebhookSettings: [
|
|
55
|
-
{
|
|
56
|
-
webhook: "https://discord.com/api/webhooks/XXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
57
|
-
title: "AtmosphericX - (@atmosx/event-product-parser)",
|
|
58
|
-
message: ``,
|
|
59
|
-
upload: true,
|
|
60
|
-
events: [`Severe Thunderstorm Warning`, `Radar Indicated Tornado Warning`, `*Warning`, `*Thunderstorm*`],
|
|
61
|
-
rate: 5,
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
GlobalSettings: {
|
|
65
|
-
EventManagement: true,
|
|
66
|
-
BetterEventNames: true,
|
|
67
|
-
DisableGeometryParsing: false,
|
|
68
|
-
UseShapefileCoordinates: true,
|
|
69
|
-
SPCWatchesOnly: true,
|
|
70
|
-
ShapefileSkipPoints: 0,
|
|
71
|
-
NodeTTL: 60,
|
|
72
|
-
NodeMinDistance: 120,
|
|
73
|
-
EventFiltering: {
|
|
74
|
-
ListeningEvents: [
|
|
75
|
-
"Tornado Emergency", "PDS Tornado Warning", "Tornado Warning",
|
|
76
|
-
"Confirmed Tornado Warning", "Radar Indicated Tornado Warning",
|
|
77
|
-
"Special Marine Warning (TPROB)", "PDS Tornado Watch", "Tornado Watch",
|
|
78
|
-
"EDS Severe Thunderstorm Warning (TPROB)", "EDS Severe Thunderstorm Warning",
|
|
79
|
-
"Destructive Severe Thunderstorm Warning (TPROB)", "Destructive Severe Thunderstorm Warning",
|
|
80
|
-
"Considerable Severe Thunderstorm Warning (TPROB)", "Considerable Severe Thunderstorm Warning",
|
|
81
|
-
"Severe Thunderstorm Warning (TPROB)", "Severe Thunderstorm Warning",
|
|
82
|
-
"Severe Thunderstorm Watch",
|
|
83
|
-
"Flash Flood Emergency", "Flash Flood Warning",
|
|
84
|
-
"Flash Flood Watch",
|
|
85
|
-
"Tsunami Warning", "Tsunami Watch",
|
|
86
|
-
"Tsunami Advisory", "Special Marine Warning",
|
|
87
|
-
"Earthquake Warning",
|
|
88
|
-
"Hurricane Warning", "Hurricane Watch",
|
|
89
|
-
"Tropical Storm Warning",
|
|
90
|
-
"Winter Storm Warning", "Blizzard Warning",
|
|
91
|
-
"Ice Storm Warning", "Snow Squall Warning",
|
|
92
|
-
"Winter Weather Advisory", "Extreme Cold Watch"
|
|
93
|
-
],
|
|
94
|
-
ListeningICAO: [],
|
|
95
|
-
IgnoredICAO: [],
|
|
96
|
-
IgnoredEvents: [],
|
|
97
|
-
ListeningUGC: [],
|
|
98
|
-
ListeningStates: [],
|
|
99
|
-
NodeLocationFiltering: false,
|
|
100
|
-
IgnoreTestProducts: true,
|
|
101
|
-
},
|
|
102
|
-
EASSettings: {
|
|
103
|
-
ArchiveDirectory: null,
|
|
104
|
-
IntroWavFile: null,
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
```
|
|
109
|
-
### General Settings
|
|
110
|
-
- **Database**: The database file name and location, please make sure to include the `.db` extension.
|
|
111
|
-
- **EnableWireService**: Whether to enable `NOAA Weather Wire Service` within the parser. This requires credentials from [NOAA Weather Wire Service](https://www.weather.gov/nwws/).
|
|
112
|
-
- **EnableJournal**: Whether to output logs without requiring event `listeners`.
|
|
113
|
-
|
|
114
|
-
### NOAAWeatherWireServiceSettings
|
|
115
|
-
- **ReconnectionSettings**: When the XMPP client gets disconnected or has an error, choose to reconnect to the service again. This contains a reconnection check interval.
|
|
116
|
-
- **CredentialSettings**: The username (nickname) and password that is required for using `NOAA Weather Wire Service`.
|
|
117
|
-
- **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.
|
|
118
|
-
- **StanzaSettings**: Modify what type of products metadata you'd like to receive. (UGC, VTEC, RawText)
|
|
119
|
-
|
|
120
|
-
### NationalWeatherServiceSettings
|
|
121
|
-
- **CallbackInterval**: The interval at which the parser will check for new alerts from the National Weather Service API.
|
|
122
|
-
- **EventsEndpoint**: The URL that directs to the API.
|
|
123
|
-
|
|
124
|
-
### WebhookSettings
|
|
125
|
-
- **webhook**: The URL of the webhook you want to send messages to.
|
|
126
|
-
- **title**: The title of the message you want to send.
|
|
127
|
-
- **message**: The message content you want to send. You can use placeholders like `<@&role_id>` to mention roles in Discord.
|
|
128
|
-
- **upload**: Whether to upload a JSON file as well with the message containing the event data.
|
|
129
|
-
- **events**: An array of event types that will trigger the webhook when they are received by the parser. If this array is empty, the webhook will be triggered for all events.
|
|
130
|
-
- **rate**: The rate limit in seconds for how often the webhook can be triggered. This is to prevent spamming the webhook with too many messages in a short period of time.
|
|
131
|
-
|
|
132
|
-
### GlobalSettings
|
|
133
|
-
- **EventManagement**: Whether to enable the event management system which includes filtering, tracking nodes, and custom messages.
|
|
134
|
-
- **BetterEventNames**: Changes events to a more specific version depending on parameters, message types, etc. `(Ex. "Tornado Warning" -> "Observed Tornado Warning")`
|
|
135
|
-
- **DisableGeometryParsing**: Disable automatically appending GeoJSON geometry data to the events to save on memory consumption.
|
|
136
|
-
- **UseShapefileCoordinates**: Whether to use the shapefile database to obtain the coordinates for events with specified UGC zones.
|
|
137
|
-
- **SPCWatchesOnly**: Whether to only listen for SPC watches only (TOR/SVR) (If using the API, this is ignored).
|
|
138
|
-
- **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).
|
|
139
|
-
- **NodeTTL**: How often nodes should be checked per event. (Tracking/Filtering)
|
|
140
|
-
- **NodeMinDistance**: The minimum distance to filter events from the node (Miles)
|
|
141
|
-
- **ListeningEvents**: Events you'd like to listen for. If this array is left empty, it will listen for **ALL** events and products.
|
|
142
|
-
- **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"])`
|
|
143
|
-
- **IgnoredICAO**: Ignored ICAO codes `(Ex. ["KWNS"])`
|
|
144
|
-
- **IgnoredEvents**: Ignored events / products.
|
|
145
|
-
- **ListeningUGC**: Zones you'd like to listen to `(Ex. ["ILZ001"])`
|
|
146
|
-
- **ListeningStates**: States you'd like to listen to `(Ex. ["IL"])`
|
|
147
|
-
- **NodeLocationFiltering**: If you want tracking nodes to filter out events based on radius. (Miles)\
|
|
148
|
-
- **IgnoreTextProducts**: If you want to ignore test products and events.
|
|
149
|
-
- **ArchiveDirectory**: The directory you'd like to store generated EAS audio files.
|
|
150
|
-
- **IntroWavFile**: The PCM16 bit WAV audio file to append to the EAS message.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
## Events and Listeners
|
|
155
|
-
|
|
156
|
-
### Event `*`
|
|
157
|
-
Triggers for every event and product received by the parser. This is useful if you want to handle all events with a single listener.
|
|
158
|
-
```ts
|
|
159
|
-
Client.on(`*`, (data: any) => {
|
|
160
|
-
/*
|
|
161
|
-
event: string
|
|
162
|
-
data: object
|
|
163
|
-
*/
|
|
164
|
-
})
|
|
150
|
+
$ npm install @atmosx/event-product-parser
|
|
165
151
|
```
|
|
166
152
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
Client.on(`onServiceStatus`, (xmpp) => {
|
|
171
|
-
/*
|
|
172
|
-
message: string
|
|
173
|
-
data: object
|
|
174
|
-
type: string
|
|
175
|
-
error: boolean
|
|
176
|
-
*/
|
|
177
|
-
})
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Event `onTestProduct`
|
|
181
|
-
Triggers when a event is labeled as a **test message**. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
|
|
182
|
-
```ts
|
|
183
|
-
Client.on(`onTestProduct`, (product: TypeEvent) => {})
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Event `onExpiredProduct`
|
|
187
|
-
Triggers when a event is cancelled, expired, or terminated. See [`types.event.ts`](./src/@types/type.event.ts) for properties.
|
|
188
|
-
```ts
|
|
189
|
-
Client.on(`onExpiredProduct`, (product: TypeEvent) => {})
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Event `onProductType`
|
|
193
|
-
Supports all events and product, simply append the event name to the end like `onProductTypeRadarIndicatedTornadoWarning` and you will receive the event in the listener.
|
|
194
|
-
This listener returns [`types.event.ts`](./src/@types/type.event.ts).
|
|
195
|
-
```ts
|
|
196
|
-
Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Event `onFilteredEvent`, `onIgnoredEvent`, `onFilteredICAO`, `onIgnoredICAO`, `onFilteredUGC`, `onFilteredState`
|
|
200
|
-
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.
|
|
201
|
-
```ts
|
|
202
|
-
Client.on(`onFilteredEvent`, (product: TypeEvent) => {})
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Event `onEventCache`
|
|
206
|
-
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**)
|
|
207
|
-
```ts
|
|
208
|
-
Client.on(`onEventCache`, (cache) => {})
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Event `onNodeAdd`, `onNodeUpdate`, `onNodeDelete`
|
|
212
|
-
Triggers when a tracking node gets added, updated, or deleted.
|
|
213
|
-
```ts
|
|
214
|
-
Client.on(`onNodeAdd`, (cache) => {
|
|
215
|
-
/*
|
|
216
|
-
type: string
|
|
217
|
-
node: object
|
|
218
|
-
*/
|
|
219
|
-
})
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Event `onStormPredictionWatch`, `onNonStormPredictionWatch`
|
|
223
|
-
Triggers when a SPC watch gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
|
|
224
|
-
```ts
|
|
225
|
-
Client.on(`onProductTypeRadarIndicatedTornadoWarning`, (product: TypeEvent) => {})
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Event `onEventStatus`
|
|
229
|
-
Triggers when a single event gets added, updated, or cancelled. This will also add a custom message if using jorunal or the `log` listener.
|
|
230
|
-
```ts
|
|
231
|
-
Client.on(`onEventStatus`, (cache) => {
|
|
232
|
-
/*
|
|
233
|
-
type: string
|
|
234
|
-
event: <TypeEvent>
|
|
235
|
-
*/
|
|
236
|
-
})
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Function `setSettings`
|
|
240
|
-
Allows you to dynamically update parser settings without restarting the service.
|
|
241
|
-
```ts
|
|
242
|
-
import { setSettings } from "@atmosx/event-product-parser"
|
|
243
|
-
setSettings({
|
|
244
|
-
Database: `NewDatabaseFile.db`
|
|
245
|
-
})
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
### Function `getEventGeometry`
|
|
249
|
-
Fetches the `events` geometry (GeoJSON) coordinates table.
|
|
250
|
-
```ts
|
|
251
|
-
import { getEventGeometry } from "@atmosx/event-product-parser"
|
|
252
|
-
const event = {...}
|
|
253
|
-
const geometry = await getEventGeometry(event); // Returns GeoJSON
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Function `getRandomEvent`
|
|
257
|
-
Fetches a random event from the cache
|
|
258
|
-
```ts
|
|
259
|
-
import { getRandomEvent } from "@atmosx/event-product-parser"
|
|
260
|
-
const event = getRandomEvent(event); // Returns GeoJSON of an event.
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### Function `getVersion`
|
|
264
|
-
Returns the current version of the parser.
|
|
265
|
-
```ts
|
|
266
|
-
import { getVersion } from "@atmosx/event-product-parser"
|
|
267
|
-
const version = getVersion(); // Returns the current version of the parser.
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
### Function `getCleanedEvent`
|
|
272
|
-
Removed any `NULL` values from the event itself. Therefore cleaning it up from any properties that are `NULL`.
|
|
273
|
-
```ts
|
|
274
|
-
import { getCleanedEvent } from "@atmosx/event-product-parser"
|
|
275
|
-
const event = {...}
|
|
276
|
-
const cleanedEvent = await getCleanedEvent(event); // Returns cleaned event object.
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
### Function `startService`
|
|
281
|
-
Starts the event product parser service.
|
|
282
|
-
```ts
|
|
283
|
-
import { startService } from "@atmosx/event-product-parser"
|
|
284
|
-
startService()
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
### Function `setNode`
|
|
289
|
-
Sets up a tracking node using an identifier, longitude, and latitude values.
|
|
290
|
-
```ts
|
|
291
|
-
import { setNode } from "@atmosx/event-product-parser"
|
|
292
|
-
setNode({
|
|
293
|
-
identifier: `TestNode`,
|
|
294
|
-
coordinates: {longitude: -122.4194, latitude: 37.7749},
|
|
295
|
-
delete: false
|
|
296
|
-
})
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
### Function `getEvents`
|
|
301
|
-
Fetches the list of events from the parser.
|
|
302
|
-
```ts
|
|
303
|
-
import { getEvents } from "@atmosx/event-product-parser"
|
|
304
|
-
const events = getEvents() // Returns in GeoJSON (Similar to the onEventCache listener)
|
|
305
|
-
console.log(events)
|
|
153
|
+
**PNPM**:
|
|
154
|
+
```bash
|
|
155
|
+
$ pnpm install @atmosx/event-product-parser
|
|
306
156
|
```
|
|
307
157
|
|
|
308
|
-
|
|
309
|
-
Clears the event cache of all events.
|
|
310
|
-
```ts
|
|
311
|
-
import { clearEvents } from "@atmosx/event-product-parser"
|
|
312
|
-
clearEvents() // Clears the event cache of all events.
|
|
313
|
-
```
|
|
158
|
+
After installation, import the package using `import` or `require`:
|
|
314
159
|
|
|
315
|
-
### Function `getNodes`
|
|
316
|
-
Fetches the list of tracking nodes from the parser.
|
|
317
160
|
```ts
|
|
318
|
-
import {
|
|
319
|
-
const
|
|
320
|
-
console.log(nodes)
|
|
161
|
+
import { Manager } from "@atmosx/event-product-parser"
|
|
162
|
+
const client = new Manager({})
|
|
321
163
|
```
|
|
322
164
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
await setEasTone(event.properties.description, event.properties.metadata.header)
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
## Performance Recommendations
|
|
332
|
-
- Enable cache retention
|
|
333
|
-
- Disable geometry parsing if GeoJSON is unnecessary.
|
|
334
|
-
|
|
335
|
-
## References
|
|
336
|
-
[NOAA NWWS Information](https://www.weather.gov/nwws/) |
|
|
337
|
-
[NWS API Documentation](https://www.weather.gov/documentation/services-web-api) |
|
|
338
|
-
[XMPP Protocol](https://xmpp.org/about/technology-overview/) |
|
|
339
|
-
[AtmosphericX](https://github.com/k3yomi/AtmosphericX) |\
|
|
340
|
-
[Documentation](https://atmosphericx.scriptkitty.cafe/documentation) |
|
|
341
|
-
[Discord Server](https://atmosphericx-discord.scriptkitty.cafe) |
|
|
342
|
-
[Project Board](https://github.com/users/AtmosphericX/projects/2) |\
|
|
343
|
-
[Code of Conduct](/CODE_OF_CONDUCT.md) |
|
|
344
|
-
[Contributing](/CONTRIBUTING.md) |
|
|
345
|
-
[License](/LICENSE) |
|
|
346
|
-
[Security](/SECURITY.md) |
|
|
347
|
-
|
|
348
|
-
## Acknowledgements
|
|
349
|
-
- [k3yomi](https://github.com/k3yomi)
|
|
165
|
+
Using `require`:
|
|
166
|
+
```js
|
|
167
|
+
const { Manager } = require("@atmosx/event-product-parser")
|
|
168
|
+
const client = new Manager({})
|
|
169
|
+
```
|