@atmosx/event-product-parser 3.0.3 → 3.0.6
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/README.md +163 -0
- package/.github/SUPPORTED_EVENTS.md +370 -0
- package/.github/docs/docs-functions.md +30 -0
- package/.github/docs/docs-general-configurations.md +209 -0
- package/.github/docs/docs-integrations.md +37 -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/dist/cjs/index.cjs +4681 -13425
- package/dist/esm/index.mjs +3163 -11909
- package/package.json +4 -8
- package/src/@building/{building.create.ts → CreateEvent.ts} +25 -11
- package/src/@building/{building.clean.ts → GetCleanedEvent.ts} +2 -2
- package/src/@building/GetEventAttachments.ts +86 -0
- package/src/@building/{building.enhance.ts → GetEventEnhancedName.ts} +11 -12
- package/src/@building/{building.geometry.ts → GetEventGeometry.ts} +7 -7
- package/src/@building/{building.headers.ts → GetEventHeader.ts} +3 -3
- package/src/@building/{building.polygon.ts → GetEventNodes.ts} +13 -11
- package/src/@building/{building.office.ts → GetEventOffice.ts} +6 -6
- package/src/@building/GetEventProperties.ts +96 -0
- package/src/@building/{building.signature.ts → GetEventSignature.ts} +14 -15
- package/src/@building/{building.tags.ts → GetEventTags.ts} +9 -4
- package/src/@building/{building.tracking.ts → GetEventTracking.ts} +15 -15
- package/src/@building/{building.validate.ts → ValidateEvents.ts} +67 -60
- package/src/@core/{core.clearEvents.ts → ClearEvents.ts} +3 -4
- package/src/@core/{core.createListener.ts → CreateListener.ts} +3 -3
- package/src/@core/{core.getEvents.ts → GetEvents.ts} +1 -2
- package/src/@core/{core.getNodes.ts → GetNodes.ts} +1 -2
- package/src/@core/{core.getRandomEvent.ts → GetRandomEvent.ts} +1 -2
- package/src/@core/{core.getVersion.ts → GetVersion.ts} +1 -2
- package/src/@core/ManualEvent.ts +56 -0
- package/src/@core/QueryStanza.ts +39 -0
- package/src/@core/{core.setNode.ts → SetNode.ts} +8 -8
- package/src/@core/{core.start.ts → StartService.ts} +21 -21
- package/src/@core/{core.stop.ts → StopService.ts} +1 -1
- package/src/@enums/AWIPS.ts +366 -0
- package/src/{@dictionaries/dictionaries.eventActions.ts → @enums/Actions.ts} +1 -1
- package/src/{@dictionaries/dictionaries.eventCancelMessages.ts → @enums/Cancellation.ts} +2 -1
- package/src/{@dictionaries/dictionaries.eventCauses.ts → @enums/Causes.ts} +1 -1
- package/src/{@dictionaries/dictionaries.statusCorrelationText.ts → @enums/Correlations.ts} +1 -1
- package/src/@enums/Enhanced.ts +70 -0
- package/src/{@dictionaries/dictionaries.eventTypes.ts → @enums/Events.ts} +1 -1
- package/src/{@dictionaries/dictionaries.regExp.ts → @enums/Expressions.ts} +2 -1
- package/src/@enums/GlobalFilter.ts +24 -0
- package/src/{@dictionaries/dictionaries.hailStrings.ts → @enums/Hail.ts} +7 -2
- package/src/{@dictionaries/dictionaries.officeICAOs.ts → @enums/ICAO.ts} +3 -1
- package/src/@enums/Matches.ts +55 -0
- package/src/{@dictionaries/dictionaries.eventProducts.ts → @enums/Products.ts} +1 -1
- package/src/{@dictionaries/dictionaries.eventRecords.ts → @enums/Records.ts} +1 -1
- package/src/{@dictionaries/dictionaries.eventSeverity.ts → @enums/Severity.ts} +1 -1
- package/src/{@dictionaries/dictionaries.shapefileLinks.ts → @enums/Shapefiles.ts} +1 -1
- package/src/@enums/States.ts +72 -0
- package/src/{@dictionaries/dictionaries.eventStatus.ts → @enums/Status.ts} +1 -1
- package/src/@enums/Strings.ts +22 -0
- package/src/@enums/Tags.ts +167 -0
- package/src/{@dictionaries/dictionaries.testSignatures.ts → @enums/Testing.ts} +3 -2
- package/src/@events/{events.api.ts → ParseAPI.ts} +42 -38
- package/src/@events/{events.text.ts → ParseText.ts} +25 -18
- package/src/@events/{events.ugc.ts → ParseUGC.ts} +28 -19
- package/src/@events/{events.vtec.ts → ParseVTEC.ts} +21 -21
- package/src/@manager/CreateActions.ts +213 -0
- package/src/@manager/{manager.mkEvent.ts → MakeEvent.ts} +34 -30
- package/src/@manager/RemoveEvent.ts +70 -0
- package/src/@manager/{manager.setHash.ts → SetHash.ts} +8 -9
- package/src/@manager/{manager.updateEvents.ts → UpdateEvents.ts} +9 -9
- package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +24 -17
- package/src/@modules/@database/{database.cache.ts → GetCachedEvents.ts} +10 -8
- package/src/@modules/@database/ImportBroadcastify.ts +70 -0
- package/src/@modules/@database/{database.shapefiles.ts → ImportShapefiles.ts} +17 -20
- package/src/@modules/@database/{database.stanza.ts → ImportStanza.ts} +5 -6
- package/src/@modules/@database/{database.init.ts → InitializeDatabase.ts} +25 -11
- package/src/@modules/@eas/GenerateEASMessage.ts +144 -0
- package/src/@modules/@eas/GetCleanDescription.ts +91 -0
- package/src/@modules/@eas/{eas.getFloatPCM16.ts → GetFloatPCM16.ts} +1 -1
- package/src/@modules/@eas/{eas.getMergedPCM16.ts → GetMergedPCM16.ts} +1 -1
- package/src/@modules/@eas/{eas.getPCM16.ts → GetPCM16.ts} +1 -1
- package/src/@modules/@eas/{eas.getPCMToFloat.ts → GetPCMToFloat.ts} +1 -1
- package/src/@modules/@eas/{eas.getSampledPCM16.ts → GetSampledPCM16.ts} +1 -1
- package/src/@modules/@eas/GetTTS.ts +54 -0
- package/src/@modules/@eas/{eas.getWavPCM16.ts → GetWavPCM16.ts} +1 -1
- package/src/@modules/@eas/{eas.setAFSK.ts → SetAFSK.ts} +1 -2
- package/src/@modules/@eas/{eas.setAsciiToBits.ts → SetAsciiToBits.ts} +1 -2
- package/src/@modules/@eas/{eas.setAttentionTone.ts → SetAttentionTone.ts} +1 -1
- package/src/@modules/@eas/{eas.setNoise.ts → SetNoise.ts} +6 -5
- package/src/@modules/@eas/{eas.setRadioEffect.ts → SetRadioEffect.ts} +6 -5
- package/src/@modules/@eas/{eas.setSameHeader.ts → SetSameHeader.ts} +7 -8
- package/src/@modules/@stanza/{stanza.getAwipsType.ts → GetAwipsType.ts} +11 -9
- package/src/@modules/@stanza/{stanza.validate.ts → ValidateStanza.ts} +9 -9
- package/src/@modules/@utilities/CreateHttp.ts +83 -0
- package/src/@modules/@utilities/{utilities.getFormattedTime.ts → GetFormattedTime.ts} +1 -1
- package/src/@modules/@utilities/GetLatestIssuance.ts +32 -0
- package/src/@modules/@utilities/GetMatched.ts +33 -0
- package/src/@modules/@utilities/{utilities.getSettings.ts → GetSettings.ts} +2 -2
- package/src/@modules/@utilities/{utilities.getShapeNearestPoint.ts → GetShapeNearestPoint.ts} +1 -1
- package/src/@modules/@utilities/{utilities.setCronSchedule.ts → SetCronSchedule.ts} +41 -12
- package/src/{@types/types.webhook.ts → @modules/@utilities/SetDebug.ts} +16 -6
- package/src/@modules/@utilities/{utilities.setEventEmit.ts → SetEventEmit.ts} +5 -5
- package/src/@modules/@utilities/{utilities.setListener.ts → SetListener.ts} +1 -1
- package/src/@modules/@utilities/{utilities.setSettings.ts → SetSettings.ts} +2 -2
- package/src/@modules/@utilities/{utilities.setSleep.ts → SetSleep.ts} +1 -1
- package/src/@modules/@utilities/{utilities.setTimeoutAction.ts → SetTimeoutAction.ts} +8 -3
- package/src/@modules/@utilities/{utilities.setWarning.ts → SetWarning.ts} +4 -4
- package/src/@modules/@xmpp/{xmpp.xDeploy.ts → DeployXMPP.ts} +13 -14
- package/src/@modules/@xmpp/{xmpp.xError.ts → ErrorXMPP.ts} +1 -3
- package/src/@modules/@xmpp/{xmpp.xOffline.ts → OfflineXMPP.ts} +3 -4
- package/src/@modules/@xmpp/{xmpp.xOnline.ts → OnlineXMPP.ts} +6 -5
- package/src/@modules/@xmpp/{xmpp.xReconnect.ts → ReconnectXMPP.ts} +8 -8
- package/src/@modules/@xmpp/{xmpp.xStanza.ts → StanzaXMPP.ts} +11 -11
- package/src/@parsers/@hvtec/{hvtec.extract.ts → HVExtract.ts} +10 -10
- package/src/@parsers/@pvtec/{pvtec.expires.ts → GetExpiry.ts} +1 -1
- package/src/@parsers/@pvtec/{pvtec.extract.ts → VTECExtract.ts} +17 -17
- package/src/@parsers/@text/{text.getDescriptionFromProduct.ts → GetDescriptionFromProduct.ts} +12 -5
- package/src/@parsers/@text/GetEmbededText.ts +56 -0
- package/src/@parsers/@text/{text.getPolygonFromProduct.ts → GetPolygonFromProduct.ts} +31 -10
- package/src/@parsers/@text/GetStringText.ts +58 -0
- package/src/@parsers/@text/{text.getTextFromProduct.ts → GetTextFromProduct.ts} +1 -1
- package/src/@parsers/@text/{text.getXML.ts → GetXML.ts} +1 -1
- package/src/@parsers/@ugc/GetCache.ts +24 -0
- package/src/@parsers/@ugc/{ugc.expiry.ts → GetExpiry.ts} +1 -1
- package/src/@parsers/@ugc/{ugc.locations.ts → GetLocations.ts} +35 -7
- package/src/@parsers/@ugc/{ugc.header.ts → GetUGCHeader.ts} +3 -3
- package/src/@parsers/@ugc/{ugc.coordinates.ts → GetZonePolygon.ts} +4 -3
- package/src/@parsers/@ugc/SetCache.ts +28 -0
- package/src/@parsers/@ugc/{ugc.extract.ts → UGCExtract.ts} +6 -6
- package/src/@types/Actions.ts +37 -0
- package/src/@types/{type.event.ts → Event.ts} +7 -5
- package/src/@types/{type.properties.ts → Properties.ts} +11 -8
- package/src/@types/{types.settings.ts → Settings.ts} +31 -7
- package/src/@types/{types.compiled.ts → StanzaCompiled.ts} +2 -1
- package/src/bootstrap.ts +33 -9
- package/src/index.ts +28 -26
- package/tsup.config.ts +1 -1
- package/README.md +0 -339
- package/dist/index.d.mts +0 -239
- package/dist/index.d.ts +0 -239
- package/src/@building/building.properties.ts +0 -89
- 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/@manager/manager.rmEvent.ts +0 -49
- package/src/@manager/manager.updateWebhooks.ts +0 -50
- package/src/@modules/@eas/eas.setEasTone.ts +0 -137
- package/src/@modules/@utilities/utilities.createHttp.ts +0 -85
- package/src/@modules/@utilities/utilities.createWebhook.ts +0 -115
- package/test.js +0 -91
- /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/src/@parsers/@ugc/{ugc.zones.ts → GetZones.ts} +0 -0
- /package/src/@types/{types.attributes.ts → Attributes.ts} +0 -0
- /package/src/@types/{types.hvtec.ts → HVTEC.ts} +0 -0
- /package/src/@types/{types.hash.ts → Hash.ts} +0 -0
- /package/src/@types/{types.stanza.ts → Stanza.ts} +0 -0
- /package/src/@types/{types.ugc.ts → UGC.ts} +0 -0
- /package/src/@types/{types.pvtec.ts → VTEC.ts} +0 -0
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeUGC } from "../../@types/
|
|
21
|
-
import { getUGCHeader } from "./
|
|
22
|
-
import { getZones } from "./
|
|
23
|
-
import {
|
|
24
|
-
import { getLocations } from "./
|
|
20
|
+
import { TypeUGC } from "../../@types/UGC";
|
|
21
|
+
import { getUGCHeader } from "./GetUGCHeader"
|
|
22
|
+
import { getZones } from "./GetZones";
|
|
23
|
+
import { GetExpiry } from './GetExpiry';
|
|
24
|
+
import { getLocations } from "./GetLocations";
|
|
25
25
|
|
|
26
26
|
export const ugcExtract = async (message: string): Promise<TypeUGC> => {
|
|
27
27
|
const head = getUGCHeader(message);
|
|
28
28
|
const ugcs = getZones(head)
|
|
29
|
-
const expires =
|
|
29
|
+
const expires = GetExpiry(message)
|
|
30
30
|
const areas = await getLocations(ugcs)
|
|
31
31
|
if (!head || ugcs?.length == 0) return;
|
|
32
32
|
return {
|
|
@@ -0,0 +1,37 @@
|
|
|
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: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
|
+
|
|
16
|
+
Internal Package: @atmosx/event-product-parser
|
|
17
|
+
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export type TypeActions = {
|
|
21
|
+
Events: string[]
|
|
22
|
+
Webhook?: {
|
|
23
|
+
Enabled: boolean
|
|
24
|
+
Destination: string
|
|
25
|
+
Ratelimit: number
|
|
26
|
+
Title: string
|
|
27
|
+
Message: string
|
|
28
|
+
}
|
|
29
|
+
NotificationServer?: {
|
|
30
|
+
Enabled: boolean
|
|
31
|
+
Topic: string
|
|
32
|
+
Priority?: string | number
|
|
33
|
+
}
|
|
34
|
+
Uploads?: {
|
|
35
|
+
TEXT?: boolean, EAS?: boolean, JSON?: boolean
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeEventProperties as BaseTypeEventProperties } from "./
|
|
21
|
-
import { TypeHVTEC } from "
|
|
22
|
-
import { TypePVTEC } from "./
|
|
20
|
+
import { TypeEventProperties as BaseTypeEventProperties } from "./Properties";
|
|
21
|
+
import { TypeHVTEC } from "./HVTEC";
|
|
22
|
+
import { TypePVTEC } from "./VTEC";
|
|
23
23
|
|
|
24
24
|
export type TypeEvent = {
|
|
25
25
|
type: string
|
|
@@ -46,8 +46,8 @@ export type TypeEvent = {
|
|
|
46
46
|
tracking: string
|
|
47
47
|
hash?: string
|
|
48
48
|
header: string
|
|
49
|
-
vtec
|
|
50
|
-
hvtec
|
|
49
|
+
vtec?: TypePVTEC | null
|
|
50
|
+
hvtec?: TypeHVTEC[] | null
|
|
51
51
|
nodes?: {
|
|
52
52
|
id?: string | number
|
|
53
53
|
coordinates: [number, number]
|
|
@@ -63,6 +63,8 @@ export type TypeEvent = {
|
|
|
63
63
|
issued: string
|
|
64
64
|
status: string
|
|
65
65
|
}[]
|
|
66
|
+
attachments?: { name: string; link: string }[]
|
|
67
|
+
raw: string
|
|
66
68
|
}
|
|
67
69
|
} & BaseTypeEventProperties
|
|
68
70
|
}
|
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "./
|
|
20
|
+
import { TypeAttributes } from "./Attributes";
|
|
21
21
|
|
|
22
22
|
export type TypeEventProperties = {
|
|
23
23
|
locations: string
|
|
24
|
+
locations_array: string[]
|
|
24
25
|
description: string
|
|
25
|
-
attributes
|
|
26
|
+
attributes?: TypeAttributes
|
|
26
27
|
geocode: {
|
|
27
28
|
office: {
|
|
28
29
|
name: string
|
|
@@ -33,7 +34,7 @@ export type TypeEventProperties = {
|
|
|
33
34
|
polygon: string
|
|
34
35
|
polygon_generated: boolean
|
|
35
36
|
}
|
|
36
|
-
parameters
|
|
37
|
+
parameters?: {
|
|
37
38
|
tags: string[]
|
|
38
39
|
instructions: string
|
|
39
40
|
source: string
|
|
@@ -66,10 +67,12 @@ export type TypeEventProperties = {
|
|
|
66
67
|
max_tops_x100feet: string
|
|
67
68
|
pds_watch: boolean
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
discussion_parameters?: {
|
|
71
|
+
discussion_number: string
|
|
72
|
+
discussion_concerning: string
|
|
73
|
+
discussion_max_tornado: string
|
|
74
|
+
discussion_max_hail: string
|
|
75
|
+
discussion_max_wind: string
|
|
76
|
+
discussion_watch_issuance: string
|
|
74
77
|
}
|
|
75
78
|
}
|
|
@@ -17,12 +17,15 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import { TypeActions } from "./Actions"
|
|
21
|
+
|
|
22
|
+
type TypeTimezones = string | "CST" | "CDT" | "MDT" | "MST" | "EST" | "EDT" | "HST" | "HDT" | "PDT" | "UTC"
|
|
21
23
|
|
|
22
24
|
export type TypeSettings = {
|
|
23
25
|
Database: string
|
|
24
26
|
EnableWireService: boolean
|
|
25
27
|
EnableJournal: boolean
|
|
28
|
+
EnableDebugging: boolean
|
|
26
29
|
NOAAWeatherWireServiceSettings: {
|
|
27
30
|
ReconnectionSettings: {
|
|
28
31
|
Enabled: boolean
|
|
@@ -48,16 +51,34 @@ export type TypeSettings = {
|
|
|
48
51
|
CallbackInterval: number
|
|
49
52
|
EventsEndpoint: string
|
|
50
53
|
}
|
|
54
|
+
BroadcastifySettings: {
|
|
55
|
+
BroadcastifyAttachments: boolean
|
|
56
|
+
BroadcastifyDatabase: string
|
|
57
|
+
BroadcastifyTags: string[]
|
|
58
|
+
},
|
|
59
|
+
NotifyServer: {
|
|
60
|
+
Enabled: boolean
|
|
61
|
+
Server: string
|
|
62
|
+
Timezone?: TypeTimezones
|
|
63
|
+
MediaStorage: {
|
|
64
|
+
TEXT?: string
|
|
65
|
+
JSON?: string
|
|
66
|
+
EAS?: string
|
|
67
|
+
}
|
|
68
|
+
Credentials?: {
|
|
69
|
+
Username: string | void
|
|
70
|
+
Password: string | void
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
ActionSettings?: TypeActions[]
|
|
51
74
|
GlobalSettings: {
|
|
52
75
|
EventManagement: boolean
|
|
53
|
-
BetterEventNames: boolean
|
|
54
76
|
DisableGeometryParsing: boolean
|
|
55
77
|
UseShapefileCoordinates: boolean
|
|
56
78
|
SPCWatchesOnly: boolean
|
|
57
79
|
ShapefileSkipPoints: number
|
|
58
80
|
NodeTTL: number
|
|
59
|
-
|
|
60
|
-
WebhookSettings?: TypeWebhook
|
|
81
|
+
NodeMaxDistance: number
|
|
61
82
|
EventFiltering: {
|
|
62
83
|
ListeningEvents: string[]
|
|
63
84
|
ListeningICAO: string[]
|
|
@@ -68,9 +89,12 @@ export type TypeSettings = {
|
|
|
68
89
|
NodeLocationFiltering: boolean
|
|
69
90
|
IgnoreTestProducts: boolean
|
|
70
91
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
92
|
+
ArchiveSettings: {
|
|
93
|
+
TTL: number
|
|
94
|
+
JSONDirectory: string
|
|
95
|
+
TextDirectory: string
|
|
96
|
+
EasDirectory: string
|
|
97
|
+
EasToneout: string
|
|
74
98
|
}
|
|
75
99
|
}
|
|
76
100
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "./
|
|
20
|
+
import { TypeAttributes } from "./Attributes"
|
|
21
21
|
|
|
22
22
|
export type TypeStanzaCompiled = {
|
|
23
23
|
message?: string
|
|
@@ -31,5 +31,6 @@ export type TypeStanzaCompiled = {
|
|
|
31
31
|
getType?: {
|
|
32
32
|
type: string
|
|
33
33
|
prefix: string
|
|
34
|
+
discovered: boolean
|
|
34
35
|
}
|
|
35
36
|
}
|
package/src/bootstrap.ts
CHANGED
|
@@ -21,7 +21,7 @@ import path from 'path'
|
|
|
21
21
|
import { EventEmitter } from 'node:events';
|
|
22
22
|
|
|
23
23
|
export const bootstrap = {
|
|
24
|
-
version: `3.0.
|
|
24
|
+
version: `3.0.6`,
|
|
25
25
|
isReady: true,
|
|
26
26
|
ratelimits: {},
|
|
27
27
|
session_xmpp: null,
|
|
@@ -42,10 +42,13 @@ export const bootstrap = {
|
|
|
42
42
|
events: {type: "FeatureCollection", features: []},
|
|
43
43
|
nodes: {type: "FeatureCollection", features: []},
|
|
44
44
|
hashes: [],
|
|
45
|
+
processed: [],
|
|
46
|
+
ugc: new Map<string, string[]>()
|
|
45
47
|
},
|
|
46
48
|
settings: {
|
|
47
49
|
Database: path.join(process.cwd(), 'shapefiles.db'),
|
|
48
|
-
EnableWireService:
|
|
50
|
+
EnableWireService: false,
|
|
51
|
+
EnableDebugging: false,
|
|
49
52
|
EnableJournal: true,
|
|
50
53
|
NOAAWeatherWireServiceSettings: {
|
|
51
54
|
ReconnectionSettings: {
|
|
@@ -72,16 +75,34 @@ export const bootstrap = {
|
|
|
72
75
|
CallbackInterval: 15,
|
|
73
76
|
EventsEndpoint: `https://api.weather.gov/alerts/active`,
|
|
74
77
|
},
|
|
75
|
-
|
|
78
|
+
BroadcastifySettings: {
|
|
79
|
+
BroadcastifyAttachments: true,
|
|
80
|
+
BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
|
|
81
|
+
BroadcastifyTags: [`Ham`, `Air`, `Fire`, `Public Safety`, `Weather`, `EMS`, `Police`, `Rail`]
|
|
82
|
+
},
|
|
83
|
+
NotifyServer: {
|
|
84
|
+
Enabled: false,
|
|
85
|
+
Server: `https://ntfy.sh`,
|
|
86
|
+
Timezone: "UTC",
|
|
87
|
+
MediaStorage: {
|
|
88
|
+
EAS: null,
|
|
89
|
+
TEXT: null,
|
|
90
|
+
JSON: null,
|
|
91
|
+
},
|
|
92
|
+
Credentials: {
|
|
93
|
+
Username: null,
|
|
94
|
+
Password: null
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
ActionSettings: [],
|
|
76
98
|
GlobalSettings: {
|
|
77
99
|
EventManagement: true,
|
|
78
|
-
BetterEventNames: true,
|
|
79
100
|
DisableGeometryParsing: false,
|
|
80
|
-
UseShapefileCoordinates:
|
|
101
|
+
UseShapefileCoordinates: true,
|
|
81
102
|
SPCWatchesOnly: true,
|
|
82
103
|
ShapefileSkipPoints: 15,
|
|
83
104
|
NodeTTL: 60,
|
|
84
|
-
|
|
105
|
+
NodeMaxDistance: 120,
|
|
85
106
|
EventFiltering: {
|
|
86
107
|
ListeningEvents: [],
|
|
87
108
|
ListeningICAO: [],
|
|
@@ -92,9 +113,12 @@ export const bootstrap = {
|
|
|
92
113
|
NodeLocationFiltering: false,
|
|
93
114
|
IgnoreTestProducts: true,
|
|
94
115
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
116
|
+
ArchiveSettings: {
|
|
117
|
+
TTL: 60,
|
|
118
|
+
JSONDirectory: null,
|
|
119
|
+
TextDirectory: null,
|
|
120
|
+
EasDirectory: null,
|
|
121
|
+
EasToneout: null
|
|
98
122
|
}
|
|
99
123
|
}
|
|
100
124
|
},
|
package/src/index.ts
CHANGED
|
@@ -17,37 +17,39 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeSettings } from './@types/
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
20
|
+
import { TypeSettings } from './@types/Settings'
|
|
21
|
+
import { SetSettings } from "./@modules/@utilities/SetSettings"
|
|
22
|
+
import { GetEventGeometry } from "./@building/GetEventGeometry";
|
|
23
|
+
import { GetCleanedEvent } from "./@building/GetCleanedEvent"
|
|
24
|
+
import { SetEventEmit } from './@modules/@utilities/SetEventEmit';
|
|
25
|
+
import { SetWarning } from './@modules/@utilities/SetWarning';
|
|
26
|
+
import { CreateListener } from "./@core/CreateListener"
|
|
27
|
+
import { StartService } from "./@core/StartService"
|
|
28
|
+
import { StopService } from "./@core/StopService"
|
|
29
|
+
import { GenerateEASMessage } from './@modules/@eas/GenerateEASMessage';
|
|
30
|
+
import { SetNode } from "./@core/SetNode"
|
|
31
|
+
import { GetEvents } from "./@core/GetEvents"
|
|
32
|
+
import { GetNodes } from "./@core/GetNodes"
|
|
33
|
+
import { ManualEvent } from "./@core/ManualEvent"
|
|
34
|
+
import { GetRandomEvent } from './@core/GetRandomEvent';
|
|
35
|
+
import { QueryStanza } from './@core/QueryStanza';
|
|
36
|
+
import { ClearEvents } from './@core/ClearEvents';
|
|
35
37
|
|
|
36
38
|
export class Manager {
|
|
37
|
-
constructor(settings: TypeSettings) { this.trycatch();
|
|
39
|
+
constructor(settings: TypeSettings) { this.trycatch(); StartService(settings) }
|
|
38
40
|
|
|
39
41
|
on(event: string, callback: () => void) {
|
|
40
|
-
|
|
42
|
+
CreateListener(event, callback)
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
trycatch() {
|
|
44
46
|
process.on('uncaughtException', (err: any) => {
|
|
45
|
-
const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'STARTTLS_FAILURE'];
|
|
47
|
+
const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'ENOTFOUND', 'ECONNREFUSED', 'EPIPE', 'EADDRINUSE', 'EALREADY', 'EACCES', 'EAGAIN', 'EHOSTDOWN', 'STARTTLS_FAILURE'];
|
|
46
48
|
if (ignored.includes(err?.code)) {
|
|
47
|
-
|
|
49
|
+
SetEventEmit({
|
|
48
50
|
event: `onServiceStatus`,
|
|
49
51
|
metadata: {
|
|
50
|
-
message: `
|
|
52
|
+
message: `Ignored Critical Error: ${err?.code ?? 'Unknown error code'}. This may indicate a connection issue. Attempting to continue...`,
|
|
51
53
|
data: {},
|
|
52
54
|
type: `error`,
|
|
53
55
|
error: true
|
|
@@ -55,18 +57,18 @@ export class Manager {
|
|
|
55
57
|
})
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
SetWarning({message: `Uncaught Exception: ${err instanceof Error ? err.stack ?? err.message : String(err)}`})
|
|
59
61
|
})
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
export default Manager;
|
|
64
|
-
export type { TypeEvent } from './@types/
|
|
66
|
+
export type { TypeEvent } from './@types/Event';
|
|
65
67
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
SetSettings, GetEventGeometry, ManualEvent,
|
|
69
|
+
GetCleanedEvent, StopService, ClearEvents,
|
|
70
|
+
StartService, SetNode, GetRandomEvent,
|
|
71
|
+
GetEvents, GetNodes, GenerateEASMessage, QueryStanza
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
|
package/tsup.config.ts
CHANGED