@atmosx/event-product-parser 3.0.4 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +1 -1
  2. package/.github/README.md +163 -0
  3. package/.github/SUPPORTED_EVENTS.md +370 -0
  4. package/.github/docs/docs-functions.md +30 -0
  5. package/.github/docs/docs-general-configurations.md +209 -0
  6. package/.github/docs/docs-integrations.md +37 -0
  7. package/.github/docs/docs-listeners.md +28 -0
  8. package/.github/docs/docs-source-configuration.md +218 -0
  9. package/.github/docs/docs-technical.md +50 -0
  10. package/.github/logo.png +0 -0
  11. package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
  12. package/.github/samples/SAMPLE_GEOJSON.json +204 -0
  13. package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
  14. package/dist/cjs/index.cjs +4677 -13422
  15. package/dist/esm/index.mjs +3159 -11906
  16. package/package.json +3 -9
  17. package/src/@building/{building.create.ts → CreateEvent.ts} +25 -11
  18. package/src/@building/{building.clean.ts → GetCleanedEvent.ts} +2 -2
  19. package/src/@building/GetEventAttachments.ts +86 -0
  20. package/src/@building/{building.enhance.ts → GetEventEnhancedName.ts} +11 -12
  21. package/src/@building/{building.geometry.ts → GetEventGeometry.ts} +7 -7
  22. package/src/@building/{building.headers.ts → GetEventHeader.ts} +3 -3
  23. package/src/@building/{building.polygon.ts → GetEventNodes.ts} +13 -11
  24. package/src/@building/{building.office.ts → GetEventOffice.ts} +6 -6
  25. package/src/@building/GetEventProperties.ts +96 -0
  26. package/src/@building/{building.signature.ts → GetEventSignature.ts} +14 -15
  27. package/src/@building/{building.tags.ts → GetEventTags.ts} +9 -4
  28. package/src/@building/{building.tracking.ts → GetEventTracking.ts} +15 -15
  29. package/src/@building/{building.validate.ts → ValidateEvents.ts} +67 -60
  30. package/src/@core/{core.clearEvents.ts → ClearEvents.ts} +3 -4
  31. package/src/@core/{core.createListener.ts → CreateListener.ts} +3 -3
  32. package/src/@core/{core.getEvents.ts → GetEvents.ts} +1 -2
  33. package/src/@core/{core.getNodes.ts → GetNodes.ts} +1 -2
  34. package/src/@core/{core.getRandomEvent.ts → GetRandomEvent.ts} +1 -2
  35. package/src/@core/{core.getVersion.ts → GetVersion.ts} +1 -2
  36. package/src/@core/ManualEvent.ts +56 -0
  37. package/src/@core/QueryStanza.ts +39 -0
  38. package/src/@core/{core.setNode.ts → SetNode.ts} +8 -8
  39. package/src/@core/{core.start.ts → StartService.ts} +21 -21
  40. package/src/@core/{core.stop.ts → StopService.ts} +1 -1
  41. package/src/@enums/AWIPS.ts +366 -0
  42. package/src/{@dictionaries/dictionaries.eventActions.ts → @enums/Actions.ts} +1 -1
  43. package/src/{@dictionaries/dictionaries.eventCancelMessages.ts → @enums/Cancellation.ts} +2 -1
  44. package/src/{@dictionaries/dictionaries.eventCauses.ts → @enums/Causes.ts} +1 -1
  45. package/src/{@dictionaries/dictionaries.statusCorrelationText.ts → @enums/Correlations.ts} +1 -1
  46. package/src/@enums/Enhanced.ts +70 -0
  47. package/src/{@dictionaries/dictionaries.eventTypes.ts → @enums/Events.ts} +1 -1
  48. package/src/{@dictionaries/dictionaries.regExp.ts → @enums/Expressions.ts} +2 -1
  49. package/src/@enums/GlobalFilter.ts +24 -0
  50. package/src/{@dictionaries/dictionaries.hailStrings.ts → @enums/Hail.ts} +7 -2
  51. package/src/{@dictionaries/dictionaries.officeICAOs.ts → @enums/ICAO.ts} +3 -1
  52. package/src/@enums/Matches.ts +55 -0
  53. package/src/{@dictionaries/dictionaries.eventProducts.ts → @enums/Products.ts} +1 -1
  54. package/src/{@dictionaries/dictionaries.eventRecords.ts → @enums/Records.ts} +1 -1
  55. package/src/{@dictionaries/dictionaries.eventSeverity.ts → @enums/Severity.ts} +1 -1
  56. package/src/{@dictionaries/dictionaries.shapefileLinks.ts → @enums/Shapefiles.ts} +1 -1
  57. package/src/@enums/States.ts +72 -0
  58. package/src/{@dictionaries/dictionaries.eventStatus.ts → @enums/Status.ts} +1 -1
  59. package/src/@enums/Strings.ts +22 -0
  60. package/src/@enums/Tags.ts +167 -0
  61. package/src/{@dictionaries/dictionaries.testSignatures.ts → @enums/Testing.ts} +3 -2
  62. package/src/@events/{events.api.ts → ParseAPI.ts} +42 -38
  63. package/src/@events/{events.text.ts → ParseText.ts} +25 -18
  64. package/src/@events/{events.ugc.ts → ParseUGC.ts} +28 -19
  65. package/src/@events/{events.vtec.ts → ParseVTEC.ts} +21 -21
  66. package/src/@manager/CreateActions.ts +213 -0
  67. package/src/@manager/{manager.mkEvent.ts → MakeEvent.ts} +34 -31
  68. package/src/@manager/RemoveEvent.ts +70 -0
  69. package/src/@manager/{manager.setHash.ts → SetHash.ts} +8 -9
  70. package/src/@manager/{manager.updateEvents.ts → UpdateEvents.ts} +9 -9
  71. package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +24 -17
  72. package/src/@modules/@database/{database.cache.ts → GetCachedEvents.ts} +10 -8
  73. package/src/@modules/@database/ImportBroadcastify.ts +70 -0
  74. package/src/@modules/@database/{database.shapefiles.ts → ImportShapefiles.ts} +17 -20
  75. package/src/@modules/@database/{database.stanza.ts → ImportStanza.ts} +5 -6
  76. package/src/@modules/@database/{database.init.ts → InitializeDatabase.ts} +25 -11
  77. package/src/@modules/@eas/GenerateEASMessage.ts +144 -0
  78. package/src/@modules/@eas/GetCleanDescription.ts +91 -0
  79. package/src/@modules/@eas/{eas.getFloatPCM16.ts → GetFloatPCM16.ts} +1 -1
  80. package/src/@modules/@eas/{eas.getMergedPCM16.ts → GetMergedPCM16.ts} +1 -1
  81. package/src/@modules/@eas/{eas.getPCM16.ts → GetPCM16.ts} +1 -1
  82. package/src/@modules/@eas/{eas.getPCMToFloat.ts → GetPCMToFloat.ts} +1 -1
  83. package/src/@modules/@eas/{eas.getSampledPCM16.ts → GetSampledPCM16.ts} +1 -1
  84. package/src/@modules/@eas/GetTTS.ts +54 -0
  85. package/src/@modules/@eas/{eas.getWavPCM16.ts → GetWavPCM16.ts} +1 -1
  86. package/src/@modules/@eas/{eas.setAFSK.ts → SetAFSK.ts} +1 -2
  87. package/src/@modules/@eas/{eas.setAsciiToBits.ts → SetAsciiToBits.ts} +1 -2
  88. package/src/@modules/@eas/{eas.setAttentionTone.ts → SetAttentionTone.ts} +1 -1
  89. package/src/@modules/@eas/{eas.setNoise.ts → SetNoise.ts} +6 -5
  90. package/src/@modules/@eas/{eas.setRadioEffect.ts → SetRadioEffect.ts} +6 -5
  91. package/src/@modules/@eas/{eas.setSameHeader.ts → SetSameHeader.ts} +7 -8
  92. package/src/@modules/@stanza/{stanza.getAwipsType.ts → GetAwipsType.ts} +11 -9
  93. package/src/@modules/@stanza/{stanza.validate.ts → ValidateStanza.ts} +9 -9
  94. package/src/@modules/@utilities/CreateHttp.ts +83 -0
  95. package/src/@modules/@utilities/{utilities.getFormattedTime.ts → GetFormattedTime.ts} +1 -1
  96. package/src/@modules/@utilities/GetLatestIssuance.ts +32 -0
  97. package/src/@modules/@utilities/GetMatched.ts +33 -0
  98. package/src/@modules/@utilities/{utilities.getSettings.ts → GetSettings.ts} +2 -2
  99. package/src/@modules/@utilities/{utilities.getShapeNearestPoint.ts → GetShapeNearestPoint.ts} +1 -1
  100. package/src/@modules/@utilities/{utilities.setCronSchedule.ts → SetCronSchedule.ts} +41 -12
  101. package/src/{@types/types.webhook.ts → @modules/@utilities/SetDebug.ts} +16 -6
  102. package/src/@modules/@utilities/{utilities.setEventEmit.ts → SetEventEmit.ts} +5 -5
  103. package/src/@modules/@utilities/{utilities.setListener.ts → SetListener.ts} +1 -1
  104. package/src/@modules/@utilities/{utilities.setSettings.ts → SetSettings.ts} +2 -2
  105. package/src/@modules/@utilities/{utilities.setSleep.ts → SetSleep.ts} +1 -1
  106. package/src/@modules/@utilities/{utilities.setTimeoutAction.ts → SetTimeoutAction.ts} +8 -3
  107. package/src/@modules/@utilities/{utilities.setWarning.ts → SetWarning.ts} +2 -2
  108. package/src/@modules/@xmpp/{xmpp.xDeploy.ts → DeployXMPP.ts} +13 -14
  109. package/src/@modules/@xmpp/{xmpp.xError.ts → ErrorXMPP.ts} +1 -3
  110. package/src/@modules/@xmpp/{xmpp.xOffline.ts → OfflineXMPP.ts} +3 -4
  111. package/src/@modules/@xmpp/{xmpp.xOnline.ts → OnlineXMPP.ts} +6 -5
  112. package/src/@modules/@xmpp/{xmpp.xReconnect.ts → ReconnectXMPP.ts} +8 -8
  113. package/src/@modules/@xmpp/{xmpp.xStanza.ts → StanzaXMPP.ts} +11 -11
  114. package/src/@parsers/@hvtec/{hvtec.extract.ts → HVExtract.ts} +10 -10
  115. package/src/@parsers/@pvtec/{pvtec.expires.ts → GetExpiry.ts} +1 -1
  116. package/src/@parsers/@pvtec/{pvtec.extract.ts → VTECExtract.ts} +17 -17
  117. package/src/@parsers/@text/{text.getDescriptionFromProduct.ts → GetDescriptionFromProduct.ts} +12 -5
  118. package/src/@parsers/@text/GetEmbededText.ts +56 -0
  119. package/src/@parsers/@text/{text.getPolygonFromProduct.ts → GetPolygonFromProduct.ts} +31 -10
  120. package/src/@parsers/@text/GetStringText.ts +58 -0
  121. package/src/@parsers/@text/{text.getTextFromProduct.ts → GetTextFromProduct.ts} +1 -1
  122. package/src/@parsers/@text/{text.getXML.ts → GetXML.ts} +1 -1
  123. package/src/@parsers/@ugc/GetCache.ts +24 -0
  124. package/src/@parsers/@ugc/{ugc.expiry.ts → GetExpiry.ts} +1 -1
  125. package/src/@parsers/@ugc/{ugc.locations.ts → GetLocations.ts} +35 -7
  126. package/src/@parsers/@ugc/{ugc.header.ts → GetUGCHeader.ts} +3 -3
  127. package/src/@parsers/@ugc/{ugc.coordinates.ts → GetZonePolygon.ts} +4 -3
  128. package/src/@parsers/@ugc/SetCache.ts +28 -0
  129. package/src/@parsers/@ugc/{ugc.extract.ts → UGCExtract.ts} +6 -6
  130. package/src/@types/Actions.ts +37 -0
  131. package/src/@types/{type.event.ts → Event.ts} +7 -5
  132. package/src/@types/{type.properties.ts → Properties.ts} +11 -8
  133. package/src/@types/{types.settings.ts → Settings.ts} +31 -7
  134. package/src/@types/{types.compiled.ts → StanzaCompiled.ts} +2 -1
  135. package/src/bootstrap.ts +33 -9
  136. package/src/index.ts +26 -24
  137. package/tsup.config.ts +1 -1
  138. package/README.md +0 -349
  139. package/dist/index.d.mts +0 -239
  140. package/dist/index.d.ts +0 -239
  141. package/src/@building/building.properties.ts +0 -89
  142. package/src/@dictionaries/dictionaries.betterEventNames.ts +0 -99
  143. package/src/@dictionaries/dictionaries.eventAwipAbreviations.ts +0 -364
  144. package/src/@dictionaries/dictionaries.eventTags.ts +0 -93
  145. package/src/@dictionaries/dictionaries.eventsMatchText.ts +0 -36
  146. package/src/@dictionaries/dictionaries.transcribedMessageReplacements.ts +0 -68
  147. package/src/@manager/manager.rmEvent.ts +0 -49
  148. package/src/@manager/manager.updateWebhooks.ts +0 -50
  149. package/src/@modules/@eas/eas.setEasTone.ts +0 -137
  150. package/src/@modules/@utilities/utilities.createHttp.ts +0 -85
  151. package/src/@modules/@utilities/utilities.createWebhook.ts +0 -115
  152. package/test.js +0 -91
  153. /package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +0 -0
  154. /package/{LICENSE → .github/LICENSE} +0 -0
  155. /package/{SECURITY.md → .github/SECURITY.md} +0 -0
  156. /package/src/@parsers/@ugc/{ugc.zones.ts → GetZones.ts} +0 -0
  157. /package/src/@types/{types.attributes.ts → Attributes.ts} +0 -0
  158. /package/src/@types/{types.hvtec.ts → HVTEC.ts} +0 -0
  159. /package/src/@types/{types.hash.ts → Hash.ts} +0 -0
  160. /package/src/@types/{types.stanza.ts → Stanza.ts} +0 -0
  161. /package/src/@types/{types.ugc.ts → UGC.ts} +0 -0
  162. /package/src/@types/{types.pvtec.ts → VTEC.ts} +0 -0
@@ -1,364 +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
- export const eventAwipAbreviations: Record<string, string> = {
21
- ABV: `rawinsonde-data-above-100-millibars`,
22
- ADA: `alarm-alert-administrative-message`,
23
- ADM: `alert-administrative-message`,
24
- ADR: `nws-administrative-message`,
25
- ADV: `space-environment-advisory`,
26
- AFD: `area-forecast-discussion`,
27
- AFM: `area-forecast-matrices`,
28
- AFP: `area-forecast-product`,
29
- AFW: `fire-weather-matrix`,
30
- AGF: `agricultural-forecast`,
31
- AGO: `agricultural-observations`,
32
- ALT: `space-environment-alert`,
33
- AQA: `air-quality-alert`,
34
- AQI: `air-quality-index-statement`,
35
- ASA: `air-stagnation-advisory`,
36
- AVA: `avalanche-watch`,
37
- AVG: `avalanche-weather-guidance`,
38
- AVW: `avalanche-warning`,
39
- AWO: `area-weather-outlook`,
40
- AWS: `area-weather-summary`,
41
- AWU: `area-weather-update`,
42
- AWW: `airport-weather-warning`,
43
- BLU: `blue-alert`,
44
- BOY: `buoy-report`,
45
- BRG: `coast-guard-observations`,
46
- BRT: `hourly-roundup-for-weather-radio`,
47
- CAE: `child-abduction-emergency`,
48
- CCF: `coded-city-forecast`,
49
- CDW: `civil-danger-warning`,
50
- CEM: `civil-emergency-message`,
51
- CF6: `monthly-daily-climate-data`,
52
- CFP: `convective-forecast-product`,
53
- CFW: `coastal-flood-warnings-watches-statements`,
54
- CGR: `coast-guard-surface-report`,
55
- CHG: `computer-hurricane-guidance`,
56
- CLA: `climatological-report-annual`,
57
- CLI: `climatological-report-daily`,
58
- CLM: `climatological-report-monthly`,
59
- CLQ: `climatological-report-quarterly`,
60
- CLS: `climatological-report-seasonal`,
61
- CLT: `climate-report`,
62
- CMM: `coded-climatological-monthly-means`,
63
- COD: `coded-analysis-and-forecasts`,
64
- CPF: `great-lakes-port-forecast`,
65
- CUR: `space-environment-products-routine`,
66
- CWA: `center-weather-advisory`,
67
- CWF: `coastal-waters-forecast`,
68
- CWS: `center-weather-statement`,
69
- DAY: `space-environment-product-daily`,
70
- DDO: `daily-dispersion-outlook`,
71
- DGT: `drought-information-statement`,
72
- DMO: `practice-demo-warning`,
73
- DSA: `unnumbered-depression-advisory`,
74
- DSM: `asos-daily-summary`,
75
- DSW: `dust-storm-warning`,
76
- EFP: `extended-forecast-3-to-5-day`,
77
- EOL: `six-to-ten-day-weather-outlook-local`,
78
- EQI: `tsunami-bulletin`,
79
- EQR: `earthquake-report`,
80
- EQW: `earthquake-warning`,
81
- ESF: `flood-potential-outlook`,
82
- ESG: `extended-streamflow-guidance`,
83
- ESP: `extended-streamflow-prediction`,
84
- ESS: `water-supply-outlook`,
85
- EVI: `evacuation-immediate`,
86
- EWW: `extreme-wind-warning`,
87
- FA0: `aviation-area-forecast-pacific`,
88
- FA1: `aviation-area-forecast-northeast`,
89
- FA2: `aviation-area-forecast-southeast`,
90
- FA3: `aviation-area-forecast-north-central`,
91
- FA4: `aviation-area-forecast-south-central`,
92
- FA5: `aviation-area-forecast-rocky-mountains`,
93
- FA6: `aviation-area-forecast-west-coast`,
94
- FA7: `aviation-area-forecast-juneau-ak`,
95
- FA8: `aviation-area-forecast-anchorage-ak`,
96
- FA9: `aviation-area-forecast-fairbanks-ak`,
97
- FD0: `winds-aloft-forecast-24hr-high-altitude`,
98
- FD1: `winds-aloft-forecast-6hr`,
99
- FD2: `winds-aloft-forecast-12hr`,
100
- FD3: `winds-aloft-forecast-24hr`,
101
- FD4: `winds-aloft-forecast`,
102
- FD5: `winds-aloft-forecast`,
103
- FD6: `winds-aloft-forecast`,
104
- FD7: `winds-aloft-forecast`,
105
- FD8: `winds-aloft-forecast-6hr-high-altitude`,
106
- FD9: `winds-aloft-forecast-12hr-high-altitude`,
107
- FDI: `fire-danger-indices`,
108
- FFA: `flash-flood-watch`,
109
- FFG: `flash-flood-guidance`,
110
- FFH: `headwater-guidance`,
111
- FFS: `flash-flood-statement`,
112
- FFW: `flash-flood-warning`,
113
- FLN: `national-flood-summary`,
114
- FLS: `flood-statement`,
115
- FLW: `flood-warning`,
116
- FOF: `upper-wind-fallout-forecast`,
117
- FRW: `fire-warning`,
118
- FSH: `marine-fisheries-service-message`,
119
- FTM: `radar-outage-notification`,
120
- FTP: `temp-pop-guidance`,
121
- FWA: `fire-weather-administrative-message`,
122
- FWD: `fire-weather-outlook-discussion`,
123
- FWF: `fire-weather-forecast`,
124
- FWL: `land-management-forecast`,
125
- FWM: `miscellaneous-fire-weather-product`,
126
- FWN: `fire-weather-notification`,
127
- FWO: `fire-weather-observation`,
128
- FWS: `fire-weather-spot-forecast`,
129
- FZL: `freezing-level-data`,
130
- GLF: `great-lakes-forecast`,
131
- GLS: `great-lakes-storm-summary`,
132
- GRE: `green`,
133
- HD1: `rfc-qpf-data-product`,
134
- HD2: `rfc-qpf-data-product`,
135
- HD3: `rfc-qpf-data-product`,
136
- HD4: `rfc-qpf-data-product`,
137
- HD7: `rfc-qpf-data-product`,
138
- HD8: `rfc-qpf-data-product`,
139
- HD9: `rfc-qpf-data-product`,
140
- HLS: `hurricane-local-statement`,
141
- HMD: `hydrometeorological-discussion`,
142
- HML: `ahps-xml-product`,
143
- HMW: `hazardous-materials-warning`,
144
- HP1: `rfc-qpf-verification-product`,
145
- HP2: `rfc-qpf-verification-product`,
146
- HP3: `rfc-qpf-verification-product`,
147
- HP4: `rfc-qpf-verification-product`,
148
- HP5: `rfc-qpf-verification-product`,
149
- HP6: `rfc-qpf-verification-product`,
150
- HP7: `rfc-qpf-verification-product`,
151
- HP8: `rfc-qpf-verification-product`,
152
- HRR: `weather-roundup`,
153
- HSF: `high-seas-forecast`,
154
- HWO: `hazardous-weather-outlook`,
155
- HWR: `hourly-weather-roundup`,
156
- HYD: `daily-hydrometeorological-products`,
157
- HYM: `monthly-hydrometeorological-product`,
158
- ICE: `ice-forecast`,
159
- IDM: `ice-drift-vectors`,
160
- INI: `administrative-message`,
161
- IOB: `ice-observation`,
162
- KPA: `keep-alive-message`,
163
- LAE: `local-area-emergency`,
164
- LCD: `preliminary-local-climatological-data`,
165
- LCO: `local-cooperative-observation`,
166
- LEW: `law-enforcement-warning`,
167
- LFP: `local-forecast`,
168
- LKE: `lake-stages`,
169
- LLS: `low-level-sounding`,
170
- LOW: `low-temperatures`,
171
- LSR: `local-storm-report`,
172
- LTG: `lightning-data`,
173
- MAN: `rawinsonde-mandatory-levels`,
174
- MAP: `mean-areal-precipitation`,
175
- MAW: `amended-marine-forecast`,
176
- MFM: `marine-forecast-matrix`,
177
- MIM: `marine-interpretation-message`,
178
- MIS: `miscellaneous-local-product`,
179
- MOB: `marine-observations`,
180
- MON: `space-environment-product-monthly`,
181
- MRP: `marine-product-techniques-development`,
182
- MSM: `asos-monthly-summary-message`,
183
- MTR: `metar-observation`,
184
- MTT: `metar-test-message`,
185
- MVF: `marine-verification-coded-message`,
186
- MWS: `marine-weather-statement`,
187
- MWW: `marine-weather-message`,
188
- NOU: `weather-reconnaissance-flights`,
189
- NOW: `short-term-forecast`,
190
- NOX: `data-management-message`,
191
- NPW: `non-precipitation-warning`,
192
- NSH: `nearshore-marine-forecast`,
193
- NUW: `nuclear-power-plant-warning`,
194
- NWR: `noaa-weather-radio-forecast`,
195
- OAV: `other-aviation-products`,
196
- OBS: `observations`,
197
- OFA: `offshore-aviation-forecast`,
198
- OFF: `offshore-forecast`,
199
- OMR: `other-marine-products`,
200
- OPU: `other-public-products`,
201
- OSO: `other-surface-observations`,
202
- OSW: `ocean-surface-winds`,
203
- OUA: `other-upper-air-data`,
204
- OZF: `zone-forecast`,
205
- PFM: `point-forecast-matrices`,
206
- PFW: `fire-weather-point-forecast-matrices`,
207
- PLS: `plain-language-ship-report`,
208
- PMD: `prognostic-meteorological-discussion`,
209
- PNS: `public-information-statement`,
210
- POE: `probability-of-exceedance`,
211
- PRB: `heat-index-forecast-tables`,
212
- PRC: `pilot-report-collective`,
213
- PRE: `preliminary-forecasts`,
214
- PSH: `post-storm-hurricane-report`,
215
- PTS: `probabilistic-outlook-points`,
216
- PWO: `public-severe-weather-outlook`,
217
- PWS: `tropical-cyclone-probabilities`,
218
- QPF: `quantitative-precipitation-forecast`,
219
- QPS: `quantitative-precipitation-statement`,
220
- RDF: `revised-digital-forecast`,
221
- REC: `recreational-report`,
222
- RER: `record-report`,
223
- RET: `eas-activation-request`,
224
- RFD: `rangeland-fire-danger-forecast`,
225
- RFI: `rfi-observation`,
226
- RFR: `route-forecast`,
227
- RFW: `red-flag-warning`,
228
- RHW: `radiological-hazard-warning`,
229
- RMT: `required-monthly-test`,
230
- RNS: `rain-information-statement`,
231
- RR1: `hydro-met-data-report-part-1`,
232
- RR2: `hydro-met-data-report-part-2`,
233
- RR3: `hydro-met-data-report-part-3`,
234
- RR4: `hydro-met-data-report-part-4`,
235
- RR5: `hydro-met-data-report-part-5`,
236
- RR6: `hydro-met-data-report-part-6`,
237
- RR7: `hydro-met-data-report-part-7`,
238
- RR8: `hydro-met-data-report-part-8`,
239
- RR9: `hydro-met-data-report-part-9`,
240
- RRA: `automated-hydrologic-observation-report`,
241
- RRM: `miscellaneous-hydrologic-data`,
242
- RRS: `hads-data`,
243
- RRY: `asos-hourly-test-message`,
244
- RSD: `daily-snotel-data`,
245
- RSM: `monthly-snotel-data`,
246
- RTP: `regional-temp-precip-table`,
247
- RVA: `river-summary`,
248
- RVD: `daily-river-forecast`,
249
- RVF: `river-forecast`,
250
- RVI: `river-ice-statement`,
251
- RVM: `miscellaneous-river-product`,
252
- RVR: `river-recreation-statement`,
253
- RVS: `river-statement`,
254
- RWR: `regional-weather-roundup`,
255
- RWS: `regional-weather-summary`,
256
- RWT: `required-weekly-test`,
257
- SAB: `special-avalanche-bulletin`,
258
- SAF: `agricultural-weather-forecast`,
259
- SAG: `snow-avalanche-guidance`,
260
- SAT: `apt-prediction`,
261
- SAW: `preliminary-notice-of-watch`,
262
- SCC: `storm-summary`,
263
- SCD: `supplementary-climatological-data`,
264
- SCN: `soil-climate-analysis-network`,
265
- SCP: `satellite-cloud-product`,
266
- SCS: `selected-cities-summary`,
267
- SDO: `supplementary-data-observation`,
268
- SDS: `special-dispersion-statement`,
269
- SEL: `severe-local-storm-watch`,
270
- SEV: `spc-watch-point-information`,
271
- SFP: `state-forecast`,
272
- SFT: `tabular-state-forecast`,
273
- SGL: `rawinsonde-significant-levels`,
274
- SHP: `surface-ship-report`,
275
- SIG: `international-sigmet`,
276
- SIM: `satellite-interpretation-message`,
277
- SLS: `severe-local-storm-outline`,
278
- SMF: `smoke-management-weather-forecast`,
279
- SMW: `special-marine-warning`,
280
- SOO: `science-operations-officer-product`,
281
- SPE: `satellite-precipitation-estimates`,
282
- SPF: `storm-strike-probability-bulletin`,
283
- SPS: `special-weather-statement`,
284
- SPW: `shelter-in-place-warning`,
285
- SQW: `snow-squall-warning`,
286
- SRD: `surf-discussion`,
287
- SRF: `surf-forecast`,
288
- SRG: `soaring-guidance`,
289
- SSM: `synoptic-surface-observation`,
290
- STA: `weather-statistical-summary`,
291
- STD: `satellite-tropical-disturbance-summary`,
292
- STO: `road-condition-report`,
293
- STP: `state-temp-precip-table`,
294
- STQ: `spot-forecast-request`,
295
- SUM: `space-weather-message`,
296
- SVR: `severe-thunderstorm-warning`,
297
- SVS: `severe-weather-statement`,
298
- SWOMCD: `mesoscale-discussion`,
299
- SWODY1: `day-1`,
300
- SWODY2: `day-2`,
301
- SWODY3: `day-3`,
302
- SWS: `state-weather-summary`,
303
- SYN: `regional-weather-synopsis`,
304
- TAF: `terminal-aerodrome-forecast`,
305
- TAP: `terminal-alerting-products`,
306
- TAV: `travelers-forecast-table`,
307
- TCA: `tropical-cyclone-advisory`,
308
- TCD: `tropical-cyclone-discussion`,
309
- TCE: `tropical-cyclone-position-estimate`,
310
- TCM: `tropical-cyclone-marine-aviation-advisory`,
311
- TCP: `public-tropical-cyclone-advisory`,
312
- TCS: `satellite-tropical-cyclone-summary`,
313
- TCU: `tropical-cyclone-update`,
314
- TCV: `tropical-cyclone-break-points`,
315
- TIB: `tsunami-bulletin`,
316
- TID: `tide-report`,
317
- TMA: `tsunami-tide-seismic-acknowledgement`,
318
- TOE: `telephone-outage-emergency`,
319
- TOR: `tornado-warning`,
320
- TPT: `temperature-precipitation-table`,
321
- TSU: `tsunami-watch`,
322
- TUV: `ultraviolet-index`,
323
- TVL: `travelers-forecast`,
324
- TWB: `transcribed-weather-broadcast`,
325
- TWD: `tropical-weather-discussion`,
326
- TWO: `tropical-weather-outlook`,
327
- TWS: `tropical-weather-summary`,
328
- URN: `aircraft-reconnaissance`,
329
- UVI: `ultraviolet-index`,
330
- VAA: `volcanic-activity-advisory`,
331
- VER: `forecast-verification-statistics`,
332
- VFT: `taf-verification-product`,
333
- VOW: `volcano-warning`,
334
- WA0: `airmet-pacific`,
335
- WA1: `airmet-northeast`,
336
- WA2: `airmet-southeast`,
337
- WA3: `airmet-north-central`,
338
- WA4: `airmet-south-central`,
339
- WA5: `airmet-rocky-mountains`,
340
- WA6: `airmet-west-coast`,
341
- WA7: `airmet-juneau-ak`,
342
- WA8: `airmet-anchorage-ak`,
343
- WA9: `airmet-fairbanks-ak`,
344
- WAR: `space-environment-warning`,
345
- WAT: `space-environment-watch`,
346
- WCN: `weather-watch-clearance-notification`,
347
- WCR: `weekly-weather-and-crop-report`,
348
- WDA: `weekly-data-for-agriculture`,
349
- WDU: `warning-decision-update`,
350
- WEK: `space-environment-product-weekly`,
351
- WOU: `watch-outline-update`,
352
- WS1: `sigmet-northeast`,
353
- WS2: `sigmet-southeast`,
354
- WS3: `sigmet-north-central`,
355
- WS4: `sigmet-south-central`,
356
- WS5: `sigmet-rocky-mountains`,
357
- WS6: `sigmet-west-coast`,
358
- WST: `tropical-cyclone-sigmet`,
359
- WSV: `volcanic-activity-sigmet`,
360
- WSW: `winter-weather-warning`,
361
- WWA: `watch-status-report`,
362
- WWP: `watch-probabilities`,
363
- ZFP: `zone-forecast-product`,
364
- };
@@ -1,93 +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
- export const eventTags: Record<string, string> = {
21
- "FROSTBITE AND HYPOTHERMIA ARE LIKELY": "Frostbite and Hypothermia Likely",
22
- "LICKELY BECOME SLICK AND HAZARDOUS": "Slick and Hazardous Roads",
23
- "SLIPPERY ROAD CONDITIONS": "Slippery Roads",
24
- "BLOWING SNOW WHICH COULD REDUCE VISIBILITY": "Blowing Snow Reducing Visibility",
25
- "TRAVEL COULD BE VERY DIFFICULT": "Difficult Travel Conditions",
26
- "DIFFICULT TRAVEL CONDITIONS": "Difficult Travel Conditions",
27
- "EXPECT DISRUPTIONS": "Expect Disruptions to Travel",
28
- "A LARGE AND EXTREMELY DANGEROUS TORNADO": "Large and Dangerous Tornado",
29
- "THIS IS A PARTICULARLY DANGEROUS SITUATION": "Particularly Dangerous Situation",
30
- "RADAR INDICATED ROTATION": "Radar Indicated Tornado",
31
- "WEATHER SPOTTERS CONFIRMED TORNADO": "Confirmed by Storm Spotters",
32
- "A SEVERE THUNDERSTORM CAPABLE OF PRODUCING A TORNADO": "Developing Tornado",
33
- "LAW ENFORCEMENT CONFIRMED TORNADO": "Reported by Law Enforcement",
34
- "A TORNADO IS ON THE GROUND": "Confirmed Tornado",
35
- "WEATHER SPOTTERS REPORTED FUNNEL CLOUD": "Confirmed Funnel Cloud by Storm Spotters",
36
- "PUBLIC CONFIRMED TORNADO": "Public reports of Tornado",
37
- "RADAR CONFIRMED": "Radar Confirmed",
38
- "TORNADO WAS REPORTED BRIEFLY ON THE GROUND": "Tornado no longer on ground",
39
- "SPOTTERS INDICATE THAT A FUNNEL CLOUD CONTINUES WITH THIS STORM": "Funnel Cloud Continues",
40
- "A TORNADO MAY DEVELOP AT ANY TIME": "Potentional still exists for Tornado to form",
41
- "LIFE-THREATENING SITUATION": "Life Threating Situation",
42
- "COMPLETE DESTRUCTION IS POSSIBLE": "Extremly Damaging Tornado",
43
- "POTENTIALLY DEADLY TORNADO": "Deadly Tornado",
44
- "RADAR INDICATED": "Radar Indicated",
45
- "HAIL DAMAGE TO VEHICLES IS EXPECTED": "Damaging to Vehicles",
46
- "EXPECT WIND DAMAGE": "Wind Damage",
47
- "FREQUENT LIGHTNING": "Frequent Lightning",
48
- "PEOPLE AND ANIMALS OUTDOORS WILL BE INJURED": "Capable of Injuring People and Animals",
49
- "TRAINED WEATHER SPOTTERS": "Confirmed by Storm Spotters",
50
- "SOURCE...PUBLIC": "Confirmed by Public",
51
- "SMALL CRAFT COULD BE DAMAGED": "Potential Damage to Small Craft",
52
- "A TORNADO WATCH REMAINS IN EFFECT": "Active Tornado Watch",
53
- "TENNIS BALL SIZE HAIL": "Tennis Ball Size Hail",
54
- "BASEBALL SIZE HAIL": "Baseball Size Hail",
55
- "GOLF BALL SIZE HAIL": "Golf Ball Size Hail",
56
- "QUARTER SIZE HAIL": "Quarter Size Hail",
57
- "PING PONG BALL SIZE HAIL": "Ping Pong Ball Size Hail",
58
- "NICKEL SIZE HAIL": "Nickel Size Hail",
59
- "DOPPLER RADAR.": "Confirmed by Radar",
60
- "DOPPLER RADAR AND AUTOMATED GAUGES.": "Confirmed by Radar and Gauges",
61
- "FLASH FLOODING CAUSED BY THUNDERSTORMS.": "Caused by Thunderstorm",
62
- "SOURCE...EMERGENCY MANAGEMENT.": "Confirmed by Emergency Management",
63
- "FLASH FLOODING CAUSED BY HEAVY RAIN.": "Caused by heavy rain",
64
- "SOURCE...LAW ENFORCEMENT REPORTED.": "Confirmed by Law Enforcement",
65
- "MINOR FLOODING IS OCCURING": "Minor Flooding Occurring",
66
- "VERY COLD TEMPERATURES CAN LEAD TO HYPOTHERMIA": "Hypothermia Risk",
67
- "SENSITIVE VEGETATION AND POSSIBLY DAMAGE UNPROTECTED OUTDOOR": "Vegetation and Outdoor Plumbing Risk",
68
- "RIP CURRENTS CAN SWEEP EVEN THE BEST SWIMMER": "Hazardous to All Swimmers",
69
- "HYPOTHERMIA IF PRECAUTIONS ARE NOT TAKEN.": "Hypothermia Risk",
70
- "FROSTBITE AND HYPOTHERMIA WILL OCCUR IF UNPROTECTED SKIN": "Frostbite and Hypothermia Risk on Unprotected Skin",
71
- "TEMPERATURES COULD CAUSE RUPTURED WATER PIPES": "Risk of Ruptured Water Pipes",
72
- "COULD RESULT IN HYPOTHERMIA OR FROSTBITE ON EXPOSED SKIN IF": "Hypothermia or Frostbite Risk on Exposed Skin",
73
- "WINDS WILL STRENGTHEN": "Strengthening Winds",
74
- "EXPECT ROADS TO RE-FREEZE": "Roads May Re-Freeze",
75
- "SLICK AND ICY SPOTS ON ROADS": "Slick and Icy Roads",
76
- "ICY PATCHES MAY BE MORE COMMON ON BRIDGES": "Icy Patches Likely on Bridges",
77
- "SLICK SPOTS ON UNTREATED ROADS": "Slick Spots on Untreated Roads",
78
- "TEMPERATURES ARE EXPECTED TO FALL BELOW FREEZING": "Temperatures Expected Below Freezing",
79
- "HAZARDOUS ROADWAYS AND BLACK ICE": "Hazardous Roadways and Black Ice",
80
- "SLOW DOWN AND ALLOW EXTRA TIME": "Slow Down and Allow Extra Time",
81
- "SHOULD EXERCISE CAUTION": "Should Exercise Caution",
82
- "LAKE EFFECT SNOW EXPECTED": "Lake Effect Snow Expected",
83
- "MODERATE LAKE EFFECT SNOWFALL RATES AND BLOWING SNOW": "Moderate Lake Effect Snowfall and Blowing Snow",
84
- "NO TSUNAMI THREAT": "No Active Tsunami Threat",
85
- "NO SIGNIFICANT TSUNAMI THREAT": "No Significant Tsunami Threat",
86
- "NO TSUNAMI IMPACTS ARE EXPECTED": "No Tsunami Impacts Expected",
87
- "A TSUNAMI THREAT EXISTS": "Tsunami Threat Exists",
88
- "TSUNAMI THREAT": "Active Tsunami Threat",
89
- "HEAT ILLNESSES": "Can cause heat illness",
90
- "WATCH POSSIBLE": "Watch Possible",
91
- "INTENSIFYING": "Intensifying",
92
- "CAPABLE OF PRODUCING A LANDSPOUT": "Landspout Possible",
93
- }
@@ -1,36 +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
- export const eventsMatchText: Record<string, string> = {
21
- "Special Weather Statement": "Special Weather Statement",
22
- "Hurricane Warning": "Hurricane Warning",
23
- "Hurricane Force Wind Warning": "Hurricane Force Wind Warning",
24
- "Hurricane Watch": "Hurricane Watch",
25
- "Tropical Storm Warning": "Tropical Storm Warning",
26
- "Tropical Storm Watch": "Tropical Storm Watch",
27
- "High Wind Warning": "High Wind Warning",
28
- "Gale Warning": "Gale Warning",
29
- "Small Craft Advisory": "Small Craft Advisory",
30
- "Small Craft Warning": "Small Craft Warning",
31
- "Tsunami Warning": "Tsunami Warning",
32
- "Tsunami Watch": "Tsunami Watch",
33
- "Tsunami Advisory": "Tsunami Advisory",
34
- "Tsunami Information Statement": "Tsunami Information Statement",
35
- "Subscribers:": "National Weather Service Policy",
36
- };
@@ -1,68 +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
- export const transcribedMessageReplacements: { regex: RegExp, replacement: string }[] = [
21
- { regex: /\*/g, replacement: "" },
22
- { regex: /\.{3,}/g, replacement: "" },
23
- { regex: /\bUTC\b/g, replacement: 'Coordinated Universal Time' },
24
- { regex: /\bGMT\b/g, replacement: 'Greenwich Mean Time' },
25
- { regex: /\bEST\b(?!\w)/g, replacement: 'Eastern Standard Time' },
26
- { regex: /\bEDT\b(?!\w)/g, replacement: 'Eastern Daylight Time' },
27
- { regex: /\bCST\b(?!\w)/g, replacement: 'Central Standard Time' },
28
- { regex: /\bCDT\b(?!\w)/g, replacement: 'Central Daylight Time' },
29
- { regex: /\bMST\b(?!\w)/g, replacement: 'Mountain Standard Time' },
30
- { regex: /\bMDT\b(?!\w)/g, replacement: 'Mountain Daylight Time' },
31
- { regex: /\bPST\b(?!\w)/g, replacement: 'Pacific Standard Time' },
32
- { regex: /\bPDT\b(?!\w)/g, replacement: 'Pacific Daylight Time' },
33
- { regex: /\bAKST\b(?!\w)/g, replacement: 'Alaska Standard Time' },
34
- { regex: /\bAKDT\b(?!\w)/g, replacement: 'Alaska Daylight Time' },
35
- { regex: /\bHST\b(?!\w)/g, replacement: 'Hawaii Standard Time' },
36
- { regex: /\bHDT\b(?!\w)/g, replacement: 'Hawaii Daylight Time' },
37
- { regex: /\bmph\b(?!\w)/g, replacement: 'miles per hour' },
38
- { regex: /\bkm\/h\b(?!\w)/g, replacement: 'kilometers per hour' },
39
- { regex: /\bkmh\b(?!\w)/g, replacement: 'kilometers per hour' },
40
- { regex: /\bkt\b(?!\w)/g, replacement: 'knots' },
41
- { regex: /\bNE\b(?!\w)/g, replacement: 'northeast' },
42
- { regex: /\bNW\b(?!\w)/g, replacement: 'northwest' },
43
- { regex: /\bSE\b(?!\w)/g, replacement: 'southeast' },
44
- { regex: /\bSW\b(?!\w)/g, replacement: 'southwest' },
45
- { regex: /\bNM\b(?!\w)/g, replacement: 'nautical miles' },
46
- { regex: /\bdeg\b(?!\w)/g, replacement: 'degrees' },
47
- { regex: /\btstm\b(?!\w)/g, replacement: 'thunderstorm' },
48
- { regex: /\bmm\b(?!\w)/g, replacement: 'millimeters' },
49
- { regex: /\bcm\b(?!\w)/g, replacement: 'centimeters' },
50
- { regex: /\bin.\b(?!\w)/g, replacement: 'inches' },
51
- { regex: /\bft\b(?!\w)/g, replacement: 'feet' },
52
- { regex: /\bmi\b(?!\w)/g, replacement: 'miles' },
53
- { regex: /\bhr\b(?!\w)/g, replacement: 'hour' },
54
- { regex: /\bhourly\b(?!\w)/g, replacement: 'per hour' },
55
- { regex: /\bkg\b(?!\w)/g, replacement: 'kilograms' },
56
- { regex: /\bg\/kg\b(?!\w)/g, replacement: 'grams per kilogram' },
57
- { regex: /\bmb\b(?!\w)/g, replacement: 'millibars' },
58
- { regex: /\bhPa\b(?!\w)/g, replacement: 'hectopascals' },
59
- { regex: /\bPa\b(?!\w)/g, replacement: 'pascals' },
60
- { regex: /\bKPa\b(?!\w)/g, replacement: 'kilopascals' },
61
- { regex: /\bC\/hr\b(?!\w)/g, replacement: 'degrees Celsius per hour' },
62
- { regex: /\bF\/hr\b(?!\w)/g, replacement: 'degrees Fahrenheit per hour' },
63
- { regex: /\bC\/min\b(?!\w)/g, replacement: 'degrees Celsius per minute' },
64
- { regex: /\bF\/min\b(?!\w)/g, replacement: 'degrees Fahrenheit per minute' },
65
- { regex: /\bC\b(?!\w)/g, replacement: 'degrees Celsius' },
66
- { regex: /\bF\b(?!\w)/g, replacement: 'degrees Fahrenheit' },
67
- ];
68
-
@@ -1,49 +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 { setEventEmit } from "../@modules/@utilities/utilities.setEventEmit";
21
- import { TypeEvent } from "../@types/type.event";
22
- import { bootstrap } from "../bootstrap"
23
- import { updateWebhooks } from "./manager.updateWebhooks";
24
-
25
- export const rmEvent = (event: TypeEvent): void => {
26
- const getEvent = bootstrap.cache.events.features.find(f => f?.properties?.metadata?.tracking === event?.properties?.metadata?.tracking);
27
- const cachedStatus = event.properties.status;
28
- event.properties.expires = new Date().toISOString();
29
- event.properties.status = `Expired`;
30
- if (getEvent) {
31
- setEventEmit({
32
- event: `onEventStatus`,
33
- metadata: {
34
- type: `Removed`,
35
- event: event
36
- },
37
- message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
38
- })
39
- setEventEmit({ event: `onExpiredProduct`, metadata: event })
40
- if (cachedStatus != `Statement`) updateWebhooks(event)
41
- bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(getEvent), 1);
42
- bootstrap.cache.hashes = bootstrap.cache.hashes.filter(hash => hash.tracking !== event.properties.metadata.tracking);
43
- }
44
- setEventEmit({
45
- event: `onEventCache`,
46
- metadata: bootstrap.cache.events,
47
- limited: true
48
- })
49
- }
@@ -1,50 +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 { createWebhook } from "../@modules/@utilities/utilities.createWebhook";
21
- import { TypeEvent } from "../@types/type.event";
22
- import { TypeWebhook } from "../@types/types.webhook";
23
- import { bootstrap } from "../bootstrap"
24
-
25
-
26
- export const updateWebhooks = async (event: TypeEvent): Promise<void> => {
27
- const settings = bootstrap.settings;
28
- const webhooks = settings.WebhookSettings as TypeWebhook[];
29
- const eventName = event.properties.event;
30
- for (const socket of webhooks) {
31
- const events = socket.events;
32
- if (!events || events.length === 0) {
33
- await createWebhook({ webhook: socket, event });
34
- continue;
35
- }
36
- const matched = events.some(pattern => {
37
- if (!pattern) return false;
38
- if (pattern === "*" || pattern === eventName) return true;
39
- if (pattern.includes("*")) {
40
- const regex = "^" +
41
- pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*") + "$";
42
- return new RegExp(regex).test(eventName);
43
- }
44
- return false;
45
- });
46
- if (matched) {
47
- await createWebhook({ webhook: socket, event });
48
- }
49
- }
50
- };