@atmosx/event-product-parser 3.0.62 → 3.0.75
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/.github/docs/docs-functions.md +1 -1
- package/.github/docs/docs-general-configurations.md +1 -11
- package/.github/docs/docs-integrations.md +3 -2
- package/README.md +10 -8
- package/dist/cjs/index.cjs +24482 -7207
- package/dist/esm/index.mjs +24275 -7003
- package/package.json +56 -47
- package/pnpm-workspace.yaml +4 -0
- package/src/bootstrap.ts +65 -48
- package/src/{@building → building}/CreateEvent.ts +22 -24
- package/src/{@building → building}/GetCleanedEvent.ts +2 -2
- package/src/{@building → building}/GetEventAttachments.ts +14 -12
- package/src/building/GetEventDirection.ts +28 -0
- package/src/{@building → building}/GetEventEnhancedName.ts +5 -8
- package/src/{@building → building}/GetEventGeometry.ts +19 -13
- package/src/{@building → building}/GetEventHeader.ts +13 -13
- package/src/{@building → building}/GetEventNodes.ts +22 -20
- package/src/{@building → building}/GetEventOffice.ts +13 -13
- package/src/building/GetEventPopulation.ts +58 -0
- package/src/building/GetEventProperties.ts +106 -0
- package/src/{@building → building}/GetEventSignature.ts +9 -9
- package/src/{@building → building}/GetEventTags.ts +3 -3
- package/src/building/GetEventTheme.ts +26 -0
- package/src/building/GetEventTracking.ts +64 -0
- package/src/components/audio/GenerateAudioMessage.ts +149 -0
- package/src/{@modules/@eas → components/audio/components}/GetCleanDescription.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetFloatPCM16.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetMergedPCM16.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetPCM16.ts +13 -8
- package/src/{@modules/@eas → components/audio/components}/GetPCMToFloat.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetSampledPCM16.ts +14 -8
- package/src/{@modules/@eas → components/audio/components}/GetTTS.ts +17 -10
- package/src/{@modules/@eas → components/audio/components}/GetWavPCM16.ts +7 -7
- package/src/{@modules/@eas → components/audio/components}/SetAFSK.ts +13 -8
- package/src/{@modules/@eas → components/audio/components}/SetAsciiToBits.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/SetAttentionTone.ts +11 -6
- package/src/{@modules/@eas → components/audio/components}/SetNoise.ts +12 -7
- package/src/{@modules/@eas → components/audio/components}/SetRadioEffect.ts +12 -7
- package/src/{@modules/@eas → components/audio/components}/SetSameHeader.ts +22 -14
- package/src/{@modules/@utilities/SetWarning.ts → components/database/CreateQuery.ts} +18 -13
- package/src/{@modules/@database → components/database}/GetCachedEvents.ts +18 -15
- package/src/components/database/ImportBoundaries.ts +168 -0
- package/src/{@modules/@database → components/database}/ImportBroadcastify.ts +14 -24
- package/src/components/database/ImportCities.ts +87 -0
- package/src/{@modules/@database → components/database}/ImportShapefiles.ts +23 -26
- package/src/{@modules/@database → components/database}/ImportStanza.ts +15 -19
- package/src/components/database/InitializeDatabase.ts +71 -0
- package/src/components/images/GenerateGraphic.ts +242 -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 → components/stanza}/GetAwipsType.ts +16 -17
- package/src/{@modules/@stanza → components/stanza}/ValidateStanza.ts +27 -15
- package/src/{@modules/@utilities → components/utilities}/CreateHttp.ts +26 -26
- package/src/{@parsers/@text → components/utilities}/GetEmbededText.ts +8 -6
- package/src/{@modules/@utilities → components/utilities}/GetFormattedTime.ts +2 -2
- package/src/{@modules/@utilities → components/utilities}/GetLatestIssuance.ts +2 -2
- package/src/{@modules/@utilities → components/utilities}/GetMatched.ts +10 -5
- package/src/{@modules/@utilities → components/utilities}/GetShapeNearestPoint.ts +24 -19
- package/src/{@parsers/@text → components/utilities}/GetStringText.ts +9 -9
- package/src/components/utilities/GetUnionPolygon.ts +36 -0
- package/src/components/utilities/QueueManager.ts +70 -0
- package/src/components/utilities/SetCronSchedule.ts +106 -0
- package/src/{@modules/@utilities → components/utilities}/SetDebug.ts +12 -12
- package/src/components/utilities/SetEventEmit.ts +42 -0
- package/src/{@modules/@utilities → components/utilities}/SetSettings.ts +7 -7
- package/src/{@modules/@utilities → 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 → components/xmpp}/DeployXMPP.ts +20 -20
- package/src/{@core/CreateListener.ts → components/xmpp/ErrorXMPP.ts} +8 -5
- package/src/{@modules/@xmpp → components/xmpp}/OfflineXMPP.ts +13 -13
- package/src/{@modules/@xmpp → components/xmpp}/OnlineXMPP.ts +18 -18
- package/src/components/xmpp/ReconnectXMPP.ts +64 -0
- package/src/{@modules/@xmpp → components/xmpp}/StanzaXMPP.ts +25 -25
- package/src/{@core → core}/ClearEvents.ts +9 -9
- package/src/{@core → core}/GetEvents.ts +4 -4
- package/src/{@core → core}/GetNodes.ts +4 -4
- package/src/{@core → core}/GetRandomEvent.ts +4 -4
- package/src/{@core → core}/GetVersion.ts +4 -4
- package/src/{@core → core}/ManualEvent.ts +23 -24
- package/src/{@core → core}/QueryStanza.ts +12 -11
- package/src/core/SetNode.ts +87 -0
- package/src/{@core → core}/StartService.ts +21 -20
- package/src/{@core → core}/StopService.ts +10 -10
- package/src/{@enums → enums}/AWIPS.ts +2 -2
- package/src/{@enums → enums}/Actions.ts +2 -2
- package/src/{@enums → enums}/Cancellation.ts +2 -2
- package/src/{@enums → enums}/Causes.ts +2 -2
- package/src/{@enums → enums}/Correlations.ts +2 -2
- package/src/{@enums → enums}/Enhanced.ts +4 -3
- package/src/{@enums → enums}/Events.ts +2 -2
- package/src/{@enums → enums}/Expressions.ts +3 -3
- package/src/{@enums → enums}/GlobalFilter.ts +2 -2
- package/src/{@enums → enums}/Hail.ts +2 -2
- package/src/{@enums → enums}/ICAO.ts +2 -2
- package/src/{@enums → enums}/Matches.ts +8 -3
- package/src/{@enums → enums}/Products.ts +2 -2
- package/src/{@enums → enums}/Records.ts +2 -2
- package/src/{@enums → enums}/Severity.ts +2 -2
- package/src/{@enums → enums}/Shapefiles.ts +2 -2
- package/src/{@enums → enums}/States.ts +68 -4
- package/src/{@enums → enums}/Status.ts +2 -2
- package/src/{@enums → enums}/Strings.ts +2 -2
- package/src/{@enums → enums}/Tags.ts +9 -4
- package/src/{@enums → enums}/Testing.ts +2 -2
- package/src/enums/Themes.ts +70 -0
- package/src/events/ParseAPI.ts +133 -0
- package/src/{@events → events}/ParseText.ts +24 -22
- package/src/{@events → events}/ParseUGC.ts +27 -26
- package/src/{@events → events}/ParseVTEC.ts +38 -37
- package/src/index.ts +57 -37
- package/src/{@manager → manager}/MakeEvents.ts +38 -47
- package/src/manager/RemoveEvent.ts +74 -0
- package/src/{@manager → manager}/SetHash.ts +18 -13
- package/src/{@manager → manager}/UpdateEvents.ts +12 -12
- package/src/{@manager → manager}/UpdateNode.ts +14 -14
- package/src/{@manager → manager}/ValidateEvents.ts +55 -45
- package/src/{@parsers/@hvtec → parsers/hvtec}/HVExtract.ts +11 -11
- package/src/{@parsers/@text → parsers/text}/GetDescriptionFromProduct.ts +20 -21
- package/src/parsers/text/GetPolygonFromProduct.ts +71 -0
- package/src/{@parsers/@text → parsers/text}/GetTextFromProduct.ts +12 -12
- package/src/parsers/ugc/GetCache.ts +24 -0
- package/src/{@parsers/@ugc → parsers/ugc}/GetExpiry.ts +2 -2
- package/src/{@parsers/@ugc/GetUGCHeader.ts → parsers/ugc/GetHeader.ts} +4 -4
- package/src/{@parsers/@ugc → parsers/ugc}/GetLocations.ts +10 -10
- package/src/parsers/ugc/GetZonePolygon.ts +73 -0
- package/src/{@parsers/@ugc → parsers/ugc}/GetZones.ts +3 -3
- package/src/{@parsers/@ugc → parsers/ugc}/SetCache.ts +13 -8
- package/src/{@parsers/@ugc → parsers/ugc}/UGCExtract.ts +14 -14
- package/src/{@parsers/@pvtec → parsers/vtec}/GetExpiry.ts +2 -2
- package/src/parsers/vtec/VTECExtract.ts +49 -0
- package/src/{@types → static}/Attributes.ts +2 -3
- package/src/{@types → static}/Event.ts +8 -7
- package/src/{@types → static}/Properties.ts +17 -3
- package/src/{@types → static}/Stanza.ts +2 -2
- package/src/tasks/CreateTasks.ts +116 -0
- package/src/tasks/TaskGenerateJSON.ts +34 -0
- package/src/tasks/TaskGenerateText.ts +34 -0
- package/src/tasks/TaskSendNTFY.ts +95 -0
- package/src/tasks/TaskSendWebhook.ts +107 -0
- package/src/{@types → types}/Actions.ts +3 -3
- package/src/{@types → types}/HVTEC.ts +6 -6
- package/src/{@types → types}/Hash.ts +5 -5
- package/src/types/Nodes.ts +29 -0
- package/src/{@types → types}/Settings.ts +17 -8
- package/src/{@types → types}/StanzaCompiled.ts +15 -15
- package/src/{@types → types}/UGC.ts +5 -5
- package/src/{@modules/@utilities/GetSettings.ts → types/VTEC.ts} +12 -7
- package/tools/build.js +47 -0
- package/tsconfig.json +28 -1
- package/src/@building/GetEventProperties.ts +0 -96
- package/src/@building/GetEventTracking.ts +0 -68
- package/src/@core/SetNode.ts +0 -81
- package/src/@events/ParseAPI.ts +0 -117
- package/src/@manager/RemoveEvent.ts +0 -70
- package/src/@manager/Tasks.ts +0 -246
- package/src/@modules/@database/InitializeDatabase.ts +0 -59
- package/src/@modules/@eas/GenerateEASMessage.ts +0 -144
- package/src/@modules/@utilities/SetCronSchedule.ts +0 -94
- package/src/@modules/@utilities/SetEventEmit.ts +0 -41
- package/src/@modules/@utilities/SetListener.ts +0 -30
- package/src/@modules/@utilities/SetTimeoutAction.ts +0 -64
- package/src/@modules/@xmpp/ErrorXMPP.ts +0 -27
- package/src/@modules/@xmpp/ReconnectXMPP.ts +0 -64
- package/src/@parsers/@pvtec/VTECExtract.ts +0 -49
- package/src/@parsers/@text/GetPolygonFromProduct.ts +0 -53
- package/src/@parsers/@text/GetXML.ts +0 -61
- package/src/@parsers/@ugc/GetCache.ts +0 -24
- package/src/@parsers/@ugc/GetZonePolygon.ts +0 -111
- package/src/@types/VTEC.ts +0 -30
- package/tsup.config.ts +0 -16
package/package.json
CHANGED
|
@@ -1,47 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@atmosx/event-product-parser",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "NOAA Weather Wire & NWS API Parser - Built for standalone and Project AtmosphericX Integration.",
|
|
5
|
-
"main": "dist/cjs/index.cjs",
|
|
6
|
-
"module": "dist/esm/index.mjs",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/AtmosphericX/event-product-parser",
|
|
10
|
-
"branch": "v3-beta-branch"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"start": "cd ./test && node ./index.js",
|
|
14
|
-
"build": "
|
|
15
|
-
"
|
|
16
|
-
"publish
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@atmosx/event-product-parser",
|
|
3
|
+
"version": "3.0.75",
|
|
4
|
+
"description": "NOAA Weather Wire & NWS API Parser - Built for standalone and Project AtmosphericX Integration.",
|
|
5
|
+
"main": "dist/cjs/index.cjs",
|
|
6
|
+
"module": "dist/esm/index.mjs",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/AtmosphericX/event-product-parser",
|
|
10
|
+
"branch": "v3-beta-branch"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"start": "cd ./test && node ./index.js",
|
|
14
|
+
"build": "node ./tools/build.js && cd ./test && node index.js",
|
|
15
|
+
"watch": "node ./tools/build.js --watch",
|
|
16
|
+
"publish": "node ./tools/build.js && npm publish --access public",
|
|
17
|
+
"publish-beta-branch": "node ./tools/build.js && npm publish --tag v3-beta-branch --access public"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"NWWS",
|
|
21
|
+
"NOAA Weather Wire Service",
|
|
22
|
+
"TypeScript",
|
|
23
|
+
"XMPP",
|
|
24
|
+
"Parser",
|
|
25
|
+
"JavaScript",
|
|
26
|
+
"CommonJS",
|
|
27
|
+
"ESM"
|
|
28
|
+
],
|
|
29
|
+
"author": "k3yomi, StarflightWx",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/AtmosphericX/event-product-parser/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/AtmosphericX/event-product-parser#readme",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@xmpp/client": "0.14.0",
|
|
37
|
+
"better-sqlite3": "12.9.0",
|
|
38
|
+
"croner": "10.0.1",
|
|
39
|
+
"d3-geo": "3.1.1",
|
|
40
|
+
"esbuild": "0.28.1",
|
|
41
|
+
"jszip": "3.10.1",
|
|
42
|
+
"polygon-clipping": "0.15.7",
|
|
43
|
+
"shapefile": "0.6.6",
|
|
44
|
+
"sharp": "0.35.3",
|
|
45
|
+
"topojson-client": "3.1.0",
|
|
46
|
+
"typescript": "5.9.3"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/better-sqlite3": "7.6.13",
|
|
50
|
+
"@types/d3-geo": "3.1.0",
|
|
51
|
+
"@types/node": "25.2.0",
|
|
52
|
+
"@types/shapefile": "0.6.4",
|
|
53
|
+
"@types/topojson-client": "3.1.5",
|
|
54
|
+
"@types/xmpp__client": "0.14.1"
|
|
55
|
+
}
|
|
56
|
+
}
|
package/src/bootstrap.ts
CHANGED
|
@@ -11,53 +11,63 @@
|
|
|
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
|
|
21
|
-
import {
|
|
20
|
+
import { TypeEvent } from "StaticTypes/Event"
|
|
21
|
+
import { TypeHash } from "Types/Hash"
|
|
22
|
+
import { TypeActions } from "Types/Actions"
|
|
23
|
+
import { TypeNode } from "Types/Nodes"
|
|
24
|
+
import { EnumThemes } from "@Enums/Themes"
|
|
25
|
+
import { EventEmitter } from "node:events"
|
|
26
|
+
import { client } from "@xmpp/client"
|
|
27
|
+
import { Database } from "better-sqlite3"
|
|
28
|
+
import { join } from "path"
|
|
22
29
|
|
|
23
|
-
export const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
export const Bootstrap = {
|
|
31
|
+
Version: `3.0.75`,
|
|
32
|
+
Ready: true,
|
|
33
|
+
Ratelimits: {} as Record<string, number[]>,
|
|
34
|
+
Session: null as ReturnType<typeof client>,
|
|
35
|
+
Database: null as Database,
|
|
36
|
+
Job: null as unknown,
|
|
37
|
+
Listener: new EventEmitter(),
|
|
38
|
+
Colors: {
|
|
39
|
+
Red: `\x1b[31m`, Green: `\x1b[32m`, Yellow: `\x1b[33m`,
|
|
40
|
+
Blue: `\x1b[34m`, Magenta: `\x1b[35m`, Cyan: `\x1b[36m`,
|
|
41
|
+
White: `\x1b[37m`, Reset: `\x1b[0m`
|
|
35
42
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
Cache: {
|
|
44
|
+
LastStanzaTime: null as number,
|
|
45
|
+
Connected: false,
|
|
46
|
+
Reconnecting: false,
|
|
47
|
+
TotalReconnects: 0,
|
|
48
|
+
Hault: false,
|
|
49
|
+
Events: {type: "FeatureCollection", features: [] as TypeEvent[]},
|
|
50
|
+
Nodes: {type: "FeatureCollection", features: [] as TypeNode[]},
|
|
51
|
+
Hashes: [] as TypeHash[],
|
|
52
|
+
Parsed: [] as TypeEvent[],
|
|
53
|
+
UGC: new Map<string, string[]>()
|
|
47
54
|
},
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
Settings: {
|
|
56
|
+
Timezone: "UTC",
|
|
57
|
+
Database: join(process.cwd(), 'shapefiles.db'),
|
|
58
|
+
DebugDisableAllEvents: false,
|
|
50
59
|
EnableWireService: false,
|
|
51
60
|
EnableDebugging: false,
|
|
52
61
|
EnableJournal: true,
|
|
62
|
+
EnhancedEventJournaling: false,
|
|
53
63
|
NOAAWeatherWireServiceSettings: {
|
|
54
64
|
ReconnectionSettings: {
|
|
55
65
|
Enabled: true,
|
|
56
66
|
ReconnectionInterval: 60,
|
|
57
67
|
},
|
|
58
68
|
CredentialSettings: {
|
|
59
|
-
Username: null,
|
|
60
|
-
Password: null,
|
|
69
|
+
Username: null as string,
|
|
70
|
+
Password: null as string,
|
|
61
71
|
Nickname: "@atmosx/event-product-parser/3.0",
|
|
62
72
|
},
|
|
63
73
|
CacheSettings: {
|
|
@@ -80,45 +90,52 @@ export const bootstrap = {
|
|
|
80
90
|
BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
|
|
81
91
|
BroadcastifyTags: [`Ham`, `Air`, `Fire`, `Public Safety`, `Weather`, `EMS`, `Police`, `Rail`]
|
|
82
92
|
},
|
|
93
|
+
BoundarySettings: {
|
|
94
|
+
BoundaryDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/counties-10m.json`,
|
|
95
|
+
CityDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/cities500.json`
|
|
96
|
+
},
|
|
83
97
|
NotifyServer: {
|
|
84
98
|
Enabled: false,
|
|
85
99
|
Server: `https://ntfy.sh`,
|
|
86
|
-
Timezone: "UTC",
|
|
87
100
|
MediaStorage: {
|
|
88
|
-
|
|
89
|
-
TEXT: null,
|
|
90
|
-
JSON: null,
|
|
101
|
+
AUDIO: null as string,
|
|
102
|
+
TEXT: null as string,
|
|
103
|
+
JSON: null as string,
|
|
104
|
+
IMAGE: null as string
|
|
91
105
|
},
|
|
92
106
|
Credentials: {
|
|
93
|
-
Username: null,
|
|
94
|
-
Password: null
|
|
107
|
+
Username: null as string,
|
|
108
|
+
Password: null as string
|
|
95
109
|
}
|
|
96
110
|
},
|
|
97
|
-
ActionSettings: [],
|
|
111
|
+
ActionSettings: [] as TypeActions[],
|
|
98
112
|
GlobalSettings: {
|
|
99
113
|
EventManagement: true,
|
|
100
114
|
DisableGeometryParsing: false,
|
|
101
115
|
UseShapefileCoordinates: true,
|
|
102
116
|
SPCWatchesOnly: true,
|
|
103
|
-
|
|
117
|
+
CensusPopulationData: true,
|
|
104
118
|
NodeTTL: 60,
|
|
105
119
|
NodeMaxDistance: 120,
|
|
106
120
|
EventFiltering: {
|
|
107
|
-
ListeningEvents: [],
|
|
108
|
-
ListeningICAO: [],
|
|
109
|
-
ListeningUGC: [],
|
|
110
|
-
ListeningStates: [],
|
|
111
|
-
IgnoredICAO: [],
|
|
121
|
+
ListeningEvents: [] as string[],
|
|
122
|
+
ListeningICAO: [] as string[],
|
|
123
|
+
ListeningUGC: [] as string[],
|
|
124
|
+
ListeningStates: [] as string[],
|
|
125
|
+
IgnoredICAO: [] as string[],
|
|
112
126
|
IgnoredEvents: [`Test Message`],
|
|
113
127
|
NodeLocationFiltering: false,
|
|
114
128
|
IgnoreTestProducts: true,
|
|
115
129
|
},
|
|
130
|
+
Themes: EnumThemes,
|
|
116
131
|
ArchiveSettings: {
|
|
117
132
|
TTL: 60,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
ImageDirectory: `Archive/Images` as string,
|
|
134
|
+
JSONDirectory: `Archive/Products` as string,
|
|
135
|
+
TextDirectory: `Archive/Text` as string,
|
|
136
|
+
AudioDirectory: `Archive/Audio` as string,
|
|
137
|
+
Logo: null as string,
|
|
138
|
+
AudioToneout: null as string
|
|
122
139
|
}
|
|
123
140
|
}
|
|
124
141
|
},
|
|
@@ -11,46 +11,44 @@
|
|
|
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 { TypeStanzaCompiled } from "
|
|
21
|
-
import { TypeSettings } from "
|
|
22
|
-
import {
|
|
23
|
-
import { ParseText } from "
|
|
24
|
-
import { ParseUGC } from "
|
|
25
|
-
import { ParseVTEC } from "
|
|
26
|
-
import { ParseAPI } from "
|
|
27
|
-
import { ValidateEvents } from "
|
|
20
|
+
import { TypeStanzaCompiled } from "Types/StanzaCompiled"
|
|
21
|
+
import { TypeSettings } from "Types/Settings"
|
|
22
|
+
import { Bootstrap } from "@Bootstrap"
|
|
23
|
+
import { ParseText } from "@Events/ParseText"
|
|
24
|
+
import { ParseUGC } from "@Events/ParseUGC"
|
|
25
|
+
import { ParseVTEC } from "@Events/ParseVTEC"
|
|
26
|
+
import { ParseAPI } from "@Events/ParseAPI"
|
|
27
|
+
import { ValidateEvents } from "@Manager/ValidateEvents"
|
|
28
28
|
|
|
29
|
-
export const CreateEvent = async (
|
|
30
|
-
const settings =
|
|
29
|
+
export const CreateEvent = async (Stanza: TypeStanzaCompiled): Promise<void | string> => {
|
|
30
|
+
const settings = Bootstrap.Settings as TypeSettings
|
|
31
31
|
const StanzaSettings = settings.NOAAWeatherWireServiceSettings.StanzaSettings;
|
|
32
32
|
|
|
33
|
-
const isVtecEvent = (
|
|
34
|
-
const isUgcEvent = (!
|
|
35
|
-
const isTextEvent = (!
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const isVtecEvent = (Stanza.VTEC && Stanza.UGC)
|
|
34
|
+
const isUgcEvent = (!Stanza.VTEC && Stanza.UGC)
|
|
35
|
+
const isTextEvent = (!Stanza.VTEC && !Stanza.UGC)
|
|
36
|
+
|
|
37
|
+
const isNWWS = (Stanza.NWWS)
|
|
38
38
|
switch (true) {
|
|
39
39
|
case (!isNWWS):
|
|
40
|
-
await ParseAPI(
|
|
40
|
+
await ParseAPI(Stanza)
|
|
41
41
|
break;
|
|
42
42
|
case (isNWWS && !StanzaSettings.DisableVTEC && isVtecEvent):
|
|
43
|
-
await ParseVTEC(
|
|
43
|
+
await ParseVTEC(Stanza)
|
|
44
44
|
break;
|
|
45
45
|
case (isNWWS && !StanzaSettings.DisableUGC && isUgcEvent):
|
|
46
|
-
await ParseUGC(
|
|
46
|
+
await ParseUGC(Stanza)
|
|
47
47
|
break;
|
|
48
48
|
case (isNWWS && !StanzaSettings.DisableText && isTextEvent):
|
|
49
|
-
await ParseText(
|
|
49
|
+
await ParseText(Stanza)
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
await ValidateEvents(bootstrap.cache.processed)
|
|
54
|
-
}
|
|
52
|
+
await ValidateEvents(Bootstrap.Cache.Parsed)
|
|
55
53
|
return 'nothing picked';
|
|
56
54
|
}
|
|
@@ -11,9 +11,9 @@
|
|
|
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
|
|
|
@@ -11,17 +11,18 @@
|
|
|
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 { TypeEvent } from "
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { EnumExpressions } from "
|
|
24
|
-
import { GetLatestIssuance } from "
|
|
20
|
+
import { TypeEvent } from "StaticTypes/Event"
|
|
21
|
+
import { EnumStates } from "@Enums/States"
|
|
22
|
+
import { Bootstrap } from "@Bootstrap"
|
|
23
|
+
import { EnumExpressions } from "@Enums/Expressions"
|
|
24
|
+
import { GetLatestIssuance } from "@Utilities/GetLatestIssuance"
|
|
25
|
+
import { CreateQuery } from "@Database/CreateQuery"
|
|
25
26
|
|
|
26
27
|
interface GetEventAttachmentsResponse {
|
|
27
28
|
name: string
|
|
@@ -38,7 +39,7 @@ type BroadcastifyResponse = {
|
|
|
38
39
|
|
|
39
40
|
export const GetEventAttachments = (event: TypeEvent): GetEventAttachmentsResponse[] | null => {
|
|
40
41
|
let attachments = [];
|
|
41
|
-
const settings =
|
|
42
|
+
const settings = Bootstrap.Settings;
|
|
42
43
|
const issuanceTime = GetLatestIssuance();
|
|
43
44
|
const spcNumber = event?.properties?.discussion_parameters?.discussion_number;
|
|
44
45
|
const watchNumber = event?.properties?.watch_parameters?.watch_number;
|
|
@@ -64,14 +65,15 @@ export const GetEventAttachments = (event: TypeEvent): GetEventAttachmentsRespon
|
|
|
64
65
|
const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`]
|
|
65
66
|
const county = location?.split(',')[0]?.trim().replace(new RegExp(`^(${lines.join('|')}) `), '')
|
|
66
67
|
const state = EnumStates[location?.split(',')[1]?.trim()]
|
|
67
|
-
const feeds =
|
|
68
|
+
const feeds = CreateQuery({ Query: `SELECT * FROM broadcastify WHERE state = ? AND county = ?`, Parameters: [state, county] }) as BroadcastifyResponse[];
|
|
69
|
+
const so = feeds.sort((a: BroadcastifyResponse, b: BroadcastifyResponse) => {
|
|
68
70
|
const typeOrder = ['Other', 'Public Safety'];
|
|
69
71
|
const indexA = typeOrder.indexOf(a.type);
|
|
70
72
|
const indexB = typeOrder.indexOf(b.type);
|
|
71
73
|
return indexA - indexB;
|
|
72
|
-
})
|
|
73
|
-
const tags =
|
|
74
|
-
const filtered =
|
|
74
|
+
});
|
|
75
|
+
const tags = Bootstrap.Settings.BroadcastifySettings.BroadcastifyTags;
|
|
76
|
+
const filtered = so.filter((feed: BroadcastifyResponse) => tags.includes(feed.type));
|
|
75
77
|
if (filtered.length > 0) {
|
|
76
78
|
filtered.map((filtered: BroadcastifyResponse) => {
|
|
77
79
|
if (!attachments.some((a) => a.link === filtered.link)) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
_ _ _ __ __
|
|
3
|
+
/\ | | | | (_) \ \ / /
|
|
4
|
+
/ \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
|
|
5
|
+
/ /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
|
|
6
|
+
/ ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
|
|
7
|
+
/_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
|
|
8
|
+
| |
|
|
9
|
+
|_|
|
|
10
|
+
|
|
11
|
+
Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
|
|
12
|
+
Discord: https://atmosphericx-discord.scriptkitty.cafe
|
|
13
|
+
Ko-Fi: https://ko-fi.com/k3yomi
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
|
+
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
|
+
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export const GetEventDirection = (message: string): string | null => {
|
|
21
|
+
const direction = message
|
|
22
|
+
.replace(/\s+/g, ' ')
|
|
23
|
+
.match(/moving\s+(north|south|east|west|northeast|northwest|southeast|southwest)\s+at\s+(\d+)\s+mph/i);
|
|
24
|
+
if (direction) {
|
|
25
|
+
return direction[1].charAt(0).toUpperCase() + direction[1].slice(1).toLowerCase() + ` @ ${direction[2]} MPH`;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
@@ -11,21 +11,18 @@
|
|
|
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 { TypeEvent } from "
|
|
21
|
-
import {
|
|
22
|
-
import { EnumEnhanced } from "../@enums/Enhanced"
|
|
23
|
-
import { bootstrap } from "../bootstrap"
|
|
20
|
+
import { TypeEvent } from "StaticTypes/Event"
|
|
21
|
+
import { EnumEnhanced } from "@Enums/Enhanced"
|
|
24
22
|
|
|
25
23
|
export const GetEventEnhancedName = (event: TypeEvent): string => {
|
|
26
24
|
let name = event?.properties?.event;
|
|
27
|
-
|
|
28
|
-
const damage = event?.properties?.parameters?.damage_threat
|
|
25
|
+
const damage = event?.properties?.parameters?.damage_threat ?? event?.properties?.parameters?.flood_threat
|
|
29
26
|
const tornado = event?.properties?.parameters?.tornado_threat;
|
|
30
27
|
const pdswatch = event?.properties?.watch_parameters?.pds_watch;
|
|
31
28
|
const description = event?.properties?.description?.toLowerCase()
|
|
@@ -11,32 +11,38 @@
|
|
|
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 { TypeSettings } from "
|
|
21
|
-
import { TypeEvent } from "
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
20
|
+
import { TypeSettings } from "Types/Settings"
|
|
21
|
+
import { TypeEvent } from "StaticTypes/Event"
|
|
22
|
+
import { Bootstrap } from "@Bootstrap"
|
|
23
|
+
import { GetZonePolygon } from "@ParsingUGC/GetZonePolygon"
|
|
24
24
|
|
|
25
|
-
interface
|
|
25
|
+
interface GetEventGeometryOptions {
|
|
26
|
+
Event: TypeEvent
|
|
27
|
+
Union?: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface GetEventGeometryResponse {
|
|
26
31
|
type: `Polygon` | `MultiPolygon`
|
|
27
32
|
coordinates: any[]
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
export const GetEventGeometry = (
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
+
export const GetEventGeometry = ({ Event, Union }: GetEventGeometryOptions): GetEventGeometryResponse => {
|
|
36
|
+
const { properties } = Event;
|
|
37
|
+
const settings = Bootstrap.Settings as TypeSettings
|
|
38
|
+
const generated = properties?.geocode?.polygon ?? null;
|
|
39
|
+
const ugc = properties?.geocode?.ugc ?? null;
|
|
40
|
+
let geo: GetEventGeometryResponse = {
|
|
35
41
|
type: `Polygon`,
|
|
36
42
|
coordinates: generated != null ? JSON.parse(Buffer.from(generated, 'base64').toString('utf-8')) : null
|
|
37
43
|
}
|
|
38
44
|
if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc != null) {
|
|
39
|
-
geo =
|
|
45
|
+
geo = GetZonePolygon({Zones: ugc, Union: Union ?? false});
|
|
40
46
|
if (geo == null) {
|
|
41
47
|
geo = {
|
|
42
48
|
type: `Polygon`,
|
|
@@ -11,27 +11,27 @@
|
|
|
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 {
|
|
21
|
-
import { TypeEventProperties } from "
|
|
20
|
+
import { TypeVTEC } from "Types/VTEC"
|
|
21
|
+
import { TypeEventProperties } from "StaticTypes/Properties"
|
|
22
22
|
|
|
23
23
|
interface GetHeaderOptions {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
Properties: TypeEventProperties
|
|
25
|
+
VTEC?: TypeVTEC
|
|
26
|
+
Type: {
|
|
27
|
+
Type: string
|
|
28
|
+
Prefix: string
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export const GetEventHeader = (
|
|
33
|
-
const properties =
|
|
34
|
-
const vtec =
|
|
32
|
+
export const GetEventHeader = ({ Properties, VTEC, Type }: GetHeaderOptions): string => {
|
|
33
|
+
const properties = Properties
|
|
34
|
+
const vtec = VTEC ?? null
|
|
35
35
|
const ugc = properties.geocode.ugc != null ? properties.geocode.ugc.join(`-`) : `0`;
|
|
36
|
-
return `ZCZC-ATMOSX-${
|
|
36
|
+
return `ZCZC-ATMOSX-${Type?.Prefix}-${ugc}-${vtec?.Status ?? `Issued`}-${new Date().toISOString().replace(/[-:]/g, '').split('.')[0]}-${properties.geocode.office.office ?? `KWNS`}`
|
|
37
37
|
}
|
|
@@ -11,16 +11,16 @@
|
|
|
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 { TypeEvent } from "
|
|
21
|
-
import {
|
|
22
|
-
import { GetEventGeometry } from "
|
|
23
|
-
import { GetShapeNearestPoint } from "
|
|
20
|
+
import { TypeEvent } from "StaticTypes/Event"
|
|
21
|
+
import { Bootstrap } from "@Bootstrap"
|
|
22
|
+
import { GetEventGeometry } from "@Building/GetEventGeometry"
|
|
23
|
+
import { GetShapeNearestPoint } from "@Utilities/GetShapeNearestPoint"
|
|
24
24
|
|
|
25
25
|
interface GetEventNodesResponse {
|
|
26
26
|
nodes: {
|
|
@@ -36,34 +36,36 @@ interface GetEventNodesResponse {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export const GetEventNodes = async (event: TypeEvent): Promise<GetEventNodesResponse> => {
|
|
39
|
-
const nodes =
|
|
39
|
+
const nodes = Bootstrap.Cache.Nodes.features;
|
|
40
40
|
if (!nodes || nodes.length === 0) {
|
|
41
|
-
return { nodes: [], filtered:
|
|
41
|
+
return { nodes: [], filtered: false, updated: Date.now() };
|
|
42
42
|
}
|
|
43
|
-
const metadata = { nodes: [], proximity: false, filtered: false };
|
|
44
|
-
const geometry = await GetEventGeometry(event)
|
|
43
|
+
const metadata = { nodes: [] as GetEventNodesResponse['nodes'], proximity: false, filtered: false };
|
|
44
|
+
const geometry = await GetEventGeometry({ Event: event });;
|
|
45
45
|
if (!geometry || !geometry.coordinates) {
|
|
46
46
|
return { nodes: [], filtered: false, updated: Date.now() }
|
|
47
47
|
}
|
|
48
48
|
for (const node of nodes) {
|
|
49
|
-
const [longitude, latitude] = node
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const
|
|
49
|
+
const [longitude, latitude] = (node?.geometry?.coordinates ?? []) as [number, number];
|
|
50
|
+
|
|
51
|
+
const getPoint = GetShapeNearestPoint({ Coordinates: geometry.coordinates, Point: [longitude, latitude] });
|
|
52
|
+
const miles = getPoint.Distance ?? null;
|
|
53
|
+
const kilometers = miles != null ? Number((miles * 1.609344).toFixed(3)) : null;
|
|
53
54
|
|
|
54
55
|
const info = {
|
|
55
56
|
id: node.properties?.identifier,
|
|
56
|
-
coordinates: [longitude, latitude],
|
|
57
|
-
nearest: getPoint.
|
|
57
|
+
coordinates: [longitude, latitude] as [number, number],
|
|
58
|
+
nearest: getPoint.Point as [number, number],
|
|
58
59
|
miles,
|
|
59
60
|
kilometers,
|
|
60
61
|
proximity: false
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (miles != null && (
|
|
64
|
-
metadata.proximity = true;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
if (miles != null && (miles < Bootstrap.Settings.GlobalSettings.NodeMaxDistance)) {
|
|
65
65
|
info.proximity = true;
|
|
66
|
+
metadata.proximity = true;
|
|
66
67
|
}
|
|
68
|
+
metadata.nodes.push(info);
|
|
67
69
|
}
|
|
68
70
|
return {
|
|
69
71
|
nodes: metadata.nodes,
|