@atmosx/event-product-parser 3.0.63 → 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.
Files changed (164) hide show
  1. package/.github/docs/docs-functions.md +1 -1
  2. package/.github/docs/docs-general-configurations.md +1 -11
  3. package/.github/docs/docs-integrations.md +3 -2
  4. package/README.md +4 -4
  5. package/dist/cjs/index.cjs +3590 -623
  6. package/dist/esm/index.mjs +3589 -624
  7. package/package.json +11 -4
  8. package/src/bootstrap.ts +50 -33
  9. package/src/{@building → building}/CreateEvent.ts +10 -10
  10. package/src/{@building → building}/GetCleanedEvent.ts +2 -2
  11. package/src/{@building → building}/GetEventAttachments.ts +12 -10
  12. package/src/building/GetEventDirection.ts +28 -0
  13. package/src/{@building → building}/GetEventEnhancedName.ts +5 -6
  14. package/src/{@building → building}/GetEventGeometry.ts +19 -13
  15. package/src/{@building → building}/GetEventHeader.ts +4 -4
  16. package/src/{@building → building}/GetEventNodes.ts +16 -14
  17. package/src/{@building → building}/GetEventOffice.ts +5 -5
  18. package/src/building/GetEventPopulation.ts +58 -0
  19. package/src/{@building → building}/GetEventProperties.ts +23 -18
  20. package/src/{@building → building}/GetEventSignature.ts +8 -8
  21. package/src/{@building → building}/GetEventTags.ts +3 -3
  22. package/src/{@core/CreateListener.ts → building/GetEventTheme.ts} +8 -6
  23. package/src/{@building → building}/GetEventTracking.ts +6 -6
  24. package/src/{@modules/@eas/GenerateEASMessage.ts → components/audio/GenerateAudioMessage.ts} +32 -33
  25. package/src/{@modules/@eas → components/audio/components}/GetCleanDescription.ts +2 -2
  26. package/src/{@modules/@eas → components/audio/components}/GetFloatPCM16.ts +2 -2
  27. package/src/{@modules/@eas → components/audio/components}/GetMergedPCM16.ts +2 -2
  28. package/src/{@modules/@eas → components/audio/components}/GetPCM16.ts +2 -2
  29. package/src/{@modules/@eas → components/audio/components}/GetPCMToFloat.ts +2 -2
  30. package/src/{@modules/@eas → components/audio/components}/GetSampledPCM16.ts +2 -2
  31. package/src/{@modules/@eas → components/audio/components}/GetTTS.ts +5 -3
  32. package/src/{@modules/@eas → components/audio/components}/GetWavPCM16.ts +2 -2
  33. package/src/{@modules/@eas → components/audio/components}/SetAFSK.ts +2 -2
  34. package/src/{@modules/@eas → components/audio/components}/SetAsciiToBits.ts +2 -2
  35. package/src/{@modules/@eas → components/audio/components}/SetAttentionTone.ts +2 -2
  36. package/src/{@modules/@eas → components/audio/components}/SetNoise.ts +4 -4
  37. package/src/{@modules/@eas → components/audio/components}/SetRadioEffect.ts +4 -4
  38. package/src/{@modules/@eas → components/audio/components}/SetSameHeader.ts +5 -5
  39. package/src/{@modules/@utilities/SetWarning.ts → components/database/CreateQuery.ts} +18 -13
  40. package/src/{@modules/@database → components/database}/GetCachedEvents.ts +14 -9
  41. package/src/components/database/ImportBoundaries.ts +168 -0
  42. package/src/{@modules/@database → components/database}/ImportBroadcastify.ts +8 -17
  43. package/src/components/database/ImportCities.ts +87 -0
  44. package/src/{@modules/@database → components/database}/ImportShapefiles.ts +14 -16
  45. package/src/{@modules/@database → components/database}/ImportStanza.ts +13 -17
  46. package/src/components/database/InitializeDatabase.ts +71 -0
  47. package/src/components/images/GenerateGraphic.ts +242 -0
  48. package/src/components/images/components/CreateRectangle.ts +22 -0
  49. package/src/components/images/components/CreateText.ts +22 -0
  50. package/src/components/images/modules/CreateSVG.ts +37 -0
  51. package/src/components/images/modules/GetGeographicalBoundaries.ts +72 -0
  52. package/src/components/images/modules/GetGeographicalCities.ts +58 -0
  53. package/src/components/images/modules/GetGeographicalEvents.ts +48 -0
  54. package/src/components/images/modules/GetGeometryBounds.ts +82 -0
  55. package/src/components/images/modules/GetParsedBoundary.ts +58 -0
  56. package/src/components/images/modules/GetSVGPath.ts +53 -0
  57. package/src/components/images/modules/NormalizePolygon.ts +57 -0
  58. package/src/{@modules/@stanza → components/stanza}/GetAwipsType.ts +4 -4
  59. package/src/{@modules/@stanza → components/stanza}/ValidateStanza.ts +6 -6
  60. package/src/{@modules/@utilities → components/utilities}/CreateHttp.ts +2 -2
  61. package/src/{@parsers/@text → components/utilities}/GetEmbededText.ts +6 -4
  62. package/src/{@modules/@utilities → components/utilities}/GetFormattedTime.ts +2 -2
  63. package/src/{@modules/@utilities → components/utilities}/GetLatestIssuance.ts +2 -2
  64. package/src/{@modules/@utilities → components/utilities}/GetMatched.ts +2 -2
  65. package/src/{@modules/@utilities → components/utilities}/GetShapeNearestPoint.ts +2 -2
  66. package/src/{@parsers/@text → components/utilities}/GetStringText.ts +7 -7
  67. package/src/components/utilities/GetUnionPolygon.ts +36 -0
  68. package/src/{@modules/@utilities → components/utilities}/QueueManager.ts +2 -2
  69. package/src/{@modules/@utilities → components/utilities}/SetCronSchedule.ts +37 -25
  70. package/src/{@modules/@utilities → components/utilities}/SetDebug.ts +4 -4
  71. package/src/{@modules/@utilities → components/utilities}/SetEventEmit.ts +8 -7
  72. package/src/{@modules/@utilities → components/utilities}/SetSettings.ts +4 -4
  73. package/src/{@modules/@utilities → components/utilities}/SetSleep.ts +2 -2
  74. package/src/{@modules/@utilities → components/utilities}/SetTimeoutAction.ts +3 -3
  75. package/src/components/utilities/SetWarning.ts +47 -0
  76. package/src/{@modules/@xmpp → components/xmpp}/DeployXMPP.ts +12 -12
  77. package/src/{@modules/@xmpp → components/xmpp}/ErrorXMPP.ts +3 -3
  78. package/src/{@modules/@xmpp → components/xmpp}/OfflineXMPP.ts +4 -4
  79. package/src/{@modules/@xmpp → components/xmpp}/OnlineXMPP.ts +5 -5
  80. package/src/{@modules/@xmpp → components/xmpp}/ReconnectXMPP.ts +6 -6
  81. package/src/{@modules/@xmpp → components/xmpp}/StanzaXMPP.ts +8 -8
  82. package/src/{@core → core}/ClearEvents.ts +4 -4
  83. package/src/{@core → core}/GetEvents.ts +3 -3
  84. package/src/{@core → core}/GetNodes.ts +3 -3
  85. package/src/{@core → core}/GetRandomEvent.ts +3 -3
  86. package/src/{@core → core}/GetVersion.ts +3 -3
  87. package/src/{@core → core}/ManualEvent.ts +6 -6
  88. package/src/{@core → core}/QueryStanza.ts +9 -8
  89. package/src/{@core → core}/SetNode.ts +5 -5
  90. package/src/{@core → core}/StartService.ts +13 -12
  91. package/src/{@core → core}/StopService.ts +3 -3
  92. package/src/{@enums → enums}/AWIPS.ts +2 -2
  93. package/src/{@enums → enums}/Actions.ts +2 -2
  94. package/src/{@enums → enums}/Cancellation.ts +2 -2
  95. package/src/{@enums → enums}/Causes.ts +2 -2
  96. package/src/{@enums → enums}/Correlations.ts +2 -2
  97. package/src/{@enums → enums}/Enhanced.ts +4 -3
  98. package/src/{@enums → enums}/Events.ts +2 -2
  99. package/src/{@enums → enums}/Expressions.ts +2 -2
  100. package/src/{@enums → enums}/GlobalFilter.ts +2 -2
  101. package/src/{@enums → enums}/Hail.ts +2 -2
  102. package/src/{@enums → enums}/ICAO.ts +2 -2
  103. package/src/{@enums → enums}/Matches.ts +8 -3
  104. package/src/{@enums → enums}/Products.ts +2 -2
  105. package/src/{@enums → enums}/Records.ts +2 -2
  106. package/src/{@enums → enums}/Severity.ts +2 -2
  107. package/src/{@enums → enums}/Shapefiles.ts +2 -2
  108. package/src/{@enums → enums}/States.ts +68 -4
  109. package/src/{@enums → enums}/Status.ts +2 -2
  110. package/src/{@enums → enums}/Strings.ts +2 -2
  111. package/src/{@enums → enums}/Tags.ts +8 -3
  112. package/src/{@enums → enums}/Testing.ts +2 -2
  113. package/src/enums/Themes.ts +70 -0
  114. package/src/{@events → events}/ParseAPI.ts +28 -17
  115. package/src/{@events → events}/ParseText.ts +13 -11
  116. package/src/{@events → events}/ParseUGC.ts +15 -14
  117. package/src/{@events → events}/ParseVTEC.ts +18 -16
  118. package/src/index.ts +49 -32
  119. package/src/{@manager → manager}/MakeEvents.ts +16 -28
  120. package/src/{@manager → manager}/RemoveEvent.ts +9 -9
  121. package/src/{@manager → manager}/SetHash.ts +5 -5
  122. package/src/{@manager → manager}/UpdateEvents.ts +6 -6
  123. package/src/{@manager → manager}/UpdateNode.ts +6 -6
  124. package/src/{@manager → manager}/ValidateEvents.ts +31 -20
  125. package/src/{@parsers/@hvtec → parsers/hvtec}/HVExtract.ts +7 -7
  126. package/src/{@parsers/@text → parsers/text}/GetDescriptionFromProduct.ts +3 -3
  127. package/src/parsers/text/GetPolygonFromProduct.ts +71 -0
  128. package/src/{@parsers/@text → parsers/text}/GetTextFromProduct.ts +2 -2
  129. package/src/{@parsers/@ugc → parsers/ugc}/GetCache.ts +4 -4
  130. package/src/{@parsers/@ugc → parsers/ugc}/GetExpiry.ts +2 -2
  131. package/src/{@parsers/@ugc → parsers/ugc}/GetHeader.ts +3 -3
  132. package/src/{@parsers/@ugc → parsers/ugc}/GetLocations.ts +9 -9
  133. package/src/parsers/ugc/GetZonePolygon.ts +73 -0
  134. package/src/{@parsers/@ugc → parsers/ugc}/GetZones.ts +2 -2
  135. package/src/{@parsers/@ugc → parsers/ugc}/SetCache.ts +4 -4
  136. package/src/{@parsers/@ugc → parsers/ugc}/UGCExtract.ts +9 -9
  137. package/src/{@parsers/@vtec → parsers/vtec}/GetExpiry.ts +2 -2
  138. package/src/{@parsers/@vtec → parsers/vtec}/VTECExtract.ts +9 -9
  139. package/src/{@types-lower → static}/Attributes.ts +2 -3
  140. package/src/{@types-lower → static}/Event.ts +7 -6
  141. package/src/{@types-lower → static}/Properties.ts +17 -4
  142. package/src/{@types-lower → static}/Stanza.ts +3 -3
  143. package/src/{@tasks → tasks}/CreateTasks.ts +40 -34
  144. package/src/{@tasks → tasks}/TaskGenerateJSON.ts +2 -2
  145. package/src/{@tasks → tasks}/TaskGenerateText.ts +2 -2
  146. package/src/{@tasks → tasks}/TaskSendNTFY.ts +29 -25
  147. package/src/{@tasks → tasks}/TaskSendWebhook.ts +22 -15
  148. package/src/{@types → types}/Actions.ts +3 -3
  149. package/src/{@types → types}/HVTEC.ts +2 -2
  150. package/src/{@types → types}/Hash.ts +2 -2
  151. package/src/types/Nodes.ts +29 -0
  152. package/src/{@types → types}/Settings.ts +17 -8
  153. package/src/{@types → types}/StanzaCompiled.ts +3 -3
  154. package/src/{@types → types}/UGC.ts +2 -2
  155. package/src/{@types → types}/VTEC.ts +2 -2
  156. package/tools/build.js +2 -0
  157. package/tsconfig.json +25 -18
  158. package/src/@modules/@database/InitializeDatabase.ts +0 -59
  159. package/src/@modules/@utilities/GetSettings.ts +0 -25
  160. package/src/@modules/@utilities/SetListener.ts +0 -30
  161. package/src/@parsers/@text/GetPolygonFromProduct.ts +0 -53
  162. package/src/@parsers/@text/GetXML.ts +0 -61
  163. package/src/@parsers/@ugc/GetZonePolygon.ts +0 -111
  164. package/src/@tasks/TaskGenerateAudio.ts +0 -34
@@ -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: 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
 
@@ -68,5 +68,69 @@ export const EnumStates: Record<string, string> = {
68
68
  "WV": "West Virginia",
69
69
  "WI": "Wisconsin",
70
70
  "WY": "Wyoming",
71
- "DC": "District of Columbia"
72
- };
71
+ "DC": "District of Columbia",
72
+ };
73
+
74
+ export const EnumZones: Record<string, string> = {
75
+ "LM": "Lake Michigan",
76
+ "GM": "Gulf of Mexico",
77
+ "LH": "Lake Huron",
78
+ "LE": "Lake Erie",
79
+ "LS": "Lake Superior",
80
+ "LO": "Lake Ontario",
81
+ "AM": "Atlantic Ocean",
82
+ }
83
+
84
+ export const EnumStateFIPS: Record<string, string> = {
85
+ "01": "AL",
86
+ "02": "AK",
87
+ "04": "AZ",
88
+ "05": "AR",
89
+ "06": "CA",
90
+ "08": "CO",
91
+ "09": "CT",
92
+ "10": "DE",
93
+ "11": "DC",
94
+ "12": "FL",
95
+ "13": "GA",
96
+ "15": "HI",
97
+ "16": "ID",
98
+ "17": "IL",
99
+ "18": "IN",
100
+ "19": "IA",
101
+ "20": "KS",
102
+ "21": "KY",
103
+ "22": "LA",
104
+ "23": "ME",
105
+ "24": "MD",
106
+ "25": "MA",
107
+ "26": "MI",
108
+ "27": "MN",
109
+ "28": "MS",
110
+ "29": "MO",
111
+ "30": "MT",
112
+ "31": "NE",
113
+ "32": "NV",
114
+ "33": "NH",
115
+ "34": "NJ",
116
+ "35": "NM",
117
+ "36": "NY",
118
+ "37": "NC",
119
+ "38": "ND",
120
+ "39": "OH",
121
+ "40": "OK",
122
+ "41": "OR",
123
+ "42": "PA",
124
+ "44": "RI",
125
+ "45": "SC",
126
+ "46": "SD",
127
+ "47": "TN",
128
+ "48": "TX",
129
+ "49": "UT",
130
+ "50": "VT",
131
+ "51": "VA",
132
+ "53": "WA",
133
+ "54": "WV",
134
+ "55": "WI",
135
+ "56": "WY"
136
+ }
@@ -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: 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
 
@@ -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: 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
 
@@ -11,13 +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: 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
- export const EnumTags = {
20
+ type EnumTagsType = {
21
+ match: RegExp;
22
+ tag: string;
23
+ };
24
+
25
+ export const EnumTags: Record<string, EnumTagsType[]> = {
21
26
  SEVERE_WEATHER: [
22
27
  { match: /A Large And Extremely Dangerous Tornado/i, tag: "Large and Dangerous Tornado" },
23
28
  { match: /This Is A Particularly Dangerous Situation/i, tag: "Particularly Dangerous Situation" },
@@ -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: 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
 
@@ -0,0 +1,70 @@
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
+ type Themes = {
21
+ Event: string;
22
+ RGB: string;
23
+ }
24
+
25
+ export const EnumThemes: Themes[] = [
26
+ { Event: `Tornado Emergency`, RGB: `rgb(166, 0, 255)` },
27
+ { Event: `Flash Flood Emergency`, RGB: `rgb(21, 216, 37)` },
28
+ { Event: `*PDS Tornado Warning*`, RGB: `rgb(208, 0, 255)` },
29
+ { Event: `*Tornado Warning*`, RGB: `rgb(255, 0, 0)` },
30
+ { Event: `Confirmed Tornado Warning`, RGB: `rgb(220, 20, 20)` },
31
+ { Event: `Radar Indicated Tornado Warning`, RGB: `rgb(200, 30, 30)` },
32
+ { Event: `Tornado Warning`, RGB: `rgb(180, 40, 40)` },
33
+ { Event: `*EDS Severe Thunderstorm Warning*`, RGB: `rgb(255, 51, 0)` },
34
+ { Event: `*Destructive Severe Thunderstorm Warning*`, RGB: `rgb(255, 51, 0)` },
35
+ { Event: `Destructive Severe Thunderstorm Warning (TPROB)`, RGB: `rgb(240, 60, 0)` },
36
+ { Event: `EDS Severe Thunderstorm Warning (TPROB)`, RGB: `rgb(240, 60, 0)` },
37
+ { Event: `Considerable Severe Thunderstorm Warning (TPROB)`, RGB: `rgb(230, 100, 0)` },
38
+ { Event: `*Severe Thunderstorm Warning*`, RGB: `rgb(197, 159, 32)` },
39
+ { Event: `Severe Thunderstorm Warning (TPROB)`, RGB: `rgb(210, 140, 20)` },
40
+ { Event: `Considerable Severe Thunderstorm Warning`, RGB: `rgb(204, 160, 0)` },
41
+ { Event: `Severe Thunderstorm Warning`, RGB: `rgb(204, 132, 0)` },
42
+ { Event: `Flash Flood Warning`, RGB: `rgb(97, 204, 30)` },
43
+ { Event: `Flood Warning`, RGB: `rgb(0, 204, 0)` },
44
+ { Event: `Hurricane Warning`, RGB: `rgb(16, 125, 176)` },
45
+ { Event: `Tsunami Warning`, RGB: `rgb(93, 27, 158)` },
46
+ { Event: `Tsunami Watch`, RGB: `rgb(72, 16, 128)` },
47
+ { Event: `Tsunami Advisory`, RGB: `rgb(80, 48, 160)` },
48
+ { Event: `Tropical Storm Warning`, RGB: `rgb(101, 194, 238)` },
49
+ { Event: `Hurricane Watch`, RGB: `rgb(204, 84, 144)` },
50
+ { Event: `*PDS Blizzard Warning*`, RGB: `rgb(5, 115, 151)` },
51
+ { Event: `Blizzard Warning`, RGB: `rgb(0, 152, 204)` },
52
+ { Event: `Snow Squall Warning`, RGB: `rgb(56, 104, 144)` },
53
+ { Event: `*PDS Ice Storm Warning*`, RGB: `rgb(86, 67, 196)` },
54
+ { Event: `Ice Storm Warning`, RGB: `rgb(58, 49, 111)` },
55
+ { Event: `Lake Effect Snow Warning`, RGB: `rgb(0, 111, 111)` },
56
+ { Event: `Winter Storm Warning`, RGB: `rgb(24, 115, 204)` },
57
+ { Event: `Extreme Cold Warning`, RGB: `rgb(47, 47, 137)` },
58
+ { Event: `Tornadic Special Marine Warning`, RGB: `rgb(3, 134, 134)` },
59
+ { Event: `Special Marine Warning`, RGB: `rgb(0, 204, 204)` },
60
+ { Event: `Special Weather Statement`, RGB: `rgb(70, 130, 180)` },
61
+ { Event: `Mesoscale Discussion`, RGB: `rgb(255, 0, 0)` },
62
+ { Event: `*PDS Tornado Watch*`, RGB: `rgb(255, 0, 0)` },
63
+ { Event: `*Tornado Watch*`, RGB: `rgb(151, 23, 23)` },
64
+ { Event: `*PDS Severe Thunderstorm Watch*`, RGB: `rgb(255, 81, 0)` },
65
+ { Event: `*Severe Thunderstorm Watch*`, RGB: `rgb(255, 204, 0)` },
66
+ { Event: `*Excessive Heat Warning*`, RGB: `rgb(255, 255, 255)` },
67
+ { Event: `*Flood*`, RGB: `rgb(0, 255, 128)` },
68
+ { Event: `*Heat*`, RGB: `rgb(240, 197, 119)` },
69
+ { Event: `Default`, RGB: `rgb(86, 125, 165)` },
70
+ ];
@@ -11,21 +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 { TypeStanzaCompiled } from "types/StanzaCompiled"
21
- import { TypeVTEC } from "types/VTEC"
22
- import { EnumICAO } from "@enums/ICAO"
23
- import { Bootstrap } from "@bootstrap"
24
- import { GetEventTracking } from "@building/GetEventTracking"
25
- import { VTECExtract } from "@parsers/vtec/VTECExtract"
26
- import { GetEventTags } from "@building/GetEventTags"
27
- import { GetTextFromProduct } from "@parsers/text/GetTextFromProduct"
28
- import { SetDebug } from "@utilities/SetDebug"
20
+ import { TypeStanzaCompiled } from "Types/StanzaCompiled"
21
+ import { TypeVTEC } from "Types/VTEC"
22
+ import { EnumICAO } from "@Enums/ICAO"
23
+ import { Bootstrap } from "@Bootstrap"
24
+ import { GetEventTracking } from "@Building/GetEventTracking"
25
+ import { VTECExtract } from "@ParsingVTEC/VTECExtract"
26
+ import { GetEventTags } from "@Building/GetEventTags"
27
+ import { GetEventTheme } from "@Building/GetEventTheme"
28
+ import { GetEventDirection } from "@Building/GetEventDirection"
29
+ import { GetTextFromProduct } from "@ParsingText/GetTextFromProduct"
30
+ import { SetDebug } from "@Utilities/SetDebug"
29
31
 
30
32
  export const ParseAPI = async (Stanza: TypeStanzaCompiled): Promise<void> => {
31
33
  const messages = Object.values(JSON.parse(Stanza.Message).features) as any;
@@ -35,7 +37,7 @@ export const ParseAPI = async (Stanza: TypeStanzaCompiled): Promise<void> => {
35
37
  Bootstrap.Cache.Parsed.push({
36
38
  type: `Feature`,
37
39
  geometry: {
38
- type: `Point`,
40
+ type: `Polygon`,
39
41
  coordinates: []
40
42
  },
41
43
  properties: {
@@ -46,13 +48,17 @@ export const ParseAPI = async (Stanza: TypeStanzaCompiled): Promise<void> => {
46
48
  expires: feature?.properties?.expires ? new Date(feature?.properties?.expires).toISOString() : null,
47
49
  locations: feature?.properties?.areaDesc ?? null,
48
50
  locations_array: feature?.properties?.areaDesc ? feature?.properties?.areaDesc.split('; ') : [],
49
- location_states: [...new Set(
50
- feature?.properties?.areaDesc?.split(';')
51
- ?.map((location: string) => location.match(/,\s*([A-Z]{2})\b/)?.[1])
51
+ regions: [...new Set(
52
+ feature?.properties?.geocode?.UGC?.map((ugc: string) => ugc.match(/^([A-Z]{2})[CZ](\d{3})$/)?.[1])
52
53
  .filter(Boolean) ?? []
53
- )],
54
+ )] as string[],
55
+ regions_string: (() => {
56
+ const abbrs = [...new Set(feature?.properties?.geocode?.UGC?.map((l: string) => l.match(/^([A-Z]{2})[CZ](\d{3})$/)?.[1]).filter(Boolean) ?? [])];
57
+ return abbrs.length ? abbrs.join(`-`) : null;
58
+ })(),
54
59
  description: feature?.properties?.description ?? null,
55
60
  attributes: feature?.properties?.attributes ?? {},
61
+ theme: GetEventTheme(feature?.properties?.event),
56
62
  geocode: {
57
63
  office: {
58
64
  office: VTEC ? VTEC?.[0]?.Tracking.split(`.`)[0] : null,
@@ -60,6 +66,10 @@ export const ParseAPI = async (Stanza: TypeStanzaCompiled): Promise<void> => {
60
66
  },
61
67
  organization: feature?.properties?.parameters?.WMOidentifier?.[0],
62
68
  ugc: feature?.properties?.geocode?.UGC ?? [],
69
+ census: {
70
+ population: null,
71
+ cities: []
72
+ },
63
73
  polygon: feature?.geometry?.coordinates.length > 0 ? Buffer.from(JSON.stringify([feature?.geometry?.coordinates[0]])).toString('base64') : null,
64
74
  polygon_generated: feature?.geometry?.coordinates.length > 0 ? true : false,
65
75
  },
@@ -71,9 +81,10 @@ export const ParseAPI = async (Stanza: TypeStanzaCompiled): Promise<void> => {
71
81
  impacts: GetTextFromProduct({ Message: feature?.properties?.description, Find: [`IMPACT...`], Removal: [`.`]}) ?? null,
72
82
  estimated_hail_size: feature?.properties?.parameters?.maxHailSize?.[0] ?? null,
73
83
  estimated_wind_gusts: feature?.properties?.parameters?.maxWindGust?.[0] ?? null,
84
+ direction: GetEventDirection(feature?.properties?.description) ?? null,
74
85
  damage_threat: feature?.properties?.parameters?.thunderstormDamageThreat?.[0] ?? null,
75
86
  tornado_threat: feature?.properties?.parameters?.tornadoDetection?.[0] ?? null,
76
- flood_threat: feature?.properties?.parameters?.floodDetection?.[0] ?? null,
87
+ flood_threat: feature?.properties?.parameters?.flashFloodDamageThreat?.[0] ?? null,
77
88
  wind_threat: feature?.properties?.parameters?.windThreat?.[0] ?? null,
78
89
  hail_threat: feature?.properties?.parameters?.hailThreat?.[0] ?? null,
79
90
  },
@@ -11,20 +11,21 @@
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-lower/Attributes"
21
- import { TypeStanzaCompiled } from "types/StanzaCompiled"
22
- import { EnumMatches } from "@enums/Matches"
23
- import { Bootstrap } from "@bootstrap"
24
- import { GetEventProperties } from "@building/GetEventProperties"
25
- import { GetEventHeader } from "@building/GetEventHeader"
26
- import { GetEventTracking } from "@building/GetEventTracking"
27
- import { SetDebug } from "@utilities/SetDebug"
20
+ import { TypeAttributes } from "StaticTypes/Attributes"
21
+ import { TypeStanzaCompiled } from "Types/StanzaCompiled"
22
+ import { EnumMatches } from "@Enums/Matches"
23
+ import { Bootstrap } from "@Bootstrap"
24
+ import { GetEventProperties } from "@Building/GetEventProperties"
25
+ import { GetEventHeader } from "@Building/GetEventHeader"
26
+ import { GetEventTracking } from "@Building/GetEventTracking"
27
+ import { GetEventTheme } from "@Building/GetEventTheme"
28
+ import { SetDebug } from "@Utilities/SetDebug"
28
29
 
29
30
  export const ParseText = async (Stanza: TypeStanzaCompiled): Promise<void> => {
30
31
  const getMessages = Stanza?.Message
@@ -55,7 +56,7 @@ export const ParseText = async (Stanza: TypeStanzaCompiled): Promise<void> => {
55
56
  Bootstrap.Cache.Parsed.push({
56
57
  type: `Feature`,
57
58
  geometry: {
58
- type: `Point`,
59
+ type: `Polygon`,
59
60
  coordinates: []
60
61
  },
61
62
  properties: {
@@ -64,6 +65,7 @@ export const ParseText = async (Stanza: TypeStanzaCompiled): Promise<void> => {
64
65
  status: isStatement ? `Statement` : `Issued`,
65
66
  issued: (!isNaN(issued.getTime())) ? issued.toISOString() : new Date().toISOString(),
66
67
  expires: isStatement ? new Date(issued.getTime() + 120 * 1000).toISOString() : (!isNaN(expires.getTime())) ? expires.toISOString() : new Date(Date.now() + 60 * 60 * 1000).toISOString(),
68
+ theme: GetEventTheme(event),
67
69
  ...props,
68
70
  metadata: {
69
71
  ms: performance.now() - tick,
@@ -11,21 +11,22 @@
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-lower/Attributes"
21
- import { TypeStanzaCompiled } from "types/StanzaCompiled"
22
- import { EnumMatches } from "@enums/Matches"
23
- import { Bootstrap } from "@bootstrap"
24
- import { ugcExtract } from "@parsers/ugc/UGCExtract"
25
- import { GetEventProperties } from "@building/GetEventProperties"
26
- import { GetEventHeader } from "@building/GetEventHeader"
27
- import { GetEventTracking } from "@building/GetEventTracking"
28
- import { SetDebug } from "@utilities/SetDebug"
20
+ import { TypeAttributes } from "StaticTypes/Attributes"
21
+ import { TypeStanzaCompiled } from "Types/StanzaCompiled"
22
+ import { EnumMatches } from "@Enums/Matches"
23
+ import { Bootstrap } from "@Bootstrap"
24
+ import { UGCExtract } from "@ParsingUGC/UGCExtract"
25
+ import { GetEventProperties } from "@Building/GetEventProperties"
26
+ import { GetEventHeader } from "@Building/GetEventHeader"
27
+ import { GetEventTracking } from "@Building/GetEventTracking"
28
+ import { GetEventTheme } from "@Building/GetEventTheme"
29
+ import { SetDebug } from "@Utilities/SetDebug"
29
30
 
30
31
  export const ParseUGC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
31
32
  const getMessages = Stanza?.Message
@@ -36,7 +37,7 @@ export const ParseUGC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
36
37
  for (const message of getMessages) {
37
38
  const tick = performance.now();
38
39
  const attributes = Stanza?.Attributes as TypeAttributes
39
- const ugc = await ugcExtract(message)
40
+ const ugc = await UGCExtract(message)
40
41
 
41
42
  if (ugc != null ) {
42
43
  const props = GetEventProperties({ Message: message, Attributes: attributes, UGC: ugc })
@@ -54,13 +55,12 @@ export const ParseUGC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
54
55
  event += ` (AWIPSID)`
55
56
  }
56
57
  isStatement = true;
57
-
58
58
  }
59
59
 
60
60
  Bootstrap.Cache.Parsed.push({
61
61
  type: `Feature`,
62
62
  geometry: {
63
- type: `Point`,
63
+ type: `Polygon`,
64
64
  coordinates: []
65
65
  },
66
66
  properties: {
@@ -69,6 +69,7 @@ export const ParseUGC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
69
69
  status: isStatement ? `Statement` : `Issued`,
70
70
  issued: (!isNaN(issued.getTime())) ? issued.toISOString() : new Date().toISOString(),
71
71
  expires: isStatement ? new Date(issued.getTime() + 120 * 1000).toISOString() : (!isNaN(expires.getTime())) ? expires.toISOString() : new Date(Date.now() + 60 * 60 * 1000).toISOString(),
72
+ theme: GetEventTheme(event),
72
73
  ...props,
73
74
  metadata: {
74
75
  ms: performance.now() - tick,
@@ -11,24 +11,25 @@
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-lower/Attributes"
21
- import { TypeStanzaCompiled } from "types/StanzaCompiled"
22
- import { TypeVTEC } from "types/VTEC"
23
- import { TypeHVTEC } from "types/HVTEC"
24
- import { Bootstrap } from "@bootstrap"
25
- import { VTECExtract } from "@parsers/vtec/VTECExtract"
26
- import { HVExtract } from "@parsers/hvtec/HVExtract"
27
- import { ugcExtract } from "@parsers/ugc/UGCExtract"
28
- import { GetEventProperties } from "@building/GetEventProperties"
29
- import { GetEventHeader } from "@building/GetEventHeader"
30
- import { GetEventTracking } from "@building/GetEventTracking"
31
- import { SetDebug } from "@utilities/SetDebug"
20
+ import { TypeAttributes } from "StaticTypes/Attributes"
21
+ import { TypeStanzaCompiled } from "Types/StanzaCompiled"
22
+ import { TypeVTEC } from "Types/VTEC"
23
+ import { TypeHVTEC } from "Types/HVTEC"
24
+ import { Bootstrap } from "@Bootstrap"
25
+ import { VTECExtract } from "@ParsingVTEC/VTECExtract"
26
+ import { HVExtract } from "@ParsingHVTEC/HVExtract"
27
+ import { UGCExtract } from "@ParsingUGC/UGCExtract"
28
+ import { GetEventProperties } from "@Building/GetEventProperties"
29
+ import { GetEventHeader } from "@Building/GetEventHeader"
30
+ import { GetEventTracking } from "@Building/GetEventTracking"
31
+ import { GetEventTheme } from "@Building/GetEventTheme"
32
+ import { SetDebug } from "@Utilities/SetDebug"
32
33
 
33
34
  export const ParseVTEC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
34
35
  const getMessages = Stanza?.Message
@@ -41,7 +42,7 @@ export const ParseVTEC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
41
42
  const attributes = Stanza?.Attributes as TypeAttributes
42
43
  const VTEC = VTECExtract(message) as TypeVTEC[];
43
44
  const hVTEC = HVExtract(message) as TypeHVTEC[];
44
- const ugc = await ugcExtract(message)
45
+ const ugc = await UGCExtract(message)
45
46
  if (VTEC != null && ugc != null ) {
46
47
  for (const vtec of VTEC) {
47
48
  const props = GetEventProperties({ Message: message, Attributes: attributes, UGC: ugc, VTEC: vtec })
@@ -51,7 +52,7 @@ export const ParseVTEC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
51
52
  Bootstrap.Cache.Parsed.push({
52
53
  type: `Feature`,
53
54
  geometry: {
54
- type: `Point`,
55
+ type: `Polygon`,
55
56
  coordinates: []
56
57
  },
57
58
  properties: {
@@ -60,6 +61,7 @@ export const ParseVTEC = async (Stanza: TypeStanzaCompiled): Promise<void> => {
60
61
  status: vtec.Status,
61
62
  issued: (!isNaN(issued.getTime())) ? issued.toISOString() : new Date().toISOString(),
62
63
  expires: (!isNaN(expires.getTime())) ? expires.toISOString() : ugc.Expires ?? new Date(issued.getTime() + 60 * 60 * 1000).toISOString(),
64
+ theme: GetEventTheme(vtec.Event),
63
65
  ...props,
64
66
  metadata: {
65
67
  ms: performance.now() - tick,
package/src/index.ts CHANGED
@@ -11,67 +11,84 @@
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/Settings"
21
- import { GetEventGeometry } from "@building/GetEventGeometry"
22
- import { GetCleanedEvent } from "@building/GetCleanedEvent"
23
- import { SetSettings } from "@utilities/SetSettings"
24
- import { SetEventEmit } from "@utilities/SetEventEmit"
25
- import { SetWarning } from "@utilities/SetWarning"
26
- import { GenerateEASMessage } from "@eas/GenerateEASMessage"
27
- import { SetNode } from "@core/SetNode"
28
- import { GetEvents } from "@core/GetEvents"
29
- import { GetNodes } from "@core/GetNodes"
30
- import { ManualEvent } from "@core/ManualEvent"
31
- import { GetRandomEvent } from "@core/GetRandomEvent"
32
- import { QueryStanza } from "@core/QueryStanza"
33
- import { ClearEvents } from "@core/ClearEvents"
34
- import { CreateListener } from "@core/CreateListener"
35
- import { StartService } from "@core/StartService"
36
- import { StopService } from "@core/StopService"
37
- import { GetVersion } from "@core/GetVersion"
20
+ import { TypeSettings } from "Types/Settings"
21
+ import { Bootstrap } from "@Bootstrap"
22
+ import { GetEventGeometry } from "@Building/GetEventGeometry"
23
+ import { GetCleanedEvent } from "@Building/GetCleanedEvent"
24
+ import { SetSettings } from "@Utilities/SetSettings"
25
+ import { SetEventEmit } from "@Utilities/SetEventEmit"
26
+ import { SetWarning } from "@Utilities/SetWarning"
27
+ import { GenerateAudioMessage } from "@Audio/GenerateAudioMessage"
28
+ import { GenerateGraphic } from "@Image/GenerateGraphic"
29
+ import { SetNode } from "@Core/SetNode"
30
+ import { GetEvents } from "@Core/GetEvents"
31
+ import { GetNodes } from "@Core/GetNodes"
32
+ import { ManualEvent } from "@Core/ManualEvent"
33
+ import { GetRandomEvent } from "@Core/GetRandomEvent"
34
+ import { QueryStanza } from "@Core/QueryStanza"
35
+ import { ClearEvents } from "@Core/ClearEvents"
36
+ import { StartService } from "@Core/StartService"
37
+ import { StopService } from "@Core/StopService"
38
+ import { GetVersion } from "@Core/GetVersion"
39
+
38
40
 
39
41
  export class Manager {
40
42
  public constructor(settings: TypeSettings) {
41
- this.trycatch(); StartService(settings)
43
+ this.ErrorHandler(); StartService(settings)
42
44
  }
43
45
 
44
- on(event: string, callback: () => void) {
45
- CreateListener(event, callback)
46
+ public on(event: string, callback: () => void) {
47
+ Bootstrap.Listener.on(event, callback)
48
+ return () => { void Bootstrap.Listener.off(event, callback) };
46
49
  }
47
50
 
48
- trycatch() {
49
- process.on('uncaughtException', (err: any) => {
50
- const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'ENOTFOUND', 'ECONNREFUSED', 'EPIPE', 'EADDRINUSE', 'EALREADY', 'EACCES', 'EAGAIN', 'EHOSTDOWN', 'STARTTLS_FAILURE'];
51
- if (ignored.includes(err?.code)) {
51
+ private ErrorHandler() {
52
+ process.on('uncaughtException', (error: any) => {
53
+ const _IGNORED = [
54
+ 'ETIMEDOUT',
55
+ 'ECONNRESET',
56
+ 'EHOSTUNREACH',
57
+ 'ENOTFOUND',
58
+ 'ECONNREFUSED',
59
+ 'EPIPE',
60
+ 'EADDRINUSE',
61
+ 'EALREADY',
62
+ 'EACCES',
63
+ 'EAGAIN',
64
+ 'EHOSTDOWN',
65
+ 'STARTTLS_FAILURE'
66
+ ];
67
+ if (_IGNORED.includes(error?.code)) {
52
68
  SetEventEmit({
53
69
  Event: `onServiceStatus`,
54
70
  Metadata: {
55
- Message: `Ignored Critical Error: ${err?.code ?? 'Unknown error code'}. This may indicate a connection issue. Attempting to continue...`,
71
+ Message: `Ignored Critical Error: ${error?.code ?? 'Unknown error code'}. This may indicate a connection issue. Attempting to continue...`,
56
72
  Data: {},
57
73
  Type: `error`,
58
74
  Error: true
59
75
  }
60
76
  })
61
- return;
62
77
  }
63
- SetWarning({Message: `Uncaught Exception: ${err instanceof Error ? err.stack ?? err.message : String(err)}`})
78
+ console.log(`Uncaught Exception: ${error instanceof Error ? error.stack ?? error.message : String(error)}`);
79
+ SetWarning({Message: `Uncaught Exception: ${error instanceof Error ? error.stack ?? error.message : String(error)}`})
64
80
  })
65
81
  }
66
82
  }
67
83
 
68
84
  export default Manager;
69
- export type { TypeEvent } from "./@types-lower/Event"
85
+ export type { TypeEvent } from "StaticTypes/Event"
70
86
  export {
71
87
  SetSettings, GetEventGeometry, ManualEvent,
72
88
  GetCleanedEvent, StopService, ClearEvents,
73
89
  StartService, SetNode, GetRandomEvent, GetVersion,
74
- GetEvents, GetNodes, GenerateEASMessage, QueryStanza
90
+ GetEvents, GetNodes, GenerateAudioMessage, GenerateGraphic,
91
+ QueryStanza
75
92
  }
76
93
 
77
94