@atmosx/event-product-parser 3.0.3 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +4681 -13425
  15. package/dist/esm/index.mjs +3163 -11909
  16. package/package.json +4 -8
  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 -30
  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} +4 -4
  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 +28 -26
  137. package/tsup.config.ts +1 -1
  138. package/README.md +0 -339
  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
package/dist/index.d.ts 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: (settings: 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 };
@@ -1,89 +0,0 @@
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
- import { TypeEventProperties } from "../@types/type.properties";
21
- import { TypeAttributes } from "../@types/types.attributes";
22
- import { TypeUGC } from "../@types/types.ugc";
23
- import { TypePVTEC } from "../@types/types.pvtec";
24
- import { TypeHVTEC } from "../@types/types.hvtec";
25
- import { regExp } from "../@dictionaries/dictionaries.regExp";
26
- import { getDescriptionFromProduct } from "../@parsers/@text/text.getDescriptionFromProduct";
27
- import { getPolygonFromProduct } from "../@parsers/@text/text.getPolygonFromProduct";
28
- import { getTextFromProduct } from "../@parsers/@text/text.getTextFromProduct";
29
- import { getEventOffice } from "./building.office";
30
- import { getEventTags } from "./building.tags";
31
-
32
- interface GetPropertiesOptions {
33
- message: string
34
- attributes: TypeAttributes
35
- ugc?: TypeUGC
36
- pVtec?: TypePVTEC
37
- hVtec?: TypeHVTEC
38
- }
39
-
40
- export const properties = (options: GetPropertiesOptions): TypeEventProperties => {
41
- const organization = options.message.match(regExp.wmo)?.[0] ?? null
42
- const polygons = getPolygonFromProduct(options.message)
43
- return {
44
- locations: options?.ugc?.locations?.join(`; `) ?? null,
45
- description: getDescriptionFromProduct({ message: options.message, handle: options?.pVtec?.vtec ?? null }),
46
- attributes: options.attributes,
47
- geocode: {
48
- office: getEventOffice({ attributes: options.attributes, organization: organization, pVtec: options.pVtec }),
49
- organization: organization,
50
- ugc: options?.ugc?.zones ?? [],
51
- polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString('base64') : null,
52
- polygon_generated: polygons.length > 0 ? true : false
53
- },
54
- parameters: {
55
- tags: getEventTags(options.message),
56
- instructions: getTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`]}) ?? null,
57
- source: getTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`]}) ?? null,
58
- hazards: getTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`]}) ?? null,
59
- impacts: getTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`]}) ?? null,
60
- estimated_hail_size: getTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ['in']}) ?? null,
61
- estimated_wind_gusts: getTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`]}) ?? null,
62
- damage_threat: getTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: []}) ?? null,
63
- tornado_threat: getTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] }) ?? null,
64
- flood_threat: getTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`]}) ?? null,
65
- wind_threat: getTextFromProduct({ message: options.message, find: [`WIND THREAT...`]}) ?? null,
66
- hail_threat: getTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: []}) ?? null,
67
- },
68
- spc_parameters: {
69
- spc_max_tornado: getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] }) ?? null,
70
- spc_max_hail: getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] }) ?? null,
71
- spc_max_wind: getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] }) ?? null,
72
- spc_watch_issuance: getTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`]}) ?? null,
73
- },
74
- watch_parameters: {
75
- watch_number: getTextFromProduct({ message: options.message, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })?.replace(/(WT|WS|)/g, '')?.trim() ?? null,
76
- watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : options?.message.includes(`SEVERE`) ? `Severe` : null,
77
- additional_tornadoes_probability: getTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
78
- strong_tornadoes_probability: getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
79
- severe_wind_probability: getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
80
- severe_hail_probability: getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
81
- hail_2in_probability: getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] }) ?? null,
82
- combined_hail_wind_probability: getTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
83
- max_hail_in: getTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] }) ?? null,
84
- max_wind_surface: getTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] }) ?? null,
85
- max_tops_x100feet: getTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] }) ?? null,
86
- pds_watch: (getTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`)
87
- }
88
- }
89
- }
@@ -1,99 +0,0 @@
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
- type EnhancedEventType = {
21
- description?: string
22
- append?: boolean
23
- tornado?: string
24
- damage?: string
25
- }
26
-
27
- export const betterEventNames: Record<string, Record<string, EnhancedEventType>> = {
28
- "Tornado Warning": {
29
- "Tornado Emergency": {
30
- description: "tornado emergency"
31
- },
32
- "PDS Tornado Warning": {
33
- description: "particularly dangerous situation",
34
- damage: `CONSIDERABLE`
35
- },
36
- "Radar Confirmed Tornado Warning": {
37
- description: "source...radar confirmed tornado.",
38
- tornado: `OBSERVED`
39
- },
40
- "Confirmed Tornado Warning": {
41
- tornado: `OBSERVED`
42
- },
43
- "Radar Indicated Tornado Warning": { },
44
- },
45
- "Blizzard Warning": {
46
- "PDS Blizzard Warning": {
47
- description: "particularly dangerous situation",
48
- },
49
- },
50
- "Ice Storm Warning": {
51
- "PDS Ice Storm Warning": {
52
- description: "particularly dangerous situation",
53
- },
54
- },
55
- "Special Marine Warning": {
56
- "Special Marine Warning (TPROB)": {
57
- tornado: `POSSIBLE`
58
- },
59
- },
60
- "Tornado Watch": {
61
- "PDS Tornado Watch": {
62
- description: "particularly dangerous situation"
63
- }
64
- },
65
- "Flash Flood Warning": {
66
- "Flash Flood Emergency": {
67
- description: "flash flood emergency"
68
- },
69
- "Considerable Flash Flood Warning": {
70
- damage: `CONSIDERABLE`
71
- },
72
- },
73
- "Severe Thunderstorm Warning": {
74
- "EDS Severe Thunderstorm Warning (TPROB)": {
75
- description: "extremely dangerous situation",
76
- tornado: "POSSIBLE"
77
- },
78
- "EDS Severe Thunderstorm Warning": {
79
- description: "extremely dangerous situation"
80
- },
81
- "Destructive Severe Thunderstorm Warning (TPROB)": {
82
- damage: `DESTRUCTIVE`,
83
- tornado: `POSSIBLE`
84
- },
85
- "Destructive Severe Thunderstorm Warning": {
86
- damage: `DESTRUCTIVE`
87
- },
88
- "Considerable Severe Thunderstorm Warning (TPROB)": {
89
- damage: `CONSIDERABLE`,
90
- tornado: `POSSIBLE`
91
- },
92
- "Considerable Severe Thunderstorm Warning": {
93
- damage: `CONSIDERABLE`
94
- },
95
- "Severe Thunderstorm Warning (TPROB)": {
96
- tornado: `POSSIBLE`
97
- },
98
- },
99
- }