@atmosx/event-product-parser 3.0.52 → 3.0.54
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.
- package/{README.md → .github/README.md} +36 -95
- package/{SUPPORTED_EVENTS.md → .github/SUPPORTED_EVENTS.md} +3 -3
- package/dist/cjs/index.cjs +108 -36
- package/dist/esm/index.mjs +108 -36
- package/package.json +1 -1
- package/src/@building/building.attachments.ts +3 -3
- package/src/@dictionaries/dictionaries.awips.ts +3 -3
- package/src/@manager/manager.rmEvent.ts +11 -9
- package/src/@manager/manager.updateListener.ts +39 -17
- package/src/@modules/@utilities/utilities.createHttp.ts +13 -0
- package/src/@parsers/@text/{text.getEmbed.ts → text.getEmbedText.ts} +1 -1
- package/src/@parsers/@text/text.getStringText.ts +54 -0
- package/src/@types/type.listener.ts +15 -9
- package/src/@types/type.settings.ts +9 -0
- package/src/bootstrap.ts +10 -1
- package/testing/init.js +91 -0
- package/test.js +0 -93
- /package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +0 -0
- /package/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +0 -0
- /package/{LICENSE → .github/LICENSE} +0 -0
- /package/{SECURITY.md → .github/SECURITY.md} +0 -0
|
@@ -23,7 +23,7 @@ const { Manager } = require(`@atmosx/event-product-parser`) // CJS Importing
|
|
|
23
23
|
import { Manager } from '@atmosx/event-product-parser' // EJS Importing
|
|
24
24
|
|
|
25
25
|
const Client = new Manager({
|
|
26
|
-
Database: `
|
|
26
|
+
Database: `event-product-parser.db`,
|
|
27
27
|
EnableWireService: false,
|
|
28
28
|
EnableJournal: true,
|
|
29
29
|
EnableDebugging: false,
|
|
@@ -39,8 +39,8 @@ const Client = new Manager({
|
|
|
39
39
|
},
|
|
40
40
|
CacheSettings: {
|
|
41
41
|
Enabled: true,
|
|
42
|
-
MaxDatabaseHistory:
|
|
43
|
-
MaxRetentionHistory:
|
|
42
|
+
MaxDatabaseHistory: 50000,
|
|
43
|
+
MaxRetentionHistory: 1500,
|
|
44
44
|
},
|
|
45
45
|
StanzaSettings: {
|
|
46
46
|
DisableUGC: false,
|
|
@@ -54,22 +54,30 @@ const Client = new Manager({
|
|
|
54
54
|
},
|
|
55
55
|
BroadcastifySettings: {
|
|
56
56
|
BroadcastifyAttachments: true,
|
|
57
|
+
BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
|
|
57
58
|
BroadcastifyTags: [`Public Safety`, `Amateur Radio`, `Other`, `Rail`, `Aviation`, `Marine`, `Disaster Event`, `Special Event`]
|
|
58
59
|
},
|
|
60
|
+
NotifyServer: {
|
|
61
|
+
Enabled: false,
|
|
62
|
+
Server: "https://ntfy.scriptkitty.cafe",
|
|
63
|
+
Attachments: "https://scriptkitty.cafe/ftp/@bucket/EAS/encoded",
|
|
64
|
+
Credentials: {
|
|
65
|
+
Username: "username",
|
|
66
|
+
Password: "password"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
59
69
|
ListenerSettings: [
|
|
60
70
|
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
message: "<@&XXXXXXXXXXXXXXXXXXXXX>",
|
|
67
|
-
ratelimit: 1
|
|
71
|
+
Events: ["*Extreme Heat Warning*"],
|
|
72
|
+
NotificationServer: {
|
|
73
|
+
Enabled: false,
|
|
74
|
+
Topic: "heat-warnings",
|
|
75
|
+
Priority: 5
|
|
68
76
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
Uploads: {
|
|
78
|
+
EAS: true,
|
|
79
|
+
File: true,
|
|
80
|
+
JSON: true
|
|
73
81
|
}
|
|
74
82
|
}
|
|
75
83
|
],
|
|
@@ -81,96 +89,29 @@ const Client = new Manager({
|
|
|
81
89
|
SPCWatchesOnly: true,
|
|
82
90
|
ShapefileSkipPoints: 0,
|
|
83
91
|
NodeTTL: 60,
|
|
84
|
-
NodeMinDistance:
|
|
92
|
+
NodeMinDistance: 125,
|
|
85
93
|
EventFiltering: {
|
|
86
94
|
ListeningEvents: [
|
|
87
|
-
|
|
88
|
-
"*Blizzard*", "*Ice Storm*", "*Winter Storm*", "*Snow Squall*",
|
|
89
|
-
"Tornado Emergency", "*Tornado Warning*",
|
|
90
|
-
"Special Weather Statement", "Marine Weather Statement",
|
|
91
|
-
"*Tsunami*", "*Hurricane*", "*Tropical Storm*", "*Special Marine*",
|
|
92
|
-
"*Flash Flood Warning*", "*Flash Flood Watch*", "*Flash Flood Advisory*",
|
|
93
|
-
"Mesoscale Discussion",
|
|
94
|
-
"SPC Day 1 Outlook", "SPC Day 2 Outlook", "SPC Day 3 Outlook",
|
|
95
|
-
"PDS Tornado Watch", "Tornado Watch", "Severe Thunderstorm Watch", "Flash Flood Watch", "PDS Severe Thunderstorm Watch",
|
|
96
|
-
"*Administrative*", "National Weather Service Policy",
|
|
97
|
-
"Fire Weather Warning", "Fire Weather Watch", "Fire Weather Advisory",
|
|
95
|
+
"*Warning*"
|
|
98
96
|
],
|
|
99
|
-
ListeningICAO: [
|
|
97
|
+
ListeningICAO: [],
|
|
98
|
+
ListeningUGC: [],
|
|
99
|
+
ListeningStates: [],
|
|
100
100
|
IgnoredICAO: [],
|
|
101
101
|
IgnoredEvents: [],
|
|
102
|
-
ListeningUGC: [`WIC001`],
|
|
103
|
-
ListeningStates: [`MO`, `IA`],
|
|
104
102
|
NodeLocationFiltering: false,
|
|
105
103
|
IgnoreTestProducts: true,
|
|
106
104
|
},
|
|
107
105
|
ArchiveSettings: {
|
|
108
|
-
TTL:
|
|
109
|
-
EventDirectory:
|
|
110
|
-
TextDirectory:
|
|
111
|
-
EasDirectory:
|
|
112
|
-
EasToneout: `
|
|
106
|
+
TTL: 30,
|
|
107
|
+
EventDirectory: `@bucket/ParsedProducts`,
|
|
108
|
+
TextDirectory: `@bucket/RawTextProducts`,
|
|
109
|
+
EasDirectory: `@bucket/EAS`,
|
|
110
|
+
EasToneout: `eas-toneout.wav`,
|
|
113
111
|
}
|
|
114
112
|
}
|
|
115
113
|
})
|
|
116
114
|
```
|
|
117
|
-
### General Settings
|
|
118
|
-
- **Database**: The database file name and location, please make sure to include the `.db` extension.
|
|
119
|
-
- **EnableWireService**: Whether to enable `NOAA Weather Wire Service` within the parser. This requires credentials from [NOAA Weather Wire Service](https://www.weather.gov/nwws/).
|
|
120
|
-
- **EnableJournal**: Whether to output logs without requiring event `listeners`.
|
|
121
|
-
|
|
122
|
-
### NOAAWeatherWireServiceSettings
|
|
123
|
-
- **ReconnectionSettings**: When the XMPP client gets disconnected or has an error, choose to reconnect to the service again. This contains a reconnection check interval.
|
|
124
|
-
- **CredentialSettings**: The username (nickname) and password that is required for using `NOAA Weather Wire Service`.
|
|
125
|
-
- **CacheSettings**: The ability to use the cache system so when you relaunch the parser, it will have a event retention history of all the stanzas collected.
|
|
126
|
-
- **StanzaSettings**: Modify what type of products metadata you'd like to receive. (UGC, VTEC, RawText)
|
|
127
|
-
|
|
128
|
-
### NationalWeatherServiceSettings
|
|
129
|
-
- **CallbackInterval**: The interval at which the parser will check for new alerts from the National Weather Service API.
|
|
130
|
-
- **EventsEndpoint**: The URL that directs to the API.
|
|
131
|
-
|
|
132
|
-
## BroadcastifySettings
|
|
133
|
-
- **BroadcastifyAttachments**: Whether to enable broadcastify attachments for events.
|
|
134
|
-
- **BroadcastifyDatabase**: The download url to point to for the collection of broadcastify feeds. (Stored locally once downloaded)
|
|
135
|
-
- **BroadcastifyTags**: An array of tags to filter broadcastify feeds. (`Public Safety`, `Amateur Radio`, `Other`, `Rail`, `Aviation`, `Marine`, `Disaster Event`, `Special Event`)
|
|
136
|
-
|
|
137
|
-
### ListenerSettings
|
|
138
|
-
- **events**: An array of event types that will trigger the listener when they are received by the parser. If this array is empty, the listener will be triggered for all events.
|
|
139
|
-
|
|
140
|
-
#### Webhook
|
|
141
|
-
- **enabled**: If the webhook is enabled or not
|
|
142
|
-
- **destination**: Webhook URL
|
|
143
|
-
- **title**: The title of the webhook
|
|
144
|
-
- **message**: The message you'd like to use for the webhook
|
|
145
|
-
- **ratelimit**: How many messages can it send before being ratelimited
|
|
146
|
-
|
|
147
|
-
#### Uploads
|
|
148
|
-
- **eas**: Whether to enable auto eas generated audio files
|
|
149
|
-
- **file**: Wheather to generate text files
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
### GlobalSettings
|
|
153
|
-
- **EventManagement**: Whether to enable the event management system which includes filtering, tracking nodes, and custom messages.
|
|
154
|
-
- **BetterEventNames**: Changes events to a more specific version depending on parameters, message types, etc. `(Ex. "Tornado Warning" -> "Observed Tornado Warning")`
|
|
155
|
-
- **DisableGeometryParsing**: Disable automatically appending GeoJSON geometry data to the events to save on memory consumption.
|
|
156
|
-
- **UseShapefileCoordinates**: Whether to use the shapefile database to obtain the coordinates for events with specified UGC zones.
|
|
157
|
-
- **SPCWatchesOnly**: Whether to only listen for SPC watches only (TOR/SVR) (If using the API, this is ignored).
|
|
158
|
-
- **ShapefileSkipPoints**: When using the shapefile database to obtain coordinates, you can choose to skip a certain amount of points to reduce the number of coordinates for large events. (Ex. If an event has 1000 coordinates and you set this to `2`, it will only use every other coordinate, therefore using 500 coordinates instead of 1000).
|
|
159
|
-
- **NodeTTL**: How often nodes should be checked per event. (Tracking/Filtering)
|
|
160
|
-
- **NodeMinDistance**: The minimum distance to filter events from the node (Miles)
|
|
161
|
-
- **ListeningEvents**: Events you'd like to listen for. If this array is left empty, it will listen for **ALL** events and products.
|
|
162
|
-
- **ListeningICAO**: ICAO codes for the weather stations you'd like to listen for. Filtering all events that do not contain the codes. `(Ex. ["KLOT", "TORD"])`
|
|
163
|
-
- **IgnoredICAO**: Ignored ICAO codes `(Ex. ["KWNS"])`
|
|
164
|
-
- **IgnoredEvents**: Ignored events / products.
|
|
165
|
-
- **ListeningUGC**: Zones you'd like to listen to `(Ex. ["ILZ001"])`
|
|
166
|
-
- **ListeningStates**: States you'd like to listen to `(Ex. ["IL"])`
|
|
167
|
-
- **NodeLocationFiltering**: If you want tracking nodes to filter out events based on radius. (Miles)\
|
|
168
|
-
- **IgnoreTextProducts**: If you want to ignore test products and events.
|
|
169
|
-
- **TTL**: How long files live for before getting automatically deleted
|
|
170
|
-
- **TextDirectory**: The location to store text products that are generated.
|
|
171
|
-
- **EasDirectory**: The location to store audio eas files that are generated.
|
|
172
|
-
- **EasToneout**: The toneout prefix to use for generated eas messages.
|
|
173
|
-
|
|
174
115
|
|
|
175
116
|
## How do custom listeners work?
|
|
176
117
|
|
|
@@ -434,10 +375,10 @@ If you wish to view all supported products, please see: [SUPPORTED_EVENTS.md](./
|
|
|
434
375
|
[Documentation](https://atmosphericx.scriptkitty.cafe/documentation) |
|
|
435
376
|
[Discord Server](https://atmosphericx-discord.scriptkitty.cafe) |
|
|
436
377
|
[Project Board](https://github.com/users/AtmosphericX/projects/2) |\
|
|
437
|
-
[Code of Conduct](/CODE_OF_CONDUCT.md) |
|
|
438
|
-
[Contributing](/CONTRIBUTING.md) |
|
|
439
|
-
[License](/LICENSE) |
|
|
440
|
-
[Security](/SECURITY.md) |
|
|
378
|
+
[Code of Conduct](/.github/CODE_OF_CONDUCT.md) |
|
|
379
|
+
[Contributing](/.github/CONTRIBUTING.md) |
|
|
380
|
+
[License](/.github/LICENSE) |
|
|
381
|
+
[Security](/.github/SECURITY.md) |
|
|
441
382
|
|
|
442
383
|
## Acknowledgements
|
|
443
384
|
- [k3yomi](https://github.com/k3yomi)
|
|
@@ -293,9 +293,9 @@
|
|
|
293
293
|
- Severe Thunderstorm Warning
|
|
294
294
|
- Severe Weather Statement
|
|
295
295
|
- Mesoscale Discussion
|
|
296
|
-
- Day 1 Outlook
|
|
297
|
-
- Day 2 Outlook
|
|
298
|
-
- Day 3 Outlook
|
|
296
|
+
- Storm Prediction Center Day 1 Outlook
|
|
297
|
+
- Storm Prediction Center Day 2 Outlook
|
|
298
|
+
- Storm Prediction Center Day 3 Outlook
|
|
299
299
|
- State Weather Summary
|
|
300
300
|
- Regional Weather Synopsis
|
|
301
301
|
- Terminal Aerodrome Forecast
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1124,7 +1124,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
1124
1124
|
var import_path = __toESM(require("path"));
|
|
1125
1125
|
var import_node_events = require("events");
|
|
1126
1126
|
var bootstrap = {
|
|
1127
|
-
version: `3.0.
|
|
1127
|
+
version: `3.0.54`,
|
|
1128
1128
|
isReady: true,
|
|
1129
1129
|
ratelimits: {},
|
|
1130
1130
|
session_xmpp: null,
|
|
@@ -1188,6 +1188,15 @@ var bootstrap = {
|
|
|
1188
1188
|
BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
|
|
1189
1189
|
BroadcastifyTags: [`Ham`, `Air`, `Fire`, `Public Safety`, `Weather`, `EMS`, `Police`, `Rail`]
|
|
1190
1190
|
},
|
|
1191
|
+
NotifyServer: {
|
|
1192
|
+
Enabled: false,
|
|
1193
|
+
Server: `https://ntfy.sh`,
|
|
1194
|
+
Attachments: null,
|
|
1195
|
+
Credentials: {
|
|
1196
|
+
Username: null,
|
|
1197
|
+
Password: null
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1191
1200
|
ListenerSettings: [],
|
|
1192
1201
|
GlobalSettings: {
|
|
1193
1202
|
EventManagement: true,
|
|
@@ -4523,9 +4532,9 @@ var dict_awips = {
|
|
|
4523
4532
|
SVR: `severe-thunderstorm-warning`,
|
|
4524
4533
|
SVS: `severe-weather-statement`,
|
|
4525
4534
|
SWOMCD: `mesoscale-discussion`,
|
|
4526
|
-
SWODY1: `
|
|
4527
|
-
SWODY2: `
|
|
4528
|
-
SWODY3: `
|
|
4535
|
+
SWODY1: `storm-prediction-center-day-1-outlook`,
|
|
4536
|
+
SWODY2: `storm-prediction-center-day-2-outlook`,
|
|
4537
|
+
SWODY3: `storm-prediction-center-day-3-outlook`,
|
|
4529
4538
|
SWS: `state-weather-summary`,
|
|
4530
4539
|
SYN: `regional-weather-synopsis`,
|
|
4531
4540
|
TAF: `terminal-aerodrome-forecast`,
|
|
@@ -6415,8 +6424,8 @@ var setEasTone = (options) => __async(null, null, function* () {
|
|
|
6415
6424
|
return outTTS;
|
|
6416
6425
|
});
|
|
6417
6426
|
|
|
6418
|
-
// src/@parsers/@text/text.
|
|
6419
|
-
var
|
|
6427
|
+
// src/@parsers/@text/text.getEmbedText.ts
|
|
6428
|
+
var getEmebedText = (event) => {
|
|
6420
6429
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na;
|
|
6421
6430
|
const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
|
|
6422
6431
|
const isStatement = event.properties.status_metadata.is_statement;
|
|
@@ -6453,6 +6462,42 @@ var getEmebed = (event) => {
|
|
|
6453
6462
|
].filter(Boolean).join("\n");
|
|
6454
6463
|
};
|
|
6455
6464
|
|
|
6465
|
+
// src/@parsers/@text/text.getStringText.ts
|
|
6466
|
+
var getStringText = (event) => {
|
|
6467
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da;
|
|
6468
|
+
const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
|
|
6469
|
+
const isStatement = event.properties.status_metadata.is_statement;
|
|
6470
|
+
const isExpired = event.properties.status_metadata.is_expired;
|
|
6471
|
+
return [
|
|
6472
|
+
line(`Locations:`, (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.locations) == null ? void 0 : _b.slice(0, 100)),
|
|
6473
|
+
line(`Issued:`, new Date(event.properties.issued).toUTCString(), !isExpired),
|
|
6474
|
+
line(`Expires:`, new Date(event.properties.expires).toUTCString(), !isStatement),
|
|
6475
|
+
line(`Damage Threat:`, (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat, !isExpired),
|
|
6476
|
+
line(`Flood Threat:`, (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.flood_threat, !isExpired),
|
|
6477
|
+
line(`Tornado Threat:`, (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.parameters) == null ? void 0 : _h.tornado_threat, !isExpired),
|
|
6478
|
+
line(`Estimated Wind Gusts:`, `${(_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.parameters) == null ? void 0 : _j.estimated_wind_gusts} ${((_l = (_k = event == null ? void 0 : event.properties) == null ? void 0 : _k.parameters) == null ? void 0 : _l.wind_threat) ? ` (${(_n = (_m = event == null ? void 0 : event.properties) == null ? void 0 : _m.parameters) == null ? void 0 : _n.wind_threat})` : ""}`, !isExpired && ((_p = (_o = event == null ? void 0 : event.properties) == null ? void 0 : _o.parameters) == null ? void 0 : _p.estimated_wind_gusts) != null),
|
|
6479
|
+
line(`Estimated Hail Size:`, `${(_r = (_q = event == null ? void 0 : event.properties) == null ? void 0 : _q.parameters) == null ? void 0 : _r.estimated_hail_size} ${((_t = (_s = event == null ? void 0 : event.properties) == null ? void 0 : _s.parameters) == null ? void 0 : _t.hail_threat) ? ` (${(_v = (_u = event == null ? void 0 : event.properties) == null ? void 0 : _u.parameters) == null ? void 0 : _v.hail_threat})` : ""}`, !isExpired && ((_x = (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.parameters) == null ? void 0 : _x.estimated_hail_size) != null),
|
|
6480
|
+
line(`Discussion:`, (_z = (_y = event == null ? void 0 : event.properties) == null ? void 0 : _y.discussion_parameters) == null ? void 0 : _z.discussion_number, !isExpired),
|
|
6481
|
+
line(`Concern:`, (_B = (_A = event == null ? void 0 : event.properties) == null ? void 0 : _A.discussion_parameters) == null ? void 0 : _B.discussion_concerning, !isExpired),
|
|
6482
|
+
line(`SPC Max Tornado Threat:`, (_D = (_C = event == null ? void 0 : event.properties) == null ? void 0 : _C.discussion_parameters) == null ? void 0 : _D.discussion_max_tornado, !isExpired),
|
|
6483
|
+
line(`SPC Max Hail Threat:`, (_F = (_E = event == null ? void 0 : event.properties) == null ? void 0 : _E.discussion_parameters) == null ? void 0 : _F.discussion_max_hail, !isExpired),
|
|
6484
|
+
line(`SPC Max Wind Threat:`, (_H = (_G = event == null ? void 0 : event.properties) == null ? void 0 : _G.discussion_parameters) == null ? void 0 : _H.discussion_max_wind, !isExpired),
|
|
6485
|
+
line(`SPC Watch Issuance Probability:`, ((_J = (_I = event == null ? void 0 : event.properties) == null ? void 0 : _I.discussion_parameters) == null ? void 0 : _J.discussion_watch_issuance) ? `${(_L = (_K = event == null ? void 0 : event.properties) == null ? void 0 : _K.discussion_parameters) == null ? void 0 : _L.discussion_watch_issuance}%` : null, !isExpired),
|
|
6486
|
+
line(`Watch Number:`, (_N = (_M = event == null ? void 0 : event.properties) == null ? void 0 : _M.watch_parameters) == null ? void 0 : _N.watch_number, !isExpired),
|
|
6487
|
+
line(`Strong Tornadoes Probability:`, ((_P = (_O = event == null ? void 0 : event.properties) == null ? void 0 : _O.watch_parameters) == null ? void 0 : _P.strong_tornadoes_probability) ? `${(_R = (_Q = event == null ? void 0 : event.properties) == null ? void 0 : _Q.watch_parameters) == null ? void 0 : _R.strong_tornadoes_probability}%` : null, !isExpired),
|
|
6488
|
+
line(`Additional Tornadoes Probability:`, ((_T = (_S = event == null ? void 0 : event.properties) == null ? void 0 : _S.watch_parameters) == null ? void 0 : _T.additional_tornadoes_probability) ? `${(_V = (_U = event == null ? void 0 : event.properties) == null ? void 0 : _U.watch_parameters) == null ? void 0 : _V.additional_tornadoes_probability}%` : null, !isExpired),
|
|
6489
|
+
line(`Combined Hail/Wind Probability:`, ((_X = (_W = event == null ? void 0 : event.properties) == null ? void 0 : _W.watch_parameters) == null ? void 0 : _X.combined_hail_wind_probability) ? `${(_Z = (_Y = event == null ? void 0 : event.properties) == null ? void 0 : _Y.watch_parameters) == null ? void 0 : _Z.combined_hail_wind_probability}%` : null, !isExpired),
|
|
6490
|
+
line(`Severe Hail Probability:`, ((_$ = (__ = event == null ? void 0 : event.properties) == null ? void 0 : __.watch_parameters) == null ? void 0 : _$.severe_hail_probability) ? `${(_ba = (_aa = event == null ? void 0 : event.properties) == null ? void 0 : _aa.watch_parameters) == null ? void 0 : _ba.severe_hail_probability}%` : null, !isExpired),
|
|
6491
|
+
line(`Hail >2in Probability:`, ((_da = (_ca = event == null ? void 0 : event.properties) == null ? void 0 : _ca.watch_parameters) == null ? void 0 : _da.hail_2in_probability) ? `${(_fa = (_ea = event == null ? void 0 : event.properties) == null ? void 0 : _ea.watch_parameters) == null ? void 0 : _fa.hail_2in_probability}%` : null, !isExpired),
|
|
6492
|
+
line(`Max Hail Inches:`, (_ha = (_ga = event == null ? void 0 : event.properties) == null ? void 0 : _ga.watch_parameters) == null ? void 0 : _ha.max_hail_in, !isExpired),
|
|
6493
|
+
line(`Severe Wind Probability:`, ((_ja = (_ia = event == null ? void 0 : event.properties) == null ? void 0 : _ia.watch_parameters) == null ? void 0 : _ja.severe_wind_probability) ? `${(_la = (_ka = event == null ? void 0 : event.properties) == null ? void 0 : _ka.watch_parameters) == null ? void 0 : _la.severe_wind_probability}%` : null, !isExpired),
|
|
6494
|
+
line(`Max Surface Wind:`, (_na = (_ma = event == null ? void 0 : event.properties) == null ? void 0 : _ma.watch_parameters) == null ? void 0 : _na.max_wind_surface, !isExpired),
|
|
6495
|
+
line(`Max Tops (x100 feet):`, (_pa = (_oa = event == null ? void 0 : event.properties) == null ? void 0 : _oa.watch_parameters) == null ? void 0 : _pa.max_tops_x100feet, !isExpired),
|
|
6496
|
+
line(`Sender:`, ((_sa = (_ra = (_qa = event == null ? void 0 : event.properties) == null ? void 0 : _qa.geocode) == null ? void 0 : _ra.office) == null ? void 0 : _sa.name) ? `${(_va = (_ua = (_ta = event == null ? void 0 : event.properties) == null ? void 0 : _ta.geocode) == null ? void 0 : _ua.office) == null ? void 0 : _va.name} (${(_ya = (_xa = (_wa = event == null ? void 0 : event.properties) == null ? void 0 : _wa.geocode) == null ? void 0 : _xa.office) == null ? void 0 : _ya.office})` : (_Ba = (_Aa = (_za = event == null ? void 0 : event.properties) == null ? void 0 : _za.geocode) == null ? void 0 : _Aa.office) == null ? void 0 : _Ba.office),
|
|
6497
|
+
line(`Tracking:`, (_Da = (_Ca = event == null ? void 0 : event.properties) == null ? void 0 : _Ca.metadata) == null ? void 0 : _Da.tracking)
|
|
6498
|
+
].filter(Boolean).join("\n");
|
|
6499
|
+
};
|
|
6500
|
+
|
|
6456
6501
|
// src/@modules/@utilities/utilities.createHttp.ts
|
|
6457
6502
|
var createHttp = (options) => __async(null, null, function* () {
|
|
6458
6503
|
var _a, _b, _c, _d;
|
|
@@ -6469,6 +6514,13 @@ var createHttp = (options) => __async(null, null, function* () {
|
|
|
6469
6514
|
const returnHttp = function(error, status, message) {
|
|
6470
6515
|
return { error, options: requestOptions, status, message };
|
|
6471
6516
|
};
|
|
6517
|
+
if (options == null ? void 0 : options.auth) {
|
|
6518
|
+
const authString = `${options.auth.username}:${options.auth.password}`;
|
|
6519
|
+
const encodedAuth = Buffer.from(authString).toString("base64");
|
|
6520
|
+
requestOptions.headers = __spreadProps(__spreadValues({}, requestOptions.headers), {
|
|
6521
|
+
"Authorization": `Basic ${encodedAuth}`
|
|
6522
|
+
});
|
|
6523
|
+
}
|
|
6472
6524
|
if (options == null ? void 0 : options.formData) {
|
|
6473
6525
|
requestOptions.body = options.formData;
|
|
6474
6526
|
} else if ((options == null ? void 0 : options.body) != void 0) {
|
|
@@ -6508,7 +6560,7 @@ var getMatched = (strings, string) => {
|
|
|
6508
6560
|
// src/@manager/manager.updateListener.ts
|
|
6509
6561
|
var import_fs3 = require("fs");
|
|
6510
6562
|
var updateListener = (event) => __async(null, null, function* () {
|
|
6511
|
-
var _a, _b, _c, _d, _e, _f;
|
|
6563
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
6512
6564
|
const tick = performance.now();
|
|
6513
6565
|
const settings = bootstrap.settings;
|
|
6514
6566
|
const listeners2 = settings.ListenerSettings;
|
|
@@ -6527,19 +6579,20 @@ var updateListener = (event) => __async(null, null, function* () {
|
|
|
6527
6579
|
attachments: properties2.metadata.attachments
|
|
6528
6580
|
};
|
|
6529
6581
|
for (const listener2 of listeners2) {
|
|
6530
|
-
const events = listener2 == null ? void 0 : listener2.
|
|
6531
|
-
const webhook = listener2 == null ? void 0 : listener2.
|
|
6532
|
-
const
|
|
6582
|
+
const events = listener2 == null ? void 0 : listener2.Events;
|
|
6583
|
+
const webhook = listener2 == null ? void 0 : listener2.Webhook;
|
|
6584
|
+
const notify = listener2 == null ? void 0 : listener2.NotificationServer;
|
|
6585
|
+
const uploads = listener2 == null ? void 0 : listener2.Uploads;
|
|
6533
6586
|
const isMatched = getMatched(events != null ? events : [], metadata.name);
|
|
6534
6587
|
if ((events == null ? void 0 : events.length) == 0 || isMatched) {
|
|
6535
|
-
if (uploads == null ? void 0 : uploads.
|
|
6588
|
+
if (uploads == null ? void 0 : uploads.EAS) {
|
|
6536
6589
|
metadata.eas = yield setEasTone({
|
|
6537
6590
|
title: `${metadata.name}_${metadata.status}_${metadata.tracking}`,
|
|
6538
6591
|
message: metadata.description,
|
|
6539
6592
|
header: metadata.header
|
|
6540
6593
|
});
|
|
6541
6594
|
}
|
|
6542
|
-
if (uploads == null ? void 0 : uploads.
|
|
6595
|
+
if (uploads == null ? void 0 : uploads.File) {
|
|
6543
6596
|
const fDestination = settings.GlobalSettings.ArchiveSettings.TextDirectory;
|
|
6544
6597
|
if (fDestination) {
|
|
6545
6598
|
const file = `${fDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
|
|
@@ -6554,7 +6607,7 @@ var updateListener = (event) => __async(null, null, function* () {
|
|
|
6554
6607
|
}
|
|
6555
6608
|
metadata.file = metadata.raw;
|
|
6556
6609
|
}
|
|
6557
|
-
if (uploads == null ? void 0 : uploads.
|
|
6610
|
+
if (uploads == null ? void 0 : uploads.JSON) {
|
|
6558
6611
|
const eDestination = settings.GlobalSettings.ArchiveSettings.EventDirectory;
|
|
6559
6612
|
if (eDestination) {
|
|
6560
6613
|
const file = `${eDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
|
|
@@ -6565,16 +6618,34 @@ var updateListener = (event) => __async(null, null, function* () {
|
|
|
6565
6618
|
}
|
|
6566
6619
|
metadata.json = JSON.stringify(getCleanedEvent(event), null, 2);
|
|
6567
6620
|
}
|
|
6568
|
-
if ((
|
|
6569
|
-
const
|
|
6621
|
+
if (((_a = settings == null ? void 0 : settings.NotifyServer) == null ? void 0 : _a.Enabled) && (notify == null ? void 0 : notify.Enabled) && (notify == null ? void 0 : notify.Topic)) {
|
|
6622
|
+
const server = settings == null ? void 0 : settings.NotifyServer;
|
|
6623
|
+
const auth = ((_b = server == null ? void 0 : server.Credentials) == null ? void 0 : _b.Username) && ((_c = server == null ? void 0 : server.Credentials) == null ? void 0 : _c.Password) ? { username: (_e = (_d = settings == null ? void 0 : settings.NotifyServer) == null ? void 0 : _d.Credentials) == null ? void 0 : _e.Username, password: (_f = server == null ? void 0 : server.Credentials) == null ? void 0 : _f.Password } : void 0;
|
|
6624
|
+
const attachment = metadata.eas && (server == null ? void 0 : server.Attachments) ? `${server == null ? void 0 : server.Attachments}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav` : void 0;
|
|
6625
|
+
yield createHttp(__spreadProps(__spreadValues({
|
|
6626
|
+
url: `${(_g = server == null ? void 0 : server.Server) == null ? void 0 : _g.replace(/\/$/, "")}/${(_h = listener2 == null ? void 0 : listener2.NotificationServer) == null ? void 0 : _h.Topic}`,
|
|
6627
|
+
timeout: 15e3,
|
|
6628
|
+
method: "POST"
|
|
6629
|
+
}, auth && { auth }), {
|
|
6630
|
+
headers: __spreadValues({
|
|
6631
|
+
"Title": `${metadata.name} (${metadata.status})`,
|
|
6632
|
+
"Tags": (_j = (_i = properties2.parameters.tags) == null ? void 0 : _i.join(",")) != null ? _j : "N/A",
|
|
6633
|
+
"Expires": new Date(properties2.expires).getTime(),
|
|
6634
|
+
"Priority": (notify == null ? void 0 : notify.Priority) ? notify.Priority.toString() : "5"
|
|
6635
|
+
}, attachment && { "Attach": attachment }),
|
|
6636
|
+
body: getStringText(event)
|
|
6637
|
+
}));
|
|
6638
|
+
}
|
|
6639
|
+
if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
|
|
6640
|
+
const isRatelimited = setTimeoutAction({ identifier: webhook.Destination, interval: ((_k = webhook.Ratelimit) != null ? _k : 2) * 2, max: (_l = webhook.Ratelimit) != null ? _l : 2, addTime: true });
|
|
6570
6641
|
const form = new FormData();
|
|
6571
6642
|
const embed = {
|
|
6572
6643
|
title: `${metadata.name} (${metadata.status})`,
|
|
6573
|
-
description:
|
|
6644
|
+
description: getEmebedText(event),
|
|
6574
6645
|
fields: [],
|
|
6575
6646
|
color: 16711680,
|
|
6576
6647
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6577
|
-
footer: { text: (
|
|
6648
|
+
footer: { text: (_m = webhook.Title) != null ? _m : `AtmosphericX` }
|
|
6578
6649
|
};
|
|
6579
6650
|
if (isRatelimited.limited) {
|
|
6580
6651
|
return;
|
|
@@ -6588,32 +6659,32 @@ var updateListener = (event) => __async(null, null, function* () {
|
|
|
6588
6659
|
value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
|
|
6589
6660
|
});
|
|
6590
6661
|
}
|
|
6591
|
-
if (((
|
|
6662
|
+
if (((_n = metadata.attachments) == null ? void 0 : _n.length) > 0) {
|
|
6592
6663
|
metadata.attachments = metadata.attachments.slice(0, 5);
|
|
6593
6664
|
embed.fields.push({
|
|
6594
6665
|
name: "Attachments",
|
|
6595
6666
|
value: metadata.attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
|
|
6596
6667
|
});
|
|
6597
6668
|
}
|
|
6598
|
-
if (uploads == null ? void 0 : uploads.
|
|
6669
|
+
if (uploads == null ? void 0 : uploads.File) {
|
|
6599
6670
|
form.append("fUpload", new Blob([Buffer.from(metadata.file)], { type: "application/text" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`);
|
|
6600
6671
|
}
|
|
6601
|
-
if (uploads == null ? void 0 : uploads.
|
|
6672
|
+
if (uploads == null ? void 0 : uploads.JSON) {
|
|
6602
6673
|
form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.json`);
|
|
6603
6674
|
}
|
|
6604
|
-
if (uploads == null ? void 0 : uploads.
|
|
6675
|
+
if (uploads == null ? void 0 : uploads.EAS) {
|
|
6605
6676
|
if (metadata.eas) {
|
|
6606
6677
|
const file = (0, import_fs3.readFileSync)(metadata.eas);
|
|
6607
6678
|
form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}_eas.mp3`);
|
|
6608
6679
|
}
|
|
6609
6680
|
}
|
|
6610
6681
|
form.append("payload_json", JSON.stringify({
|
|
6611
|
-
username: (
|
|
6612
|
-
content: (
|
|
6682
|
+
username: (_o = webhook.Title) != null ? _o : "AtmosphericX",
|
|
6683
|
+
content: (_p = webhook.Message) != null ? _p : "",
|
|
6613
6684
|
embeds: [embed]
|
|
6614
6685
|
}));
|
|
6615
6686
|
yield createHttp({
|
|
6616
|
-
url: webhook.
|
|
6687
|
+
url: webhook.Destination,
|
|
6617
6688
|
timeout: 15e3,
|
|
6618
6689
|
method: `POST`,
|
|
6619
6690
|
body: form
|
|
@@ -6852,16 +6923,17 @@ var mkEvent = (event) => __async(null, null, function* () {
|
|
|
6852
6923
|
|
|
6853
6924
|
// src/@manager/manager.rmEvent.ts
|
|
6854
6925
|
var rmEvent = (event) => __async(null, null, function* () {
|
|
6855
|
-
const
|
|
6926
|
+
const gSelect = event;
|
|
6927
|
+
const gEvent = bootstrap.cache.events.features.find((f) => {
|
|
6856
6928
|
var _a, _b, _c, _d;
|
|
6857
6929
|
return ((_b = (_a = f == null ? void 0 : f.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.tracking) === ((_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.metadata) == null ? void 0 : _d.tracking);
|
|
6858
6930
|
});
|
|
6859
|
-
const
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
if (
|
|
6864
|
-
if (!
|
|
6931
|
+
const gStatement = event.properties.status_metadata.is_statement;
|
|
6932
|
+
gSelect.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
|
|
6933
|
+
gSelect.properties.status = `Expired`;
|
|
6934
|
+
gSelect.properties.status_metadata.is_expired = true;
|
|
6935
|
+
if (gEvent) {
|
|
6936
|
+
if (!gStatement) {
|
|
6865
6937
|
setEventEmit({
|
|
6866
6938
|
event: `onEventStatus`,
|
|
6867
6939
|
metadata: {
|
|
@@ -6872,10 +6944,10 @@ var rmEvent = (event) => __async(null, null, function* () {
|
|
|
6872
6944
|
});
|
|
6873
6945
|
setEventEmit({ event: `onExpiredProduct`, metadata: event });
|
|
6874
6946
|
}
|
|
6875
|
-
|
|
6876
|
-
bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(getEvent), 1);
|
|
6947
|
+
bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(gEvent), 1);
|
|
6877
6948
|
bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== event.properties.metadata.tracking);
|
|
6878
6949
|
setTimeoutAction({ identifier: event.properties.metadata.tracking, expire: true });
|
|
6950
|
+
if (!gStatement) yield updateListener(gSelect);
|
|
6879
6951
|
}
|
|
6880
6952
|
setEventEmit({
|
|
6881
6953
|
event: `onEventCache`,
|
|
@@ -6962,9 +7034,9 @@ var getEventAttachments = (event) => {
|
|
|
6962
7034
|
const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
|
|
6963
7035
|
const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
|
|
6964
7036
|
const events = [
|
|
6965
|
-
{ target: "
|
|
6966
|
-
{ target: "
|
|
6967
|
-
{ target: "
|
|
7037
|
+
{ target: "Storm Prediction Center Day 1 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day1otlk_${issuanceTime}.png` },
|
|
7038
|
+
{ target: "Storm Prediction Center Day 2 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day2otlk.png` },
|
|
7039
|
+
{ target: "Storm Prediction Center Day 3 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day3otlk.png` },
|
|
6968
7040
|
{ target: "Mesoscale Discussion", attachment: `https://www.spc.noaa.gov/products/md/mcd${spcNumber}.png` },
|
|
6969
7041
|
{ target: "Tornado Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` },
|
|
6970
7042
|
{ target: "PDS Tornado Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` },
|