@atmosx/event-product-parser 3.0.4 → 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.
Files changed (162) hide show
  1. package/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +1 -1
  2. package/.github/README.md +163 -0
  3. package/.github/SUPPORTED_EVENTS.md +370 -0
  4. package/.github/docs/docs-functions.md +30 -0
  5. package/.github/docs/docs-general-configurations.md +209 -0
  6. package/.github/docs/docs-integrations.md +37 -0
  7. package/.github/docs/docs-listeners.md +28 -0
  8. package/.github/docs/docs-source-configuration.md +218 -0
  9. package/.github/docs/docs-technical.md +50 -0
  10. package/.github/logo.png +0 -0
  11. package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
  12. package/.github/samples/SAMPLE_GEOJSON.json +204 -0
  13. package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
  14. package/dist/cjs/index.cjs +4677 -13422
  15. package/dist/esm/index.mjs +3159 -11906
  16. package/package.json +3 -9
  17. package/src/@building/{building.create.ts → CreateEvent.ts} +25 -11
  18. package/src/@building/{building.clean.ts → GetCleanedEvent.ts} +2 -2
  19. package/src/@building/GetEventAttachments.ts +86 -0
  20. package/src/@building/{building.enhance.ts → GetEventEnhancedName.ts} +11 -12
  21. package/src/@building/{building.geometry.ts → GetEventGeometry.ts} +7 -7
  22. package/src/@building/{building.headers.ts → GetEventHeader.ts} +3 -3
  23. package/src/@building/{building.polygon.ts → GetEventNodes.ts} +13 -11
  24. package/src/@building/{building.office.ts → GetEventOffice.ts} +6 -6
  25. package/src/@building/GetEventProperties.ts +96 -0
  26. package/src/@building/{building.signature.ts → GetEventSignature.ts} +14 -15
  27. package/src/@building/{building.tags.ts → GetEventTags.ts} +9 -4
  28. package/src/@building/{building.tracking.ts → GetEventTracking.ts} +15 -15
  29. package/src/@building/{building.validate.ts → ValidateEvents.ts} +67 -60
  30. package/src/@core/{core.clearEvents.ts → ClearEvents.ts} +3 -4
  31. package/src/@core/{core.createListener.ts → CreateListener.ts} +3 -3
  32. package/src/@core/{core.getEvents.ts → GetEvents.ts} +1 -2
  33. package/src/@core/{core.getNodes.ts → GetNodes.ts} +1 -2
  34. package/src/@core/{core.getRandomEvent.ts → GetRandomEvent.ts} +1 -2
  35. package/src/@core/{core.getVersion.ts → GetVersion.ts} +1 -2
  36. package/src/@core/ManualEvent.ts +56 -0
  37. package/src/@core/QueryStanza.ts +39 -0
  38. package/src/@core/{core.setNode.ts → SetNode.ts} +8 -8
  39. package/src/@core/{core.start.ts → StartService.ts} +21 -21
  40. package/src/@core/{core.stop.ts → StopService.ts} +1 -1
  41. package/src/@enums/AWIPS.ts +366 -0
  42. package/src/{@dictionaries/dictionaries.eventActions.ts → @enums/Actions.ts} +1 -1
  43. package/src/{@dictionaries/dictionaries.eventCancelMessages.ts → @enums/Cancellation.ts} +2 -1
  44. package/src/{@dictionaries/dictionaries.eventCauses.ts → @enums/Causes.ts} +1 -1
  45. package/src/{@dictionaries/dictionaries.statusCorrelationText.ts → @enums/Correlations.ts} +1 -1
  46. package/src/@enums/Enhanced.ts +70 -0
  47. package/src/{@dictionaries/dictionaries.eventTypes.ts → @enums/Events.ts} +1 -1
  48. package/src/{@dictionaries/dictionaries.regExp.ts → @enums/Expressions.ts} +2 -1
  49. package/src/@enums/GlobalFilter.ts +24 -0
  50. package/src/{@dictionaries/dictionaries.hailStrings.ts → @enums/Hail.ts} +7 -2
  51. package/src/{@dictionaries/dictionaries.officeICAOs.ts → @enums/ICAO.ts} +3 -1
  52. package/src/@enums/Matches.ts +55 -0
  53. package/src/{@dictionaries/dictionaries.eventProducts.ts → @enums/Products.ts} +1 -1
  54. package/src/{@dictionaries/dictionaries.eventRecords.ts → @enums/Records.ts} +1 -1
  55. package/src/{@dictionaries/dictionaries.eventSeverity.ts → @enums/Severity.ts} +1 -1
  56. package/src/{@dictionaries/dictionaries.shapefileLinks.ts → @enums/Shapefiles.ts} +1 -1
  57. package/src/@enums/States.ts +72 -0
  58. package/src/{@dictionaries/dictionaries.eventStatus.ts → @enums/Status.ts} +1 -1
  59. package/src/@enums/Strings.ts +22 -0
  60. package/src/@enums/Tags.ts +167 -0
  61. package/src/{@dictionaries/dictionaries.testSignatures.ts → @enums/Testing.ts} +3 -2
  62. package/src/@events/{events.api.ts → ParseAPI.ts} +42 -38
  63. package/src/@events/{events.text.ts → ParseText.ts} +25 -18
  64. package/src/@events/{events.ugc.ts → ParseUGC.ts} +28 -19
  65. package/src/@events/{events.vtec.ts → ParseVTEC.ts} +21 -21
  66. package/src/@manager/CreateActions.ts +213 -0
  67. package/src/@manager/{manager.mkEvent.ts → MakeEvent.ts} +34 -31
  68. package/src/@manager/RemoveEvent.ts +70 -0
  69. package/src/@manager/{manager.setHash.ts → SetHash.ts} +8 -9
  70. package/src/@manager/{manager.updateEvents.ts → UpdateEvents.ts} +9 -9
  71. package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +24 -17
  72. package/src/@modules/@database/{database.cache.ts → GetCachedEvents.ts} +10 -8
  73. package/src/@modules/@database/ImportBroadcastify.ts +70 -0
  74. package/src/@modules/@database/{database.shapefiles.ts → ImportShapefiles.ts} +17 -20
  75. package/src/@modules/@database/{database.stanza.ts → ImportStanza.ts} +5 -6
  76. package/src/@modules/@database/{database.init.ts → InitializeDatabase.ts} +25 -11
  77. package/src/@modules/@eas/GenerateEASMessage.ts +144 -0
  78. package/src/@modules/@eas/GetCleanDescription.ts +91 -0
  79. package/src/@modules/@eas/{eas.getFloatPCM16.ts → GetFloatPCM16.ts} +1 -1
  80. package/src/@modules/@eas/{eas.getMergedPCM16.ts → GetMergedPCM16.ts} +1 -1
  81. package/src/@modules/@eas/{eas.getPCM16.ts → GetPCM16.ts} +1 -1
  82. package/src/@modules/@eas/{eas.getPCMToFloat.ts → GetPCMToFloat.ts} +1 -1
  83. package/src/@modules/@eas/{eas.getSampledPCM16.ts → GetSampledPCM16.ts} +1 -1
  84. package/src/@modules/@eas/GetTTS.ts +54 -0
  85. package/src/@modules/@eas/{eas.getWavPCM16.ts → GetWavPCM16.ts} +1 -1
  86. package/src/@modules/@eas/{eas.setAFSK.ts → SetAFSK.ts} +1 -2
  87. package/src/@modules/@eas/{eas.setAsciiToBits.ts → SetAsciiToBits.ts} +1 -2
  88. package/src/@modules/@eas/{eas.setAttentionTone.ts → SetAttentionTone.ts} +1 -1
  89. package/src/@modules/@eas/{eas.setNoise.ts → SetNoise.ts} +6 -5
  90. package/src/@modules/@eas/{eas.setRadioEffect.ts → SetRadioEffect.ts} +6 -5
  91. package/src/@modules/@eas/{eas.setSameHeader.ts → SetSameHeader.ts} +7 -8
  92. package/src/@modules/@stanza/{stanza.getAwipsType.ts → GetAwipsType.ts} +11 -9
  93. package/src/@modules/@stanza/{stanza.validate.ts → ValidateStanza.ts} +9 -9
  94. package/src/@modules/@utilities/CreateHttp.ts +83 -0
  95. package/src/@modules/@utilities/{utilities.getFormattedTime.ts → GetFormattedTime.ts} +1 -1
  96. package/src/@modules/@utilities/GetLatestIssuance.ts +32 -0
  97. package/src/@modules/@utilities/GetMatched.ts +33 -0
  98. package/src/@modules/@utilities/{utilities.getSettings.ts → GetSettings.ts} +2 -2
  99. package/src/@modules/@utilities/{utilities.getShapeNearestPoint.ts → GetShapeNearestPoint.ts} +1 -1
  100. package/src/@modules/@utilities/{utilities.setCronSchedule.ts → SetCronSchedule.ts} +41 -12
  101. package/src/{@types/types.webhook.ts → @modules/@utilities/SetDebug.ts} +16 -6
  102. package/src/@modules/@utilities/{utilities.setEventEmit.ts → SetEventEmit.ts} +5 -5
  103. package/src/@modules/@utilities/{utilities.setListener.ts → SetListener.ts} +1 -1
  104. package/src/@modules/@utilities/{utilities.setSettings.ts → SetSettings.ts} +2 -2
  105. package/src/@modules/@utilities/{utilities.setSleep.ts → SetSleep.ts} +1 -1
  106. package/src/@modules/@utilities/{utilities.setTimeoutAction.ts → SetTimeoutAction.ts} +8 -3
  107. package/src/@modules/@utilities/{utilities.setWarning.ts → SetWarning.ts} +2 -2
  108. package/src/@modules/@xmpp/{xmpp.xDeploy.ts → DeployXMPP.ts} +13 -14
  109. package/src/@modules/@xmpp/{xmpp.xError.ts → ErrorXMPP.ts} +1 -3
  110. package/src/@modules/@xmpp/{xmpp.xOffline.ts → OfflineXMPP.ts} +3 -4
  111. package/src/@modules/@xmpp/{xmpp.xOnline.ts → OnlineXMPP.ts} +6 -5
  112. package/src/@modules/@xmpp/{xmpp.xReconnect.ts → ReconnectXMPP.ts} +8 -8
  113. package/src/@modules/@xmpp/{xmpp.xStanza.ts → StanzaXMPP.ts} +11 -11
  114. package/src/@parsers/@hvtec/{hvtec.extract.ts → HVExtract.ts} +10 -10
  115. package/src/@parsers/@pvtec/{pvtec.expires.ts → GetExpiry.ts} +1 -1
  116. package/src/@parsers/@pvtec/{pvtec.extract.ts → VTECExtract.ts} +17 -17
  117. package/src/@parsers/@text/{text.getDescriptionFromProduct.ts → GetDescriptionFromProduct.ts} +12 -5
  118. package/src/@parsers/@text/GetEmbededText.ts +56 -0
  119. package/src/@parsers/@text/{text.getPolygonFromProduct.ts → GetPolygonFromProduct.ts} +31 -10
  120. package/src/@parsers/@text/GetStringText.ts +58 -0
  121. package/src/@parsers/@text/{text.getTextFromProduct.ts → GetTextFromProduct.ts} +1 -1
  122. package/src/@parsers/@text/{text.getXML.ts → GetXML.ts} +1 -1
  123. package/src/@parsers/@ugc/GetCache.ts +24 -0
  124. package/src/@parsers/@ugc/{ugc.expiry.ts → GetExpiry.ts} +1 -1
  125. package/src/@parsers/@ugc/{ugc.locations.ts → GetLocations.ts} +35 -7
  126. package/src/@parsers/@ugc/{ugc.header.ts → GetUGCHeader.ts} +3 -3
  127. package/src/@parsers/@ugc/{ugc.coordinates.ts → GetZonePolygon.ts} +4 -3
  128. package/src/@parsers/@ugc/SetCache.ts +28 -0
  129. package/src/@parsers/@ugc/{ugc.extract.ts → UGCExtract.ts} +6 -6
  130. package/src/@types/Actions.ts +37 -0
  131. package/src/@types/{type.event.ts → Event.ts} +7 -5
  132. package/src/@types/{type.properties.ts → Properties.ts} +11 -8
  133. package/src/@types/{types.settings.ts → Settings.ts} +31 -7
  134. package/src/@types/{types.compiled.ts → StanzaCompiled.ts} +2 -1
  135. package/src/bootstrap.ts +33 -9
  136. package/src/index.ts +26 -24
  137. package/tsup.config.ts +1 -1
  138. package/README.md +0 -349
  139. package/dist/index.d.mts +0 -239
  140. package/dist/index.d.ts +0 -239
  141. package/src/@building/building.properties.ts +0 -89
  142. package/src/@dictionaries/dictionaries.betterEventNames.ts +0 -99
  143. package/src/@dictionaries/dictionaries.eventAwipAbreviations.ts +0 -364
  144. package/src/@dictionaries/dictionaries.eventTags.ts +0 -93
  145. package/src/@dictionaries/dictionaries.eventsMatchText.ts +0 -36
  146. package/src/@dictionaries/dictionaries.transcribedMessageReplacements.ts +0 -68
  147. package/src/@manager/manager.rmEvent.ts +0 -49
  148. package/src/@manager/manager.updateWebhooks.ts +0 -50
  149. package/src/@modules/@eas/eas.setEasTone.ts +0 -137
  150. package/src/@modules/@utilities/utilities.createHttp.ts +0 -85
  151. package/src/@modules/@utilities/utilities.createWebhook.ts +0 -115
  152. package/test.js +0 -91
  153. /package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +0 -0
  154. /package/{LICENSE → .github/LICENSE} +0 -0
  155. /package/{SECURITY.md → .github/SECURITY.md} +0 -0
  156. /package/src/@parsers/@ugc/{ugc.zones.ts → GetZones.ts} +0 -0
  157. /package/src/@types/{types.attributes.ts → Attributes.ts} +0 -0
  158. /package/src/@types/{types.hvtec.ts → HVTEC.ts} +0 -0
  159. /package/src/@types/{types.hash.ts → Hash.ts} +0 -0
  160. /package/src/@types/{types.stanza.ts → Stanza.ts} +0 -0
  161. /package/src/@types/{types.ugc.ts → UGC.ts} +0 -0
  162. /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/types.ugc";
21
- import { getUGCHeader } from "./ugc.header"
22
- import { getZones } from "./ugc.zones";
23
- import { getExpiry } from './ugc.expiry';
24
- import { getLocations } from "./ugc.locations";
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 = getExpiry(message)
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 "./type.properties";
21
- import { TypeHVTEC } from "../@types/types.hvtec";
22
- import { TypePVTEC } from "./types.pvtec";
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: TypePVTEC | null
50
- hvtec: TypeHVTEC[]
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 "./types.attributes";
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: TypeAttributes
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
- spc_parameters: {
70
- spc_max_tornado: string
71
- spc_max_hail: string
72
- spc_max_wind: string
73
- spc_watch_issuance: string
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 { TypeWebhook } from "./types.webhook"
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
- NodeMinDistance: number
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
- EASSettings: {
72
- ArchiveDirectory: string,
73
- IntroWavFile: string,
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 "./types.attributes"
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.3`,
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: true,
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
- WebhookSettings: [],
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: false,
101
+ UseShapefileCoordinates: true,
81
102
  SPCWatchesOnly: true,
82
103
  ShapefileSkipPoints: 15,
83
104
  NodeTTL: 60,
84
- NodeMinDistance: 120,
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
- EASSettings: {
96
- ArchiveDirectory: null,
97
- IntroWavFile: null,
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,34 +17,36 @@
17
17
 
18
18
  */
19
19
 
20
- import { TypeSettings } from './@types/types.settings'
21
- import { setSettings } from "./@modules/@utilities/utilities.setSettings"
22
- import { getEventGeometry } from "./@building/building.geometry";
23
- import { getCleanedEvent } from "./@building/building.clean"
24
- import { setEventEmit } from './@modules/@utilities/utilities.setEventEmit';
25
- import { setWarning } from './@modules/@utilities/utilities.setWarning';
26
- import { createListener } from "./@core/core.createListener"
27
- import { startService } from "./@core/core.start"
28
- import { stopService } from "./@core/core.stop"
29
- import { setEasTone } from './@modules/@eas/eas.setEasTone';
30
- import { setNode } from "./@core/core.setNode"
31
- import { getEvents } from "./@core/core.getEvents"
32
- import { getNodes } from "./@core/core.getNodes"
33
- import { getRandomEvent } from './@core/core.getRandomEvent';
34
- import { clearEvents } from './@core/core.clearEvents';
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(); startService(settings) }
39
+ constructor(settings: TypeSettings) { this.trycatch(); StartService(settings) }
38
40
 
39
41
  on(event: string, callback: () => void) {
40
- createListener(event, callback)
42
+ CreateListener(event, callback)
41
43
  }
42
44
 
43
45
  trycatch() {
44
46
  process.on('uncaughtException', (err: any) => {
45
47
  const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'ENOTFOUND', 'ECONNREFUSED', 'EPIPE', 'EADDRINUSE', 'EALREADY', 'EACCES', 'EAGAIN', 'EHOSTDOWN', 'STARTTLS_FAILURE'];
46
48
  if (ignored.includes(err?.code)) {
47
- setEventEmit({
49
+ SetEventEmit({
48
50
  event: `onServiceStatus`,
49
51
  metadata: {
50
52
  message: `Ignored Critical Error: ${err?.code ?? 'Unknown error code'}. This may indicate a connection issue. Attempting to continue...`,
@@ -55,18 +57,18 @@ export class Manager {
55
57
  })
56
58
  return;
57
59
  }
58
- setWarning({message: `Uncaught Exception: ${err instanceof Error ? err.stack || err.message : String(err)}`})
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/type.event';
66
+ export type { TypeEvent } from './@types/Event';
65
67
  export {
66
- setSettings, getEventGeometry,
67
- getCleanedEvent, stopService, clearEvents,
68
- startService, setNode, getRandomEvent,
69
- getEvents, getNodes, setEasTone
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
@@ -4,7 +4,7 @@ export default defineConfig({
4
4
  entry: ['src/index.ts'],
5
5
  outDir: 'dist',
6
6
  format: ['esm', 'cjs'],
7
- dts: true,
7
+ dts: false,
8
8
  noExternal: ["@xmpp/client", "@xmpp/sasl", "@xmpp/sasl-plain"],
9
9
  clean: true,
10
10
  outExtension({ format }) {