@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
|
@@ -11,18 +11,23 @@
|
|
|
11
11
|
Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
|
|
12
12
|
Discord: https://atmosphericx-discord.scriptkitty.cafe
|
|
13
13
|
Ko-Fi: https://ko-fi.com/k3yomi
|
|
14
|
-
Documentation:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import { TypeActions } from "Types/Actions"
|
|
21
|
+
|
|
22
|
+
type TypeTimezones = string | "CST" | "CDT" | "MDT" | "MST" | "EST" | "EDT" | "HST" | "HDT" | "PDT" | "UTC"
|
|
21
23
|
|
|
22
24
|
export type TypeSettings = {
|
|
25
|
+
Timezone?: TypeTimezones
|
|
23
26
|
Database: string
|
|
27
|
+
DebugDisableAllEvents: boolean
|
|
24
28
|
EnableWireService: boolean
|
|
25
29
|
EnableJournal: boolean
|
|
30
|
+
EnableDebugging: boolean
|
|
26
31
|
NOAAWeatherWireServiceSettings: {
|
|
27
32
|
ReconnectionSettings: {
|
|
28
33
|
Enabled: boolean
|
|
@@ -48,16 +53,37 @@ export type TypeSettings = {
|
|
|
48
53
|
CallbackInterval: number
|
|
49
54
|
EventsEndpoint: string
|
|
50
55
|
}
|
|
56
|
+
BroadcastifySettings: {
|
|
57
|
+
BroadcastifyAttachments: boolean
|
|
58
|
+
BroadcastifyDatabase: string
|
|
59
|
+
BroadcastifyTags: string[]
|
|
60
|
+
},
|
|
61
|
+
BoundarySettings: {
|
|
62
|
+
BoundaryDatabase: string
|
|
63
|
+
CityDatabase: string
|
|
64
|
+
},
|
|
65
|
+
NotifyServer: {
|
|
66
|
+
Enabled: boolean
|
|
67
|
+
Server: string
|
|
68
|
+
MediaStorage: {
|
|
69
|
+
TEXT?: string
|
|
70
|
+
JSON?: string
|
|
71
|
+
AUDIO?: string
|
|
72
|
+
IMAGE?: string
|
|
73
|
+
}
|
|
74
|
+
Credentials?: {
|
|
75
|
+
Username: string | void
|
|
76
|
+
Password: string | void
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
ActionSettings?: TypeActions[]
|
|
51
80
|
GlobalSettings: {
|
|
52
81
|
EventManagement: boolean
|
|
53
|
-
BetterEventNames: boolean
|
|
54
82
|
DisableGeometryParsing: boolean
|
|
55
83
|
UseShapefileCoordinates: boolean
|
|
56
84
|
SPCWatchesOnly: boolean
|
|
57
|
-
ShapefileSkipPoints: number
|
|
58
85
|
NodeTTL: number
|
|
59
|
-
|
|
60
|
-
WebhookSettings?: TypeWebhook
|
|
86
|
+
NodeMaxDistance: number
|
|
61
87
|
EventFiltering: {
|
|
62
88
|
ListeningEvents: string[]
|
|
63
89
|
ListeningICAO: string[]
|
|
@@ -68,9 +94,15 @@ export type TypeSettings = {
|
|
|
68
94
|
NodeLocationFiltering: boolean
|
|
69
95
|
IgnoreTestProducts: boolean
|
|
70
96
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
97
|
+
Themes: { Event: string, RGB: string }[]
|
|
98
|
+
ArchiveSettings: {
|
|
99
|
+
TTL: number
|
|
100
|
+
ImageDirectory: string
|
|
101
|
+
JSONDirectory: string
|
|
102
|
+
TextDirectory: string
|
|
103
|
+
AudioDirectory: string
|
|
104
|
+
Logo: string
|
|
105
|
+
AudioToneout: string
|
|
74
106
|
}
|
|
75
107
|
}
|
|
76
108
|
}
|
|
@@ -11,25 +11,26 @@
|
|
|
11
11
|
Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
|
|
12
12
|
Discord: https://atmosphericx-discord.scriptkitty.cafe
|
|
13
13
|
Ko-Fi: https://ko-fi.com/k3yomi
|
|
14
|
-
Documentation:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "
|
|
20
|
+
import { TypeAttributes } from "StaticTypes/Attributes"
|
|
21
21
|
|
|
22
22
|
export type TypeStanzaCompiled = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
Message?: string
|
|
24
|
+
Attributes?: TypeAttributes
|
|
25
|
+
CapEvent?: boolean
|
|
26
|
+
VTEC?: boolean
|
|
27
|
+
UGC?: boolean
|
|
28
|
+
CapAreaDescription?: boolean
|
|
29
|
+
Ignored?: boolean
|
|
30
|
+
NWWS?: boolean
|
|
31
|
+
Type?: {
|
|
32
|
+
Type: string
|
|
33
|
+
Prefix: string
|
|
34
|
+
Discovered: boolean
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
|
|
12
12
|
Discord: https://atmosphericx-discord.scriptkitty.cafe
|
|
13
13
|
Ko-Fi: https://ko-fi.com/k3yomi
|
|
14
|
-
Documentation:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
export type TypeUGC = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
Zones: string[]
|
|
22
|
+
Locations: string[]
|
|
23
|
+
Expires: string
|
|
24
24
|
}
|
|
@@ -11,15 +11,20 @@
|
|
|
11
11
|
Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
|
|
12
12
|
Discord: https://atmosphericx-discord.scriptkitty.cafe
|
|
13
13
|
Ko-Fi: https://ko-fi.com/k3yomi
|
|
14
|
-
Documentation:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export type TypeVTEC = {
|
|
21
|
+
Raw: string
|
|
22
|
+
ProductType: string
|
|
23
|
+
Tracking: string
|
|
24
|
+
Event: string
|
|
25
|
+
Status: string
|
|
26
|
+
WMO: string
|
|
27
|
+
Expires: string
|
|
28
|
+
Watch: boolean
|
|
29
|
+
PredictionCenter: boolean
|
|
25
30
|
}
|
package/tools/build.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const { spawn } = require("child_process");
|
|
2
|
+
const watch = process.argv.includes("--watch");
|
|
3
|
+
|
|
4
|
+
const commands = [
|
|
5
|
+
{
|
|
6
|
+
name: "esm",
|
|
7
|
+
args: [
|
|
8
|
+
"--bundle",
|
|
9
|
+
"--platform=node",
|
|
10
|
+
"--target=node22",
|
|
11
|
+
"--format=esm",
|
|
12
|
+
"--external:better-sqlite3",
|
|
13
|
+
"--external:sharp",
|
|
14
|
+
"--out-extension:.js=.mjs",
|
|
15
|
+
"--outdir=dist/esm",
|
|
16
|
+
...(watch ? ["--watch"] : []),
|
|
17
|
+
"./src/index.ts",
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "cjs",
|
|
22
|
+
args: [
|
|
23
|
+
"--bundle",
|
|
24
|
+
"--platform=node",
|
|
25
|
+
"--target=node22",
|
|
26
|
+
"--format=cjs",
|
|
27
|
+
"--external:better-sqlite3",
|
|
28
|
+
"--external:sharp",
|
|
29
|
+
"--out-extension:.js=.cjs",
|
|
30
|
+
"--outdir=dist/cjs",
|
|
31
|
+
...(watch ? ["--watch"] : []),
|
|
32
|
+
"./src/index.ts",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
function runBuild({ name, args }) {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
const proc = spawn("esbuild", args, {
|
|
40
|
+
shell: true,
|
|
41
|
+
stdio: "inherit",
|
|
42
|
+
});
|
|
43
|
+
proc.on("error", reject);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Promise.all(commands.map(runBuild)).catch((err) => { console.error(err); process.exit(1); });
|
package/tsconfig.json
CHANGED
|
@@ -8,7 +8,34 @@
|
|
|
8
8
|
"declarationDir": "dist/types",
|
|
9
9
|
"esModuleInterop": true,
|
|
10
10
|
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"skipLibCheck": true
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"strictNullChecks": false, // Note: I use optional changing and heavily rely on `null` and `undefined` values in the codebase. Please do not set this to true unless you want the compiler to throw a fucking temper tantrum every time you try to access a property of an object that may or may not be null or undefined. I have better things to do than to deal with that nonsense.
|
|
14
|
+
"noImplicitAny": true,
|
|
15
|
+
"paths": {
|
|
16
|
+
"@ParsingHVTEC/*": ["./src/parsers/hvtec/*"],
|
|
17
|
+
"@ParsingVTEC/*": ["./src/parsers/vtec/*"],
|
|
18
|
+
"@ParsingUGC/*": ["./src/parsers/ugc/*"],
|
|
19
|
+
"@ParsingText/*": ["./src/parsers/text/*"],
|
|
20
|
+
"@Database/*": ["./src/components/database/*"],
|
|
21
|
+
"@Audio/*": ["./src/components/audio/*"],
|
|
22
|
+
"@AudioComponents/*": ["./src/components/audio/components/*"],
|
|
23
|
+
"@Image/*": ["./src/components/images/*"],
|
|
24
|
+
"@ImageModules/*": ["./src/components/images/modules/*"],
|
|
25
|
+
"@ImageComponents/*": ["./src/components/images/components/*"],
|
|
26
|
+
"@Stanza/*": ["./src/components/stanza/*"],
|
|
27
|
+
"@Utilities/*": ["./src/components/utilities/*"],
|
|
28
|
+
"@XMPP/*": ["./src/components/xmpp/*"],
|
|
29
|
+
"@Manager/*": ["./src/manager/*"],
|
|
30
|
+
"@Tasks/*": ["./src/tasks/*"],
|
|
31
|
+
"@Events/*": ["./src/events/*"],
|
|
32
|
+
"@Enums/*": ["./src/enums/*"],
|
|
33
|
+
"@Core/*": ["./src/core/*"],
|
|
34
|
+
"@Building/*": ["./src/building/*"],
|
|
35
|
+
"Types/*": ["./src/types/*"],
|
|
36
|
+
"StaticTypes/*": ["./src/static/*"],
|
|
37
|
+
"@Bootstrap": ["./src/bootstrap.ts"],
|
|
38
|
+
}
|
|
12
39
|
},
|
|
13
40
|
"include": ["src"]
|
|
14
41
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
type TypeWebhook = {
|
|
2
|
-
webhook: string;
|
|
3
|
-
title: string;
|
|
4
|
-
message: string;
|
|
5
|
-
upload: boolean;
|
|
6
|
-
rate: number;
|
|
7
|
-
events: string[];
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type TypeSettings = {
|
|
11
|
-
Database: string;
|
|
12
|
-
EnableWireService: boolean;
|
|
13
|
-
EnableJournal: boolean;
|
|
14
|
-
NOAAWeatherWireServiceSettings: {
|
|
15
|
-
ReconnectionSettings: {
|
|
16
|
-
Enabled: boolean;
|
|
17
|
-
ReconnectionInterval: number;
|
|
18
|
-
};
|
|
19
|
-
CredentialSettings: {
|
|
20
|
-
Username: string | void;
|
|
21
|
-
Password: string | void;
|
|
22
|
-
Nickname: string | void;
|
|
23
|
-
};
|
|
24
|
-
CacheSettings: {
|
|
25
|
-
Enabled: boolean;
|
|
26
|
-
MaxDatabaseHistory: number;
|
|
27
|
-
MaxRetentionHistory: number;
|
|
28
|
-
};
|
|
29
|
-
StanzaSettings: {
|
|
30
|
-
DisableUGC: boolean;
|
|
31
|
-
DisableVTEC: boolean;
|
|
32
|
-
DisableText: boolean;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
NationalWeatherServiceSettings: {
|
|
36
|
-
CallbackInterval: number;
|
|
37
|
-
EventsEndpoint: string;
|
|
38
|
-
};
|
|
39
|
-
GlobalSettings: {
|
|
40
|
-
EventManagement: boolean;
|
|
41
|
-
BetterEventNames: boolean;
|
|
42
|
-
DisableGeometryParsing: boolean;
|
|
43
|
-
UseShapefileCoordinates: boolean;
|
|
44
|
-
SPCWatchesOnly: boolean;
|
|
45
|
-
ShapefileSkipPoints: number;
|
|
46
|
-
NodeTTL: number;
|
|
47
|
-
NodeMinDistance: number;
|
|
48
|
-
WebhookSettings?: TypeWebhook;
|
|
49
|
-
EventFiltering: {
|
|
50
|
-
ListeningEvents: string[];
|
|
51
|
-
ListeningICAO: string[];
|
|
52
|
-
ListeningUGC: string[];
|
|
53
|
-
ListeningStates: string[];
|
|
54
|
-
IgnoredICAO: string[];
|
|
55
|
-
IgnoredEvents: string[];
|
|
56
|
-
NodeLocationFiltering: boolean;
|
|
57
|
-
IgnoreTestProducts: boolean;
|
|
58
|
-
};
|
|
59
|
-
EASSettings: {
|
|
60
|
-
ArchiveDirectory: string;
|
|
61
|
-
IntroWavFile: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
declare const setSettings: (newSettings: TypeSettings) => TypeSettings;
|
|
67
|
-
|
|
68
|
-
type TypeAttributes = {
|
|
69
|
-
xmlns: string;
|
|
70
|
-
id: string;
|
|
71
|
-
issue: string;
|
|
72
|
-
ttaaii: string;
|
|
73
|
-
cccc: string;
|
|
74
|
-
awipsid: string;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
type TypeEventProperties = {
|
|
78
|
-
locations: string;
|
|
79
|
-
description: string;
|
|
80
|
-
attributes: TypeAttributes;
|
|
81
|
-
geocode: {
|
|
82
|
-
office: {
|
|
83
|
-
name: string;
|
|
84
|
-
office: string;
|
|
85
|
-
};
|
|
86
|
-
organization: string;
|
|
87
|
-
ugc: string[];
|
|
88
|
-
polygon: string;
|
|
89
|
-
polygon_generated: boolean;
|
|
90
|
-
};
|
|
91
|
-
parameters: {
|
|
92
|
-
tags: string[];
|
|
93
|
-
instructions: string;
|
|
94
|
-
source: string;
|
|
95
|
-
hazards: string;
|
|
96
|
-
impacts: string;
|
|
97
|
-
estimated_hail_size: string;
|
|
98
|
-
estimated_wind_gusts: string;
|
|
99
|
-
damage_threat: string;
|
|
100
|
-
tornado_threat: string;
|
|
101
|
-
flood_threat: string;
|
|
102
|
-
wind_threat: string;
|
|
103
|
-
hail_threat: string;
|
|
104
|
-
max_hail_inches?: string;
|
|
105
|
-
max_wind_gusts_surface_knots?: string;
|
|
106
|
-
max_tops_x100feet?: string;
|
|
107
|
-
mean_storm_motion_vector?: string;
|
|
108
|
-
particularly_dangerous_situation?: string;
|
|
109
|
-
};
|
|
110
|
-
watch_parameters?: {
|
|
111
|
-
watch_number: string;
|
|
112
|
-
watch_type: string;
|
|
113
|
-
additional_tornadoes_probability: string;
|
|
114
|
-
strong_tornadoes_probability: string;
|
|
115
|
-
severe_wind_probability: string;
|
|
116
|
-
severe_hail_probability: string;
|
|
117
|
-
hail_2in_probability: string;
|
|
118
|
-
combined_hail_wind_probability: string;
|
|
119
|
-
max_hail_in: string;
|
|
120
|
-
max_wind_surface: string;
|
|
121
|
-
max_tops_x100feet: string;
|
|
122
|
-
pds_watch: boolean;
|
|
123
|
-
};
|
|
124
|
-
spc_parameters: {
|
|
125
|
-
spc_max_tornado: string;
|
|
126
|
-
spc_max_hail: string;
|
|
127
|
-
spc_max_wind: string;
|
|
128
|
-
spc_watch_issuance: string;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
type TypeHVTEC = {
|
|
133
|
-
hvtec: string;
|
|
134
|
-
severity: string;
|
|
135
|
-
cause: string;
|
|
136
|
-
record: string;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
type TypePVTEC = {
|
|
140
|
-
vtec: string;
|
|
141
|
-
product: string;
|
|
142
|
-
tracking: string;
|
|
143
|
-
event: string;
|
|
144
|
-
status: string;
|
|
145
|
-
organization: string;
|
|
146
|
-
expires: string;
|
|
147
|
-
is_watch: boolean;
|
|
148
|
-
prediction_center: boolean;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
type TypeEvent = {
|
|
152
|
-
type: string;
|
|
153
|
-
geometry: {
|
|
154
|
-
type: string;
|
|
155
|
-
coordinates: number[][];
|
|
156
|
-
};
|
|
157
|
-
properties: {
|
|
158
|
-
event: string;
|
|
159
|
-
parent: string;
|
|
160
|
-
status: string;
|
|
161
|
-
issued: string;
|
|
162
|
-
expires: string;
|
|
163
|
-
status_metadata?: {
|
|
164
|
-
is_issued?: boolean;
|
|
165
|
-
is_updated?: boolean;
|
|
166
|
-
is_expired?: boolean;
|
|
167
|
-
is_test?: boolean;
|
|
168
|
-
is_statement?: boolean;
|
|
169
|
-
};
|
|
170
|
-
metadata: {
|
|
171
|
-
ms: number;
|
|
172
|
-
source: string;
|
|
173
|
-
tracking: string;
|
|
174
|
-
hash?: string;
|
|
175
|
-
header: string;
|
|
176
|
-
vtec: TypePVTEC | null;
|
|
177
|
-
hvtec: TypeHVTEC[];
|
|
178
|
-
nodes?: {
|
|
179
|
-
id?: string | number;
|
|
180
|
-
coordinates: [number, number];
|
|
181
|
-
nearest: [number, number];
|
|
182
|
-
miles: number | null;
|
|
183
|
-
kilometers: number | null;
|
|
184
|
-
proximity: boolean;
|
|
185
|
-
}[];
|
|
186
|
-
filtered_proximity?: boolean;
|
|
187
|
-
updated?: number;
|
|
188
|
-
history: {
|
|
189
|
-
description: string;
|
|
190
|
-
issued: string;
|
|
191
|
-
status: string;
|
|
192
|
-
}[];
|
|
193
|
-
};
|
|
194
|
-
} & TypeEventProperties;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
interface GetGeometryResponse {
|
|
198
|
-
type: `Polygon` | `MultiPolygon`;
|
|
199
|
-
coordinates: any[];
|
|
200
|
-
}
|
|
201
|
-
declare const getEventGeometry: (event: TypeEvent) => Promise<GetGeometryResponse>;
|
|
202
|
-
|
|
203
|
-
declare const getCleanedEvent: <T extends Record<string, any>>(event: T) => T;
|
|
204
|
-
|
|
205
|
-
declare const startService: (configurations: TypeSettings) => Promise<void>;
|
|
206
|
-
|
|
207
|
-
declare const stopService: () => Promise<void>;
|
|
208
|
-
|
|
209
|
-
interface GenerateEASOptions {
|
|
210
|
-
message: string;
|
|
211
|
-
header: string;
|
|
212
|
-
}
|
|
213
|
-
declare const setEasTone: (options: GenerateEASOptions) => Promise<string>;
|
|
214
|
-
|
|
215
|
-
interface GetAddChaserOptions {
|
|
216
|
-
identifier: string;
|
|
217
|
-
delete?: boolean;
|
|
218
|
-
coordinates: {
|
|
219
|
-
longitude: number;
|
|
220
|
-
latitude: number;
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
declare const setNode: (options: GetAddChaserOptions) => void;
|
|
224
|
-
|
|
225
|
-
declare const getEvents: () => any;
|
|
226
|
-
|
|
227
|
-
declare const getNodes: () => any;
|
|
228
|
-
|
|
229
|
-
declare const getRandomEvent: () => any;
|
|
230
|
-
|
|
231
|
-
declare const clearEvents: () => void;
|
|
232
|
-
|
|
233
|
-
declare class Manager {
|
|
234
|
-
constructor(settings: TypeSettings);
|
|
235
|
-
on(event: string, callback: () => void): void;
|
|
236
|
-
trycatch(): void;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export { Manager, type TypeEvent, clearEvents, Manager as default, getCleanedEvent, getEventGeometry, getEvents, getNodes, getRandomEvent, setEasTone, setNode, setSettings, startService, stopService };
|