@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.
Files changed (212) hide show
  1. package/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +1 -1
  2. package/.github/SUPPORTED_EVENTS.md +370 -0
  3. package/.github/docs/docs-functions.md +30 -0
  4. package/.github/docs/docs-general-configurations.md +199 -0
  5. package/.github/docs/docs-integrations.md +38 -0
  6. package/.github/docs/docs-listeners.md +28 -0
  7. package/.github/docs/docs-source-configuration.md +218 -0
  8. package/.github/docs/docs-technical.md +50 -0
  9. package/.github/logo.png +0 -0
  10. package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
  11. package/.github/samples/SAMPLE_GEOJSON.json +204 -0
  12. package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
  13. package/README.md +157 -337
  14. package/dist/cjs/index.cjs +24125 -15815
  15. package/dist/esm/index.mjs +24144 -15839
  16. package/package.json +56 -53
  17. package/pnpm-workspace.yaml +4 -0
  18. package/src/bootstrap.ts +83 -43
  19. package/src/building/CreateEvent.ts +54 -0
  20. package/src/{@building/building.clean.ts → building/GetCleanedEvent.ts} +4 -4
  21. package/src/building/GetEventAttachments.ts +88 -0
  22. package/src/building/GetEventDirection.ts +28 -0
  23. package/src/{@building/building.enhance.ts → building/GetEventEnhancedName.ts} +13 -17
  24. package/src/{@building/building.geometry.ts → building/GetEventGeometry.ts} +19 -13
  25. package/src/{@building/building.headers.ts → building/GetEventHeader.ts} +13 -13
  26. package/src/{@building/building.polygon.ts → building/GetEventNodes.ts} +26 -22
  27. package/src/{@building/building.office.ts → building/GetEventOffice.ts} +14 -14
  28. package/src/building/GetEventProperties.ts +105 -0
  29. package/src/{@building/building.signature.ts → building/GetEventSignature.ts} +16 -17
  30. package/src/{@core/core.createListener.ts → building/GetEventTags.ts} +11 -6
  31. package/src/building/GetEventTheme.ts +26 -0
  32. package/src/building/GetEventTracking.ts +64 -0
  33. package/src/components/audio/GenerateAudioMessage.ts +149 -0
  34. package/src/components/audio/components/GetCleanDescription.ts +91 -0
  35. package/src/{@modules/@eas/eas.getFloatPCM16.ts → components/audio/components/GetFloatPCM16.ts} +3 -3
  36. package/src/{@modules/@eas/eas.getMergedPCM16.ts → components/audio/components/GetMergedPCM16.ts} +3 -3
  37. package/src/{@modules/@eas/eas.getPCM16.ts → components/audio/components/GetPCM16.ts} +13 -8
  38. package/src/{@modules/@eas/eas.getPCMToFloat.ts → components/audio/components/GetPCMToFloat.ts} +3 -3
  39. package/src/{@modules/@eas/eas.getSampledPCM16.ts → components/audio/components/GetSampledPCM16.ts} +14 -8
  40. package/src/components/audio/components/GetTTS.ts +61 -0
  41. package/src/{@modules/@eas/eas.getWavPCM16.ts → components/audio/components/GetWavPCM16.ts} +8 -8
  42. package/src/{@modules/@eas/eas.setAFSK.ts → components/audio/components/SetAFSK.ts} +12 -8
  43. package/src/{@modules/@eas/eas.setAsciiToBits.ts → components/audio/components/SetAsciiToBits.ts} +3 -4
  44. package/src/{@modules/@eas/eas.setAttentionTone.ts → components/audio/components/SetAttentionTone.ts} +11 -6
  45. package/src/{@modules/@eas/eas.setNoise.ts → components/audio/components/SetNoise.ts} +14 -8
  46. package/src/{@modules/@eas/eas.setRadioEffect.ts → components/audio/components/SetRadioEffect.ts} +14 -8
  47. package/src/{@modules/@eas/eas.setSameHeader.ts → components/audio/components/SetSameHeader.ts} +22 -15
  48. package/src/{@modules/@utilities/utilities.setWarning.ts → components/database/CreateQuery.ts} +18 -13
  49. package/src/{@modules/@database/database.cache.ts → components/database/GetCachedEvents.ts} +19 -14
  50. package/src/components/database/ImportBoundaries.ts +168 -0
  51. package/src/components/database/ImportBroadcastify.ts +60 -0
  52. package/src/components/database/ImportCities.ts +87 -0
  53. package/src/{@modules/@database/database.shapefiles.ts → components/database/ImportShapefiles.ts} +31 -37
  54. package/src/components/database/ImportStanza.ts +43 -0
  55. package/src/components/database/InitializeDatabase.ts +71 -0
  56. package/src/components/images/GenerateGraphic.ts +234 -0
  57. package/src/components/images/components/CreateRectangle.ts +22 -0
  58. package/src/components/images/components/CreateText.ts +22 -0
  59. package/src/components/images/modules/CreateSVG.ts +37 -0
  60. package/src/components/images/modules/GetGeographicalBoundaries.ts +72 -0
  61. package/src/components/images/modules/GetGeographicalCities.ts +58 -0
  62. package/src/components/images/modules/GetGeographicalEvents.ts +48 -0
  63. package/src/components/images/modules/GetGeometryBounds.ts +82 -0
  64. package/src/components/images/modules/GetParsedBoundary.ts +58 -0
  65. package/src/components/images/modules/GetSVGPath.ts +53 -0
  66. package/src/components/images/modules/NormalizePolygon.ts +57 -0
  67. package/src/{@modules/@stanza/stanza.getAwipsType.ts → components/stanza/GetAwipsType.ts} +19 -18
  68. package/src/components/stanza/ValidateStanza.ts +62 -0
  69. package/src/components/utilities/CreateHttp.ts +83 -0
  70. package/src/{@modules/@utilities/utilities.getFormattedTime.ts → components/utilities/GetFormattedTime.ts} +3 -3
  71. package/src/components/utilities/GetLatestIssuance.ts +32 -0
  72. package/src/components/utilities/GetMatched.ts +38 -0
  73. package/src/{@modules/@utilities/utilities.getShapeNearestPoint.ts → components/utilities/GetShapeNearestPoint.ts} +24 -19
  74. package/src/components/utilities/GetUnionPolygon.ts +36 -0
  75. package/src/components/utilities/QueueManager.ts +70 -0
  76. package/src/components/utilities/SetCronSchedule.ts +98 -0
  77. package/src/{@core/core.clearEvents.ts → components/utilities/SetDebug.ts} +17 -12
  78. package/src/components/utilities/SetEventEmit.ts +42 -0
  79. package/src/{@modules/@utilities/utilities.setSettings.ts → components/utilities/SetSettings.ts} +7 -7
  80. package/src/{@modules/@utilities/utilities.setSleep.ts → components/utilities/SetSleep.ts} +5 -5
  81. package/src/components/utilities/SetTimeoutAction.ts +64 -0
  82. package/src/components/utilities/SetWarning.ts +47 -0
  83. package/src/{@modules/@xmpp/xmpp.xDeploy.ts → components/xmpp/DeployXMPP.ts} +26 -27
  84. package/src/components/xmpp/ErrorXMPP.ts +27 -0
  85. package/src/{@modules/@xmpp/xmpp.xError.ts → components/xmpp/OfflineXMPP.ts} +17 -9
  86. package/src/{@modules/@xmpp/xmpp.xOnline.ts → components/xmpp/OnlineXMPP.ts} +21 -20
  87. package/src/components/xmpp/ReconnectXMPP.ts +64 -0
  88. package/src/components/xmpp/StanzaXMPP.ts +63 -0
  89. package/src/{@building/building.tags.ts → core/ClearEvents.ts} +12 -5
  90. package/src/{@core/core.getVersion.ts → core/GetEvents.ts} +5 -6
  91. package/src/core/GetNodes.ts +24 -0
  92. package/src/{@core/core.getNodes.ts → core/GetRandomEvent.ts} +5 -6
  93. package/src/core/GetVersion.ts +24 -0
  94. package/src/core/ManualEvent.ts +55 -0
  95. package/src/core/QueryStanza.ts +40 -0
  96. package/src/core/SetNode.ts +87 -0
  97. package/src/core/StartService.ts +62 -0
  98. package/src/core/StopService.ts +32 -0
  99. package/src/enums/AWIPS.ts +366 -0
  100. package/src/{@dictionaries/dictionaries.eventActions.ts → enums/Actions.ts} +3 -3
  101. package/src/{@dictionaries/dictionaries.eventCancelMessages.ts → enums/Cancellation.ts} +4 -3
  102. package/src/{@dictionaries/dictionaries.eventCauses.ts → enums/Causes.ts} +3 -3
  103. package/src/{@dictionaries/dictionaries.statusCorrelationText.ts → enums/Correlations.ts} +3 -3
  104. package/src/enums/Enhanced.ts +70 -0
  105. package/src/{@dictionaries/dictionaries.eventTypes.ts → enums/Events.ts} +3 -3
  106. package/src/{@dictionaries/dictionaries.regExp.ts → enums/Expressions.ts} +5 -4
  107. package/src/{@core/core.getEvents.ts → enums/GlobalFilter.ts} +7 -8
  108. package/src/{@dictionaries/dictionaries.hailStrings.ts → enums/Hail.ts} +9 -4
  109. package/src/{@dictionaries/dictionaries.officeICAOs.ts → enums/ICAO.ts} +5 -3
  110. package/src/enums/Matches.ts +60 -0
  111. package/src/{@dictionaries/dictionaries.eventProducts.ts → enums/Products.ts} +3 -3
  112. package/src/{@dictionaries/dictionaries.eventRecords.ts → enums/Records.ts} +3 -3
  113. package/src/{@dictionaries/dictionaries.eventSeverity.ts → enums/Severity.ts} +3 -3
  114. package/src/{@dictionaries/dictionaries.shapefileLinks.ts → enums/Shapefiles.ts} +3 -3
  115. package/src/enums/States.ts +136 -0
  116. package/src/{@dictionaries/dictionaries.eventStatus.ts → enums/Status.ts} +3 -3
  117. package/src/enums/Strings.ts +22 -0
  118. package/src/enums/Tags.ts +172 -0
  119. package/src/{@dictionaries/dictionaries.testSignatures.ts → enums/Testing.ts} +5 -4
  120. package/src/enums/Themes.ts +70 -0
  121. package/src/events/ParseAPI.ts +129 -0
  122. package/src/{@events/events.text.ts → events/ParseText.ts} +32 -23
  123. package/src/{@events/events.ugc.ts → events/ParseUGC.ts} +36 -26
  124. package/src/events/ParseVTEC.ts +88 -0
  125. package/src/index.ts +60 -38
  126. package/src/manager/MakeEvents.ts +110 -0
  127. package/src/manager/RemoveEvent.ts +74 -0
  128. package/src/{@manager/manager.setHash.ts → manager/SetHash.ts} +19 -15
  129. package/src/manager/UpdateEvents.ts +35 -0
  130. package/src/manager/UpdateNode.ts +62 -0
  131. package/src/manager/ValidateEvents.ts +144 -0
  132. package/src/{@parsers/@hvtec/hvtec.extract.ts → parsers/hvtec/HVExtract.ts} +13 -13
  133. package/src/parsers/text/GetDescriptionFromProduct.ts +59 -0
  134. package/src/parsers/text/GetEmbededText.ts +57 -0
  135. package/src/parsers/text/GetPolygonFromProduct.ts +71 -0
  136. package/src/parsers/text/GetStringText.ts +58 -0
  137. package/src/{@parsers/@text/text.getTextFromProduct.ts → parsers/text/GetTextFromProduct.ts} +12 -12
  138. package/src/parsers/ugc/GetCache.ts +24 -0
  139. package/src/{@parsers/@ugc/ugc.expiry.ts → parsers/ugc/GetExpiry.ts} +3 -3
  140. package/src/{@parsers/@ugc/ugc.header.ts → parsers/ugc/GetHeader.ts} +6 -6
  141. package/src/parsers/ugc/GetLocations.ts +57 -0
  142. package/src/parsers/ugc/GetZonePolygon.ts +73 -0
  143. package/src/{@parsers/@ugc/ugc.zones.ts → parsers/ugc/GetZones.ts} +3 -3
  144. package/src/{@modules/@utilities/utilities.setListener.ts → parsers/ugc/SetCache.ts} +13 -10
  145. package/src/{@parsers/@ugc/ugc.extract.ts → parsers/ugc/UGCExtract.ts} +15 -15
  146. package/src/{@parsers/@pvtec/pvtec.expires.ts → parsers/vtec/GetExpiry.ts} +3 -3
  147. package/src/parsers/vtec/VTECExtract.ts +49 -0
  148. package/src/{@types/types.attributes.ts → static/Attributes.ts} +2 -3
  149. package/src/{@types/type.event.ts → static/Event.ts} +11 -8
  150. package/src/{@types/type.properties.ts → static/Properties.ts} +17 -10
  151. package/src/{@types/types.stanza.ts → static/Stanza.ts} +2 -2
  152. package/src/tasks/CreateTasks.ts +123 -0
  153. package/src/{@core/core.stop.ts → tasks/TaskGenerateJSON.ts} +14 -12
  154. package/src/tasks/TaskGenerateText.ts +34 -0
  155. package/src/tasks/TaskSendNTFY.ts +97 -0
  156. package/src/tasks/TaskSendWebhook.ts +107 -0
  157. package/src/types/Actions.ts +37 -0
  158. package/src/{@types/types.hvtec.ts → types/HVTEC.ts} +6 -6
  159. package/src/{@types/types.hash.ts → types/Hash.ts} +5 -5
  160. package/src/types/Nodes.ts +29 -0
  161. package/src/{@types/types.settings.ts → types/Settings.ts} +42 -10
  162. package/src/{@types/types.compiled.ts → types/StanzaCompiled.ts} +15 -14
  163. package/src/{@types/types.ugc.ts → types/UGC.ts} +5 -5
  164. package/src/{@modules/@utilities/utilities.getSettings.ts → types/VTEC.ts} +12 -7
  165. package/tools/build.js +47 -0
  166. package/tsconfig.json +28 -1
  167. package/dist/index.d.mts +0 -239
  168. package/dist/index.d.ts +0 -239
  169. package/src/@building/building.create.ts +0 -42
  170. package/src/@building/building.properties.ts +0 -89
  171. package/src/@building/building.tracking.ts +0 -68
  172. package/src/@building/building.validate.ts +0 -147
  173. package/src/@core/core.getRandomEvent.ts +0 -25
  174. package/src/@core/core.setNode.ts +0 -81
  175. package/src/@core/core.start.ts +0 -61
  176. package/src/@dictionaries/dictionaries.betterEventNames.ts +0 -99
  177. package/src/@dictionaries/dictionaries.eventAwipAbreviations.ts +0 -364
  178. package/src/@dictionaries/dictionaries.eventTags.ts +0 -93
  179. package/src/@dictionaries/dictionaries.eventsMatchText.ts +0 -36
  180. package/src/@dictionaries/dictionaries.transcribedMessageReplacements.ts +0 -68
  181. package/src/@events/events.api.ts +0 -113
  182. package/src/@events/events.vtec.ts +0 -87
  183. package/src/@manager/manager.mkEvent.ts +0 -96
  184. package/src/@manager/manager.rmEvent.ts +0 -49
  185. package/src/@manager/manager.updateEvents.ts +0 -35
  186. package/src/@manager/manager.updateNodes.ts +0 -55
  187. package/src/@manager/manager.updateWebhooks.ts +0 -50
  188. package/src/@modules/@database/database.init.ts +0 -45
  189. package/src/@modules/@database/database.stanza.ts +0 -48
  190. package/src/@modules/@eas/eas.setEasTone.ts +0 -137
  191. package/src/@modules/@stanza/stanza.validate.ts +0 -50
  192. package/src/@modules/@utilities/utilities.createHttp.ts +0 -85
  193. package/src/@modules/@utilities/utilities.createWebhook.ts +0 -115
  194. package/src/@modules/@utilities/utilities.setCronSchedule.ts +0 -65
  195. package/src/@modules/@utilities/utilities.setEventEmit.ts +0 -41
  196. package/src/@modules/@utilities/utilities.setTimeoutAction.ts +0 -59
  197. package/src/@modules/@xmpp/xmpp.xOffline.ts +0 -38
  198. package/src/@modules/@xmpp/xmpp.xReconnect.ts +0 -64
  199. package/src/@modules/@xmpp/xmpp.xStanza.ts +0 -63
  200. package/src/@parsers/@pvtec/pvtec.extract.ts +0 -49
  201. package/src/@parsers/@text/text.getDescriptionFromProduct.ts +0 -53
  202. package/src/@parsers/@text/text.getPolygonFromProduct.ts +0 -32
  203. package/src/@parsers/@text/text.getXML.ts +0 -61
  204. package/src/@parsers/@ugc/ugc.coordinates.ts +0 -110
  205. package/src/@parsers/@ugc/ugc.locations.ts +0 -29
  206. package/src/@types/types.pvtec.ts +0 -30
  207. package/src/@types/types.webhook.ts +0 -27
  208. package/test.js +0 -91
  209. package/tsup.config.ts +0 -16
  210. /package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +0 -0
  211. /package/{LICENSE → .github/LICENSE} +0 -0
  212. /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: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeWebhook } from "./types.webhook"
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
- NodeMinDistance: number
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
- EASSettings: {
72
- ArchiveDirectory: string,
73
- IntroWavFile: string,
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: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeAttributes } from "./types.attributes"
20
+ import { TypeAttributes } from "StaticTypes/Attributes"
21
21
 
22
22
  export type TypeStanzaCompiled = {
23
- message?: string
24
- attributes?: TypeAttributes
25
- isCapEvent?: boolean
26
- isVTEC?: boolean
27
- isUGC?: boolean
28
- isCapAreaDescription?: boolean
29
- isIgnored?: boolean
30
- isNWWS?: boolean
31
- getType?: {
32
- type: string
33
- prefix: string
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: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
20
  export type TypeUGC = {
21
- zones: string[]
22
- locations: string[]
23
- expires: string
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: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeSettings } from '../../@types/types.settings'
21
- import { bootstrap } from "../../bootstrap"
22
-
23
- export const getSettings = (): TypeSettings => {
24
- return bootstrap.settings;
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 };