@atmosx/event-product-parser 3.0.55 → 3.0.62
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/.github/CODE_OF_CONDUCT.md +9 -9
- package/.github/CONTRIBUTING.md +29 -29
- package/.github/LICENSE +17 -17
- package/.github/SECURITY.md +20 -20
- package/.github/SUPPORTED_EVENTS.md +369 -369
- package/.github/docs/docs-functions.md +30 -0
- package/.github/docs/docs-general-configurations.md +209 -0
- package/.github/docs/docs-integrations.md +37 -0
- package/.github/docs/docs-listeners.md +28 -0
- package/.github/docs/docs-source-configuration.md +218 -0
- package/.github/docs/docs-technical.md +50 -0
- package/.github/logo.png +0 -0
- package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
- package/.github/samples/SAMPLE_GEOJSON.json +204 -0
- package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +119 -0
- package/.vscode/settings.json +3 -3
- package/README.md +167 -0
- package/dist/cjs/index.cjs +1439 -1277
- package/dist/esm/index.mjs +1420 -1258
- package/package.json +47 -52
- package/src/@building/{building.create.ts → CreateEvent.ts} +55 -55
- package/src/@building/{building.clean.ts → GetCleanedEvent.ts} +29 -29
- package/src/@building/{building.attachments.ts → GetEventAttachments.ts} +85 -82
- package/src/@building/{building.enhance.ts → GetEventEnhancedName.ts} +54 -59
- package/src/@building/{building.geometry.ts → GetEventGeometry.ts} +47 -47
- package/src/@building/{building.headers.ts → GetEventHeader.ts} +36 -36
- package/src/@building/{building.polygon.ts → GetEventNodes.ts} +72 -69
- package/src/@building/{building.office.ts → GetEventOffice.ts} +42 -42
- package/src/@building/{building.properties.ts → GetEventProperties.ts} +95 -95
- package/src/@building/{building.signature.ts → GetEventSignature.ts} +60 -60
- package/src/@building/{building.tags.ts → GetEventTags.ts} +29 -24
- package/src/@building/{building.tracking.ts → GetEventTracking.ts} +67 -67
- package/src/@core/{core.clearEvents.ts → ClearEvents.ts} +30 -30
- package/src/@core/{core.createListener.ts → CreateListener.ts} +23 -23
- package/src/@core/{core.getEvents.ts → GetEvents.ts} +23 -23
- package/src/@core/{core.getNodes.ts → GetNodes.ts} +23 -23
- package/src/@core/{core.getRandomEvent.ts → GetRandomEvent.ts} +23 -23
- package/src/@core/{core.getVersion.ts → GetVersion.ts} +23 -23
- package/src/@core/{core.manualEvent.ts → ManualEvent.ts} +56 -38
- package/src/@core/{core.query.ts → QueryStanza.ts} +38 -38
- package/src/@core/{core.setNode.ts → SetNode.ts} +80 -80
- package/src/@core/{core.start.ts → StartService.ts} +60 -60
- package/src/@core/{core.stop.ts → StopService.ts} +31 -31
- package/src/@enums/AWIPS.ts +366 -0
- package/src/{@dictionaries/dictionaries.actions.ts → @enums/Actions.ts} +27 -27
- package/src/{@dictionaries/dictionaries.cancellation.ts → @enums/Cancellation.ts} +30 -30
- package/src/{@dictionaries/dictionaries.causes.ts → @enums/Causes.ts} +35 -35
- package/src/{@dictionaries/dictionaries.correlations.ts → @enums/Correlations.ts} +42 -42
- package/src/{@dictionaries/dictionaries.enhanced.ts → @enums/Enhanced.ts} +69 -69
- package/src/{@dictionaries/dictionaries.events.ts → @enums/Events.ts} +82 -82
- package/src/{@dictionaries/dictionaries.expressions.ts → @enums/Expressions.ts} +28 -28
- package/src/@enums/GlobalFilter.ts +24 -0
- package/src/{@dictionaries/dictionaries.hail.ts → @enums/Hail.ts} +37 -35
- package/src/{@dictionaries/dictionaries.icao.ts → @enums/ICAO.ts} +258 -258
- package/src/{@dictionaries/dictionaries.matches.ts → @enums/Matches.ts} +54 -54
- package/src/{@dictionaries/dictionaries.products.ts → @enums/Products.ts} +24 -24
- package/src/{@dictionaries/dictionaries.records.ts → @enums/Records.ts} +25 -25
- package/src/{@dictionaries/dictionaries.severity.ts → @enums/Severity.ts} +27 -27
- package/src/{@dictionaries/dictionaries.shapefiles.ts → @enums/Shapefiles.ts} +35 -35
- package/src/{@dictionaries/dictionaries.states.ts → @enums/States.ts} +71 -71
- package/src/{@dictionaries/dictionaries.status.ts → @enums/Status.ts} +30 -30
- package/src/{@dictionaries/dictionaries.global.ts → @enums/Strings.ts} +22 -24
- package/src/@enums/Tags.ts +167 -0
- package/src/{@dictionaries/dictionaries.testing.ts → @enums/Testing.ts} +24 -24
- package/src/@events/{events.api.ts → ParseAPI.ts} +116 -116
- package/src/@events/{events.text.ts → ParseText.ts} +87 -84
- package/src/@events/{events.ugc.ts → ParseUGC.ts} +93 -89
- package/src/@events/{events.vtec.ts → ParseVTEC.ts} +86 -86
- package/src/@manager/MakeEvents.ts +106 -0
- package/src/@manager/{manager.rmEvent.ts → RemoveEvent.ts} +69 -71
- package/src/@manager/{manager.setHash.ts → SetHash.ts} +35 -35
- package/src/@manager/Tasks.ts +246 -0
- package/src/@manager/{manager.updateEvents.ts → UpdateEvents.ts} +34 -34
- package/src/@manager/{manager.updateNodes.ts → UpdateNode.ts} +61 -53
- package/src/{@building/building.validate.ts → @manager/ValidateEvents.ts} +141 -154
- package/src/@modules/@database/{database.cache.ts → GetCachedEvents.ts} +49 -49
- package/src/@modules/@database/{database.broadcastify.ts → ImportBroadcastify.ts} +69 -66
- package/src/@modules/@database/{database.shapefiles.ts → ImportShapefiles.ts} +92 -92
- package/src/@modules/@database/{database.stanza.ts → ImportStanza.ts} +46 -46
- package/src/@modules/@database/{database.init.ts → InitializeDatabase.ts} +58 -58
- package/src/@modules/@eas/{eas.setEasTone.ts → GenerateEASMessage.ts} +144 -151
- package/src/@modules/@eas/{eas.getCleanDescription.ts → GetCleanDescription.ts} +91 -91
- package/src/@modules/@eas/{eas.getFloatPCM16.ts → GetFloatPCM16.ts} +29 -29
- package/src/@modules/@eas/{eas.getMergedPCM16.ts → GetMergedPCM16.ts} +32 -32
- package/src/@modules/@eas/{eas.getPCM16.ts → GetPCM16.ts} +52 -52
- package/src/@modules/@eas/{eas.getPCMToFloat.ts → GetPCMToFloat.ts} +26 -26
- package/src/@modules/@eas/{eas.getSampledPCM16.ts → GetSampledPCM16.ts} +36 -36
- package/src/@modules/@eas/{eas.getTTS.ts → GetTTS.ts} +54 -54
- package/src/@modules/@eas/{eas.getWavPCM16.ts → GetWavPCM16.ts} +52 -52
- package/src/@modules/@eas/{eas.setAFSK.ts → SetAFSK.ts} +51 -51
- package/src/@modules/@eas/{eas.setAsciiToBits.ts → SetAsciiToBits.ts} +31 -31
- package/src/@modules/@eas/{eas.setAttentionTone.ts → SetAttentionTone.ts} +40 -40
- package/src/@modules/@eas/{eas.setNoise.ts → SetNoise.ts} +32 -32
- package/src/@modules/@eas/{eas.setRadioEffect.ts → SetRadioEffect.ts} +50 -50
- package/src/@modules/@eas/{eas.setSameHeader.ts → SetSameHeader.ts} +44 -44
- package/src/@modules/@stanza/{stanza.getAwipsType.ts → GetAwipsType.ts} +47 -45
- package/src/@modules/@stanza/{stanza.validate.ts → ValidateStanza.ts} +49 -49
- package/src/@modules/@utilities/{utilities.createHttp.ts → CreateHttp.ts} +83 -83
- package/src/@modules/@utilities/{utilities.getFormattedTime.ts → GetFormattedTime.ts} +43 -43
- package/src/@modules/@utilities/{utilities.getLatestIssuance.ts → GetLatestIssuance.ts} +32 -32
- package/src/@modules/@utilities/{utilities.getMatched.ts → GetMatched.ts} +33 -33
- package/src/@modules/@utilities/{utilities.getSettings.ts → GetSettings.ts} +25 -25
- package/src/@modules/@utilities/{utilities.getShapeNearestPoint.ts → GetShapeNearestPoint.ts} +114 -114
- package/src/@modules/@utilities/{utilities.setCronSchedule.ts → SetCronSchedule.ts} +94 -94
- package/src/@modules/@utilities/{utilities.setDebug.ts → SetDebug.ts} +37 -38
- package/src/@modules/@utilities/{utilities.setEventEmit.ts → SetEventEmit.ts} +41 -41
- package/src/@modules/@utilities/{utilities.setListener.ts → SetListener.ts} +30 -30
- package/src/@modules/@utilities/{utilities.setSettings.ts → SetSettings.ts} +42 -42
- package/src/@modules/@utilities/{utilities.setSleep.ts → SetSleep.ts} +33 -33
- package/src/@modules/@utilities/{utilities.setTimeoutAction.ts → SetTimeoutAction.ts} +63 -63
- package/src/@modules/@utilities/{utilities.setWarning.ts → SetWarning.ts} +34 -34
- package/src/@modules/@xmpp/{xmpp.xDeploy.ts → DeployXMPP.ts} +57 -57
- package/src/@modules/@xmpp/{xmpp.xError.ts → ErrorXMPP.ts} +26 -26
- package/src/@modules/@xmpp/{xmpp.xOffline.ts → OfflineXMPP.ts} +36 -36
- package/src/@modules/@xmpp/{xmpp.xOnline.ts → OnlineXMPP.ts} +45 -45
- package/src/@modules/@xmpp/{xmpp.xReconnect.ts → ReconnectXMPP.ts} +64 -64
- package/src/@modules/@xmpp/{xmpp.xStanza.ts → StanzaXMPP.ts} +62 -62
- package/src/@parsers/@hvtec/{hvtec.extract.ts → HVExtract.ts} +39 -39
- package/src/@parsers/@pvtec/{pvtec.expires.ts → GetExpiry.ts} +25 -25
- package/src/@parsers/@pvtec/{pvtec.extract.ts → VTECExtract.ts} +48 -48
- package/src/@parsers/@text/{text.getDescriptionFromProduct.ts → GetDescriptionFromProduct.ts} +59 -52
- package/src/@parsers/@text/{text.getEmbedText.ts → GetEmbededText.ts} +55 -55
- package/src/@parsers/@text/{text.getPolygonFromProduct.ts → GetPolygonFromProduct.ts} +52 -52
- package/src/@parsers/@text/{text.getStringText.ts → GetStringText.ts} +57 -53
- package/src/@parsers/@text/{text.getTextFromProduct.ts → GetTextFromProduct.ts} +42 -42
- package/src/@parsers/@text/{text.getXML.ts → GetXML.ts} +60 -60
- package/src/@parsers/@ugc/{ugc.getCache.ts → GetCache.ts} +23 -23
- package/src/@parsers/@ugc/{ugc.expiry.ts → GetExpiry.ts} +31 -31
- package/src/@parsers/@ugc/{ugc.locations.ts → GetLocations.ts} +56 -56
- package/src/@parsers/@ugc/{ugc.header.ts → GetUGCHeader.ts} +29 -29
- package/src/@parsers/@ugc/{ugc.coordinates.ts → GetZonePolygon.ts} +110 -110
- package/src/@parsers/@ugc/{ugc.zones.ts → GetZones.ts} +51 -51
- package/src/@parsers/@ugc/{ugc.setCache.ts → SetCache.ts} +27 -27
- package/src/@parsers/@ugc/{ugc.extract.ts → UGCExtract.ts} +36 -36
- package/src/@types/{type.listener.ts → Actions.ts} +37 -38
- package/src/@types/{type.attributes.ts → Attributes.ts} +28 -28
- package/src/@types/{type.event.ts → Event.ts} +69 -69
- package/src/@types/{type.hvtec.ts → HVTEC.ts} +25 -25
- package/src/@types/{type.hash.ts → Hash.ts} +24 -24
- package/src/@types/{type.properties.ts → Properties.ts} +77 -77
- package/src/@types/{type.settings.ts → Settings.ts} +99 -93
- package/src/@types/{type.stanza.ts → Stanza.ts} +37 -37
- package/src/@types/{type.compiled.ts → StanzaCompiled.ts} +35 -34
- package/src/@types/{type.ugc.ts → UGC.ts} +24 -24
- package/src/@types/{type.pvtec.ts → VTEC.ts} +30 -30
- package/src/bootstrap.ts +128 -124
- package/src/index.ts +74 -74
- package/tsconfig.json +13 -13
- package/tsup.config.ts +15 -15
- package/.github/README.md +0 -384
- package/src/@dictionaries/dictionaries.awips.ts +0 -364
- package/src/@dictionaries/dictionaries.strings.ts +0 -22
- package/src/@dictionaries/dictionaries.tags.ts +0 -93
- package/src/@manager/manager.mkEvent.ts +0 -98
- package/src/@manager/manager.updateListener.ts +0 -180
- package/testing/init.js +0 -91
package/dist/cjs/index.cjs
CHANGED
|
@@ -299,13 +299,13 @@ var require_Element = __commonJS({
|
|
|
299
299
|
return result;
|
|
300
300
|
}
|
|
301
301
|
getText() {
|
|
302
|
-
let
|
|
302
|
+
let text = "";
|
|
303
303
|
for (const child of this.children) {
|
|
304
304
|
if (typeof child === "string" || typeof child === "number") {
|
|
305
|
-
|
|
305
|
+
text += child;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
return
|
|
308
|
+
return text;
|
|
309
309
|
}
|
|
310
310
|
getChildText(name, xmlns) {
|
|
311
311
|
const child = this.getChild(name, xmlns);
|
|
@@ -364,8 +364,8 @@ var require_Element = __commonJS({
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
/** add text node and return element */
|
|
367
|
-
t(
|
|
368
|
-
this.children.push(
|
|
367
|
+
t(text) {
|
|
368
|
+
this.children.push(text);
|
|
369
369
|
return this;
|
|
370
370
|
}
|
|
371
371
|
/* Manipulation */
|
|
@@ -578,9 +578,9 @@ var require_ltx = __commonJS({
|
|
|
578
578
|
switch (state) {
|
|
579
579
|
case STATE_TEXT:
|
|
580
580
|
if (c === 60) {
|
|
581
|
-
const
|
|
582
|
-
if (
|
|
583
|
-
this.emit("text", escape2.unescapeXML(
|
|
581
|
+
const text = endRecording();
|
|
582
|
+
if (text) {
|
|
583
|
+
this.emit("text", escape2.unescapeXML(text));
|
|
584
584
|
}
|
|
585
585
|
state = STATE_TAG_NAME;
|
|
586
586
|
recordStart = pos + 1;
|
|
@@ -813,10 +813,10 @@ var require_bitops = __commonJS({
|
|
|
813
813
|
}
|
|
814
814
|
return new Uint8Array(res);
|
|
815
815
|
};
|
|
816
|
-
exports2.H = function(
|
|
816
|
+
exports2.H = function(text) {
|
|
817
817
|
return __async(this, null, function* () {
|
|
818
818
|
return new Uint8Array(
|
|
819
|
-
yield crypto.subtle.digest("SHA-1",
|
|
819
|
+
yield crypto.subtle.digest("SHA-1", text)
|
|
820
820
|
);
|
|
821
821
|
});
|
|
822
822
|
};
|
|
@@ -838,9 +838,9 @@ var require_bitops = __commonJS({
|
|
|
838
838
|
));
|
|
839
839
|
});
|
|
840
840
|
};
|
|
841
|
-
exports2.Hi = function(
|
|
841
|
+
exports2.Hi = function(text, salt, iterations) {
|
|
842
842
|
return __async(this, null, function* () {
|
|
843
|
-
const key = new TextEncoder().encode(
|
|
843
|
+
const key = new TextEncoder().encode(text);
|
|
844
844
|
var concat = new Uint8Array(salt.length + 4);
|
|
845
845
|
concat.set(salt);
|
|
846
846
|
concat.set(new Uint8Array([0, 0, 0, 1]), salt.length);
|
|
@@ -1102,21 +1102,21 @@ var require_main3 = __commonJS({
|
|
|
1102
1102
|
// src/index.ts
|
|
1103
1103
|
var index_exports = {};
|
|
1104
1104
|
__export(index_exports, {
|
|
1105
|
+
ClearEvents: () => ClearEvents,
|
|
1106
|
+
GenerateEASMessage: () => GenerateEASMessage,
|
|
1107
|
+
GetCleanedEvent: () => GetCleanedEvent,
|
|
1108
|
+
GetEventGeometry: () => GetEventGeometry,
|
|
1109
|
+
GetEvents: () => GetEvents,
|
|
1110
|
+
GetNodes: () => GetNodes,
|
|
1111
|
+
GetRandomEvent: () => GetRandomEvent,
|
|
1105
1112
|
Manager: () => Manager,
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
manualEvent: () => manualEvent,
|
|
1114
|
-
query: () => query,
|
|
1115
|
-
setEasTone: () => setEasTone,
|
|
1116
|
-
setNode: () => setNode,
|
|
1117
|
-
setSettings: () => setSettings,
|
|
1118
|
-
startService: () => startService,
|
|
1119
|
-
stopService: () => stopService
|
|
1113
|
+
ManualEvent: () => ManualEvent,
|
|
1114
|
+
QueryStanza: () => QueryStanza,
|
|
1115
|
+
SetNode: () => SetNode,
|
|
1116
|
+
SetSettings: () => SetSettings,
|
|
1117
|
+
StartService: () => StartService,
|
|
1118
|
+
StopService: () => StopService,
|
|
1119
|
+
default: () => index_default
|
|
1120
1120
|
});
|
|
1121
1121
|
module.exports = __toCommonJS(index_exports);
|
|
1122
1122
|
|
|
@@ -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.61`,
|
|
1128
1128
|
isReady: true,
|
|
1129
1129
|
ratelimits: {},
|
|
1130
1130
|
session_xmpp: null,
|
|
@@ -1191,22 +1191,26 @@ var bootstrap = {
|
|
|
1191
1191
|
NotifyServer: {
|
|
1192
1192
|
Enabled: false,
|
|
1193
1193
|
Server: `https://ntfy.sh`,
|
|
1194
|
-
|
|
1194
|
+
Timezone: "UTC",
|
|
1195
|
+
MediaStorage: {
|
|
1196
|
+
EAS: null,
|
|
1197
|
+
TEXT: null,
|
|
1198
|
+
JSON: null
|
|
1199
|
+
},
|
|
1195
1200
|
Credentials: {
|
|
1196
1201
|
Username: null,
|
|
1197
1202
|
Password: null
|
|
1198
1203
|
}
|
|
1199
1204
|
},
|
|
1200
|
-
|
|
1205
|
+
ActionSettings: [],
|
|
1201
1206
|
GlobalSettings: {
|
|
1202
1207
|
EventManagement: true,
|
|
1203
|
-
BetterEventNames: true,
|
|
1204
1208
|
DisableGeometryParsing: false,
|
|
1205
1209
|
UseShapefileCoordinates: true,
|
|
1206
1210
|
SPCWatchesOnly: true,
|
|
1207
1211
|
ShapefileSkipPoints: 15,
|
|
1208
1212
|
NodeTTL: 60,
|
|
1209
|
-
|
|
1213
|
+
NodeMaxDistance: 120,
|
|
1210
1214
|
EventFiltering: {
|
|
1211
1215
|
ListeningEvents: [],
|
|
1212
1216
|
ListeningICAO: [],
|
|
@@ -1219,7 +1223,7 @@ var bootstrap = {
|
|
|
1219
1223
|
},
|
|
1220
1224
|
ArchiveSettings: {
|
|
1221
1225
|
TTL: 60,
|
|
1222
|
-
|
|
1226
|
+
JSONDirectory: null,
|
|
1223
1227
|
TextDirectory: null,
|
|
1224
1228
|
EasDirectory: null,
|
|
1225
1229
|
EasToneout: null
|
|
@@ -1228,8 +1232,8 @@ var bootstrap = {
|
|
|
1228
1232
|
}
|
|
1229
1233
|
};
|
|
1230
1234
|
|
|
1231
|
-
// src/@modules/@utilities/
|
|
1232
|
-
var
|
|
1235
|
+
// src/@modules/@utilities/SetSettings.ts
|
|
1236
|
+
var SetSettings = (newSettings) => {
|
|
1233
1237
|
const settings = bootstrap.settings;
|
|
1234
1238
|
const merge = (target, source) => {
|
|
1235
1239
|
for (const key in source) {
|
|
@@ -1250,12 +1254,12 @@ var setSettings = (newSettings) => {
|
|
|
1250
1254
|
return settings;
|
|
1251
1255
|
};
|
|
1252
1256
|
|
|
1253
|
-
// src/@modules/@utilities/
|
|
1254
|
-
var
|
|
1257
|
+
// src/@modules/@utilities/GetSettings.ts
|
|
1258
|
+
var GetSettings = () => {
|
|
1255
1259
|
return bootstrap.settings;
|
|
1256
1260
|
};
|
|
1257
1261
|
|
|
1258
|
-
// src/@parsers/@ugc/
|
|
1262
|
+
// src/@parsers/@ugc/GetZonePolygon.ts
|
|
1259
1263
|
var import_polygon_clipping = require("polygon-clipping");
|
|
1260
1264
|
var getZonePolygon = (options) => {
|
|
1261
1265
|
var _a, _b;
|
|
@@ -1333,18 +1337,18 @@ var getZonePolygon = (options) => {
|
|
|
1333
1337
|
}
|
|
1334
1338
|
};
|
|
1335
1339
|
|
|
1336
|
-
// src/@building/
|
|
1337
|
-
var
|
|
1340
|
+
// src/@building/GetEventGeometry.ts
|
|
1341
|
+
var GetEventGeometry = (event) => {
|
|
1338
1342
|
var _a, _b, _c, _d, _e, _f;
|
|
1339
|
-
const settings =
|
|
1343
|
+
const settings = GetSettings();
|
|
1340
1344
|
const generated = (_c = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.geocode) == null ? void 0 : _b.polygon) != null ? _c : null;
|
|
1341
|
-
const
|
|
1345
|
+
const ugc = (_f = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.geocode) == null ? void 0 : _e.ugc) != null ? _f : null;
|
|
1342
1346
|
let geo = {
|
|
1343
1347
|
type: `Polygon`,
|
|
1344
1348
|
coordinates: generated != null ? JSON.parse(Buffer.from(generated, "base64").toString("utf-8")) : null
|
|
1345
1349
|
};
|
|
1346
|
-
if (settings.GlobalSettings.UseShapefileCoordinates && generated == null &&
|
|
1347
|
-
geo = getZonePolygon({ zones:
|
|
1350
|
+
if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc != null) {
|
|
1351
|
+
geo = getZonePolygon({ zones: ugc, isUnion: false });
|
|
1348
1352
|
if (geo == null) {
|
|
1349
1353
|
geo = {
|
|
1350
1354
|
type: `Polygon`,
|
|
@@ -1355,21 +1359,21 @@ var getEventGeometry = (event) => {
|
|
|
1355
1359
|
return geo;
|
|
1356
1360
|
};
|
|
1357
1361
|
|
|
1358
|
-
// src/@building/
|
|
1359
|
-
var
|
|
1362
|
+
// src/@building/GetCleanedEvent.ts
|
|
1363
|
+
var GetCleanedEvent = (event) => {
|
|
1360
1364
|
for (const key of Object.keys(event)) {
|
|
1361
1365
|
const value = event[key];
|
|
1362
1366
|
if (value === null || value === void 0) {
|
|
1363
1367
|
delete event[key];
|
|
1364
1368
|
} else if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
1365
|
-
event[key] =
|
|
1369
|
+
event[key] = GetCleanedEvent(value);
|
|
1366
1370
|
}
|
|
1367
1371
|
}
|
|
1368
1372
|
return event;
|
|
1369
1373
|
};
|
|
1370
1374
|
|
|
1371
|
-
// src/@modules/@utilities/
|
|
1372
|
-
var
|
|
1375
|
+
// src/@modules/@utilities/SetTimeoutAction.ts
|
|
1376
|
+
var SetTimeoutAction = (options) => {
|
|
1373
1377
|
var _a, _b, _c;
|
|
1374
1378
|
let target = (_b = (_a = bootstrap) == null ? void 0 : _a.ratelimits) == null ? void 0 : _b[options == null ? void 0 : options.identifier];
|
|
1375
1379
|
if (!target) {
|
|
@@ -1398,8 +1402,8 @@ var setTimeoutAction = (options) => {
|
|
|
1398
1402
|
return { limited: false };
|
|
1399
1403
|
};
|
|
1400
1404
|
|
|
1401
|
-
// src/@modules/@utilities/
|
|
1402
|
-
var
|
|
1405
|
+
// src/@modules/@utilities/SetWarning.ts
|
|
1406
|
+
var SetWarning = (options) => {
|
|
1403
1407
|
var _a, _b;
|
|
1404
1408
|
const settings = bootstrap.settings;
|
|
1405
1409
|
bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
|
|
@@ -1408,10 +1412,10 @@ var setWarning = (options) => {
|
|
|
1408
1412
|
}
|
|
1409
1413
|
};
|
|
1410
1414
|
|
|
1411
|
-
// src/@modules/@utilities/
|
|
1412
|
-
var
|
|
1415
|
+
// src/@modules/@utilities/SetEventEmit.ts
|
|
1416
|
+
var SetEventEmit = (options) => {
|
|
1413
1417
|
if (options.limited) {
|
|
1414
|
-
const isTimeout =
|
|
1418
|
+
const isTimeout = SetTimeoutAction({ identifier: `event.${options.event}`, addTime: true, max: 1, interval: 1 });
|
|
1415
1419
|
if (isTimeout.limited) return;
|
|
1416
1420
|
}
|
|
1417
1421
|
bootstrap.listener.emit(options.event, options.metadata);
|
|
@@ -1419,21 +1423,21 @@ var setEventEmit = (options) => {
|
|
|
1419
1423
|
bootstrap.listener.emit(`*`, { event: options.event, data: options.metadata });
|
|
1420
1424
|
}
|
|
1421
1425
|
if (options.message) {
|
|
1422
|
-
|
|
1426
|
+
SetWarning({ message: options.message });
|
|
1423
1427
|
}
|
|
1424
1428
|
};
|
|
1425
1429
|
|
|
1426
|
-
// src/@modules/@utilities/
|
|
1427
|
-
var
|
|
1430
|
+
// src/@modules/@utilities/SetListener.ts
|
|
1431
|
+
var SetListener = (options) => {
|
|
1428
1432
|
bootstrap.listener.on(options.event, options.callback);
|
|
1429
1433
|
return () => {
|
|
1430
1434
|
void bootstrap.listener.off(options.event, options.callback);
|
|
1431
1435
|
};
|
|
1432
1436
|
};
|
|
1433
1437
|
|
|
1434
|
-
// src/@core/
|
|
1435
|
-
var
|
|
1436
|
-
|
|
1438
|
+
// src/@core/CreateListener.ts
|
|
1439
|
+
var CreateListener = (event, callback) => {
|
|
1440
|
+
SetListener({ event, callback });
|
|
1437
1441
|
};
|
|
1438
1442
|
|
|
1439
1443
|
// node_modules/@xmpp/xml/index.js
|
|
@@ -1822,20 +1826,20 @@ var jid_default = j;
|
|
|
1822
1826
|
|
|
1823
1827
|
// node_modules/@xmpp/error/index.js
|
|
1824
1828
|
var XMPPError = class extends Error {
|
|
1825
|
-
constructor(condition,
|
|
1826
|
-
super(condition + (
|
|
1829
|
+
constructor(condition, text, application) {
|
|
1830
|
+
super(condition + (text ? ` - ${text}` : ""));
|
|
1827
1831
|
this.name = "XMPPError";
|
|
1828
1832
|
this.condition = condition;
|
|
1829
|
-
this.text =
|
|
1833
|
+
this.text = text;
|
|
1830
1834
|
this.application = application;
|
|
1831
1835
|
}
|
|
1832
1836
|
static fromElement(element) {
|
|
1833
1837
|
const [condition, second, third] = element.getChildElements();
|
|
1834
|
-
let
|
|
1838
|
+
let text;
|
|
1835
1839
|
let application;
|
|
1836
1840
|
if (second) {
|
|
1837
1841
|
if (second.is("text")) {
|
|
1838
|
-
|
|
1842
|
+
text = second;
|
|
1839
1843
|
} else if (second) {
|
|
1840
1844
|
application = second;
|
|
1841
1845
|
}
|
|
@@ -1843,7 +1847,7 @@ var XMPPError = class extends Error {
|
|
|
1843
1847
|
}
|
|
1844
1848
|
const error = new this(
|
|
1845
1849
|
condition.name,
|
|
1846
|
-
|
|
1850
|
+
text ? text.text() : "",
|
|
1847
1851
|
application
|
|
1848
1852
|
);
|
|
1849
1853
|
error.element = element;
|
|
@@ -2761,8 +2765,8 @@ function id() {
|
|
|
2761
2765
|
|
|
2762
2766
|
// node_modules/@xmpp/middleware/lib/StanzaError.js
|
|
2763
2767
|
var StanzaError = class extends error_default {
|
|
2764
|
-
constructor(condition,
|
|
2765
|
-
super(condition,
|
|
2768
|
+
constructor(condition, text, application, type) {
|
|
2769
|
+
super(condition, text, application);
|
|
2766
2770
|
this.type = type;
|
|
2767
2771
|
this.name = "StanzaError";
|
|
2768
2772
|
}
|
|
@@ -4191,8 +4195,8 @@ function setupIfAvailable(module2, ...args) {
|
|
|
4191
4195
|
return module2(...args);
|
|
4192
4196
|
}
|
|
4193
4197
|
|
|
4194
|
-
// src/@modules/@xmpp/
|
|
4195
|
-
var
|
|
4198
|
+
// src/@modules/@xmpp/OnlineXMPP.ts
|
|
4199
|
+
var OnlineXMPP = () => {
|
|
4196
4200
|
const settings = bootstrap.settings;
|
|
4197
4201
|
bootstrap.session_xmpp.on(`online`, (address) => __async(null, null, function* () {
|
|
4198
4202
|
bootstrap.cache.sigHault = false;
|
|
@@ -4203,7 +4207,7 @@ var xOnline = () => {
|
|
|
4203
4207
|
to: `nwws@conference.nwws-oi.weather.gov/${nickname}`,
|
|
4204
4208
|
xmlns: "http://jabber.org/protocol/muc"
|
|
4205
4209
|
}));
|
|
4206
|
-
|
|
4210
|
+
SetEventEmit({
|
|
4207
4211
|
event: `onServiceStatus`,
|
|
4208
4212
|
metadata: {
|
|
4209
4213
|
message: `Succesfully connected to NOAA Weather Wire Service as "${nickname}"`,
|
|
@@ -4216,12 +4220,12 @@ var xOnline = () => {
|
|
|
4216
4220
|
}));
|
|
4217
4221
|
};
|
|
4218
4222
|
|
|
4219
|
-
// src/@modules/@xmpp/
|
|
4220
|
-
var
|
|
4223
|
+
// src/@modules/@xmpp/OfflineXMPP.ts
|
|
4224
|
+
var OfflineXMPP = () => {
|
|
4221
4225
|
bootstrap.session_xmpp.on(`offline`, () => __async(null, null, function* () {
|
|
4222
4226
|
bootstrap.cache.isConnected = false;
|
|
4223
4227
|
bootstrap.cache.sigHault = true;
|
|
4224
|
-
|
|
4228
|
+
SetEventEmit({
|
|
4225
4229
|
event: `onServiceStatus`,
|
|
4226
4230
|
metadata: {
|
|
4227
4231
|
message: `Client has gone offline`,
|
|
@@ -4233,16 +4237,16 @@ var xOffline = () => {
|
|
|
4233
4237
|
}));
|
|
4234
4238
|
};
|
|
4235
4239
|
|
|
4236
|
-
// src/@modules/@xmpp/
|
|
4237
|
-
var
|
|
4240
|
+
// src/@modules/@xmpp/ErrorXMPP.ts
|
|
4241
|
+
var ErrorXMPP = () => {
|
|
4238
4242
|
bootstrap.session_xmpp.on(`error`, (error) => __async(null, null, function* () {
|
|
4239
4243
|
bootstrap.cache.isConnected = false;
|
|
4240
4244
|
bootstrap.cache.sigHault = true;
|
|
4241
4245
|
}));
|
|
4242
4246
|
};
|
|
4243
4247
|
|
|
4244
|
-
// src/@
|
|
4245
|
-
var
|
|
4248
|
+
// src/@enums/Expressions.ts
|
|
4249
|
+
var EnumExpressions = {
|
|
4246
4250
|
location: new RegExp(/^([A-Za-z.\-' ]+),\s*([A-Z]{2})$/),
|
|
4247
4251
|
pvtec: new RegExp(`[OTEX].(NEW|CON|EXT|EXA|EXB|UPG|CAN|EXP|COR|ROU).[A-Z]{4}.[A-Z]{2}.[WAYSFON].[0-9]{4}.[0-9]{6}T[0-9]{4}Z-[0-9]{6}T[0-9]{4}Z`, "g"),
|
|
4248
4252
|
hvtec: new RegExp(`[a-zA-Z0-9]{4}.[A-Z0-9].[A-Z]{2}.[0-9]{6}T[0-9]{4}Z.[0-9]{6}T[0-9]{4}Z.[0-9]{6}T[0-9]{4}Z.[A-Z]{2}`, "imu"),
|
|
@@ -4253,372 +4257,375 @@ var dict_expressions = {
|
|
|
4253
4257
|
dateline: new RegExp(`\\d{3,4}\\s*(AM|PM)?\\s*[A-Z]{2,4}\\s+[A-Z]{3,}\\s+[A-Z]{3,}\\s+\\d{1,2}\\s+\\d{4}`, "gim")
|
|
4254
4258
|
};
|
|
4255
4259
|
|
|
4256
|
-
// src/@
|
|
4257
|
-
var
|
|
4258
|
-
ABV: `
|
|
4259
|
-
ADA: `
|
|
4260
|
-
ADM: `
|
|
4261
|
-
ADR: `
|
|
4262
|
-
ADV: `
|
|
4263
|
-
AFD: `
|
|
4264
|
-
AFM: `
|
|
4265
|
-
AFP: `
|
|
4266
|
-
AFW: `
|
|
4267
|
-
AGF: `
|
|
4268
|
-
AGO: `
|
|
4269
|
-
ALT: `
|
|
4270
|
-
AQA: `
|
|
4271
|
-
AQI: `
|
|
4272
|
-
ASA: `
|
|
4273
|
-
AVA: `
|
|
4274
|
-
AVG: `
|
|
4275
|
-
AVW: `
|
|
4276
|
-
AWO: `
|
|
4277
|
-
AWS: `
|
|
4278
|
-
AWU: `
|
|
4279
|
-
AWW: `
|
|
4280
|
-
BLU: `
|
|
4281
|
-
BOY: `
|
|
4282
|
-
BRG: `
|
|
4283
|
-
BRT: `
|
|
4284
|
-
CAE: `
|
|
4285
|
-
CCF: `
|
|
4286
|
-
CDW: `
|
|
4287
|
-
CEM: `
|
|
4288
|
-
CF6: `
|
|
4289
|
-
CFP: `
|
|
4290
|
-
CFW: `
|
|
4291
|
-
CGR: `
|
|
4292
|
-
CHG: `
|
|
4293
|
-
CLA: `
|
|
4294
|
-
CLI: `
|
|
4295
|
-
CLM: `
|
|
4296
|
-
CLQ: `
|
|
4297
|
-
CLS: `
|
|
4298
|
-
CLT: `
|
|
4299
|
-
CMM: `
|
|
4300
|
-
COD: `
|
|
4301
|
-
CPF: `
|
|
4302
|
-
CUR: `
|
|
4303
|
-
CWA: `
|
|
4304
|
-
CWF: `
|
|
4305
|
-
CWS: `
|
|
4306
|
-
DAY: `
|
|
4307
|
-
DDO: `
|
|
4308
|
-
DGT: `
|
|
4309
|
-
DMO: `
|
|
4310
|
-
DSA: `
|
|
4311
|
-
DSM: `
|
|
4312
|
-
DSW: `
|
|
4313
|
-
EFP: `
|
|
4314
|
-
EOL: `
|
|
4315
|
-
EQI: `
|
|
4316
|
-
EQR: `
|
|
4317
|
-
EQW: `
|
|
4318
|
-
ESF: `
|
|
4319
|
-
ESG: `
|
|
4320
|
-
ESP: `
|
|
4321
|
-
ESS: `
|
|
4322
|
-
EVI: `
|
|
4323
|
-
EWW: `
|
|
4324
|
-
FA0: `
|
|
4325
|
-
FA1: `
|
|
4326
|
-
FA2: `
|
|
4327
|
-
FA3: `
|
|
4328
|
-
FA4: `
|
|
4329
|
-
FA5: `
|
|
4330
|
-
FA6: `
|
|
4331
|
-
FA7: `
|
|
4332
|
-
FA8: `
|
|
4333
|
-
FA9: `
|
|
4334
|
-
FD0: `
|
|
4335
|
-
FD1: `
|
|
4336
|
-
FD2: `
|
|
4337
|
-
FD3: `
|
|
4338
|
-
FD4: `
|
|
4339
|
-
FD5: `
|
|
4340
|
-
FD6: `
|
|
4341
|
-
FD7: `
|
|
4342
|
-
FD8: `
|
|
4343
|
-
FD9: `
|
|
4344
|
-
FDI: `
|
|
4345
|
-
FFA: `
|
|
4346
|
-
FFG: `
|
|
4347
|
-
FFH: `
|
|
4348
|
-
FFS: `
|
|
4349
|
-
FFW: `
|
|
4350
|
-
FLN: `
|
|
4351
|
-
FLS: `
|
|
4352
|
-
FLW: `
|
|
4353
|
-
FOF: `
|
|
4354
|
-
FRW: `
|
|
4355
|
-
FSH: `
|
|
4356
|
-
FTM: `
|
|
4357
|
-
FTP: `
|
|
4358
|
-
FWA: `
|
|
4359
|
-
FWD: `
|
|
4360
|
-
FWF: `
|
|
4361
|
-
FWL: `
|
|
4362
|
-
FWM: `
|
|
4363
|
-
FWN: `
|
|
4364
|
-
FWO: `
|
|
4365
|
-
FWS: `
|
|
4366
|
-
FZL: `
|
|
4367
|
-
GLF: `
|
|
4368
|
-
GLS: `
|
|
4369
|
-
GRE: `
|
|
4370
|
-
HD1: `
|
|
4371
|
-
HD2: `
|
|
4372
|
-
HD3: `
|
|
4373
|
-
HD4: `
|
|
4374
|
-
HD7: `
|
|
4375
|
-
HD8: `
|
|
4376
|
-
HD9: `
|
|
4377
|
-
HLS: `
|
|
4378
|
-
HMD: `
|
|
4379
|
-
HML: `
|
|
4380
|
-
HMW: `
|
|
4381
|
-
HP1: `
|
|
4382
|
-
HP2: `
|
|
4383
|
-
HP3: `
|
|
4384
|
-
HP4: `
|
|
4385
|
-
HP5: `
|
|
4386
|
-
HP6: `
|
|
4387
|
-
HP7: `
|
|
4388
|
-
HP8: `
|
|
4389
|
-
HRR: `
|
|
4390
|
-
HSF: `
|
|
4391
|
-
HWO: `
|
|
4392
|
-
HWR: `
|
|
4393
|
-
HYD: `
|
|
4394
|
-
HYM: `
|
|
4395
|
-
ICE: `
|
|
4396
|
-
IDM: `
|
|
4397
|
-
INI: `
|
|
4398
|
-
IOB: `
|
|
4399
|
-
KPA: `
|
|
4400
|
-
LAE: `
|
|
4401
|
-
LCD: `
|
|
4402
|
-
LCO: `
|
|
4403
|
-
LEW: `
|
|
4404
|
-
LFP: `
|
|
4405
|
-
LKE: `
|
|
4406
|
-
LLS: `
|
|
4407
|
-
LOW: `
|
|
4408
|
-
LSR: `
|
|
4409
|
-
LTG: `
|
|
4410
|
-
MAN: `
|
|
4411
|
-
MAP: `
|
|
4412
|
-
MAW: `
|
|
4413
|
-
MFM: `
|
|
4414
|
-
MIM: `
|
|
4415
|
-
MIS: `
|
|
4416
|
-
MOB: `
|
|
4417
|
-
MON: `
|
|
4418
|
-
MRP: `
|
|
4419
|
-
MSM: `
|
|
4420
|
-
MTR: `
|
|
4421
|
-
MTT: `
|
|
4422
|
-
MVF: `
|
|
4423
|
-
MWS: `
|
|
4424
|
-
MWW: `
|
|
4425
|
-
NOU: `
|
|
4426
|
-
NOW: `
|
|
4427
|
-
NOX: `
|
|
4428
|
-
NPW: `
|
|
4429
|
-
NSH: `
|
|
4430
|
-
NUW: `
|
|
4431
|
-
NWR: `
|
|
4432
|
-
OAV: `
|
|
4433
|
-
OBS: `
|
|
4434
|
-
OFA: `
|
|
4435
|
-
OFF: `
|
|
4436
|
-
OMR: `
|
|
4437
|
-
OPU: `
|
|
4438
|
-
OSO: `
|
|
4439
|
-
OSW: `
|
|
4440
|
-
OUA: `
|
|
4441
|
-
OZF: `
|
|
4442
|
-
PFM: `
|
|
4443
|
-
PFW: `
|
|
4444
|
-
PLS: `
|
|
4445
|
-
PMD: `
|
|
4446
|
-
PNS: `
|
|
4447
|
-
POE: `
|
|
4448
|
-
PRB: `
|
|
4449
|
-
PRC: `
|
|
4450
|
-
PRE: `
|
|
4451
|
-
PSH: `
|
|
4452
|
-
PTS: `
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4260
|
+
// src/@enums/AWIPS.ts
|
|
4261
|
+
var EnumAWIPS = {
|
|
4262
|
+
ABV: `Rawinsonde Data Above 100 Millibars`,
|
|
4263
|
+
ADA: `Alarm Alert Administrative Message`,
|
|
4264
|
+
ADM: `Alert Administrative Message`,
|
|
4265
|
+
ADR: `NWS Administrative Message`,
|
|
4266
|
+
ADV: `Space Environment Advisory`,
|
|
4267
|
+
AFD: `Area Forecast Discussion`,
|
|
4268
|
+
AFM: `Area Forecast Matrices`,
|
|
4269
|
+
AFP: `Area Forecast Product`,
|
|
4270
|
+
AFW: `Fire Weather Matrix`,
|
|
4271
|
+
AGF: `Agricultural Forecast`,
|
|
4272
|
+
AGO: `Agricultural Observations`,
|
|
4273
|
+
ALT: `Space Environment Alert`,
|
|
4274
|
+
AQA: `Air Quality Alert`,
|
|
4275
|
+
AQI: `Air Quality Index Statement`,
|
|
4276
|
+
ASA: `Air Stagnation Advisory`,
|
|
4277
|
+
AVA: `Avalanche Watch`,
|
|
4278
|
+
AVG: `Avalanche Weather Guidance`,
|
|
4279
|
+
AVW: `Avalanche Warning`,
|
|
4280
|
+
AWO: `Area Weather Outlook`,
|
|
4281
|
+
AWS: `Area Weather Summary`,
|
|
4282
|
+
AWU: `Area Weather Update`,
|
|
4283
|
+
AWW: `Airport Weather Warning`,
|
|
4284
|
+
BLU: `Blue Alert`,
|
|
4285
|
+
BOY: `Buoy Report`,
|
|
4286
|
+
BRG: `Coast Guard Observations`,
|
|
4287
|
+
BRT: `Hourly Roundup for Weather Radio`,
|
|
4288
|
+
CAE: `Child Abduction Emergency`,
|
|
4289
|
+
CCF: `Coded City Forecast`,
|
|
4290
|
+
CDW: `Civil Danger Warning`,
|
|
4291
|
+
CEM: `Civil Emergency Message`,
|
|
4292
|
+
CF6: `Monthly Daily Climate Data`,
|
|
4293
|
+
CFP: `Convective Forecast Product`,
|
|
4294
|
+
CFW: `Coastal Flood Warnings, Watches, and Statements`,
|
|
4295
|
+
CGR: `Coast Guard Surface Report`,
|
|
4296
|
+
CHG: `Computer Hurricane Guidance`,
|
|
4297
|
+
CLA: `Climatological Report Annual`,
|
|
4298
|
+
CLI: `Climatological Report Daily`,
|
|
4299
|
+
CLM: `Climatological Report Monthly`,
|
|
4300
|
+
CLQ: `Climatological Report Quarterly`,
|
|
4301
|
+
CLS: `Climatological Report Seasonal`,
|
|
4302
|
+
CLT: `Climate Report`,
|
|
4303
|
+
CMM: `Coded Climatological Monthly Means`,
|
|
4304
|
+
COD: `Coded Analysis and Forecasts`,
|
|
4305
|
+
CPF: `Great Lakes Port Forecast`,
|
|
4306
|
+
CUR: `Space Environment Products Routine`,
|
|
4307
|
+
CWA: `Center Weather Advisory`,
|
|
4308
|
+
CWF: `Coastal Waters Forecast`,
|
|
4309
|
+
CWS: `Center Weather Statement`,
|
|
4310
|
+
DAY: `Space Environment Product Daily`,
|
|
4311
|
+
DDO: `Daily Dispersion Outlook`,
|
|
4312
|
+
DGT: `Drought Information Statement`,
|
|
4313
|
+
DMO: `Practice Demo Warning`,
|
|
4314
|
+
DSA: `Unnumbered Depression Advisory`,
|
|
4315
|
+
DSM: `ASOS Daily Summary`,
|
|
4316
|
+
DSW: `Dust Storm Warning`,
|
|
4317
|
+
EFP: `Extended Forecast (3 to 5 Day)`,
|
|
4318
|
+
EOL: `Six to Ten Day Weather Outlook (Local)`,
|
|
4319
|
+
EQI: `Tsunami Bulletin`,
|
|
4320
|
+
EQR: `Earthquake Report`,
|
|
4321
|
+
EQW: `Earthquake Warning`,
|
|
4322
|
+
ESF: `Flood Potential Outlook`,
|
|
4323
|
+
ESG: `Extended Streamflow Guidance`,
|
|
4324
|
+
ESP: `Extended Streamflow Prediction`,
|
|
4325
|
+
ESS: `Water Supply Outlook`,
|
|
4326
|
+
EVI: `Evacuation Immediate`,
|
|
4327
|
+
EWW: `Extreme Wind Warning`,
|
|
4328
|
+
FA0: `Aviation Area Forecast (Pacific)`,
|
|
4329
|
+
FA1: `Aviation Area Forecast (Northeast)`,
|
|
4330
|
+
FA2: `Aviation Area Forecast (Southeast)`,
|
|
4331
|
+
FA3: `Aviation Area Forecast (North Central)`,
|
|
4332
|
+
FA4: `Aviation Area Forecast (South Central)`,
|
|
4333
|
+
FA5: `Aviation Area Forecast (Rocky Mountains)`,
|
|
4334
|
+
FA6: `Aviation Area Forecast (West Coast)`,
|
|
4335
|
+
FA7: `Aviation Area Forecast (Juneau, AK)`,
|
|
4336
|
+
FA8: `Aviation Area Forecast (Anchorage, AK)`,
|
|
4337
|
+
FA9: `Aviation Area Forecast (Fairbanks, AK)`,
|
|
4338
|
+
FD0: `Winds Aloft Forecast (24-Hour High Altitude)`,
|
|
4339
|
+
FD1: `Winds Aloft Forecast (6-Hour)`,
|
|
4340
|
+
FD2: `Winds Aloft Forecast (12-Hour)`,
|
|
4341
|
+
FD3: `Winds Aloft Forecast (24-Hour)`,
|
|
4342
|
+
FD4: `Winds Aloft Forecast`,
|
|
4343
|
+
FD5: `Winds Aloft Forecast`,
|
|
4344
|
+
FD6: `Winds Aloft Forecast`,
|
|
4345
|
+
FD7: `Winds Aloft Forecast`,
|
|
4346
|
+
FD8: `Winds Aloft Forecast (6-Hour High Altitude)`,
|
|
4347
|
+
FD9: `Winds Aloft Forecast (12-Hour High Altitude)`,
|
|
4348
|
+
FDI: `Fire Danger Indices`,
|
|
4349
|
+
FFA: `Flash Flood Watch`,
|
|
4350
|
+
FFG: `Flash Flood Guidance`,
|
|
4351
|
+
FFH: `Headwater Guidance`,
|
|
4352
|
+
FFS: `Flash Flood Statement`,
|
|
4353
|
+
FFW: `Flash Flood Warning`,
|
|
4354
|
+
FLN: `National Flood Summary`,
|
|
4355
|
+
FLS: `Flood Statement`,
|
|
4356
|
+
FLW: `Flood Warning`,
|
|
4357
|
+
FOF: `Upper Wind Fallout Forecast`,
|
|
4358
|
+
FRW: `Fire Warning`,
|
|
4359
|
+
FSH: `Marine Fisheries Service Message`,
|
|
4360
|
+
FTM: `Radar Outage Notification`,
|
|
4361
|
+
FTP: `Temp POP Guidance`,
|
|
4362
|
+
FWA: `Fire Weather Administrative Message`,
|
|
4363
|
+
FWD: `Fire Weather Outlook Discussion`,
|
|
4364
|
+
FWF: `Fire Weather Forecast`,
|
|
4365
|
+
FWL: `Land Management Forecast`,
|
|
4366
|
+
FWM: `Miscellaneous Fire Weather Product`,
|
|
4367
|
+
FWN: `Fire Weather Notification`,
|
|
4368
|
+
FWO: `Fire Weather Observation`,
|
|
4369
|
+
FWS: `Fire Weather Spot Forecast`,
|
|
4370
|
+
FZL: `Freezing Level Data`,
|
|
4371
|
+
GLF: `Great Lakes Forecast`,
|
|
4372
|
+
GLS: `Great Lakes Storm Summary`,
|
|
4373
|
+
GRE: `Green`,
|
|
4374
|
+
HD1: `RFC QPF Data Product`,
|
|
4375
|
+
HD2: `RFC QPF Data Product`,
|
|
4376
|
+
HD3: `RFC QPF Data Product`,
|
|
4377
|
+
HD4: `RFC QPF Data Product`,
|
|
4378
|
+
HD7: `RFC QPF Data Product`,
|
|
4379
|
+
HD8: `RFC QPF Data Product`,
|
|
4380
|
+
HD9: `RFC QPF Data Product`,
|
|
4381
|
+
HLS: `Hurricane Local Statement`,
|
|
4382
|
+
HMD: `Hydrometeorological Discussion`,
|
|
4383
|
+
HML: `AHPS XML Product`,
|
|
4384
|
+
HMW: `Hazardous Materials Warning`,
|
|
4385
|
+
HP1: `RFC QPF Verification Product`,
|
|
4386
|
+
HP2: `RFC QPF Verification Product`,
|
|
4387
|
+
HP3: `RFC QPF Verification Product`,
|
|
4388
|
+
HP4: `RFC QPF Verification Product`,
|
|
4389
|
+
HP5: `RFC QPF Verification Product`,
|
|
4390
|
+
HP6: `RFC QPF Verification Product`,
|
|
4391
|
+
HP7: `RFC QPF Verification Product`,
|
|
4392
|
+
HP8: `RFC QPF Verification Product`,
|
|
4393
|
+
HRR: `Weather Roundup`,
|
|
4394
|
+
HSF: `High Seas Forecast`,
|
|
4395
|
+
HWO: `Hazardous Weather Outlook`,
|
|
4396
|
+
HWR: `Hourly Weather Roundup`,
|
|
4397
|
+
HYD: `Daily Hydrometeorological Products`,
|
|
4398
|
+
HYM: `Monthly Hydrometeorological Product`,
|
|
4399
|
+
ICE: `Ice Forecast`,
|
|
4400
|
+
IDM: `Ice Drift Vectors`,
|
|
4401
|
+
INI: `Administrative Message`,
|
|
4402
|
+
IOB: `Ice Observation`,
|
|
4403
|
+
KPA: `Keep Alive Message`,
|
|
4404
|
+
LAE: `Local Area Emergency`,
|
|
4405
|
+
LCD: `Preliminary Local Climatological Data`,
|
|
4406
|
+
LCO: `Local Cooperative Observation`,
|
|
4407
|
+
LEW: `Law Enforcement Warning`,
|
|
4408
|
+
LFP: `Local Forecast`,
|
|
4409
|
+
LKE: `Lake Stages`,
|
|
4410
|
+
LLS: `Low Level Sounding`,
|
|
4411
|
+
LOW: `Low Temperatures`,
|
|
4412
|
+
LSR: `Local Storm Report`,
|
|
4413
|
+
LTG: `Lightning Data`,
|
|
4414
|
+
MAN: `Rawinsonde Mandatory Levels`,
|
|
4415
|
+
MAP: `Mean Areal Precipitation`,
|
|
4416
|
+
MAW: `Amended Marine Forecast`,
|
|
4417
|
+
MFM: `Marine Forecast Matrix`,
|
|
4418
|
+
MIM: `Marine Interpretation Message`,
|
|
4419
|
+
MIS: `Miscellaneous Local Product`,
|
|
4420
|
+
MOB: `Marine Observations`,
|
|
4421
|
+
MON: `Space Environment Product Monthly`,
|
|
4422
|
+
MRP: `Marine Product Techniques Development`,
|
|
4423
|
+
MSM: `ASOS Monthly Summary Message`,
|
|
4424
|
+
MTR: `METAR Observation`,
|
|
4425
|
+
MTT: `METAR Test Message`,
|
|
4426
|
+
MVF: `Marine Verification Coded Message`,
|
|
4427
|
+
MWS: `Marine Weather Statement`,
|
|
4428
|
+
MWW: `Marine Weather Message`,
|
|
4429
|
+
NOU: `Weather Reconnaissance Flights`,
|
|
4430
|
+
NOW: `Short-Term Forecast`,
|
|
4431
|
+
NOX: `Data Management Message`,
|
|
4432
|
+
NPW: `Non-Precipitation Warning`,
|
|
4433
|
+
NSH: `Nearshore Marine Forecast`,
|
|
4434
|
+
NUW: `Nuclear Power Plant Warning`,
|
|
4435
|
+
NWR: `NOAA Weather Radio Forecast`,
|
|
4436
|
+
OAV: `Other Aviation Products`,
|
|
4437
|
+
OBS: `Observations`,
|
|
4438
|
+
OFA: `Offshore Aviation Forecast`,
|
|
4439
|
+
OFF: `Offshore Forecast`,
|
|
4440
|
+
OMR: `Other Marine Products`,
|
|
4441
|
+
OPU: `Other Public Products`,
|
|
4442
|
+
OSO: `Other Surface Observations`,
|
|
4443
|
+
OSW: `Ocean Surface Winds`,
|
|
4444
|
+
OUA: `Other Upper Air Data`,
|
|
4445
|
+
OZF: `Zone Forecast`,
|
|
4446
|
+
PFM: `Point Forecast Matrices`,
|
|
4447
|
+
PFW: `Fire Weather Point Forecast Matrices`,
|
|
4448
|
+
PLS: `Plain Language Ship Report`,
|
|
4449
|
+
PMD: `Prognostic Meteorological Discussion`,
|
|
4450
|
+
PNS: `Public Information Statement`,
|
|
4451
|
+
POE: `Probability of Exceedance`,
|
|
4452
|
+
PRB: `Heat Index Forecast Tables`,
|
|
4453
|
+
PRC: `Pilot Report Collective`,
|
|
4454
|
+
PRE: `Preliminary Forecasts`,
|
|
4455
|
+
PSH: `Post-Storm Hurricane Report`,
|
|
4456
|
+
PTS: `Probabilistic Outlook Points`,
|
|
4457
|
+
AAG: `Aviation Area Forecast`,
|
|
4458
|
+
PWO: `Public Severe Weather Outlook`,
|
|
4459
|
+
PWS: `Tropical Cyclone Probabilities`,
|
|
4460
|
+
QPF: `Quantitative Precipitation Forecast`,
|
|
4461
|
+
QPS: `Quantitative Precipitation Statement`,
|
|
4462
|
+
RDF: `Revised Digital Forecast`,
|
|
4463
|
+
REC: `Recreational Report`,
|
|
4464
|
+
RER: `Record Report`,
|
|
4465
|
+
RET: `EAS Activation Request`,
|
|
4466
|
+
RFD: `Rangeland Fire Danger Forecast`,
|
|
4467
|
+
RFI: `RFI Observation`,
|
|
4468
|
+
RFR: `Route Forecast`,
|
|
4469
|
+
RFW: `Red Flag Warning`,
|
|
4470
|
+
RHW: `Radiological Hazard Warning`,
|
|
4471
|
+
RMT: `Required Monthly Test`,
|
|
4472
|
+
RNS: `Rain Information Statement`,
|
|
4473
|
+
RR1: `Hydro-Met Data Report Part 1`,
|
|
4474
|
+
RR2: `Hydro-Met Data Report Part 2`,
|
|
4475
|
+
RR3: `Hydro-Met Data Report Part 3`,
|
|
4476
|
+
RR4: `Hydro-Met Data Report Part 4`,
|
|
4477
|
+
RR5: `Hydro-Met Data Report Part 5`,
|
|
4478
|
+
RR6: `Hydro-Met Data Report Part 6`,
|
|
4479
|
+
RR7: `Hydro-Met Data Report Part 7`,
|
|
4480
|
+
RR8: `Hydro-Met Data Report Part 8`,
|
|
4481
|
+
RR9: `Hydro-Met Data Report Part 9`,
|
|
4482
|
+
RRA: `Automated Hydrologic Observation Report`,
|
|
4483
|
+
RRM: `Miscellaneous Hydrologic Data`,
|
|
4484
|
+
RRS: `HADS Data`,
|
|
4485
|
+
RRY: `ASOS Hourly Test Message`,
|
|
4486
|
+
RSD: `Daily SNOTEL Data`,
|
|
4487
|
+
RSM: `Monthly SNOTEL Data`,
|
|
4488
|
+
RTP: `Regional Temperature and Precipitation Table`,
|
|
4489
|
+
RVA: `River Summary`,
|
|
4490
|
+
RVD: `Daily River Forecast`,
|
|
4491
|
+
RVF: `River Forecast`,
|
|
4492
|
+
RVI: `River Ice Statement`,
|
|
4493
|
+
RVM: `Miscellaneous River Product`,
|
|
4494
|
+
RVR: `River Recreation Statement`,
|
|
4495
|
+
RVS: `River Statement`,
|
|
4496
|
+
RWR: `Regional Weather Roundup`,
|
|
4497
|
+
RWS: `Regional Weather Summary`,
|
|
4498
|
+
RWT: `Required Weekly Test`,
|
|
4499
|
+
SAB: `Special Avalanche Bulletin`,
|
|
4500
|
+
SAF: `Agricultural Weather Forecast`,
|
|
4501
|
+
SAG: `Snow Avalanche Guidance`,
|
|
4502
|
+
SAT: `APT Prediction`,
|
|
4503
|
+
SAW: `Preliminary Notice of Watch`,
|
|
4504
|
+
SCC: `Storm Summary`,
|
|
4505
|
+
SCD: `Supplementary Climatological Data`,
|
|
4506
|
+
SCN: `Soil Climate Analysis Network`,
|
|
4507
|
+
SCP: `Satellite Cloud Product`,
|
|
4508
|
+
SCS: `Selected Cities Summary`,
|
|
4509
|
+
SDO: `Supplementary Data Observation`,
|
|
4510
|
+
SDS: `Special Dispersion Statement`,
|
|
4511
|
+
SEL: `Severe Local Storm Watch`,
|
|
4512
|
+
SEV: `SPC Watch Point Information`,
|
|
4513
|
+
SFP: `State Forecast`,
|
|
4514
|
+
SFT: `Tabular State Forecast`,
|
|
4515
|
+
SGL: `Rawinsonde Significant Levels`,
|
|
4516
|
+
SHP: `Surface Ship Report`,
|
|
4517
|
+
SIG: `International SIGMET`,
|
|
4518
|
+
SIM: `Satellite Interpretation Message`,
|
|
4519
|
+
SLS: `Severe Local Storm Outline`,
|
|
4520
|
+
SMF: `Smoke Management Weather Forecast`,
|
|
4521
|
+
SMW: `Special Marine Warning`,
|
|
4522
|
+
SOO: `Science Operations Officer Product`,
|
|
4523
|
+
SPE: `Satellite Precipitation Estimates`,
|
|
4524
|
+
SPF: `Storm Strike Probability Bulletin`,
|
|
4525
|
+
SPS: `Special Weather Statement`,
|
|
4526
|
+
SPW: `Shelter in Place Warning`,
|
|
4527
|
+
SQW: `Snow Squall Warning`,
|
|
4528
|
+
SRD: `Surf Discussion`,
|
|
4529
|
+
SRF: `Surf Forecast`,
|
|
4530
|
+
SRG: `Soaring Guidance`,
|
|
4531
|
+
SSM: `Synoptic Surface Observation`,
|
|
4532
|
+
STA: `Weather Statistical Summary`,
|
|
4533
|
+
STD: `Satellite Tropical Disturbance Summary`,
|
|
4534
|
+
STO: `Road Condition Report`,
|
|
4535
|
+
STP: `State Temperature and Precipitation Table`,
|
|
4536
|
+
STQ: `Spot Forecast Request`,
|
|
4537
|
+
SUM: `Space Weather Message`,
|
|
4538
|
+
SVR: `Severe Thunderstorm Warning`,
|
|
4539
|
+
SVS: `Severe Weather Statement`,
|
|
4540
|
+
SWOMCD: `Mesoscale Discussion`,
|
|
4541
|
+
SWODY1: `Storm Prediction Center Day 1 Outlook`,
|
|
4542
|
+
SWODY2: `Storm Prediction Center Day 2 Outlook`,
|
|
4543
|
+
SWODY3: `Storm Prediction Center Day 3 Outlook`,
|
|
4544
|
+
SWOD48: `Storm Prediction Center Day 4 to 8 Outlook`,
|
|
4545
|
+
SWS: `State Weather Summary`,
|
|
4546
|
+
SYN: `Regional Weather Synopsis`,
|
|
4547
|
+
TAF: `Terminal Aerodrome Forecast`,
|
|
4548
|
+
TAP: `Terminal Alerting Products`,
|
|
4549
|
+
TAV: `Travelers Forecast Table`,
|
|
4550
|
+
TCA: `Tropical Cyclone Advisory`,
|
|
4551
|
+
TCD: `Tropical Cyclone Discussion`,
|
|
4552
|
+
TCE: `Tropical Cyclone Position Estimate`,
|
|
4553
|
+
TCM: `Tropical Cyclone Marine Aviation Advisory`,
|
|
4554
|
+
TCP: `Public Tropical Cyclone Advisory`,
|
|
4555
|
+
TCS: `Satellite Tropical Cyclone Summary`,
|
|
4556
|
+
TCU: `Tropical Cyclone Update`,
|
|
4557
|
+
TCV: `Tropical Cyclone Break Points`,
|
|
4558
|
+
TIB: `Tsunami Bulletin`,
|
|
4559
|
+
TID: `Tide Report`,
|
|
4560
|
+
TMA: `Tsunami Tide Seismic Acknowledgement`,
|
|
4561
|
+
TOE: `Telephone Outage Emergency`,
|
|
4562
|
+
TOR: `Tornado Warning`,
|
|
4563
|
+
TPT: `Temperature Precipitation Table`,
|
|
4564
|
+
TSU: `Tsunami Information Statement`,
|
|
4565
|
+
TUV: `Ultraviolet Index`,
|
|
4566
|
+
TVL: `Travelers Forecast`,
|
|
4567
|
+
TWB: `Transcribed Weather Broadcast`,
|
|
4568
|
+
TWD: `Tropical Weather Discussion`,
|
|
4569
|
+
TWO: `Tropical Weather Outlook`,
|
|
4570
|
+
TWS: `Tropical Weather Summary`,
|
|
4571
|
+
URN: `Aircraft Reconnaissance`,
|
|
4572
|
+
UVI: `Ultraviolet Index`,
|
|
4573
|
+
VAA: `Volcanic Activity Advisory`,
|
|
4574
|
+
VER: `Forecast Verification Statistics`,
|
|
4575
|
+
VFT: `TAF Verification Product`,
|
|
4576
|
+
VOW: `Volcano Warning`,
|
|
4577
|
+
WA0: `AIRMET Pacific`,
|
|
4578
|
+
WA1: `AIRMET Northeast`,
|
|
4579
|
+
WA2: `AIRMET Southeast`,
|
|
4580
|
+
WA3: `AIRMET North Central`,
|
|
4581
|
+
WA4: `AIRMET South Central`,
|
|
4582
|
+
WA5: `AIRMET Rocky Mountains`,
|
|
4583
|
+
WA6: `AIRMET West Coast`,
|
|
4584
|
+
WA7: `AIRMET Juneau, AK`,
|
|
4585
|
+
WA8: `AIRMET Anchorage, AK`,
|
|
4586
|
+
WA9: `AIRMET Fairbanks, AK`,
|
|
4587
|
+
WAR: `Space Environment Warning`,
|
|
4588
|
+
WAT: `Space Environment Watch`,
|
|
4589
|
+
WCN: `Weather Watch Clearance Notification`,
|
|
4590
|
+
WCR: `Weekly Weather and Crop Report`,
|
|
4591
|
+
WDA: `Weekly Data for Agriculture`,
|
|
4592
|
+
WDU: `Warning Decision Update`,
|
|
4593
|
+
WEK: `Space Environment Product Weekly`,
|
|
4594
|
+
WOU: `Watch Outline Update`,
|
|
4595
|
+
WS1: `SIGMET Northeast`,
|
|
4596
|
+
WS2: `SIGMET Southeast`,
|
|
4597
|
+
WS3: `SIGMET North Central`,
|
|
4598
|
+
WS4: `SIGMET South Central`,
|
|
4599
|
+
WS5: `SIGMET Rocky Mountains`,
|
|
4600
|
+
WS6: `SIGMET West Coast`,
|
|
4601
|
+
WST: `Tropical Cyclone SIGMET`,
|
|
4602
|
+
WSV: `Volcanic Activity SIGMET`,
|
|
4603
|
+
WSW: `Winter Weather Warning`,
|
|
4604
|
+
WWA: `Watch Status Report`,
|
|
4605
|
+
WWP: `Watch Probabilities`,
|
|
4606
|
+
ZFP: `Zone Forecast Product`
|
|
4601
4607
|
};
|
|
4602
4608
|
|
|
4603
|
-
// src/@modules/@stanza/
|
|
4604
|
-
var
|
|
4609
|
+
// src/@modules/@stanza/GetAwipsType.ts
|
|
4610
|
+
var GetAwipsType = (options) => {
|
|
4605
4611
|
const attributes = options.attributes;
|
|
4606
4612
|
if (!attributes.awipsid) {
|
|
4607
4613
|
return {
|
|
4608
4614
|
type: null,
|
|
4609
|
-
prefix: null
|
|
4615
|
+
prefix: null,
|
|
4616
|
+
discovered: false
|
|
4610
4617
|
};
|
|
4611
4618
|
}
|
|
4612
|
-
for (const [prefix, type] of Object.entries(
|
|
4619
|
+
for (const [prefix, type] of Object.entries(EnumAWIPS)) {
|
|
4613
4620
|
if (attributes.awipsid.startsWith(prefix)) {
|
|
4614
|
-
return { type, prefix };
|
|
4621
|
+
return { type, prefix, discovered: true };
|
|
4615
4622
|
}
|
|
4616
4623
|
}
|
|
4617
|
-
return { type:
|
|
4624
|
+
return { type: options.attributes.awipsid, prefix: options.attributes.awipsid, discovered: false };
|
|
4618
4625
|
};
|
|
4619
4626
|
|
|
4620
|
-
// src/@modules/@stanza/
|
|
4621
|
-
var
|
|
4627
|
+
// src/@modules/@stanza/ValidateStanza.ts
|
|
4628
|
+
var ValidateStanza = (options) => {
|
|
4622
4629
|
if (options.stanza.is(`message`)) {
|
|
4623
4630
|
const cb = options.stanza.getChild(`x`);
|
|
4624
4631
|
if (cb && cb.children) {
|
|
@@ -4627,9 +4634,9 @@ var validate = (options) => {
|
|
|
4627
4634
|
if (attributes.awipsid && attributes.awipsid.length > 1) {
|
|
4628
4635
|
const isCapEvent = message.includes(`<?xml`);
|
|
4629
4636
|
const isCapAreaDescription = message.includes(`<areaDesc>`);
|
|
4630
|
-
const isVTEC = message.match(
|
|
4631
|
-
const isUGC = message.match(
|
|
4632
|
-
const getType =
|
|
4637
|
+
const isVTEC = message.match(EnumExpressions.pvtec) != null;
|
|
4638
|
+
const isUGC = message.match(EnumExpressions.ugc1) != null;
|
|
4639
|
+
const getType = GetAwipsType({ attributes });
|
|
4633
4640
|
if (getType.type != null) {
|
|
4634
4641
|
return {
|
|
4635
4642
|
message,
|
|
@@ -4649,8 +4656,8 @@ var validate = (options) => {
|
|
|
4649
4656
|
return { isIgnored: true };
|
|
4650
4657
|
};
|
|
4651
4658
|
|
|
4652
|
-
// src/@
|
|
4653
|
-
var
|
|
4659
|
+
// src/@enums/Matches.ts
|
|
4660
|
+
var EnumMatches = {
|
|
4654
4661
|
SPS: [
|
|
4655
4662
|
{ match: /STRONG THUNDERSTORM/i, label: "Convective Special Weather Statement", statement: false },
|
|
4656
4663
|
{ match: /SPECIAL WEATHER STATEMENT/i, label: "Special Weather Statement", statement: false }
|
|
@@ -4686,15 +4693,20 @@ var dict_matches = {
|
|
|
4686
4693
|
]
|
|
4687
4694
|
};
|
|
4688
4695
|
|
|
4689
|
-
// src/@parsers/@text/
|
|
4690
|
-
var
|
|
4696
|
+
// src/@parsers/@text/GetDescriptionFromProduct.ts
|
|
4697
|
+
var GetDescriptionFromProduct = (options) => {
|
|
4691
4698
|
let message = options.message;
|
|
4692
|
-
const
|
|
4699
|
+
const predefinedEndMarkers = ["&&", "LAT..."];
|
|
4700
|
+
const getEndIndex = (text, fromIndex = 0) => {
|
|
4701
|
+
const indices = predefinedEndMarkers.map((marker) => text.indexOf(marker, fromIndex)).filter((idx) => idx !== -1);
|
|
4702
|
+
return indices.length ? Math.min(...indices) : -1;
|
|
4703
|
+
};
|
|
4704
|
+
const dates = Array.from(message.matchAll(EnumExpressions.dateline));
|
|
4693
4705
|
if (dates.length) {
|
|
4694
4706
|
const lastMatch = dates[dates.length - 1][0];
|
|
4695
4707
|
const sIndx = message.lastIndexOf(lastMatch);
|
|
4696
4708
|
if (sIndx !== -1) {
|
|
4697
|
-
const endIndx = message
|
|
4709
|
+
const endIndx = getEndIndex(message, sIndx);
|
|
4698
4710
|
message = message.substring(sIndx + lastMatch.length, endIndx !== -1 ? endIndx : void 0).trimStart();
|
|
4699
4711
|
if (message.startsWith("/")) message = message.slice(1).trimStart();
|
|
4700
4712
|
if (options.handle && message.includes(options.handle)) {
|
|
@@ -4708,22 +4720,22 @@ var getDescriptionFromProduct = (options) => {
|
|
|
4708
4720
|
if (handleIndx !== -1) {
|
|
4709
4721
|
let afterHandle = message.substring(handleIndx + options.handle.length).trimStart();
|
|
4710
4722
|
if (afterHandle.startsWith("/")) afterHandle = afterHandle.slice(1).trimStart();
|
|
4711
|
-
const latEnd = afterHandle
|
|
4723
|
+
const latEnd = getEndIndex(afterHandle);
|
|
4712
4724
|
message = latEnd !== -1 ? afterHandle.substring(0, latEnd).trim() : afterHandle.trim();
|
|
4713
4725
|
}
|
|
4714
4726
|
}
|
|
4715
4727
|
return message.trim();
|
|
4716
4728
|
};
|
|
4717
4729
|
|
|
4718
|
-
// src/@parsers/@text/
|
|
4730
|
+
// src/@parsers/@text/GetPolygonFromProduct.ts
|
|
4719
4731
|
var getPolygonFromProduct = (message) => {
|
|
4720
4732
|
const coordinates = [];
|
|
4721
4733
|
const match = message.match(
|
|
4722
4734
|
/LAT\.\.\.LON\s+([\s\S]*?)(?=\n[A-Z]{2,}(?:\.\.\.|:)|\$\$|&&|$)/i
|
|
4723
4735
|
);
|
|
4724
4736
|
if (!match) return coordinates;
|
|
4725
|
-
const
|
|
4726
|
-
const values =
|
|
4737
|
+
const text = match[1];
|
|
4738
|
+
const values = text.match(/\d{4,8}/g);
|
|
4727
4739
|
if (!values) return coordinates;
|
|
4728
4740
|
if (values.every((v) => v.length === 8)) {
|
|
4729
4741
|
for (const value of values) {
|
|
@@ -4748,8 +4760,8 @@ var getPolygonFromProduct = (message) => {
|
|
|
4748
4760
|
return coordinates;
|
|
4749
4761
|
};
|
|
4750
4762
|
|
|
4751
|
-
// src/@parsers/@text/
|
|
4752
|
-
var
|
|
4763
|
+
// src/@parsers/@text/GetTextFromProduct.ts
|
|
4764
|
+
var GetTextFromProduct = (options) => {
|
|
4753
4765
|
var _a;
|
|
4754
4766
|
const lines = options.message.split(`
|
|
4755
4767
|
`);
|
|
@@ -4769,8 +4781,8 @@ var getTextFromProduct = (options) => {
|
|
|
4769
4781
|
return null;
|
|
4770
4782
|
};
|
|
4771
4783
|
|
|
4772
|
-
// src/@
|
|
4773
|
-
var
|
|
4784
|
+
// src/@enums/ICAO.ts
|
|
4785
|
+
var EnumICAO = {
|
|
4774
4786
|
"KLUB": "Lubbock, TX",
|
|
4775
4787
|
"KLCH": "Lake Charles, LA",
|
|
4776
4788
|
"TSTL": "St. Louis, MO",
|
|
@@ -5011,180 +5023,251 @@ var dict_icao = {
|
|
|
5011
5023
|
"PAJK": "Juneau, AK"
|
|
5012
5024
|
};
|
|
5013
5025
|
|
|
5014
|
-
// src/@building/
|
|
5015
|
-
var
|
|
5026
|
+
// src/@building/GetEventOffice.ts
|
|
5027
|
+
var GetEventOffice = (options) => {
|
|
5016
5028
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
5017
5029
|
const office = options.pVtec != null ? (_b = (_a = options.pVtec) == null ? void 0 : _a.tracking) == null ? void 0 : _b.split(`.`)[0] : (_e = (_c = options.attributes) == null ? void 0 : _c.cccc) != null ? _e : options.organization != null ? Array.isArray(options.organization) ? (_d = options.organization) == null ? void 0 : _d[0] : options.organization : null;
|
|
5018
|
-
const name = (_g = (_f =
|
|
5030
|
+
const name = (_g = (_f = EnumICAO) == null ? void 0 : _f[office]) != null ? _g : null;
|
|
5019
5031
|
return { office, name };
|
|
5020
5032
|
};
|
|
5021
5033
|
|
|
5022
|
-
// src/@
|
|
5023
|
-
var
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5034
|
+
// src/@enums/Tags.ts
|
|
5035
|
+
var EnumTags = {
|
|
5036
|
+
SEVERE_WEATHER: [
|
|
5037
|
+
{ match: /A Large And Extremely Dangerous Tornado/i, tag: "Large and Dangerous Tornado" },
|
|
5038
|
+
{ match: /This Is A Particularly Dangerous Situation/i, tag: "Particularly Dangerous Situation" },
|
|
5039
|
+
{ match: /Weather Spotters Confirmed Tornado/i, tag: "Weather Spotters Confirmed Tornado" },
|
|
5040
|
+
{ match: /Law Enforcement Confirmed Tornado/i, tag: "Law Enforcement Confirmed Tornado" },
|
|
5041
|
+
{ match: /Radar Confirmed/i, tag: "Radar Confirmed" },
|
|
5042
|
+
{ match: /Radar Indicated Rotation/i, tag: "Radar Indicated Rotation" },
|
|
5043
|
+
{ match: /Radar Indicated(?! Rotation)/i, tag: "Radar Indicated" },
|
|
5044
|
+
{ match: /A Tornado Is On The Ground/i, tag: "Tornado On The Ground" },
|
|
5045
|
+
{ match: /Tornado Was Reported Briefly On The Ground/i, tag: "Tornado Briefly On Ground" },
|
|
5046
|
+
{ match: /Weather Spotters Reported Funnel Cloud/i, tag: "Confirmed Funnel Cloud" },
|
|
5047
|
+
{ match: /Spotters Indicate That A Funnel Cloud Continues With This Storm/i, tag: "Funnel Cloud Continues" },
|
|
5048
|
+
{ match: /A Severe Thunderstorm Capable Of Producing A Tornado/i, tag: "Tornado Possible" },
|
|
5049
|
+
{ match: /A Tornado May Develop At Any Time/i, tag: "Tornado May Develop" },
|
|
5050
|
+
{ match: /A Tornado Watch Remains In Effect/i, tag: "Active Tornado Watch" },
|
|
5051
|
+
{ match: /Complete Destruction Is Possible/i, tag: "Extremely Damaging Tornado" },
|
|
5052
|
+
{ match: /Potentially Deadly Tornado/i, tag: "Deadly Tornado" },
|
|
5053
|
+
{ match: /Life-Threatening Situation/i, tag: "Life Threatening Situation" },
|
|
5054
|
+
{ match: /Capable Of Producing A Landspout/i, tag: "Landspout Possible" },
|
|
5055
|
+
{ match: /Public Confirmed Tornado/i, tag: "Public Confirmed Tornado" },
|
|
5056
|
+
{ match: /Expect Wind Damage/i, tag: "Wind Damage" },
|
|
5057
|
+
{ match: /Destructive Winds/i, tag: "Destructive Winds" },
|
|
5058
|
+
{ match: /Wind Damage With This Storm Will Occur/i, tag: "Immediate Wind Damage Threat" },
|
|
5059
|
+
{ match: /Widespread Wind Damage/i, tag: "Widespread Wind Damage" },
|
|
5060
|
+
{ match: /Significant Wind Damage/i, tag: "Significant Wind Damage" },
|
|
5061
|
+
{ match: /Tornado Like Wind Speeds/i, tag: "Tornado-Like Wind Speeds" },
|
|
5062
|
+
{ match: /Winds Will Strengthen/i, tag: "Strengthening Winds" },
|
|
5063
|
+
{ match: /Gusty Winds/i, tag: "Gusty Winds" },
|
|
5064
|
+
{ match: /Could Knock Down Tree Limbs/i, tag: "Tree Damage Possible" },
|
|
5065
|
+
{ match: /Blow Around Unsecured Objects/i, tag: "Loose Object Damage Possible" },
|
|
5066
|
+
{ match: /Unsecured lightweight objects blown about/i, tag: "Loose Objects May Blow Around" },
|
|
5067
|
+
{ match: /Many large tree limbs broken off/i, tag: "Tree Limb Damage Possible" },
|
|
5068
|
+
{ match: /Some fences and roadway signs blown over/i, tag: "Fence and Sign Damage Possible" },
|
|
5069
|
+
{ match: /Hazardous driving conditions on bridges/i, tag: "Hazardous Bridge Travel" },
|
|
5070
|
+
{ match: /Scattered power and communications outages/i, tag: "Power Outages Possible" },
|
|
5071
|
+
{ match: /Hail Damage To Vehicles Is Expected/i, tag: "Vehicle Damaging Hail" },
|
|
5072
|
+
{ match: /Extremely Large Hail/i, tag: "Extremely Large Hail" },
|
|
5073
|
+
{ match: new RegExp("(?<!Extremely )Large Hail", "i"), tag: "Large Hail" },
|
|
5074
|
+
{ match: /Tennis Ball Size Hail/i, tag: "Tennis Ball Size Hail" },
|
|
5075
|
+
{ match: /Baseball Size Hail/i, tag: "Baseball Size Hail" },
|
|
5076
|
+
{ match: /Golf Ball Size Hail/i, tag: "Golf Ball Size Hail" },
|
|
5077
|
+
{ match: /Quarter Size Hail/i, tag: "Quarter Size Hail" },
|
|
5078
|
+
{ match: /Ping Pong Ball Size Hail/i, tag: "Ping Pong Ball Size Hail" },
|
|
5079
|
+
{ match: /Nickel Size Hail/i, tag: "Nickel Size Hail" },
|
|
5080
|
+
{ match: /Hail Driven By Severe Winds/i, tag: "Wind Driven Hail" },
|
|
5081
|
+
{ match: /Prepare Immediately For Large Hail/i, tag: "Large Hail" },
|
|
5082
|
+
{ match: /Half Inch Hail/i, tag: "Half Inch Hail" },
|
|
5083
|
+
{ match: /Frequent Lightning/i, tag: "Frequent Lightning" },
|
|
5084
|
+
{ match: /Deadly Cloud To Ground Lightning/i, tag: "Deadly Cloud To Ground Lightning" },
|
|
5085
|
+
{ match: /Continuous Cloud To Ground Lightning/i, tag: "Continuous Cloud To Ground Lightning" },
|
|
5086
|
+
{ match: /Frequent Cloud To Ground Lightning/i, tag: "Frequent Cloud To Ground Lightning" },
|
|
5087
|
+
{ match: /Lightning Can Strike \d+ Miles Away/i, tag: "Lightning Safety Threat" },
|
|
5088
|
+
{ match: /Showers and thunderstorms with gusty winds may still occur/i, tag: "Gusty Thunderstorms Possible" }
|
|
5089
|
+
],
|
|
5090
|
+
FLOOD: [
|
|
5091
|
+
{ match: /Flash Flooding Caused By Thunderstorms/i, tag: "Thunderstorm Flash Flooding" },
|
|
5092
|
+
{ match: /Flash Flooding Caused By Heavy Rain/i, tag: "Heavy Rain Flash Flooding" },
|
|
5093
|
+
{ match: /Torrential Rainfall/i, tag: "Torrential Rainfall" },
|
|
5094
|
+
{ match: /May Lead To Flash Flooding/i, tag: "Flash Flooding Possible" },
|
|
5095
|
+
{ match: /Minor Flooding Is Occurring/i, tag: "Minor Flooding Occurring" },
|
|
5096
|
+
{ match: /Localized Flooding/i, tag: "Localized Flooding Possible" },
|
|
5097
|
+
{ match: /Do Not Drive Your Vehicle Through Flooded Roadways/i, tag: "Flooded Roadways" },
|
|
5098
|
+
{ match: /No storm surge inundation forecast/i, tag: "No Storm Surge Inundation" },
|
|
5099
|
+
{ match: /Localized storm surge possible/i, tag: "Localized Storm Surge Possible" },
|
|
5100
|
+
{ match: /Peak Storm Surge Inundation/i, tag: "Storm Surge Inundation Risk" },
|
|
5101
|
+
{ match: /Potential for storm surge flooding/i, tag: "Storm Surge Flooding Possible" },
|
|
5102
|
+
{ match: /Small streams, creeks, and ditches may become swollen/i, tag: "Small Stream Flooding Risk" },
|
|
5103
|
+
{ match: /Rivers and tributaries may quickly rise/i, tag: "Rapid River Rise Possible" },
|
|
5104
|
+
{ match: /Flood waters can enter a few structures/i, tag: "Flood Damage Possible" },
|
|
5105
|
+
{ match: /Rapid ponding of water occurs/i, tag: "Water Ponding Possible" },
|
|
5106
|
+
{ match: /Brief road and bridge closures/i, tag: "Road Closures Possible" }
|
|
5107
|
+
],
|
|
5108
|
+
WINTER_WEATHER: [
|
|
5109
|
+
{ match: /Frostbite And Hypothermia Are Likely/i, tag: "Frostbite and Hypothermia Likely" },
|
|
5110
|
+
{ match: /Very Cold Temperatures Can Lead To Hypothermia/i, tag: "Hypothermia Risk" },
|
|
5111
|
+
{ match: /Hypothermia If Precautions Are Not Taken/i, tag: "Hypothermia Risk" },
|
|
5112
|
+
{ match: /Frostbite And Hypothermia Will Occur If Unprotected Skin/i, tag: "Frostbite Risk" },
|
|
5113
|
+
{ match: /Temperatures Could Cause Ruptured Water Pipes/i, tag: "Ruptured Water Pipes Possible" },
|
|
5114
|
+
{ match: /Blowing Snow Which Could Reduce Visibility/i, tag: "Reduced Visibility From Blowing Snow" },
|
|
5115
|
+
{ match: /Lake Effect Snow Expected/i, tag: "Lake Effect Snow" },
|
|
5116
|
+
{ match: /Slick And Icy Spots On Roads/i, tag: "Icy Roads" },
|
|
5117
|
+
{ match: /Hazardous Roadways And Black Ice/i, tag: "Black Ice" },
|
|
5118
|
+
{ match: /Icy Patches May Be More Common On Bridges/i, tag: "Bridge Icing" }
|
|
5119
|
+
],
|
|
5120
|
+
COASTAL_MARINE: [
|
|
5121
|
+
{ match: /Rip Currents Can Sweep Even The Best Swimmer/i, tag: "Dangerous Rip Currents" },
|
|
5122
|
+
{ match: /Small Craft Could Be Damaged/i, tag: "Small Craft Damage Possible" },
|
|
5123
|
+
{ match: /No Tsunami Threat/i, tag: "No Tsunami Threat" },
|
|
5124
|
+
{ match: /Tsunami Threat Exists/i, tag: "Tsunami Threat Exists" },
|
|
5125
|
+
{ match: /TROPICAL STORM WARNING IN EFFECT/i, tag: "Tropical Storm Warning" },
|
|
5126
|
+
{ match: /TROPICAL STORM WARNING REMAINS IN EFFECT/i, tag: "Tropical Storm Warning Continues" },
|
|
5127
|
+
{ match: /Tropical storm[- ]force winds/i, tag: "Tropical Storm Force Winds" },
|
|
5128
|
+
{ match: /hazardous wind/i, tag: "Hazardous Winds" },
|
|
5129
|
+
{ match: /hazardous seas/i, tag: "Hazardous Seas" },
|
|
5130
|
+
{ match: /could capsize or damage vessels/i, tag: "Vessel Damage Risk" },
|
|
5131
|
+
{ match: /reduce visibility/i, tag: "Reduced Visibility" },
|
|
5132
|
+
{ match: /Mariners should alter plans/i, tag: "Marine Travel Disruption" },
|
|
5133
|
+
{ match: /Remain in port/i, tag: "Remain In Port" },
|
|
5134
|
+
{ match: /seek safe harbor/i, tag: "Seek Safe Harbor" },
|
|
5135
|
+
{ match: /secure the vessel for severe conditions/i, tag: "Secure Vessel" }
|
|
5136
|
+
],
|
|
5137
|
+
SAFETY_INFO: [
|
|
5138
|
+
{ match: /Seek Shelter Now/i, tag: "Seek Shelter Now" },
|
|
5139
|
+
{ match: /Seek Shelter Immediately/i, tag: "Seek Shelter Immediately" },
|
|
5140
|
+
{ match: /Move To An Interior Room/i, tag: "Move To Interior Room" },
|
|
5141
|
+
{ match: /Move To Safe Shelter Now/i, tag: "Move To Safe Shelter" },
|
|
5142
|
+
{ match: /Potentially Deadly Storm/i, tag: "Potentially Deadly Storm" },
|
|
5143
|
+
{ match: /Serious Injury And Significant Property Damage/i, tag: "Serious Damage Possible" },
|
|
5144
|
+
{ match: /People And Animals Outdoors Will Be Injured/i, tag: "Outdoor Injury Risk" },
|
|
5145
|
+
{ match: /IMMINENT DANGEROUS WEATHER CONDITIONS/i, tag: "Imminent Dangerous Weather" },
|
|
5146
|
+
{ match: /Follow the instructions of local officials/i, tag: "Follow Local Officials" },
|
|
5147
|
+
{ match: /Monitor forecasts/i, tag: "Monitor Forecast Updates" },
|
|
5148
|
+
{ match: /Complete preparations.*before conditions become unsafe/i, tag: "Complete Preparations Early" },
|
|
5149
|
+
{ match: /Leave immediately if evacuation orders are given/i, tag: "Evacuate If Ordered" },
|
|
5150
|
+
{ match: /Heed any flood watches and warnings/i, tag: "Monitor Flood Alerts" },
|
|
5151
|
+
{ match: /Listen for changes in the forecast/i, tag: "Stay Weather Aware" },
|
|
5152
|
+
{ match: /Travel Could Be Very Difficult/i, tag: "Difficult Travel Conditions" },
|
|
5153
|
+
{ match: /Expect Disruptions/i, tag: "Travel Disruptions Expected" },
|
|
5154
|
+
{ match: /Trained Weather Spotters/i, tag: "Confirmed By Storm Spotters" },
|
|
5155
|
+
{ match: /Doppler Radar/i, tag: "Confirmed By Radar" },
|
|
5156
|
+
{ match: /Source\.\.\.Storm Spotters/i, tag: "Confirmed By Storm Spotters" },
|
|
5157
|
+
{ match: /Source\.\.\.Doppler Radar/i, tag: "Confirmed By Radar" },
|
|
5158
|
+
{ match: /Source\.\.\.Automated Gauges/i, tag: "Confirmed By Automated Gauges" },
|
|
5159
|
+
{ match: /Source\.\.\.Radar Confirmed/i, tag: "Confirmed By Radar" },
|
|
5160
|
+
{ match: /Source\.\.\.Radar Indicated/i, tag: "Indicated By Radar" },
|
|
5161
|
+
{ match: /Source\.\.\.Public/i, tag: "Confirmed By Public" },
|
|
5162
|
+
{ match: /Source\.\.\.Amateur Radio/i, tag: "Confirmed By Amateur Radio" },
|
|
5163
|
+
{ match: /Source\.\.\.Emergency Management/i, tag: "Confirmed By Emergency Management" },
|
|
5164
|
+
{ match: /Source\.\.\.Law Enforcement Reported/i, tag: "Confirmed By Law Enforcement" },
|
|
5165
|
+
{ match: /Source\.\.\.Broadcast Media/i, tag: "Confirmed By Broadcast Media" },
|
|
5166
|
+
{ match: /Source\.\.\.Media/i, tag: "Confirmed By Media" },
|
|
5167
|
+
{ match: /Source\.\.\.Media Reported/i, tag: "Confirmed By Media" },
|
|
5168
|
+
{ match: /Doppler Radar And Automated Gauges/i, tag: "Confirmed By Radar and Gauges" },
|
|
5169
|
+
{ match: /Potential Impacts:\s*Limited/i, tag: "Limited Impacts Expected" },
|
|
5170
|
+
{ match: /Potential Impacts:\s*Little to None/i, tag: "Minimal Impacts Expected" },
|
|
5171
|
+
{ match: /Slow Down And Allow Extra Time/i, tag: "Allow Extra Travel Time" },
|
|
5172
|
+
{ match: /Should Exercise Caution/i, tag: "Exercise Caution" },
|
|
5173
|
+
{ match: /Heat Illnesses/i, tag: "Heat Illness Risk" },
|
|
5174
|
+
{ match: /\bIntensifying\b/i, tag: "Intensifying Conditions" }
|
|
5175
|
+
]
|
|
5096
5176
|
};
|
|
5097
5177
|
|
|
5098
|
-
// src/@building/
|
|
5099
|
-
var
|
|
5100
|
-
|
|
5178
|
+
// src/@building/GetEventTags.ts
|
|
5179
|
+
var GetEventTags = (message) => {
|
|
5180
|
+
if (!message) return [];
|
|
5181
|
+
return [...new Set(
|
|
5182
|
+
Object.values(EnumTags).flat().filter(({ match }) => match.test(message)).map(({ tag }) => tag)
|
|
5183
|
+
)];
|
|
5101
5184
|
};
|
|
5102
5185
|
|
|
5103
|
-
// src/@building/
|
|
5104
|
-
var
|
|
5186
|
+
// src/@building/GetEventProperties.ts
|
|
5187
|
+
var GetEventProperties = (options) => {
|
|
5105
5188
|
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;
|
|
5106
|
-
const organization = (_b = (_a = options.message.match(
|
|
5189
|
+
const organization = (_b = (_a = options.message.match(EnumExpressions.wmo)) == null ? void 0 : _a[0]) != null ? _b : null;
|
|
5107
5190
|
const polygons = getPolygonFromProduct(options.message);
|
|
5108
|
-
const
|
|
5191
|
+
const properties = {
|
|
5109
5192
|
locations: (_e = (_d = (_c = options == null ? void 0 : options.ugc) == null ? void 0 : _c.locations) == null ? void 0 : _d.join(`; `)) != null ? _e : null,
|
|
5110
5193
|
locations_array: (_g = (_f = options == null ? void 0 : options.ugc) == null ? void 0 : _f.locations) != null ? _g : [],
|
|
5111
|
-
description:
|
|
5194
|
+
description: GetDescriptionFromProduct({ message: options.message, handle: (_i = (_h = options == null ? void 0 : options.pVtec) == null ? void 0 : _h.vtec) != null ? _i : null }),
|
|
5112
5195
|
attributes: options.attributes,
|
|
5113
5196
|
geocode: {
|
|
5114
|
-
office:
|
|
5197
|
+
office: GetEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
|
|
5115
5198
|
organization,
|
|
5116
5199
|
ugc: (_k = (_j = options == null ? void 0 : options.ugc) == null ? void 0 : _j.zones) != null ? _k : [],
|
|
5117
5200
|
polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString("base64") : null,
|
|
5118
5201
|
polygon_generated: polygons.length > 0 ? true : false
|
|
5119
5202
|
},
|
|
5120
5203
|
parameters: {
|
|
5121
|
-
tags:
|
|
5122
|
-
instructions: (_l =
|
|
5123
|
-
source: (_m =
|
|
5124
|
-
hazards: (_n =
|
|
5125
|
-
impacts: (_o =
|
|
5126
|
-
estimated_hail_size: (_p =
|
|
5127
|
-
estimated_wind_gusts: (_q =
|
|
5128
|
-
damage_threat: (_r =
|
|
5129
|
-
tornado_threat: (_s =
|
|
5130
|
-
flood_threat: (_t =
|
|
5131
|
-
wind_threat: (_u =
|
|
5132
|
-
hail_threat: (_v =
|
|
5204
|
+
tags: GetEventTags(options.message),
|
|
5205
|
+
instructions: (_l = GetTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
|
|
5206
|
+
source: (_m = GetTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
|
|
5207
|
+
hazards: (_n = GetTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
|
|
5208
|
+
impacts: (_o = GetTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
|
|
5209
|
+
estimated_hail_size: (_p = GetTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
|
|
5210
|
+
estimated_wind_gusts: (_q = GetTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
|
|
5211
|
+
damage_threat: (_r = GetTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
|
|
5212
|
+
tornado_threat: (_s = GetTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
|
|
5213
|
+
flood_threat: (_t = GetTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
|
|
5214
|
+
wind_threat: (_u = GetTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
|
|
5215
|
+
hail_threat: (_v = GetTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: [] })) != null ? _v : null
|
|
5133
5216
|
},
|
|
5134
5217
|
discussion_parameters: {
|
|
5135
|
-
discussion_number: (_y = (_x = (_w =
|
|
5136
|
-
discussion_concerning: (_z =
|
|
5137
|
-
discussion_max_tornado: (_A =
|
|
5138
|
-
discussion_max_hail: (_B =
|
|
5139
|
-
discussion_max_wind: (_C =
|
|
5140
|
-
discussion_watch_issuance: (_D =
|
|
5218
|
+
discussion_number: (_y = (_x = (_w = GetTextFromProduct({ message: options.message, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _w.toString()) == null ? void 0 : _x.padStart(4, "0")) != null ? _y : null,
|
|
5219
|
+
discussion_concerning: (_z = GetTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
|
|
5220
|
+
discussion_max_tornado: (_A = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
|
|
5221
|
+
discussion_max_hail: (_B = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
|
|
5222
|
+
discussion_max_wind: (_C = GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
|
|
5223
|
+
discussion_watch_issuance: (_D = GetTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _D : null
|
|
5141
5224
|
},
|
|
5142
5225
|
watch_parameters: {
|
|
5143
|
-
watch_number: ((_E = options == null ? void 0 : options.pVtec) == null ? void 0 : _E.is_watch)
|
|
5226
|
+
watch_number: ((_E = options == null ? void 0 : options.pVtec) == null ? void 0 : _E.is_watch) ? (_O = (_N = (_I = (_H = (_G = (_F = GetTextFromProduct({ message: options.message, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _F.replace(/(WT|WS|)/g, "")) == null ? void 0 : _G.trim()) == null ? void 0 : _H.toString()) == null ? void 0 : _I.padStart(4, "0")) != null ? _N : (_M = (_L = (_K = (_J = options == null ? void 0 : options.pVtec) == null ? void 0 : _J.tracking) == null ? void 0 : _K.slice(-4)) == null ? void 0 : _L.toString()) == null ? void 0 : _M.padStart(4, "0")) != null ? _O : null : null,
|
|
5144
5227
|
watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : (options == null ? void 0 : options.message.includes(`SEVERE`)) ? `Severe` : null,
|
|
5145
|
-
additional_tornadoes_probability: (_P =
|
|
5146
|
-
strong_tornadoes_probability: (_Q =
|
|
5147
|
-
severe_wind_probability: (_R =
|
|
5148
|
-
severe_hail_probability: (_S =
|
|
5149
|
-
hail_2in_probability: (_T =
|
|
5150
|
-
combined_hail_wind_probability: (_U =
|
|
5151
|
-
max_hail_in: (_V =
|
|
5152
|
-
max_wind_surface: (_W =
|
|
5153
|
-
max_tops_x100feet: (_X =
|
|
5154
|
-
pds_watch:
|
|
5228
|
+
additional_tornadoes_probability: (_P = GetTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
|
|
5229
|
+
strong_tornadoes_probability: (_Q = GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
|
|
5230
|
+
severe_wind_probability: (_R = GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
|
|
5231
|
+
severe_hail_probability: (_S = GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
|
|
5232
|
+
hail_2in_probability: (_T = GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
|
|
5233
|
+
combined_hail_wind_probability: (_U = GetTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
|
|
5234
|
+
max_hail_in: (_V = GetTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
|
|
5235
|
+
max_wind_surface: (_W = GetTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
|
|
5236
|
+
max_tops_x100feet: (_X = GetTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
|
|
5237
|
+
pds_watch: GetTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES` ? true : null
|
|
5155
5238
|
}
|
|
5156
5239
|
};
|
|
5157
|
-
if (isNaN(Number(
|
|
5158
|
-
|
|
5240
|
+
if (isNaN(Number(properties.watch_parameters.watch_number))) {
|
|
5241
|
+
properties.watch_parameters.watch_number = null;
|
|
5159
5242
|
}
|
|
5160
|
-
return
|
|
5243
|
+
return properties;
|
|
5161
5244
|
};
|
|
5162
5245
|
|
|
5163
|
-
// src/@building/
|
|
5164
|
-
var
|
|
5246
|
+
// src/@building/GetEventHeader.ts
|
|
5247
|
+
var GetEventHeader = (options) => {
|
|
5165
5248
|
var _a, _b, _c;
|
|
5166
|
-
const
|
|
5167
|
-
const
|
|
5168
|
-
const
|
|
5169
|
-
return `ZCZC-ATMOSX-${options.getType.prefix}-${
|
|
5249
|
+
const properties = options.properties;
|
|
5250
|
+
const vtec = (_a = options.vtec) != null ? _a : null;
|
|
5251
|
+
const ugc = properties.geocode.ugc != null ? properties.geocode.ugc.join(`-`) : `0`;
|
|
5252
|
+
return `ZCZC-ATMOSX-${options.getType.prefix}-${ugc}-${(_b = vtec == null ? void 0 : vtec.status) != null ? _b : `Issued`}-${(/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").split(".")[0]}-${(_c = properties.geocode.office.office) != null ? _c : `KWNS`}`;
|
|
5170
5253
|
};
|
|
5171
5254
|
|
|
5172
|
-
// src/@building/
|
|
5173
|
-
var
|
|
5255
|
+
// src/@building/GetEventTracking.ts
|
|
5256
|
+
var GetEventTracking = (options) => {
|
|
5174
5257
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
5175
|
-
const
|
|
5258
|
+
const properties = options.properties;
|
|
5176
5259
|
const attributes = options.attributes;
|
|
5177
5260
|
const stanza = options.stanza;
|
|
5178
|
-
const
|
|
5261
|
+
const vtec = options.vtec;
|
|
5179
5262
|
if (options.type === `RAW`) {
|
|
5180
|
-
const getWatchNumber = (_a =
|
|
5263
|
+
const getWatchNumber = (_a = properties.watch_parameters.watch_number) != null ? _a : null;
|
|
5181
5264
|
if (getWatchNumber) {
|
|
5182
|
-
return `${
|
|
5265
|
+
return `${properties.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`;
|
|
5183
5266
|
}
|
|
5184
|
-
return `${
|
|
5267
|
+
return `${properties.geocode.office.office}.${attributes.ttaaii}.${(_b = attributes.id.slice(-4).replace(`.`, ``)) != null ? _b : "0"}`;
|
|
5185
5268
|
}
|
|
5186
5269
|
if (options.type === `VTEC`) {
|
|
5187
|
-
return
|
|
5270
|
+
return vtec.tracking;
|
|
5188
5271
|
}
|
|
5189
5272
|
if (options.type === `API`) {
|
|
5190
5273
|
if (options.vtec) {
|
|
@@ -5203,37 +5286,39 @@ var getEventTracking = (options) => {
|
|
|
5203
5286
|
}
|
|
5204
5287
|
};
|
|
5205
5288
|
|
|
5206
|
-
// src/@modules/@utilities/
|
|
5207
|
-
var
|
|
5208
|
-
var _a, _b
|
|
5289
|
+
// src/@modules/@utilities/SetDebug.ts
|
|
5290
|
+
var SetDebug = (options) => {
|
|
5291
|
+
var _a, _b;
|
|
5209
5292
|
const settings = bootstrap.settings;
|
|
5210
5293
|
bootstrap.listener.emit(`debug`, {
|
|
5211
5294
|
message: options.message,
|
|
5212
|
-
|
|
5213
|
-
function: (_c = options == null ? void 0 : options.title) == null ? void 0 : _c.split(`.`)[1]
|
|
5295
|
+
function: (_a = options.title) != null ? _a : `debug`
|
|
5214
5296
|
});
|
|
5215
5297
|
if (settings.EnableDebugging) {
|
|
5216
|
-
console.log(`[${bootstrap.ansi_colors.BLUE}${(
|
|
5298
|
+
console.log(`[${bootstrap.ansi_colors.BLUE}${(_b = options.title) != null ? _b : `debug`}${bootstrap.ansi_colors.RESET}] ${options.message}`);
|
|
5217
5299
|
}
|
|
5218
5300
|
};
|
|
5219
5301
|
|
|
5220
|
-
// src/@events/
|
|
5221
|
-
var
|
|
5302
|
+
// src/@events/ParseText.ts
|
|
5303
|
+
var ParseText = (stanza) => __async(null, null, function* () {
|
|
5222
5304
|
var _a, _b, _c, _d, _e;
|
|
5223
5305
|
const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
|
|
5224
5306
|
if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
|
|
5225
5307
|
for (const message of getMessages) {
|
|
5226
5308
|
const tick = performance.now();
|
|
5227
5309
|
const attributes = stanza == null ? void 0 : stanza.attributes;
|
|
5228
|
-
const props =
|
|
5229
|
-
const header =
|
|
5310
|
+
const props = GetEventProperties({ message, attributes });
|
|
5311
|
+
const header = GetEventHeader({ properties: props, getType: stanza.getType });
|
|
5230
5312
|
const issued = new Date(attributes.issue);
|
|
5231
5313
|
const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1e3);
|
|
5232
|
-
const matches = (_d =
|
|
5314
|
+
const matches = (_d = EnumMatches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
|
|
5233
5315
|
let event = matches == null ? void 0 : matches.label;
|
|
5234
5316
|
let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
|
|
5235
5317
|
if (!event) {
|
|
5236
|
-
event = stanza.getType.type
|
|
5318
|
+
event = stanza.getType.type;
|
|
5319
|
+
if (!stanza.getType.discovered) {
|
|
5320
|
+
event += ` (AWIPSID)`;
|
|
5321
|
+
}
|
|
5237
5322
|
isStatement = true;
|
|
5238
5323
|
}
|
|
5239
5324
|
bootstrap.cache.processed.push({
|
|
@@ -5252,7 +5337,7 @@ var text = (stanza) => __async(null, null, function* () {
|
|
|
5252
5337
|
metadata: {
|
|
5253
5338
|
ms: performance.now() - tick,
|
|
5254
5339
|
source: `events.text`,
|
|
5255
|
-
tracking:
|
|
5340
|
+
tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
|
|
5256
5341
|
header,
|
|
5257
5342
|
vtec: null,
|
|
5258
5343
|
hvtec: null,
|
|
@@ -5267,20 +5352,20 @@ var text = (stanza) => __async(null, null, function* () {
|
|
|
5267
5352
|
}
|
|
5268
5353
|
})
|
|
5269
5354
|
});
|
|
5270
|
-
|
|
5355
|
+
SetDebug({ title: `ParseText`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
5271
5356
|
}
|
|
5272
5357
|
});
|
|
5273
5358
|
|
|
5274
|
-
// src/@parsers/@ugc/
|
|
5359
|
+
// src/@parsers/@ugc/GetUGCHeader.ts
|
|
5275
5360
|
var getUGCHeader = (message) => {
|
|
5276
|
-
const start = message.search(
|
|
5361
|
+
const start = message.search(EnumExpressions.ugc1);
|
|
5277
5362
|
const sub = message.substring(start);
|
|
5278
|
-
const end = sub.search(
|
|
5363
|
+
const end = sub.search(EnumExpressions.ugc2);
|
|
5279
5364
|
const fin = sub.substring(0, end).replace(/\s+/g, "").slice(0, -1);
|
|
5280
5365
|
return fin != null ? fin : null;
|
|
5281
5366
|
};
|
|
5282
5367
|
|
|
5283
|
-
// src/@parsers/@ugc/
|
|
5368
|
+
// src/@parsers/@ugc/GetZones.ts
|
|
5284
5369
|
var getZones = (header) => {
|
|
5285
5370
|
const splits = header.split("-");
|
|
5286
5371
|
const zones = [];
|
|
@@ -5315,8 +5400,8 @@ var getZones = (header) => {
|
|
|
5315
5400
|
return zones.filter((item) => item !== "");
|
|
5316
5401
|
};
|
|
5317
5402
|
|
|
5318
|
-
// src/@parsers/@ugc/
|
|
5319
|
-
var
|
|
5403
|
+
// src/@parsers/@ugc/GetExpiry.ts
|
|
5404
|
+
var GetExpiry = (message) => {
|
|
5320
5405
|
const match = message.match(/\b(\d{6})-/);
|
|
5321
5406
|
if (!match) {
|
|
5322
5407
|
return null;
|
|
@@ -5330,12 +5415,12 @@ var getExpiry = (message) => {
|
|
|
5330
5415
|
return expires.toISOString();
|
|
5331
5416
|
};
|
|
5332
5417
|
|
|
5333
|
-
// src/@parsers/@ugc/
|
|
5418
|
+
// src/@parsers/@ugc/GetCache.ts
|
|
5334
5419
|
var getCache = (key) => {
|
|
5335
5420
|
return bootstrap.cache.ugc.get(key);
|
|
5336
5421
|
};
|
|
5337
5422
|
|
|
5338
|
-
// src/@parsers/@ugc/
|
|
5423
|
+
// src/@parsers/@ugc/SetCache.ts
|
|
5339
5424
|
var setCache = (key, value) => {
|
|
5340
5425
|
if (bootstrap.cache.ugc.size >= 5e3) {
|
|
5341
5426
|
const firstKey = bootstrap.cache.ugc.keys().next().value;
|
|
@@ -5344,7 +5429,7 @@ var setCache = (key, value) => {
|
|
|
5344
5429
|
bootstrap.cache.ugc.set(key, value);
|
|
5345
5430
|
};
|
|
5346
5431
|
|
|
5347
|
-
// src/@parsers/@ugc/
|
|
5432
|
+
// src/@parsers/@ugc/GetLocations.ts
|
|
5348
5433
|
var getLocations = (zones) => __async(null, null, function* () {
|
|
5349
5434
|
const uniqueZones = Array.from(new Set(zones));
|
|
5350
5435
|
const results = [];
|
|
@@ -5373,11 +5458,11 @@ var getLocations = (zones) => __async(null, null, function* () {
|
|
|
5373
5458
|
return results;
|
|
5374
5459
|
});
|
|
5375
5460
|
|
|
5376
|
-
// src/@parsers/@ugc/
|
|
5461
|
+
// src/@parsers/@ugc/UGCExtract.ts
|
|
5377
5462
|
var ugcExtract = (message) => __async(null, null, function* () {
|
|
5378
5463
|
const head = getUGCHeader(message);
|
|
5379
5464
|
const ugcs = getZones(head);
|
|
5380
|
-
const expires =
|
|
5465
|
+
const expires = GetExpiry(message);
|
|
5381
5466
|
const areas = yield getLocations(ugcs);
|
|
5382
5467
|
if (!head || (ugcs == null ? void 0 : ugcs.length) == 0) return;
|
|
5383
5468
|
return {
|
|
@@ -5387,25 +5472,28 @@ var ugcExtract = (message) => __async(null, null, function* () {
|
|
|
5387
5472
|
};
|
|
5388
5473
|
});
|
|
5389
5474
|
|
|
5390
|
-
// src/@events/
|
|
5391
|
-
var
|
|
5475
|
+
// src/@events/ParseUGC.ts
|
|
5476
|
+
var ParseUGC = (stanza) => __async(null, null, function* () {
|
|
5392
5477
|
var _a, _b, _c, _d, _e;
|
|
5393
5478
|
const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
|
|
5394
5479
|
if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
|
|
5395
5480
|
for (const message of getMessages) {
|
|
5396
5481
|
const tick = performance.now();
|
|
5397
5482
|
const attributes = stanza == null ? void 0 : stanza.attributes;
|
|
5398
|
-
const
|
|
5399
|
-
if (
|
|
5400
|
-
const props =
|
|
5483
|
+
const ugc = yield ugcExtract(message);
|
|
5484
|
+
if (ugc != null) {
|
|
5485
|
+
const props = GetEventProperties({ message, attributes, ugc });
|
|
5401
5486
|
const issued = new Date(attributes.issue);
|
|
5402
|
-
const expires = new Date(
|
|
5403
|
-
const header =
|
|
5404
|
-
const matches = (_d =
|
|
5487
|
+
const expires = new Date(ugc.expires);
|
|
5488
|
+
const header = GetEventHeader({ properties: props, getType: stanza.getType });
|
|
5489
|
+
const matches = (_d = EnumMatches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
|
|
5405
5490
|
let event = matches == null ? void 0 : matches.label;
|
|
5406
5491
|
let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
|
|
5407
5492
|
if (!event) {
|
|
5408
|
-
event = stanza.getType.type
|
|
5493
|
+
event = stanza.getType.type;
|
|
5494
|
+
if (!stanza.getType.discovered) {
|
|
5495
|
+
event += ` (AWIPSID)`;
|
|
5496
|
+
}
|
|
5409
5497
|
isStatement = true;
|
|
5410
5498
|
}
|
|
5411
5499
|
bootstrap.cache.processed.push({
|
|
@@ -5424,7 +5512,7 @@ var ugc = (stanza) => __async(null, null, function* () {
|
|
|
5424
5512
|
metadata: {
|
|
5425
5513
|
ms: performance.now() - tick,
|
|
5426
5514
|
source: `events.ugc`,
|
|
5427
|
-
tracking:
|
|
5515
|
+
tracking: GetEventTracking({ type: `RAW`, stanza, attributes, properties: props }),
|
|
5428
5516
|
header,
|
|
5429
5517
|
vtec: null,
|
|
5430
5518
|
hvtec: null,
|
|
@@ -5439,21 +5527,21 @@ var ugc = (stanza) => __async(null, null, function* () {
|
|
|
5439
5527
|
}
|
|
5440
5528
|
})
|
|
5441
5529
|
});
|
|
5442
|
-
|
|
5530
|
+
SetDebug({ title: `ParseUGC`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
5443
5531
|
}
|
|
5444
5532
|
}
|
|
5445
5533
|
});
|
|
5446
5534
|
|
|
5447
|
-
// src/@
|
|
5448
|
-
var
|
|
5535
|
+
// src/@enums/Products.ts
|
|
5536
|
+
var EnumProducts = {
|
|
5449
5537
|
"O": "Operational Product",
|
|
5450
5538
|
"T": "Test Product",
|
|
5451
5539
|
"E": "Experimental Product",
|
|
5452
5540
|
"X": "Experimental Product (Non-Operational)"
|
|
5453
5541
|
};
|
|
5454
5542
|
|
|
5455
|
-
// src/@
|
|
5456
|
-
var
|
|
5543
|
+
// src/@enums/Events.ts
|
|
5544
|
+
var EnumEvents = {
|
|
5457
5545
|
"AF": "Ashfall",
|
|
5458
5546
|
"AS": "Air Stagnation",
|
|
5459
5547
|
"BH": "Beach Hazard",
|
|
@@ -5517,8 +5605,8 @@ var dict_events = {
|
|
|
5517
5605
|
"ZY": "Freezing Spray"
|
|
5518
5606
|
};
|
|
5519
5607
|
|
|
5520
|
-
// src/@
|
|
5521
|
-
var
|
|
5608
|
+
// src/@enums/Actions.ts
|
|
5609
|
+
var EnumActions = {
|
|
5522
5610
|
"W": "Warning",
|
|
5523
5611
|
"F": "Forecast",
|
|
5524
5612
|
"A": "Watch",
|
|
@@ -5528,8 +5616,8 @@ var dict_actions = {
|
|
|
5528
5616
|
"S": "Statement"
|
|
5529
5617
|
};
|
|
5530
5618
|
|
|
5531
|
-
// src/@
|
|
5532
|
-
var
|
|
5619
|
+
// src/@enums/Status.ts
|
|
5620
|
+
var EnumStatus = {
|
|
5533
5621
|
"NEW": "Issued",
|
|
5534
5622
|
"CON": "Updated",
|
|
5535
5623
|
"EXT": "Extended",
|
|
@@ -5542,8 +5630,8 @@ var dict_status = {
|
|
|
5542
5630
|
"EXP": "Expired"
|
|
5543
5631
|
};
|
|
5544
5632
|
|
|
5545
|
-
// src/@parsers/@pvtec/
|
|
5546
|
-
var
|
|
5633
|
+
// src/@parsers/@pvtec/GetExpiry.ts
|
|
5634
|
+
var GetExpiry2 = (dates) => {
|
|
5547
5635
|
if ((dates == null ? void 0 : dates[1]) == `000000T0000Z`) return "Invalid Date Format";
|
|
5548
5636
|
const expires = `${(/* @__PURE__ */ new Date()).getFullYear().toString().substring(0, 2)}${dates[1].substring(0, 2)}-${dates[1].substring(2, 4)}-${dates[1].substring(4, 6)}T${dates[1].substring(7, 9)}:${dates[1].substring(9, 11)}:00`;
|
|
5549
5637
|
const local = new Date(new Date(expires).getTime() - 4 * 60 * 6e4);
|
|
@@ -5551,24 +5639,24 @@ var getExpiry2 = (dates) => {
|
|
|
5551
5639
|
return `${local.getFullYear()}-${pad(local.getMonth() + 1)}-${pad(local.getDate())}T${pad(local.getHours())}:${pad(local.getMinutes())}:00.000-04:00`;
|
|
5552
5640
|
};
|
|
5553
5641
|
|
|
5554
|
-
// src/@parsers/@pvtec/
|
|
5555
|
-
var
|
|
5642
|
+
// src/@parsers/@pvtec/VTECExtract.ts
|
|
5643
|
+
var VTECExtract = (message) => {
|
|
5556
5644
|
var _a, _b, _c, _d;
|
|
5557
5645
|
if (!message) return null;
|
|
5558
|
-
const getVTECs = (_a = message.match(
|
|
5646
|
+
const getVTECs = (_a = message.match(EnumExpressions.pvtec)) != null ? _a : [];
|
|
5559
5647
|
const vtecs = [];
|
|
5560
|
-
for (const
|
|
5561
|
-
const sub =
|
|
5648
|
+
for (const vtec of getVTECs) {
|
|
5649
|
+
const sub = vtec.split(`.`);
|
|
5562
5650
|
if ((sub == null ? void 0 : sub.length) < 7) continue;
|
|
5563
5651
|
const dates = (_b = sub[6]) == null ? void 0 : _b.split(`-`);
|
|
5564
5652
|
vtecs.push({
|
|
5565
|
-
vtec
|
|
5566
|
-
product:
|
|
5653
|
+
vtec,
|
|
5654
|
+
product: EnumProducts[sub[0]],
|
|
5567
5655
|
tracking: `${sub[2]}.${sub[3]}.${sub[4]}.${sub[5]}`,
|
|
5568
|
-
event: `${
|
|
5569
|
-
status:
|
|
5570
|
-
organization: (_d = (_c = message.match(
|
|
5571
|
-
expires:
|
|
5656
|
+
event: `${EnumEvents[sub[3]]} ${EnumActions[sub[4]]}`,
|
|
5657
|
+
status: EnumStatus[sub[1]],
|
|
5658
|
+
organization: (_d = (_c = message.match(EnumExpressions.wmo)) == null ? void 0 : _c[0]) != null ? _d : null,
|
|
5659
|
+
expires: GetExpiry2(dates),
|
|
5572
5660
|
is_watch: (sub[4] == `A` || sub[4] == `Y`) && (sub[3] == `TO` || sub[3] == `SV`),
|
|
5573
5661
|
prediction_center: sub[2] == `KWNS` ? true : false
|
|
5574
5662
|
});
|
|
@@ -5576,8 +5664,8 @@ var pvExtract = (message) => {
|
|
|
5576
5664
|
return vtecs.length > 0 ? vtecs : null;
|
|
5577
5665
|
};
|
|
5578
5666
|
|
|
5579
|
-
// src/@
|
|
5580
|
-
var
|
|
5667
|
+
// src/@enums/Causes.ts
|
|
5668
|
+
var EnumCauses = {
|
|
5581
5669
|
"SM": "Snow Melt",
|
|
5582
5670
|
"RS": "Rain/Snow Melt",
|
|
5583
5671
|
"ER": "Excessive Rain",
|
|
@@ -5595,16 +5683,16 @@ var dict_causes = {
|
|
|
5595
5683
|
"OT": "Other Effects"
|
|
5596
5684
|
};
|
|
5597
5685
|
|
|
5598
|
-
// src/@
|
|
5599
|
-
var
|
|
5686
|
+
// src/@enums/Records.ts
|
|
5687
|
+
var EnumRecords = {
|
|
5600
5688
|
"NO": "No Record Expected",
|
|
5601
5689
|
"NR": "Near Record or possible record",
|
|
5602
5690
|
"UU": "Unknown history of records",
|
|
5603
5691
|
"OO": "Other"
|
|
5604
5692
|
};
|
|
5605
5693
|
|
|
5606
|
-
// src/@
|
|
5607
|
-
var
|
|
5694
|
+
// src/@enums/Severity.ts
|
|
5695
|
+
var EnumSeverity = {
|
|
5608
5696
|
N: "Not Expected",
|
|
5609
5697
|
0: "Areal Flood or FF Product",
|
|
5610
5698
|
1: "Minor",
|
|
@@ -5613,42 +5701,42 @@ var dict_severity = {
|
|
|
5613
5701
|
U: "Unknown"
|
|
5614
5702
|
};
|
|
5615
5703
|
|
|
5616
|
-
// src/@parsers/@hvtec/
|
|
5617
|
-
var
|
|
5704
|
+
// src/@parsers/@hvtec/HVExtract.ts
|
|
5705
|
+
var HVExtract = (message) => {
|
|
5618
5706
|
var _a;
|
|
5619
|
-
const getHVTECs = (_a = message.match(
|
|
5707
|
+
const getHVTECs = (_a = message.match(EnumExpressions.hvtec)) != null ? _a : [];
|
|
5620
5708
|
const vtecs = [];
|
|
5621
|
-
for (const
|
|
5622
|
-
const sub =
|
|
5709
|
+
for (const vtec of getHVTECs) {
|
|
5710
|
+
const sub = vtec.split(`.`);
|
|
5623
5711
|
if (sub.length < 7) continue;
|
|
5624
5712
|
vtecs.push({
|
|
5625
|
-
hvtec:
|
|
5626
|
-
severity:
|
|
5627
|
-
cause:
|
|
5628
|
-
record:
|
|
5713
|
+
hvtec: vtec,
|
|
5714
|
+
severity: EnumSeverity[sub[1]],
|
|
5715
|
+
cause: EnumCauses[sub[2]],
|
|
5716
|
+
record: EnumRecords[sub[6]]
|
|
5629
5717
|
});
|
|
5630
5718
|
}
|
|
5631
5719
|
return vtecs.length > 0 ? vtecs : null;
|
|
5632
5720
|
};
|
|
5633
5721
|
|
|
5634
|
-
// src/@events/
|
|
5635
|
-
var
|
|
5722
|
+
// src/@events/ParseVTEC.ts
|
|
5723
|
+
var ParseVTEC = (stanza) => __async(null, null, function* () {
|
|
5636
5724
|
var _a, _b, _c, _d, _e;
|
|
5637
5725
|
const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
|
|
5638
5726
|
if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
|
|
5639
5727
|
for (const message of getMessages) {
|
|
5640
5728
|
const tick = performance.now();
|
|
5641
5729
|
const attributes = stanza == null ? void 0 : stanza.attributes;
|
|
5642
|
-
const pVtec =
|
|
5643
|
-
const hVtec =
|
|
5644
|
-
const
|
|
5645
|
-
if (pVtec != null &&
|
|
5730
|
+
const pVtec = VTECExtract(message);
|
|
5731
|
+
const hVtec = HVExtract(message);
|
|
5732
|
+
const ugc = yield ugcExtract(message);
|
|
5733
|
+
if (pVtec != null && ugc != null) {
|
|
5646
5734
|
for (const pv of pVtec) {
|
|
5647
|
-
const
|
|
5648
|
-
const props =
|
|
5649
|
-
const header =
|
|
5735
|
+
const vtec = pv;
|
|
5736
|
+
const props = GetEventProperties({ message, attributes, ugc, pVtec: vtec });
|
|
5737
|
+
const header = GetEventHeader({ properties: props, getType: stanza.getType, vtec });
|
|
5650
5738
|
const issued = (_d = new Date(attributes.issue)) != null ? _d : /* @__PURE__ */ new Date();
|
|
5651
|
-
const expires = new Date(
|
|
5739
|
+
const expires = new Date(vtec.expires);
|
|
5652
5740
|
bootstrap.cache.processed.push({
|
|
5653
5741
|
type: `Feature`,
|
|
5654
5742
|
geometry: {
|
|
@@ -5660,12 +5748,12 @@ var vtec = (stanza) => __async(null, null, function* () {
|
|
|
5660
5748
|
parent: pv.event,
|
|
5661
5749
|
status: pv.status,
|
|
5662
5750
|
issued: !isNaN(issued.getTime()) ? issued.toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
5663
|
-
expires: !isNaN(expires.getTime()) ? expires.toISOString() : (_e =
|
|
5751
|
+
expires: !isNaN(expires.getTime()) ? expires.toISOString() : (_e = ugc.expires) != null ? _e : new Date(issued.getTime() + 60 * 60 * 1e3).toISOString()
|
|
5664
5752
|
}, props), {
|
|
5665
5753
|
metadata: {
|
|
5666
5754
|
ms: performance.now() - tick,
|
|
5667
5755
|
source: `events.vtec`,
|
|
5668
|
-
tracking:
|
|
5756
|
+
tracking: GetEventTracking({ type: `VTEC`, stanza, attributes, properties: props, vtec }),
|
|
5669
5757
|
header,
|
|
5670
5758
|
vtec: pv,
|
|
5671
5759
|
hvtec: hVtec,
|
|
@@ -5680,19 +5768,19 @@ var vtec = (stanza) => __async(null, null, function* () {
|
|
|
5680
5768
|
}
|
|
5681
5769
|
})
|
|
5682
5770
|
});
|
|
5683
|
-
|
|
5771
|
+
SetDebug({ title: `ParseVTEC`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
5684
5772
|
}
|
|
5685
5773
|
}
|
|
5686
5774
|
}
|
|
5687
5775
|
});
|
|
5688
5776
|
|
|
5689
|
-
// src/@events/
|
|
5690
|
-
var
|
|
5777
|
+
// src/@events/ParseAPI.ts
|
|
5778
|
+
var ParseAPI = (stanza) => __async(null, null, function* () {
|
|
5691
5779
|
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, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub;
|
|
5692
5780
|
const messages = Object.values(JSON.parse(stanza.message).features);
|
|
5693
5781
|
for (const feature of messages) {
|
|
5694
5782
|
const tick = performance.now();
|
|
5695
|
-
const pVtec = (_d =
|
|
5783
|
+
const pVtec = (_d = VTECExtract((_c = (_b = (_a = feature == null ? void 0 : feature.properties) == null ? void 0 : _a.parameters) == null ? void 0 : _b.VTEC) == null ? void 0 : _c[0])) != null ? _d : null;
|
|
5696
5784
|
bootstrap.cache.processed.push({
|
|
5697
5785
|
type: `Feature`,
|
|
5698
5786
|
geometry: {
|
|
@@ -5712,7 +5800,7 @@ var api = (stanza) => __async(null, null, function* () {
|
|
|
5712
5800
|
geocode: {
|
|
5713
5801
|
office: {
|
|
5714
5802
|
office: pVtec ? (_w = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _w.tracking.split(`.`)[0] : null,
|
|
5715
|
-
name: (_y =
|
|
5803
|
+
name: (_y = EnumICAO[pVtec ? (_x = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _x.tracking.split(`.`)[0] : null]) != null ? _y : null
|
|
5716
5804
|
},
|
|
5717
5805
|
organization: (_B = (_A = (_z = feature == null ? void 0 : feature.properties) == null ? void 0 : _z.parameters) == null ? void 0 : _A.WMOidentifier) == null ? void 0 : _B[0],
|
|
5718
5806
|
ugc: (_E = (_D = (_C = feature == null ? void 0 : feature.properties) == null ? void 0 : _C.geocode) == null ? void 0 : _D.UGC) != null ? _E : [],
|
|
@@ -5720,11 +5808,11 @@ var api = (stanza) => __async(null, null, function* () {
|
|
|
5720
5808
|
polygon_generated: ((_H = feature == null ? void 0 : feature.geometry) == null ? void 0 : _H.coordinates.length) > 0 ? true : false
|
|
5721
5809
|
},
|
|
5722
5810
|
parameters: {
|
|
5723
|
-
tags:
|
|
5811
|
+
tags: GetEventTags((_I = feature == null ? void 0 : feature.properties) == null ? void 0 : _I.description),
|
|
5724
5812
|
instructions: (_K = (_J = feature == null ? void 0 : feature.properties) == null ? void 0 : _J.instruction) != null ? _K : null,
|
|
5725
|
-
source: (_M =
|
|
5726
|
-
hazards: (_O =
|
|
5727
|
-
impacts: (_Q =
|
|
5813
|
+
source: (_M = GetTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
|
|
5814
|
+
hazards: (_O = GetTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
|
|
5815
|
+
impacts: (_Q = GetTextFromProduct({ message: (_P = feature == null ? void 0 : feature.properties) == null ? void 0 : _P.description, find: [`IMPACT...`], removal: [`.`] })) != null ? _Q : null,
|
|
5728
5816
|
estimated_hail_size: (_U = (_T = (_S = (_R = feature == null ? void 0 : feature.properties) == null ? void 0 : _R.parameters) == null ? void 0 : _S.maxHailSize) == null ? void 0 : _T[0]) != null ? _U : null,
|
|
5729
5817
|
estimated_wind_gusts: (_Y = (_X = (_W = (_V = feature == null ? void 0 : feature.properties) == null ? void 0 : _V.parameters) == null ? void 0 : _W.maxWindGust) == null ? void 0 : _X[0]) != null ? _Y : null,
|
|
5730
5818
|
damage_threat: (_aa = (_$ = (__ = (_Z = feature == null ? void 0 : feature.properties) == null ? void 0 : _Z.parameters) == null ? void 0 : __.thunderstormDamageThreat) == null ? void 0 : _$[0]) != null ? _aa : null,
|
|
@@ -5734,31 +5822,31 @@ var api = (stanza) => __async(null, null, function* () {
|
|
|
5734
5822
|
hail_threat: (_qa = (_pa = (_oa = (_na = feature == null ? void 0 : feature.properties) == null ? void 0 : _na.parameters) == null ? void 0 : _oa.hailThreat) == null ? void 0 : _pa[0]) != null ? _qa : null
|
|
5735
5823
|
},
|
|
5736
5824
|
discussion_parameters: {
|
|
5737
|
-
discussion_number: (_ua = (_ta = (_sa =
|
|
5738
|
-
discussion_concerning: (_wa =
|
|
5739
|
-
discussion_max_tornado: (_ya =
|
|
5740
|
-
discussion_max_hail: (_Aa =
|
|
5741
|
-
discussion_max_wind: (_Ca =
|
|
5742
|
-
discussion_watch_issuance: (_Ea =
|
|
5825
|
+
discussion_number: (_ua = (_ta = (_sa = GetTextFromProduct({ message: (_ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _ra.description, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })) == null ? void 0 : _sa.toString()) == null ? void 0 : _ta.padStart(4, "0")) != null ? _ua : null,
|
|
5826
|
+
discussion_concerning: (_wa = GetTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
|
|
5827
|
+
discussion_max_tornado: (_ya = GetTextFromProduct({ message: (_xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _xa.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _ya : null,
|
|
5828
|
+
discussion_max_hail: (_Aa = GetTextFromProduct({ message: (_za = feature == null ? void 0 : feature.properties) == null ? void 0 : _za.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _Aa : null,
|
|
5829
|
+
discussion_max_wind: (_Ca = GetTextFromProduct({ message: (_Ba = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ba.description, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _Ca : null,
|
|
5830
|
+
discussion_watch_issuance: (_Ea = GetTextFromProduct({ message: (_Da = feature == null ? void 0 : feature.properties) == null ? void 0 : _Da.description, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _Ea : null
|
|
5743
5831
|
},
|
|
5744
5832
|
watch_parameters: {
|
|
5745
|
-
watch_number: ((_Fa = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _Fa.is_watch) && ((_Qa = (_Pa = (_Ka = (_Ja = (_Ia = (_Ha =
|
|
5833
|
+
watch_number: ((_Fa = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _Fa.is_watch) && ((_Qa = (_Pa = (_Ka = (_Ja = (_Ia = (_Ha = GetTextFromProduct({ message: (_Ga = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ga.description, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })) == null ? void 0 : _Ha.replace(/(WT|WS|)/g, "")) == null ? void 0 : _Ia.trim()) == null ? void 0 : _Ja.toString()) == null ? void 0 : _Ka.padStart(4, "0")) != null ? _Pa : (_Oa = (_Na = (_Ma = (_La = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _La.tracking) == null ? void 0 : _Ma.slice(-4)) == null ? void 0 : _Na.toString()) == null ? void 0 : _Oa.padStart(4, "0")) != null ? _Qa : null),
|
|
5746
5834
|
watch_type: ((_Ra = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ra.description.includes(`TORNADO WATCH`)) ? `Tornado` : ((_Sa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Sa.description.includes(`SEVERE`)) ? `Severe` : null,
|
|
5747
|
-
additional_tornadoes_probability: (_Ua =
|
|
5748
|
-
strong_tornadoes_probability: (_Wa =
|
|
5749
|
-
severe_wind_probability: (_Ya =
|
|
5750
|
-
severe_hail_probability: (__a =
|
|
5751
|
-
hail_2in_probability: (_ab =
|
|
5752
|
-
combined_hail_wind_probability: (_cb =
|
|
5753
|
-
max_hail_in: (_eb =
|
|
5754
|
-
max_wind_surface: (_gb =
|
|
5755
|
-
max_tops_x100feet: (_ib =
|
|
5756
|
-
pds_watch:
|
|
5835
|
+
additional_tornadoes_probability: (_Ua = GetTextFromProduct({ message: (_Ta = feature == null ? void 0 : feature.properties) == null ? void 0 : _Ta.description, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Ua : null,
|
|
5836
|
+
strong_tornadoes_probability: (_Wa = GetTextFromProduct({ message: (_Va = feature == null ? void 0 : feature.properties) == null ? void 0 : _Va.description, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Wa : null,
|
|
5837
|
+
severe_wind_probability: (_Ya = GetTextFromProduct({ message: (_Xa = feature == null ? void 0 : feature.properties) == null ? void 0 : _Xa.description, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _Ya : null,
|
|
5838
|
+
severe_hail_probability: (__a = GetTextFromProduct({ message: (_Za = feature == null ? void 0 : feature.properties) == null ? void 0 : _Za.description, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? __a : null,
|
|
5839
|
+
hail_2in_probability: (_ab = GetTextFromProduct({ message: (_$a = feature == null ? void 0 : feature.properties) == null ? void 0 : _$a.description, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _ab : null,
|
|
5840
|
+
combined_hail_wind_probability: (_cb = GetTextFromProduct({ message: (_bb = feature == null ? void 0 : feature.properties) == null ? void 0 : _bb.description, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _cb : null,
|
|
5841
|
+
max_hail_in: (_eb = GetTextFromProduct({ message: (_db = feature == null ? void 0 : feature.properties) == null ? void 0 : _db.description, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _eb : null,
|
|
5842
|
+
max_wind_surface: (_gb = GetTextFromProduct({ message: (_fb = feature == null ? void 0 : feature.properties) == null ? void 0 : _fb.description, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _gb : null,
|
|
5843
|
+
max_tops_x100feet: (_ib = GetTextFromProduct({ message: (_hb = feature == null ? void 0 : feature.properties) == null ? void 0 : _hb.description, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _ib : null,
|
|
5844
|
+
pds_watch: GetTextFromProduct({ message: (_jb = feature == null ? void 0 : feature.properties) == null ? void 0 : _jb.description, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`
|
|
5757
5845
|
},
|
|
5758
5846
|
metadata: {
|
|
5759
5847
|
ms: performance.now() - tick,
|
|
5760
5848
|
source: `events.api`,
|
|
5761
|
-
tracking:
|
|
5849
|
+
tracking: GetEventTracking({ type: `API`, organization: { wmoidentifier: (_mb = (_lb = (_kb = feature == null ? void 0 : feature.properties) == null ? void 0 : _kb.parameters) == null ? void 0 : _lb.WMOidentifier) == null ? void 0 : _mb[0], featureId: feature == null ? void 0 : feature.id }, vtec: pVtec == null ? void 0 : pVtec[0] }),
|
|
5762
5850
|
header: `ZCZC-ATMOSX-${(_ob = (_nb = feature == null ? void 0 : feature.properties) == null ? void 0 : _nb.parameters) == null ? void 0 : _ob.WMOidentifier}`,
|
|
5763
5851
|
vtec: pVtec == null ? void 0 : pVtec[0],
|
|
5764
5852
|
hvtec: null,
|
|
@@ -5773,12 +5861,12 @@ var api = (stanza) => __async(null, null, function* () {
|
|
|
5773
5861
|
}
|
|
5774
5862
|
}
|
|
5775
5863
|
});
|
|
5776
|
-
|
|
5864
|
+
SetDebug({ title: `ParseAPI`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
5777
5865
|
}
|
|
5778
5866
|
});
|
|
5779
5867
|
|
|
5780
|
-
// src/@
|
|
5781
|
-
var
|
|
5868
|
+
// src/@enums/Enhanced.ts
|
|
5869
|
+
var EnumEnhanced = {
|
|
5782
5870
|
"Tornado Warning": {
|
|
5783
5871
|
"Tornado Emergency": { description: "tornado emergency" },
|
|
5784
5872
|
"PDS Tornado Warning": { description: "particularly dangerous situation", damage: `CONSIDERABLE` },
|
|
@@ -5822,19 +5910,15 @@ var dict_enhanced = {
|
|
|
5822
5910
|
}
|
|
5823
5911
|
};
|
|
5824
5912
|
|
|
5825
|
-
// src/@building/
|
|
5826
|
-
var
|
|
5827
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i
|
|
5828
|
-
const configurations = bootstrap.settings;
|
|
5913
|
+
// src/@building/GetEventEnhancedName.ts
|
|
5914
|
+
var GetEventEnhancedName = (event) => {
|
|
5915
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
5829
5916
|
let name = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.event;
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
const
|
|
5834
|
-
|
|
5835
|
-
const pdswatch = (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.watch_parameters) == null ? void 0 : _h.pds_watch;
|
|
5836
|
-
const description = (_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.description) == null ? void 0 : _j.toLowerCase();
|
|
5837
|
-
for (const [eventKey, eventConfig] of Object.entries(dict_enhanced)) {
|
|
5917
|
+
const damage = (_c = (_b = event == null ? void 0 : event.properties) == null ? void 0 : _b.parameters) == null ? void 0 : _c.damage_threat;
|
|
5918
|
+
const tornado = (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.parameters) == null ? void 0 : _e.tornado_threat;
|
|
5919
|
+
const pdswatch = (_g = (_f = event == null ? void 0 : event.properties) == null ? void 0 : _f.watch_parameters) == null ? void 0 : _g.pds_watch;
|
|
5920
|
+
const description = (_i = (_h = event == null ? void 0 : event.properties) == null ? void 0 : _h.description) == null ? void 0 : _i.toLowerCase();
|
|
5921
|
+
for (const [eventKey, eventConfig] of Object.entries(EnumEnhanced)) {
|
|
5838
5922
|
if (eventKey !== name) continue;
|
|
5839
5923
|
for (const [paramKey, paramValue] of Object.entries(eventConfig)) {
|
|
5840
5924
|
let matches = true;
|
|
@@ -5859,8 +5943,8 @@ var getEventEnhancedName = (event) => {
|
|
|
5859
5943
|
return name;
|
|
5860
5944
|
};
|
|
5861
5945
|
|
|
5862
|
-
// src/@
|
|
5863
|
-
var
|
|
5946
|
+
// src/@enums/Correlations.ts
|
|
5947
|
+
var EnumCorrelations = [
|
|
5864
5948
|
{ type: "Statement", name: "Statement", isCancel: false, isUpdate: false, isIssued: true, isStatement: true },
|
|
5865
5949
|
{ type: "Update", name: "Updated", isCancel: false, isUpdate: true, isIssued: false, isStatement: false },
|
|
5866
5950
|
{ type: "Cancel", name: "Cancelled", isCancel: true, isUpdate: false, isIssued: false, isStatement: false },
|
|
@@ -5875,8 +5959,8 @@ var dict_correlations = [
|
|
|
5875
5959
|
{ type: "Routine", name: "Routine", isCancel: false, isUpdate: true, isIssued: false, isStatement: false }
|
|
5876
5960
|
];
|
|
5877
5961
|
|
|
5878
|
-
// src/@
|
|
5879
|
-
var
|
|
5962
|
+
// src/@enums/Cancellation.ts
|
|
5963
|
+
var EnumCancellation = [
|
|
5880
5964
|
"has been cancelled",
|
|
5881
5965
|
"subsided sufficiently for the advisory to be cancelled",
|
|
5882
5966
|
"has been cancelled",
|
|
@@ -5889,22 +5973,24 @@ var dict_cancellation = [
|
|
|
5889
5973
|
"has weakened below severe"
|
|
5890
5974
|
];
|
|
5891
5975
|
|
|
5892
|
-
// src/@
|
|
5893
|
-
var
|
|
5976
|
+
// src/@enums/Testing.ts
|
|
5977
|
+
var EnumTesting = [
|
|
5894
5978
|
`This is a test message`,
|
|
5895
5979
|
`Monitoring message only.`,
|
|
5896
5980
|
`THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY`,
|
|
5897
5981
|
"TEST MESSAGE"
|
|
5898
5982
|
];
|
|
5899
5983
|
|
|
5900
|
-
// src/@
|
|
5901
|
-
var
|
|
5984
|
+
// src/@enums/Hail.ts
|
|
5985
|
+
var EnumHail = {
|
|
5986
|
+
"0.25": "Pea",
|
|
5902
5987
|
".25": "Pea",
|
|
5988
|
+
"0.50": "Penny",
|
|
5903
5989
|
".50": "Penny",
|
|
5904
5990
|
".75": "Penny",
|
|
5905
5991
|
"Up to .75": "Penny",
|
|
5906
|
-
".88": "Nickel",
|
|
5907
5992
|
"0.75": "Penny",
|
|
5993
|
+
".88": "Nickel",
|
|
5908
5994
|
"0.88": "Nickel",
|
|
5909
5995
|
"1.00": "Quarter",
|
|
5910
5996
|
"1.25": "Half Dollar",
|
|
@@ -5916,62 +6002,62 @@ var dict_hail = {
|
|
|
5916
6002
|
"4.00": "CD/DVD"
|
|
5917
6003
|
};
|
|
5918
6004
|
|
|
5919
|
-
// src/@building/
|
|
5920
|
-
var
|
|
6005
|
+
// src/@building/GetEventSignature.ts
|
|
6006
|
+
var GetEventSignature = (event) => {
|
|
5921
6007
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5922
|
-
const
|
|
5923
|
-
const
|
|
5924
|
-
const status =
|
|
5925
|
-
const csig =
|
|
5926
|
-
|
|
5927
|
-
if ((_c =
|
|
5928
|
-
|
|
6008
|
+
const properties = event == null ? void 0 : event.properties;
|
|
6009
|
+
const vtec = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.vtec;
|
|
6010
|
+
const status = EnumCorrelations.find((c) => c.type === (properties == null ? void 0 : properties.status));
|
|
6011
|
+
const csig = EnumCancellation.find((sig) => properties.description.toLowerCase().includes(sig.toLowerCase()));
|
|
6012
|
+
properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_issued: true, is_test: false });
|
|
6013
|
+
if ((_c = properties == null ? void 0 : properties.parameters) == null ? void 0 : _c.estimated_hail_size) {
|
|
6014
|
+
properties.parameters.estimated_hail_size += ` (${(_e = EnumHail[(_d = properties == null ? void 0 : properties.parameters) == null ? void 0 : _d.estimated_hail_size]) != null ? _e : "--"})`;
|
|
5929
6015
|
}
|
|
5930
6016
|
if (status) {
|
|
5931
|
-
|
|
5932
|
-
|
|
6017
|
+
properties.status = (_f = status.name) != null ? _f : properties.status;
|
|
6018
|
+
properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_updated: !!status.isUpdate, is_issued: !!status.isIssued, is_expired: !!status.isCancel, is_statement: !!status.isStatement });
|
|
5933
6019
|
}
|
|
5934
6020
|
if (csig) {
|
|
5935
|
-
|
|
6021
|
+
properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
|
|
5936
6022
|
}
|
|
5937
|
-
const getProduct = (_h = (_g =
|
|
5938
|
-
const isTestProduct =
|
|
5939
|
-
if (isTestProduct ||
|
|
6023
|
+
const getProduct = (_h = (_g = vtec == null ? void 0 : vtec.vtec) == null ? void 0 : _g.split(`.`)[0]) == null ? void 0 : _h.replace(`/`, ``);
|
|
6024
|
+
const isTestProduct = EnumProducts[getProduct] == `Test Product`;
|
|
6025
|
+
if (isTestProduct || EnumTesting.some((sig) => {
|
|
5940
6026
|
var _a2, _b2, _c2, _d2;
|
|
5941
|
-
return (_d2 = (_a2 =
|
|
6027
|
+
return (_d2 = (_a2 = properties.description) == null ? void 0 : _a2.toLowerCase().includes(sig.toLowerCase())) != null ? _d2 : (_c2 = (_b2 = properties == null ? void 0 : properties.parameters) == null ? void 0 : _b2.instructions) == null ? void 0 : _c2.toLowerCase().includes(sig.toLowerCase());
|
|
5942
6028
|
})) {
|
|
5943
|
-
|
|
6029
|
+
properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_test: true });
|
|
5944
6030
|
}
|
|
5945
|
-
if (new Date(
|
|
5946
|
-
|
|
6031
|
+
if (new Date(properties.expires).getTime() < Date.now()) {
|
|
6032
|
+
properties.status_metadata = __spreadProps(__spreadValues({}, properties.status_metadata), { is_expired: true });
|
|
5947
6033
|
}
|
|
5948
|
-
|
|
6034
|
+
properties.status_metadata = __spreadValues({}, properties.status_metadata);
|
|
5949
6035
|
return event;
|
|
5950
6036
|
};
|
|
5951
6037
|
|
|
5952
|
-
// src/@
|
|
5953
|
-
var
|
|
5954
|
-
"
|
|
5955
|
-
"
|
|
5956
|
-
"
|
|
6038
|
+
// src/@enums/GlobalFilter.ts
|
|
6039
|
+
var EnumGlobalFilter = [
|
|
6040
|
+
"storm prediction center day 1 outlook",
|
|
6041
|
+
"storm prediction center day 2 outlook",
|
|
6042
|
+
"storm prediction center day 3 outlook"
|
|
5957
6043
|
];
|
|
5958
6044
|
|
|
5959
|
-
// src/@manager/
|
|
5960
|
-
var
|
|
5961
|
-
if (entry) {
|
|
5962
|
-
entry.hashes.push(event.properties.metadata.hash);
|
|
5963
|
-
entry.expires = event.properties.expires;
|
|
5964
|
-
} else {
|
|
6045
|
+
// src/@manager/SetHash.ts
|
|
6046
|
+
var SetHash = (event, entry) => {
|
|
6047
|
+
if (!entry) {
|
|
5965
6048
|
bootstrap.cache.hashes.push({
|
|
5966
6049
|
tracking: event.properties.metadata.tracking,
|
|
5967
6050
|
hashes: [event.properties.metadata.hash],
|
|
5968
6051
|
expires: event.properties.expires
|
|
5969
6052
|
});
|
|
6053
|
+
return;
|
|
5970
6054
|
}
|
|
6055
|
+
entry.hashes.push(event.properties.metadata.hash);
|
|
6056
|
+
entry.expires = event.properties.expires;
|
|
5971
6057
|
};
|
|
5972
6058
|
|
|
5973
|
-
// src/@modules/@eas/
|
|
5974
|
-
var
|
|
6059
|
+
// src/@modules/@eas/GetWavPCM16.ts
|
|
6060
|
+
var GetWavPCM16 = (buffer) => {
|
|
5975
6061
|
if (buffer.toString("ascii", 0, 4) !== "RIFF" || buffer.toString("ascii", 8, 12) !== "WAVE") {
|
|
5976
6062
|
return null;
|
|
5977
6063
|
}
|
|
@@ -5999,8 +6085,8 @@ var getWavPCM16 = (buffer) => {
|
|
|
5999
6085
|
return { samples: new Int16Array(samples), sampleRate, channels, bitsPerSample };
|
|
6000
6086
|
};
|
|
6001
6087
|
|
|
6002
|
-
// src/@modules/@eas/
|
|
6003
|
-
var
|
|
6088
|
+
// src/@modules/@eas/GetSampledPCM16.ts
|
|
6089
|
+
var GetSampledPCM16 = (int16, originalRate, targetRate) => {
|
|
6004
6090
|
if (originalRate === targetRate) return int16;
|
|
6005
6091
|
const ratio = targetRate / originalRate;
|
|
6006
6092
|
const outLen = Math.max(1, Math.round(int16.length * ratio));
|
|
@@ -6016,15 +6102,15 @@ var getSampledPCM16 = (int16, originalRate, targetRate) => {
|
|
|
6016
6102
|
return out;
|
|
6017
6103
|
};
|
|
6018
6104
|
|
|
6019
|
-
// src/@modules/@eas/
|
|
6020
|
-
var
|
|
6105
|
+
// src/@modules/@eas/GetPCMToFloat.ts
|
|
6106
|
+
var GetPCMToFloat = (int16) => {
|
|
6021
6107
|
const out = new Float32Array(int16.length);
|
|
6022
6108
|
for (let i = 0; i < int16.length; i++) out[i] = int16[i] / 32768;
|
|
6023
6109
|
return out;
|
|
6024
6110
|
};
|
|
6025
6111
|
|
|
6026
|
-
// src/@modules/@eas/
|
|
6027
|
-
var
|
|
6112
|
+
// src/@modules/@eas/GetFloatPCM16.ts
|
|
6113
|
+
var GetFloatPCM16 = (float32) => {
|
|
6028
6114
|
const out = new Int16Array(float32.length);
|
|
6029
6115
|
for (let i = 0; i < float32.length; i++) {
|
|
6030
6116
|
let v = Math.max(-1, Math.min(1, float32[i]));
|
|
@@ -6033,11 +6119,11 @@ var getFloatPCM16 = (float32) => {
|
|
|
6033
6119
|
return out;
|
|
6034
6120
|
};
|
|
6035
6121
|
|
|
6036
|
-
// src/@modules/@eas/
|
|
6037
|
-
var
|
|
6122
|
+
// src/@modules/@eas/SetRadioEffect.ts
|
|
6123
|
+
var SetRadioEffect = (int16, sampleRate) => {
|
|
6038
6124
|
const hpCut = 3555;
|
|
6039
6125
|
const lpCut = 1600;
|
|
6040
|
-
const x =
|
|
6126
|
+
const x = GetPCMToFloat(int16);
|
|
6041
6127
|
const dt = 1 / sampleRate;
|
|
6042
6128
|
const rcHP = 1 / (2 * Math.PI * hpCut);
|
|
6043
6129
|
const aHP = rcHP / (rcHP + dt);
|
|
@@ -6058,11 +6144,11 @@ var setRadioEffect = (int16, sampleRate) => {
|
|
|
6058
6144
|
const compGain = 2;
|
|
6059
6145
|
const norm = Math.tanh(compGain);
|
|
6060
6146
|
for (let i = 0; i < x.length; i++) x[i] = Math.tanh(x[i] * compGain) / norm;
|
|
6061
|
-
return
|
|
6147
|
+
return GetFloatPCM16(x);
|
|
6062
6148
|
};
|
|
6063
6149
|
|
|
6064
|
-
// src/@modules/@eas/
|
|
6065
|
-
var
|
|
6150
|
+
// src/@modules/@eas/SetAFSK.ts
|
|
6151
|
+
var SetAFSK = (bits, sampleRate) => {
|
|
6066
6152
|
const baud = 520.83;
|
|
6067
6153
|
const markFreq = 2083.3;
|
|
6068
6154
|
const spaceFreq = 1562.5;
|
|
@@ -6093,8 +6179,8 @@ var setAFSK = (bits, sampleRate) => {
|
|
|
6093
6179
|
return Int16Array.from(result);
|
|
6094
6180
|
};
|
|
6095
6181
|
|
|
6096
|
-
// src/@modules/@eas/
|
|
6097
|
-
var
|
|
6182
|
+
// src/@modules/@eas/SetAsciiToBits.ts
|
|
6183
|
+
var SetAsciiToBits = (str) => {
|
|
6098
6184
|
const bits = [];
|
|
6099
6185
|
for (let i = 0; i < str.length; i++) {
|
|
6100
6186
|
const c = str.charCodeAt(i) & 255;
|
|
@@ -6105,8 +6191,8 @@ var setAsciiToBits = (str) => {
|
|
|
6105
6191
|
return bits;
|
|
6106
6192
|
};
|
|
6107
6193
|
|
|
6108
|
-
// src/@modules/@eas/
|
|
6109
|
-
var
|
|
6194
|
+
// src/@modules/@eas/GetMergedPCM16.ts
|
|
6195
|
+
var GetMergedPCM16 = (arrays) => {
|
|
6110
6196
|
let total = 0;
|
|
6111
6197
|
for (const a of arrays) total += a.length;
|
|
6112
6198
|
const out = new Int16Array(total);
|
|
@@ -6118,16 +6204,16 @@ var getMergedPCM16 = (arrays) => {
|
|
|
6118
6204
|
return out;
|
|
6119
6205
|
};
|
|
6120
6206
|
|
|
6121
|
-
// src/@modules/@eas/
|
|
6122
|
-
var
|
|
6207
|
+
// src/@modules/@eas/SetSameHeader.ts
|
|
6208
|
+
var SetSameHeader = (vtec, repeats, sampleRate = 8e3, options = {}) => {
|
|
6123
6209
|
var _a, _b;
|
|
6124
6210
|
const preMarkSec = (_a = options.preMarkSec) != null ? _a : 0.3;
|
|
6125
6211
|
const gapSec = (_b = options.gapSec) != null ? _b : 0.1;
|
|
6126
6212
|
const bursts = [];
|
|
6127
6213
|
const gap = new Int16Array(Math.floor(gapSec * sampleRate));
|
|
6128
6214
|
for (let i = 0; i < repeats; i++) {
|
|
6129
|
-
const bodyBits =
|
|
6130
|
-
const body =
|
|
6215
|
+
const bodyBits = SetAsciiToBits(vtec);
|
|
6216
|
+
const body = SetAFSK(bodyBits, sampleRate);
|
|
6131
6217
|
const extendedBodyDuration = Math.round(preMarkSec * sampleRate);
|
|
6132
6218
|
const extendedBody = new Int16Array(extendedBodyDuration + gap.length);
|
|
6133
6219
|
for (let j2 = 0; j2 < extendedBodyDuration; j2++) {
|
|
@@ -6137,11 +6223,11 @@ var setSameHeader = (vtec2, repeats, sampleRate = 8e3, options = {}) => {
|
|
|
6137
6223
|
bursts.push(extendedBody);
|
|
6138
6224
|
if (i !== repeats - 1) bursts.push(gap);
|
|
6139
6225
|
}
|
|
6140
|
-
return
|
|
6226
|
+
return GetMergedPCM16(bursts);
|
|
6141
6227
|
};
|
|
6142
6228
|
|
|
6143
|
-
// src/@modules/@eas/
|
|
6144
|
-
var
|
|
6229
|
+
// src/@modules/@eas/SetAttentionTone.ts
|
|
6230
|
+
var SetAttentionTone = (ms, sampleRate) => {
|
|
6145
6231
|
const len = Math.floor(ms * sampleRate);
|
|
6146
6232
|
const out = new Int16Array(len);
|
|
6147
6233
|
const f1 = 853;
|
|
@@ -6161,18 +6247,18 @@ var setAttentionTone = (ms, sampleRate) => {
|
|
|
6161
6247
|
return out;
|
|
6162
6248
|
};
|
|
6163
6249
|
|
|
6164
|
-
// src/@modules/@eas/
|
|
6165
|
-
var
|
|
6166
|
-
const x =
|
|
6250
|
+
// src/@modules/@eas/SetNoise.ts
|
|
6251
|
+
var SetNoise = (int16, noiseLevel = 0.02) => {
|
|
6252
|
+
const x = GetPCMToFloat(int16);
|
|
6167
6253
|
for (let i = 0; i < x.length; i++) x[i] += (Math.random() * 2 - 1) * noiseLevel;
|
|
6168
6254
|
let peak = 0;
|
|
6169
6255
|
for (let i = 0; i < x.length; i++) peak = Math.max(peak, Math.abs(x[i]));
|
|
6170
6256
|
if (peak > 1) for (let i = 0; i < x.length; i++) x[i] *= 0.98 / peak;
|
|
6171
|
-
return
|
|
6257
|
+
return GetFloatPCM16(x);
|
|
6172
6258
|
};
|
|
6173
6259
|
|
|
6174
|
-
// src/@modules/@eas/
|
|
6175
|
-
var
|
|
6260
|
+
// src/@modules/@eas/GetPCM16.ts
|
|
6261
|
+
var GetPCM16 = (samples, sampleRate) => {
|
|
6176
6262
|
let o = 0;
|
|
6177
6263
|
const bytesPerSample = 2;
|
|
6178
6264
|
const blockAlign = 1 * bytesPerSample;
|
|
@@ -6212,17 +6298,17 @@ var getPCM16 = (samples, sampleRate) => {
|
|
|
6212
6298
|
return buffer;
|
|
6213
6299
|
};
|
|
6214
6300
|
|
|
6215
|
-
// src/@modules/@eas/
|
|
6301
|
+
// src/@modules/@eas/GetTTS.ts
|
|
6216
6302
|
var import_os = require("os");
|
|
6217
6303
|
var import_fs = require("fs");
|
|
6218
6304
|
var import_child_process = require("child_process");
|
|
6219
|
-
var
|
|
6305
|
+
var GetTTS = (text, outputPath) => __async(null, null, function* () {
|
|
6220
6306
|
const vPlatform = (0, import_os.platform)();
|
|
6221
6307
|
switch (vPlatform) {
|
|
6222
6308
|
case "win32": {
|
|
6223
6309
|
try {
|
|
6224
6310
|
const txtPath = outputPath + ".txt";
|
|
6225
|
-
(0, import_fs.writeFileSync)(txtPath,
|
|
6311
|
+
(0, import_fs.writeFileSync)(txtPath, text, "utf8");
|
|
6226
6312
|
const command = [
|
|
6227
6313
|
"Add-Type -AssemblyName System.Speech;",
|
|
6228
6314
|
`$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;`,
|
|
@@ -6239,7 +6325,7 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
|
|
|
6239
6325
|
}
|
|
6240
6326
|
case "linux":
|
|
6241
6327
|
try {
|
|
6242
|
-
(0, import_child_process.execSync)(`espeak -w "${outputPath}" "${
|
|
6328
|
+
(0, import_child_process.execSync)(`espeak -w "${outputPath}" "${text.replace(/"/g, '\\"')}"`);
|
|
6243
6329
|
} catch (e) {
|
|
6244
6330
|
}
|
|
6245
6331
|
break;
|
|
@@ -6248,8 +6334,8 @@ var getTTS = (text2, outputPath) => __async(null, null, function* () {
|
|
|
6248
6334
|
}
|
|
6249
6335
|
});
|
|
6250
6336
|
|
|
6251
|
-
// src/@modules/@eas/
|
|
6252
|
-
var
|
|
6337
|
+
// src/@modules/@eas/GetCleanDescription.ts
|
|
6338
|
+
var GetCleanDescription = (message) => {
|
|
6253
6339
|
const patches = [
|
|
6254
6340
|
{ regex: /\.{3,}/g, replacement: ". " },
|
|
6255
6341
|
{ regex: /\bUTC\b/g, replacement: "Coordinated Universal Time" },
|
|
@@ -6320,12 +6406,12 @@ var getCleanDescription = (message) => {
|
|
|
6320
6406
|
return message.replace(/'/g, "''").replace(/\b(\d{1,2}):(\d{2})\s*(AM|PM)\b/gi, (_, h, m, ap) => fmt(+h, +m, ap.toUpperCase())).replace(/\b(\d{1,2})\s+(\d{2})\s+(AM|PM)\b/gi, (_, h, m, ap) => fmt(+h, +m, ap.toUpperCase())).replace(/\b(\d{2})(\d{2})\s+(AM|PM)\b/gi, (_, hh, mm, ap) => fmt(+hh, +mm, ap.toUpperCase())).replace(/\b(\d{1,2})\s+(AM|PM)\b/gi, (_, h, ap) => fmt(+h, 0, ap.toUpperCase())).replace(/\*+/g, " ").replace(/-/g, " ").replace(/\n/g, " ").trim();
|
|
6321
6407
|
};
|
|
6322
6408
|
|
|
6323
|
-
// src/@modules/@eas/
|
|
6409
|
+
// src/@modules/@eas/GenerateEASMessage.ts
|
|
6324
6410
|
var import_path2 = require("path");
|
|
6325
6411
|
var import_fs2 = require("fs");
|
|
6326
6412
|
var import_child_process2 = require("child_process");
|
|
6327
6413
|
var import_os2 = require("os");
|
|
6328
|
-
var
|
|
6414
|
+
var GenerateEASMessage = (options) => __async(null, null, function* () {
|
|
6329
6415
|
var _a;
|
|
6330
6416
|
const tick = performance.now();
|
|
6331
6417
|
const settings = bootstrap.settings;
|
|
@@ -6335,7 +6421,7 @@ var setEasTone = (options) => __async(null, null, function* () {
|
|
|
6335
6421
|
let header = options.header;
|
|
6336
6422
|
let title = ((_a = options.title) != null ? _a : `${Math.random().toString(36).substring(2, 15)}-${header.replace(/[^a-zA-Z0-9]/g, "")}`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
|
|
6337
6423
|
if (!message || !header) {
|
|
6338
|
-
|
|
6424
|
+
SetWarning({
|
|
6339
6425
|
title: `EAS`,
|
|
6340
6426
|
message: `Message and header are required to generate an EAS tone.`
|
|
6341
6427
|
});
|
|
@@ -6347,25 +6433,19 @@ var setEasTone = (options) => __async(null, null, function* () {
|
|
|
6347
6433
|
if (!(0, import_fs2.existsSync)(directory)) {
|
|
6348
6434
|
(0, import_fs2.mkdirSync)(directory, { recursive: true });
|
|
6349
6435
|
}
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
}
|
|
6353
|
-
if (!(0, import_fs2.existsSync)((0, import_path2.join)(directory, `/encoded`))) {
|
|
6354
|
-
(0, import_fs2.mkdirSync)((0, import_path2.join)(directory, `/encoded`), { recursive: true });
|
|
6355
|
-
}
|
|
6356
|
-
const tmpTTS = (0, import_path2.join)(directory, `/tts/${title}.wav`);
|
|
6357
|
-
const outTTS = (0, import_path2.join)(directory, `/encoded/${title}.wav`);
|
|
6436
|
+
const tmpTTS = (0, import_path2.join)(directory, `/${title}-tts.wav`);
|
|
6437
|
+
const outTTS = (0, import_path2.join)(directory, `/${title}.wav`);
|
|
6358
6438
|
const vPlatform = (0, import_os2.platform)();
|
|
6359
6439
|
if (vPlatform === "darwin") {
|
|
6360
|
-
|
|
6440
|
+
SetWarning({
|
|
6361
6441
|
title: `EAS`,
|
|
6362
6442
|
message: `EAS tone generation is not supported on macOS.`
|
|
6363
6443
|
});
|
|
6364
6444
|
return null;
|
|
6365
6445
|
}
|
|
6366
6446
|
yield new Promise((resolve6, reject) => {
|
|
6367
|
-
const tMsg =
|
|
6368
|
-
|
|
6447
|
+
const tMsg = GetCleanDescription(message);
|
|
6448
|
+
GetTTS(tMsg, tmpTTS).then(() => {
|
|
6369
6449
|
resolve6();
|
|
6370
6450
|
});
|
|
6371
6451
|
});
|
|
@@ -6373,19 +6453,19 @@ var setEasTone = (options) => __async(null, null, function* () {
|
|
|
6373
6453
|
return null;
|
|
6374
6454
|
}
|
|
6375
6455
|
buffTTS = (0, import_fs2.readFileSync)(tmpTTS);
|
|
6376
|
-
const vWav =
|
|
6377
|
-
const vSamples =
|
|
6378
|
-
const vRadio =
|
|
6456
|
+
const vWav = GetWavPCM16(buffTTS);
|
|
6457
|
+
const vSamples = GetSampledPCM16(vWav.samples, vWav.sampleRate, 8e3);
|
|
6458
|
+
const vRadio = SetRadioEffect(vSamples, 8e3);
|
|
6379
6459
|
if ((0, import_fs2.existsSync)(prefix)) {
|
|
6380
6460
|
let tBuffer = (0, import_fs2.readFileSync)(prefix);
|
|
6381
|
-
let tWav =
|
|
6461
|
+
let tWav = GetWavPCM16(tBuffer);
|
|
6382
6462
|
if (tWav == null) {
|
|
6383
6463
|
try {
|
|
6384
|
-
const converted = (0, import_path2.join)(directory,
|
|
6464
|
+
const converted = (0, import_path2.join)(directory, `/${title}-tts-fixed.wav`);
|
|
6385
6465
|
(0, import_child_process2.execSync)(`ffmpeg -y -i "${prefix}" -ar 8000 -ac 1 -sample_fmt s16 "${converted}"`, { stdio: "ignore" });
|
|
6386
6466
|
if ((0, import_fs2.existsSync)(converted)) {
|
|
6387
6467
|
tBuffer = (0, import_fs2.readFileSync)(converted);
|
|
6388
|
-
tWav =
|
|
6468
|
+
tWav = GetWavPCM16(tBuffer);
|
|
6389
6469
|
try {
|
|
6390
6470
|
(0, import_fs2.unlinkSync)(converted);
|
|
6391
6471
|
} catch (e) {
|
|
@@ -6395,41 +6475,41 @@ var setEasTone = (options) => __async(null, null, function* () {
|
|
|
6395
6475
|
}
|
|
6396
6476
|
}
|
|
6397
6477
|
if (tWav == null) {
|
|
6398
|
-
|
|
6478
|
+
SetWarning({ title: `EAS`, message: `Intro tone isn't a valid .WAV file or isn't in PCM 16-bit format. Converted attempt failed; please convert it then try again.` });
|
|
6399
6479
|
return null;
|
|
6400
6480
|
}
|
|
6401
|
-
const tSamples = tWav.sampleRate != 8e3 ?
|
|
6402
|
-
buffRadio =
|
|
6481
|
+
const tSamples = tWav.sampleRate != 8e3 ? GetSampledPCM16(tWav.samples, tWav.sampleRate, 8e3) : tWav.samples;
|
|
6482
|
+
buffRadio = SetRadioEffect(tSamples, 8e3);
|
|
6403
6483
|
}
|
|
6404
6484
|
buffFull = buffRadio != null ? [buffRadio, new Int16Array(Math.floor(0.5 * 8e3))] : [];
|
|
6405
6485
|
buffFull.push(
|
|
6406
|
-
|
|
6486
|
+
SetSameHeader(header, 3, 8e3, {
|
|
6407
6487
|
preMarkSec: 1.1,
|
|
6408
6488
|
gapSec: 0.5
|
|
6409
6489
|
}),
|
|
6410
6490
|
new Int16Array(Math.floor(0.5 * 8e3)),
|
|
6411
|
-
|
|
6491
|
+
SetAttentionTone(8, 8e3),
|
|
6412
6492
|
new Int16Array(Math.floor(0.5 * 8e3)),
|
|
6413
6493
|
vRadio
|
|
6414
6494
|
);
|
|
6415
6495
|
for (let i = 0; i < 3; i++) {
|
|
6416
|
-
buffFull.push(
|
|
6496
|
+
buffFull.push(SetSameHeader(header, 1, 8e3, { preMarkSec: 0.5, gapSec: 0.1 }));
|
|
6417
6497
|
buffFull.push(new Int16Array(Math.floor(0.5 * 8e3)));
|
|
6418
6498
|
}
|
|
6419
|
-
const aSamples =
|
|
6420
|
-
const aFinal =
|
|
6421
|
-
const aBuffer =
|
|
6499
|
+
const aSamples = GetMergedPCM16(buffFull);
|
|
6500
|
+
const aFinal = SetNoise(aSamples, 2e-3);
|
|
6501
|
+
const aBuffer = GetPCM16(Array.from(aFinal).map((v) => ({ value: v })), 8e3);
|
|
6422
6502
|
(0, import_fs2.writeFileSync)(outTTS, aBuffer);
|
|
6423
6503
|
try {
|
|
6424
6504
|
(0, import_fs2.unlinkSync)(tmpTTS);
|
|
6425
6505
|
} catch (e) {
|
|
6426
6506
|
}
|
|
6427
|
-
|
|
6507
|
+
SetDebug({ title: `GenerateEASMessage`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
6428
6508
|
return outTTS;
|
|
6429
6509
|
});
|
|
6430
6510
|
|
|
6431
|
-
// src/@parsers/@text/
|
|
6432
|
-
var
|
|
6511
|
+
// src/@parsers/@text/GetEmbededText.ts
|
|
6512
|
+
var GetEmebedText = (event) => {
|
|
6433
6513
|
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;
|
|
6434
6514
|
const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
|
|
6435
6515
|
const isStatement = event.properties.status_metadata.is_statement;
|
|
@@ -6466,44 +6546,46 @@ var getEmebedText = (event) => {
|
|
|
6466
6546
|
].filter(Boolean).join("\n");
|
|
6467
6547
|
};
|
|
6468
6548
|
|
|
6469
|
-
// src/@parsers/@text/
|
|
6470
|
-
var
|
|
6471
|
-
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;
|
|
6549
|
+
// src/@parsers/@text/GetStringText.ts
|
|
6550
|
+
var GetStringText = (event) => {
|
|
6551
|
+
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;
|
|
6552
|
+
const settings = bootstrap.settings;
|
|
6553
|
+
const timezone = (_a = settings.NotifyServer.Timezone) != null ? _a : `UTC`;
|
|
6472
6554
|
const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
|
|
6473
6555
|
const isStatement = event.properties.status_metadata.is_statement;
|
|
6474
6556
|
const isExpired = event.properties.status_metadata.is_expired;
|
|
6475
6557
|
return [
|
|
6476
|
-
line(`Locations:`, (
|
|
6477
|
-
line(`Issued:`, new Date(event.properties.issued).
|
|
6478
|
-
line(`Expires:`, new Date(event.properties.expires).
|
|
6479
|
-
line(`Damage Threat:`, (
|
|
6480
|
-
line(`Flood Threat:`, (
|
|
6481
|
-
line(`Tornado Threat:`, (
|
|
6482
|
-
line(`Estimated Wind Gusts:`, `${(
|
|
6483
|
-
line(`Estimated Hail Size:`, `${(
|
|
6484
|
-
line(`Discussion:`, (
|
|
6485
|
-
line(`Concern:`, (
|
|
6486
|
-
line(`SPC Max Tornado Threat:`, (
|
|
6487
|
-
line(`SPC Max Hail Threat:`, (
|
|
6488
|
-
line(`SPC Max Wind Threat:`, (
|
|
6489
|
-
line(`SPC Watch Issuance Probability:`, ((
|
|
6490
|
-
line(`Watch Number:`, (
|
|
6491
|
-
line(`Strong Tornadoes Probability:`, ((
|
|
6492
|
-
line(`Additional Tornadoes Probability:`, ((
|
|
6493
|
-
line(`Combined Hail/Wind Probability:`, ((
|
|
6494
|
-
line(`Severe Hail Probability:`, ((
|
|
6495
|
-
line(`Hail >2in Probability:`, ((
|
|
6496
|
-
line(`Max Hail Inches:`, (
|
|
6497
|
-
line(`Severe Wind Probability:`, ((
|
|
6498
|
-
line(`Max Surface Wind:`, (
|
|
6499
|
-
line(`Max Tops (x100 feet):`, (
|
|
6500
|
-
line(`Sender:`, ((
|
|
6501
|
-
line(`Tracking:`, (
|
|
6558
|
+
line(`Locations:`, (_c = (_b = event == null ? void 0 : event.properties) == null ? void 0 : _b.locations) == null ? void 0 : _c.slice(0, 100)),
|
|
6559
|
+
line(`Issued:`, `${new Date(event.properties.issued).toLocaleString([], { timeZone: timezone })} (${timezone.replace(`America/`, ``)})`, !isExpired),
|
|
6560
|
+
line(`Expires:`, `${new Date(event.properties.expires).toLocaleString([], { timeZone: timezone })} (${timezone.replace(`America/`, ``)})`, !isStatement),
|
|
6561
|
+
line(`Damage Threat:`, (_e = (_d = event == null ? void 0 : event.properties) == null ? void 0 : _d.parameters) == null ? void 0 : _e.damage_threat, !isExpired),
|
|
6562
|
+
line(`Flood Threat:`, (_g = (_f = event == null ? void 0 : event.properties) == null ? void 0 : _f.parameters) == null ? void 0 : _g.flood_threat, !isExpired),
|
|
6563
|
+
line(`Tornado Threat:`, (_i = (_h = event == null ? void 0 : event.properties) == null ? void 0 : _h.parameters) == null ? void 0 : _i.tornado_threat, !isExpired),
|
|
6564
|
+
line(`Estimated Wind Gusts:`, `${(_k = (_j = event == null ? void 0 : event.properties) == null ? void 0 : _j.parameters) == null ? void 0 : _k.estimated_wind_gusts} ${((_m = (_l = event == null ? void 0 : event.properties) == null ? void 0 : _l.parameters) == null ? void 0 : _m.wind_threat) ? ` (${(_o = (_n = event == null ? void 0 : event.properties) == null ? void 0 : _n.parameters) == null ? void 0 : _o.wind_threat})` : ""}`, !isExpired && ((_q = (_p = event == null ? void 0 : event.properties) == null ? void 0 : _p.parameters) == null ? void 0 : _q.estimated_wind_gusts) != null),
|
|
6565
|
+
line(`Estimated Hail Size:`, `${(_s = (_r = event == null ? void 0 : event.properties) == null ? void 0 : _r.parameters) == null ? void 0 : _s.estimated_hail_size} ${((_u = (_t = event == null ? void 0 : event.properties) == null ? void 0 : _t.parameters) == null ? void 0 : _u.hail_threat) ? ` (${(_w = (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.parameters) == null ? void 0 : _w.hail_threat})` : ""}`, !isExpired && ((_y = (_x = event == null ? void 0 : event.properties) == null ? void 0 : _x.parameters) == null ? void 0 : _y.estimated_hail_size) != null),
|
|
6566
|
+
line(`Discussion:`, (_A = (_z = event == null ? void 0 : event.properties) == null ? void 0 : _z.discussion_parameters) == null ? void 0 : _A.discussion_number, !isExpired),
|
|
6567
|
+
line(`Concern:`, (_C = (_B = event == null ? void 0 : event.properties) == null ? void 0 : _B.discussion_parameters) == null ? void 0 : _C.discussion_concerning, !isExpired),
|
|
6568
|
+
line(`SPC Max Tornado Threat:`, (_E = (_D = event == null ? void 0 : event.properties) == null ? void 0 : _D.discussion_parameters) == null ? void 0 : _E.discussion_max_tornado, !isExpired),
|
|
6569
|
+
line(`SPC Max Hail Threat:`, (_G = (_F = event == null ? void 0 : event.properties) == null ? void 0 : _F.discussion_parameters) == null ? void 0 : _G.discussion_max_hail, !isExpired),
|
|
6570
|
+
line(`SPC Max Wind Threat:`, (_I = (_H = event == null ? void 0 : event.properties) == null ? void 0 : _H.discussion_parameters) == null ? void 0 : _I.discussion_max_wind, !isExpired),
|
|
6571
|
+
line(`SPC Watch Issuance Probability:`, ((_K = (_J = event == null ? void 0 : event.properties) == null ? void 0 : _J.discussion_parameters) == null ? void 0 : _K.discussion_watch_issuance) ? `${(_M = (_L = event == null ? void 0 : event.properties) == null ? void 0 : _L.discussion_parameters) == null ? void 0 : _M.discussion_watch_issuance}%` : null, !isExpired),
|
|
6572
|
+
line(`Watch Number:`, (_O = (_N = event == null ? void 0 : event.properties) == null ? void 0 : _N.watch_parameters) == null ? void 0 : _O.watch_number, !isExpired),
|
|
6573
|
+
line(`Strong Tornadoes Probability:`, ((_Q = (_P = event == null ? void 0 : event.properties) == null ? void 0 : _P.watch_parameters) == null ? void 0 : _Q.strong_tornadoes_probability) ? `${(_S = (_R = event == null ? void 0 : event.properties) == null ? void 0 : _R.watch_parameters) == null ? void 0 : _S.strong_tornadoes_probability}%` : null, !isExpired),
|
|
6574
|
+
line(`Additional Tornadoes Probability:`, ((_U = (_T = event == null ? void 0 : event.properties) == null ? void 0 : _T.watch_parameters) == null ? void 0 : _U.additional_tornadoes_probability) ? `${(_W = (_V = event == null ? void 0 : event.properties) == null ? void 0 : _V.watch_parameters) == null ? void 0 : _W.additional_tornadoes_probability}%` : null, !isExpired),
|
|
6575
|
+
line(`Combined Hail/Wind Probability:`, ((_Y = (_X = event == null ? void 0 : event.properties) == null ? void 0 : _X.watch_parameters) == null ? void 0 : _Y.combined_hail_wind_probability) ? `${(__ = (_Z = event == null ? void 0 : event.properties) == null ? void 0 : _Z.watch_parameters) == null ? void 0 : __.combined_hail_wind_probability}%` : null, !isExpired),
|
|
6576
|
+
line(`Severe Hail Probability:`, ((_aa = (_$ = event == null ? void 0 : event.properties) == null ? void 0 : _$.watch_parameters) == null ? void 0 : _aa.severe_hail_probability) ? `${(_ca = (_ba = event == null ? void 0 : event.properties) == null ? void 0 : _ba.watch_parameters) == null ? void 0 : _ca.severe_hail_probability}%` : null, !isExpired),
|
|
6577
|
+
line(`Hail >2in Probability:`, ((_ea = (_da = event == null ? void 0 : event.properties) == null ? void 0 : _da.watch_parameters) == null ? void 0 : _ea.hail_2in_probability) ? `${(_ga = (_fa = event == null ? void 0 : event.properties) == null ? void 0 : _fa.watch_parameters) == null ? void 0 : _ga.hail_2in_probability}%` : null, !isExpired),
|
|
6578
|
+
line(`Max Hail Inches:`, (_ia = (_ha = event == null ? void 0 : event.properties) == null ? void 0 : _ha.watch_parameters) == null ? void 0 : _ia.max_hail_in, !isExpired),
|
|
6579
|
+
line(`Severe Wind Probability:`, ((_ka = (_ja = event == null ? void 0 : event.properties) == null ? void 0 : _ja.watch_parameters) == null ? void 0 : _ka.severe_wind_probability) ? `${(_ma = (_la = event == null ? void 0 : event.properties) == null ? void 0 : _la.watch_parameters) == null ? void 0 : _ma.severe_wind_probability}%` : null, !isExpired),
|
|
6580
|
+
line(`Max Surface Wind:`, (_oa = (_na = event == null ? void 0 : event.properties) == null ? void 0 : _na.watch_parameters) == null ? void 0 : _oa.max_wind_surface, !isExpired),
|
|
6581
|
+
line(`Max Tops (x100 feet):`, (_qa = (_pa = event == null ? void 0 : event.properties) == null ? void 0 : _pa.watch_parameters) == null ? void 0 : _qa.max_tops_x100feet, !isExpired),
|
|
6582
|
+
line(`Sender:`, ((_ta = (_sa = (_ra = event == null ? void 0 : event.properties) == null ? void 0 : _ra.geocode) == null ? void 0 : _sa.office) == null ? void 0 : _ta.name) ? `${(_wa = (_va = (_ua = event == null ? void 0 : event.properties) == null ? void 0 : _ua.geocode) == null ? void 0 : _va.office) == null ? void 0 : _wa.name} (${(_za = (_ya = (_xa = event == null ? void 0 : event.properties) == null ? void 0 : _xa.geocode) == null ? void 0 : _ya.office) == null ? void 0 : _za.office})` : (_Ca = (_Ba = (_Aa = event == null ? void 0 : event.properties) == null ? void 0 : _Aa.geocode) == null ? void 0 : _Ba.office) == null ? void 0 : _Ca.office),
|
|
6583
|
+
line(`Tracking:`, (_Ea = (_Da = event == null ? void 0 : event.properties) == null ? void 0 : _Da.metadata) == null ? void 0 : _Ea.tracking)
|
|
6502
6584
|
].filter(Boolean).join("\n");
|
|
6503
6585
|
};
|
|
6504
6586
|
|
|
6505
|
-
// src/@modules/@utilities/
|
|
6506
|
-
var
|
|
6587
|
+
// src/@modules/@utilities/CreateHttp.ts
|
|
6588
|
+
var CreateHttp = (options) => __async(null, null, function* () {
|
|
6507
6589
|
var _a, _b, _c, _d;
|
|
6508
6590
|
const requestOptions = {
|
|
6509
6591
|
method: (_a = options.method) != null ? _a : "GET",
|
|
@@ -6545,8 +6627,8 @@ var createHttp = (options) => __async(null, null, function* () {
|
|
|
6545
6627
|
}
|
|
6546
6628
|
});
|
|
6547
6629
|
|
|
6548
|
-
// src/@modules/@utilities/
|
|
6549
|
-
var
|
|
6630
|
+
// src/@modules/@utilities/GetMatched.ts
|
|
6631
|
+
var GetMatched = (strings, string) => {
|
|
6550
6632
|
const isMatched = strings.some((pattern) => {
|
|
6551
6633
|
if (!pattern) return false;
|
|
6552
6634
|
const lowerP = pattern.toLowerCase();
|
|
@@ -6561,150 +6643,204 @@ var getMatched = (strings, string) => {
|
|
|
6561
6643
|
return isMatched;
|
|
6562
6644
|
};
|
|
6563
6645
|
|
|
6564
|
-
// src/@manager/
|
|
6565
|
-
var
|
|
6566
|
-
var
|
|
6567
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
6646
|
+
// src/@manager/Tasks.ts
|
|
6647
|
+
var import_promises = require("fs/promises");
|
|
6648
|
+
var Tasks = (events) => __async(null, null, function* () {
|
|
6649
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
6568
6650
|
const tick = performance.now();
|
|
6569
6651
|
const settings = bootstrap.settings;
|
|
6570
|
-
const
|
|
6571
|
-
const
|
|
6572
|
-
const
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6652
|
+
const notifyServer = settings.NotifyServer;
|
|
6653
|
+
const actions = settings.ActionSettings;
|
|
6654
|
+
for (const event of events) {
|
|
6655
|
+
const properties = event.properties;
|
|
6656
|
+
const hasActions = Array.isArray(actions) && actions.length > 0;
|
|
6657
|
+
if (!hasActions) {
|
|
6658
|
+
SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
6659
|
+
return;
|
|
6660
|
+
}
|
|
6661
|
+
const metadata = {
|
|
6662
|
+
text: null,
|
|
6663
|
+
eas: null,
|
|
6664
|
+
json: null,
|
|
6665
|
+
name: properties.event,
|
|
6666
|
+
status: properties.status,
|
|
6667
|
+
description: properties.description,
|
|
6668
|
+
tracking: properties.metadata.tracking,
|
|
6669
|
+
header: properties.metadata.header,
|
|
6670
|
+
raw: properties.metadata.raw,
|
|
6671
|
+
expired: properties.status_metadata.is_expired,
|
|
6672
|
+
attachments: properties.metadata.attachments
|
|
6673
|
+
};
|
|
6674
|
+
const archiveSettings = (_a = settings.GlobalSettings) == null ? void 0 : _a.ArchiveSettings;
|
|
6675
|
+
const textArchiveDir = archiveSettings == null ? void 0 : archiveSettings.TextDirectory;
|
|
6676
|
+
const jsonArchiveDir = archiveSettings == null ? void 0 : archiveSettings.JSONDirectory;
|
|
6677
|
+
const eventBaseName = `${metadata.name}_${metadata.tracking}`;
|
|
6678
|
+
const easTitle = `${metadata.name}_${metadata.status}_${metadata.tracking}`;
|
|
6679
|
+
const cleanedEventText = JSON.stringify(GetCleanedEvent(event), null, 2);
|
|
6680
|
+
const stringText = GetStringText(event);
|
|
6681
|
+
const embedText = GetEmebedText(event);
|
|
6682
|
+
for (const action of actions) {
|
|
6683
|
+
const events2 = action == null ? void 0 : action.Events;
|
|
6684
|
+
const webhook = action == null ? void 0 : action.Webhook;
|
|
6685
|
+
const notify = action == null ? void 0 : action.NotificationServer;
|
|
6686
|
+
const uploads = action == null ? void 0 : action.Uploads;
|
|
6687
|
+
const isMatched = GetMatched(events2 != null ? events2 : [], metadata.name);
|
|
6688
|
+
if ((events2 == null ? void 0 : events2.length) == 0 || isMatched) {
|
|
6689
|
+
const t = performance.now();
|
|
6690
|
+
if ((uploads == null ? void 0 : uploads.EAS) && !metadata.eas) {
|
|
6691
|
+
metadata.eas = yield GenerateEASMessage({
|
|
6692
|
+
title: easTitle,
|
|
6693
|
+
message: metadata.description,
|
|
6694
|
+
header: metadata.header
|
|
6695
|
+
});
|
|
6696
|
+
SetDebug({
|
|
6697
|
+
title: "Tasks/EAS",
|
|
6698
|
+
message: `${Math.round(performance.now() - t)}ms`
|
|
6699
|
+
});
|
|
6700
|
+
}
|
|
6701
|
+
if ((uploads == null ? void 0 : uploads.TEXT) && metadata.text === null) {
|
|
6702
|
+
const t2 = performance.now();
|
|
6703
|
+
if (textArchiveDir) {
|
|
6704
|
+
const file = `${textArchiveDir}/${eventBaseName}.txt`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
|
|
6705
|
+
yield (0, import_promises.mkdir)(textArchiveDir, { recursive: true });
|
|
6706
|
+
yield (0, import_promises.appendFile)(file, `${"\n".repeat(7)}${metadata.raw}`);
|
|
6707
|
+
SetDebug({
|
|
6708
|
+
title: "Tasks/TEXT",
|
|
6709
|
+
message: `${Math.round(performance.now() - t2)}ms`
|
|
6710
|
+
});
|
|
6611
6711
|
}
|
|
6712
|
+
metadata.text = metadata.raw;
|
|
6612
6713
|
}
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6714
|
+
if ((uploads == null ? void 0 : uploads.JSON) && metadata.json === null) {
|
|
6715
|
+
const t2 = performance.now();
|
|
6716
|
+
if (jsonArchiveDir) {
|
|
6717
|
+
const file = `${jsonArchiveDir}/${eventBaseName}.json`.replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
|
|
6718
|
+
yield (0, import_promises.mkdir)(jsonArchiveDir, { recursive: true });
|
|
6719
|
+
yield (0, import_promises.writeFile)(file, cleanedEventText);
|
|
6720
|
+
SetDebug({
|
|
6721
|
+
title: "Tasks/JSON",
|
|
6722
|
+
message: `${Math.round(performance.now() - t2)}ms`
|
|
6723
|
+
});
|
|
6621
6724
|
}
|
|
6622
|
-
|
|
6725
|
+
metadata.json = cleanedEventText;
|
|
6623
6726
|
}
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6727
|
+
if ((notifyServer == null ? void 0 : notifyServer.Enabled) && (notify == null ? void 0 : notify.Enabled) && (notify == null ? void 0 : notify.Topic)) {
|
|
6728
|
+
let buttons = [];
|
|
6729
|
+
const t2 = performance.now();
|
|
6730
|
+
const auth = ((_b = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _b.Username) && ((_c = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _c.Password) ? { username: (_d = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _d.Username, password: (_e = notifyServer == null ? void 0 : notifyServer.Credentials) == null ? void 0 : _e.Password } : void 0;
|
|
6731
|
+
const image = (_f = metadata.attachments) == null ? void 0 : _f.find((a) => a.name === "Image: Graphic");
|
|
6732
|
+
if ((_g = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _g.EAS) {
|
|
6733
|
+
if (metadata.eas) {
|
|
6734
|
+
buttons.push({
|
|
6735
|
+
"action": "view",
|
|
6736
|
+
"label": "Listen",
|
|
6737
|
+
"url": `${(_h = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _h.EAS}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav`
|
|
6738
|
+
});
|
|
6739
|
+
}
|
|
6740
|
+
}
|
|
6741
|
+
if (metadata.json) {
|
|
6742
|
+
buttons.push({
|
|
6743
|
+
"action": "view",
|
|
6744
|
+
"label": "View JSON",
|
|
6745
|
+
"url": `${(_i = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _i.JSON}/${metadata.name}_${metadata.tracking}.json`
|
|
6746
|
+
});
|
|
6747
|
+
}
|
|
6748
|
+
if (metadata.text) {
|
|
6749
|
+
buttons.push({
|
|
6750
|
+
"action": "view",
|
|
6751
|
+
"label": "View Text",
|
|
6752
|
+
"url": `${(_j = notifyServer == null ? void 0 : notifyServer.MediaStorage) == null ? void 0 : _j.TEXT}/${metadata.name}_${metadata.tracking}.txt`
|
|
6753
|
+
});
|
|
6754
|
+
}
|
|
6755
|
+
if (image) {
|
|
6756
|
+
buttons.push({
|
|
6757
|
+
"action": "view",
|
|
6758
|
+
"label": "View Image",
|
|
6759
|
+
"url": image.link
|
|
6760
|
+
});
|
|
6761
|
+
}
|
|
6762
|
+
yield CreateHttp(__spreadProps(__spreadValues({
|
|
6763
|
+
url: `${(_k = notifyServer == null ? void 0 : notifyServer.Server) == null ? void 0 : _k.replace(/\/$/, "")}/${notify.Topic}`,
|
|
6634
6764
|
timeout: 15e3,
|
|
6635
|
-
method: "
|
|
6765
|
+
method: "PUT"
|
|
6636
6766
|
}, auth && { auth }), {
|
|
6637
6767
|
headers: __spreadValues({
|
|
6638
6768
|
"Title": `${metadata.name} (${metadata.status})`,
|
|
6639
|
-
"Tags": (
|
|
6640
|
-
"
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
body: getStringText(event)
|
|
6769
|
+
"Tags": (_m = (_l = properties.parameters.tags) == null ? void 0 : _l.join(",")) != null ? _m : "N/A",
|
|
6770
|
+
"Priority": (_n = notify == null ? void 0 : notify.Priority) != null ? _n : "5"
|
|
6771
|
+
}, buttons.length > 0 && { "Actions": JSON.stringify(buttons) }),
|
|
6772
|
+
body: stringText
|
|
6644
6773
|
}));
|
|
6774
|
+
SetDebug({
|
|
6775
|
+
title: "Tasks/NTFY",
|
|
6776
|
+
message: `${Math.round(performance.now() - t2)}ms`
|
|
6777
|
+
});
|
|
6645
6778
|
}
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
}
|
|
6661
|
-
if (metadata.description && !metadata.expired) {
|
|
6662
|
-
if (metadata.description.length > 900) {
|
|
6663
|
-
metadata.description = metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]";
|
|
6779
|
+
if ((webhook == null ? void 0 : webhook.Enabled) && (webhook == null ? void 0 : webhook.Destination)) {
|
|
6780
|
+
const t2 = performance.now();
|
|
6781
|
+
const isRatelimited = SetTimeoutAction({ identifier: webhook.Destination, interval: ((_o = webhook.Ratelimit) != null ? _o : 2) * 2, max: (_p = webhook.Ratelimit) != null ? _p : 2, addTime: true });
|
|
6782
|
+
const form = new FormData();
|
|
6783
|
+
const embed = {
|
|
6784
|
+
title: `${metadata.name} (${metadata.status})`,
|
|
6785
|
+
description: embedText,
|
|
6786
|
+
fields: [],
|
|
6787
|
+
color: 16711680,
|
|
6788
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6789
|
+
footer: { text: (_q = webhook.Title) != null ? _q : `AtmosphericX` }
|
|
6790
|
+
};
|
|
6791
|
+
if (isRatelimited.limited) {
|
|
6792
|
+
return;
|
|
6664
6793
|
}
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6794
|
+
if (metadata.description && !metadata.expired) {
|
|
6795
|
+
const description = metadata.description.length > 900 ? metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]" : metadata.description;
|
|
6796
|
+
embed.fields.push({
|
|
6797
|
+
name: "Description",
|
|
6798
|
+
value: description ? "```\n" + description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
|
|
6799
|
+
});
|
|
6800
|
+
}
|
|
6801
|
+
if (((_r = metadata.attachments) == null ? void 0 : _r.length) > 0) {
|
|
6802
|
+
const attachments = metadata.attachments.slice(0, 5);
|
|
6803
|
+
embed.fields.push({
|
|
6804
|
+
name: "Attachments",
|
|
6805
|
+
value: attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
|
|
6806
|
+
});
|
|
6807
|
+
}
|
|
6808
|
+
if (uploads == null ? void 0 : uploads.TEXT) {
|
|
6809
|
+
form.append("fUpload", new Blob([Buffer.from(metadata.text)], { type: "application/text" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}.txt`);
|
|
6810
|
+
}
|
|
6811
|
+
if (uploads == null ? void 0 : uploads.JSON) {
|
|
6812
|
+
form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}.json`);
|
|
6813
|
+
}
|
|
6814
|
+
if (uploads == null ? void 0 : uploads.EAS) {
|
|
6815
|
+
if (metadata.eas) {
|
|
6816
|
+
const file = yield (0, import_promises.readFile)(metadata.eas);
|
|
6817
|
+
form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties.event}_${properties.status}_${properties.metadata.tracking}_eas.mp3`);
|
|
6818
|
+
}
|
|
6819
|
+
}
|
|
6820
|
+
form.append("payload_json", JSON.stringify({
|
|
6821
|
+
username: (_s = webhook.Title) != null ? _s : "AtmosphericX",
|
|
6822
|
+
content: (_t = webhook.Message) != null ? _t : "",
|
|
6823
|
+
embeds: [embed]
|
|
6824
|
+
}));
|
|
6825
|
+
yield CreateHttp({
|
|
6826
|
+
url: webhook.Destination,
|
|
6827
|
+
timeout: 15e3,
|
|
6828
|
+
method: `POST`,
|
|
6829
|
+
body: form
|
|
6668
6830
|
});
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
embed.fields.push({
|
|
6673
|
-
name: "Attachments",
|
|
6674
|
-
value: metadata.attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
|
|
6831
|
+
SetDebug({
|
|
6832
|
+
title: "Tasks/Webhook",
|
|
6833
|
+
message: `${Math.round(performance.now() - t2)}ms`
|
|
6675
6834
|
});
|
|
6676
6835
|
}
|
|
6677
|
-
if (uploads == null ? void 0 : uploads.File) {
|
|
6678
|
-
form.append("fUpload", new Blob([Buffer.from(metadata.file)], { type: "application/text" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`);
|
|
6679
|
-
}
|
|
6680
|
-
if (uploads == null ? void 0 : uploads.JSON) {
|
|
6681
|
-
form.append("fUpload2", new Blob([Buffer.from(metadata.json)], { type: "application/json" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.json`);
|
|
6682
|
-
}
|
|
6683
|
-
if (uploads == null ? void 0 : uploads.EAS) {
|
|
6684
|
-
if (metadata.eas) {
|
|
6685
|
-
const file = (0, import_fs3.readFileSync)(metadata.eas);
|
|
6686
|
-
form.append("fEas", new Blob([Buffer.from(file)], { type: "audio/mpeg" }), `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}_eas.mp3`);
|
|
6687
|
-
}
|
|
6688
|
-
}
|
|
6689
|
-
form.append("payload_json", JSON.stringify({
|
|
6690
|
-
username: (_o = webhook.Title) != null ? _o : "AtmosphericX",
|
|
6691
|
-
content: (_p = webhook.Message) != null ? _p : "",
|
|
6692
|
-
embeds: [embed]
|
|
6693
|
-
}));
|
|
6694
|
-
yield createHttp({
|
|
6695
|
-
url: webhook.Destination,
|
|
6696
|
-
timeout: 15e3,
|
|
6697
|
-
method: `POST`,
|
|
6698
|
-
body: form
|
|
6699
|
-
});
|
|
6700
6836
|
}
|
|
6701
6837
|
}
|
|
6702
6838
|
}
|
|
6703
|
-
|
|
6839
|
+
SetDebug({ title: `Tasks`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
6704
6840
|
});
|
|
6705
6841
|
|
|
6706
|
-
// src/@modules/@utilities/
|
|
6707
|
-
var
|
|
6842
|
+
// src/@modules/@utilities/GetShapeNearestPoint.ts
|
|
6843
|
+
var GetShapeNearestPoint = (coordinates, point) => {
|
|
6708
6844
|
if (!coordinates || !point) {
|
|
6709
6845
|
return { proximity: false, point: [0, 0], distance: null };
|
|
6710
6846
|
}
|
|
@@ -6794,18 +6930,21 @@ var getShapeNearestPoint = (coordinates, point) => {
|
|
|
6794
6930
|
return { proximity: distanceMiles === 0, point: closestPoint, distance: distanceMiles, distanceKm, distanceMeters };
|
|
6795
6931
|
};
|
|
6796
6932
|
|
|
6797
|
-
// src/@building/
|
|
6798
|
-
var
|
|
6933
|
+
// src/@building/GetEventNodes.ts
|
|
6934
|
+
var GetEventNodes = (event) => __async(null, null, function* () {
|
|
6799
6935
|
var _a, _b;
|
|
6936
|
+
const nodes = bootstrap.cache.nodes.features;
|
|
6937
|
+
if (!nodes || nodes.length === 0) {
|
|
6938
|
+
return { nodes: [], filtered: true, updated: Date.now() };
|
|
6939
|
+
}
|
|
6800
6940
|
const metadata = { nodes: [], proximity: false, filtered: false };
|
|
6801
|
-
const geometry = yield
|
|
6941
|
+
const geometry = yield GetEventGeometry(event);
|
|
6802
6942
|
if (!geometry || !geometry.coordinates) {
|
|
6803
6943
|
return { nodes: [], filtered: false, updated: Date.now() };
|
|
6804
6944
|
}
|
|
6805
|
-
const nodes = bootstrap.cache.nodes.features;
|
|
6806
6945
|
for (const node of nodes) {
|
|
6807
6946
|
const [longitude, latitude] = node.geometry.coordinates;
|
|
6808
|
-
const getPoint =
|
|
6947
|
+
const getPoint = GetShapeNearestPoint(geometry.coordinates, [longitude, latitude]);
|
|
6809
6948
|
const miles = (_a = getPoint.distance) != null ? _a : null;
|
|
6810
6949
|
const kilometers = Number((miles * 1.609344).toFixed(3));
|
|
6811
6950
|
const info = {
|
|
@@ -6814,10 +6953,10 @@ var getEventNodes = (event) => __async(null, null, function* () {
|
|
|
6814
6953
|
nearest: getPoint.point,
|
|
6815
6954
|
miles,
|
|
6816
6955
|
kilometers,
|
|
6817
|
-
proximity:
|
|
6956
|
+
proximity: false
|
|
6818
6957
|
};
|
|
6819
6958
|
metadata.nodes.push(info);
|
|
6820
|
-
if (bootstrap.settings.GlobalSettings.EventFiltering.NodeLocationFiltering && miles < bootstrap.settings.GlobalSettings.
|
|
6959
|
+
if (miles != null && bootstrap.settings.GlobalSettings.EventFiltering.NodeLocationFiltering && miles < bootstrap.settings.GlobalSettings.NodeMaxDistance) {
|
|
6821
6960
|
metadata.proximity = true;
|
|
6822
6961
|
info.proximity = true;
|
|
6823
6962
|
}
|
|
@@ -6829,19 +6968,20 @@ var getEventNodes = (event) => __async(null, null, function* () {
|
|
|
6829
6968
|
};
|
|
6830
6969
|
});
|
|
6831
6970
|
|
|
6832
|
-
// src/@manager/
|
|
6833
|
-
var
|
|
6971
|
+
// src/@manager/UpdateNode.ts
|
|
6972
|
+
var UpdateNode = (selectedEvent) => __async(null, null, function* () {
|
|
6834
6973
|
const events = bootstrap.cache.events.features;
|
|
6835
6974
|
const ttl = bootstrap.settings.GlobalSettings.NodeTTL * 1e3;
|
|
6836
6975
|
let total = 0;
|
|
6976
|
+
const TTLEvents = selectedEvent ? [selectedEvent] : events.filter((evt) => {
|
|
6977
|
+
var _a, _b, _c;
|
|
6978
|
+
const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
|
|
6979
|
+
return lastUpdate == null || Date.now() - lastUpdate >= ttl;
|
|
6980
|
+
});
|
|
6981
|
+
if (TTLEvents.length === 0) return;
|
|
6837
6982
|
function update(evt) {
|
|
6838
6983
|
return __async(this, null, function* () {
|
|
6839
|
-
|
|
6840
|
-
const lastUpdate = (_c = (_b = (_a = evt == null ? void 0 : evt.properties) == null ? void 0 : _a.metadata) == null ? void 0 : _b.updated) != null ? _c : null;
|
|
6841
|
-
if (lastUpdate != null && Date.now() - lastUpdate < ttl) {
|
|
6842
|
-
return evt;
|
|
6843
|
-
}
|
|
6844
|
-
const node = yield getEventNodes(evt);
|
|
6984
|
+
const node = yield GetEventNodes(evt);
|
|
6845
6985
|
if (node.nodes.length > 0) {
|
|
6846
6986
|
total++;
|
|
6847
6987
|
}
|
|
@@ -6850,16 +6990,13 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
|
|
|
6850
6990
|
evt.properties.metadata.updated = node.updated;
|
|
6851
6991
|
});
|
|
6852
6992
|
}
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
}
|
|
6858
|
-
if (selectedEvent) {
|
|
6859
|
-
yield update(selectedEvent);
|
|
6993
|
+
const concurrency = 4;
|
|
6994
|
+
for (let index = 0; index < TTLEvents.length; index += concurrency) {
|
|
6995
|
+
const batch = TTLEvents.slice(index, index + concurrency);
|
|
6996
|
+
yield Promise.all(batch.map((evt) => update(evt)));
|
|
6860
6997
|
}
|
|
6861
6998
|
if (total > 0) {
|
|
6862
|
-
|
|
6999
|
+
SetEventEmit({
|
|
6863
7000
|
event: `onNodeUpdate`,
|
|
6864
7001
|
metadata: {
|
|
6865
7002
|
type: `global-update`,
|
|
@@ -6869,73 +7006,82 @@ var updateNode = (selectedEvent) => __async(null, null, function* () {
|
|
|
6869
7006
|
}
|
|
6870
7007
|
});
|
|
6871
7008
|
|
|
6872
|
-
// src/@manager/
|
|
6873
|
-
var
|
|
7009
|
+
// src/@manager/MakeEvents.ts
|
|
7010
|
+
var MakeEvents = (events) => __async(null, null, function* () {
|
|
6874
7011
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
7012
|
+
let tasked = [];
|
|
6875
7013
|
const settings = bootstrap.settings;
|
|
6876
|
-
|
|
6877
|
-
const
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
7014
|
+
if (events.length === 0) return;
|
|
7015
|
+
for (const event of events) {
|
|
7016
|
+
const features = bootstrap.cache.events.features;
|
|
7017
|
+
const getHash = event.properties.metadata.hash;
|
|
7018
|
+
const getTracking = event.properties.metadata.tracking;
|
|
7019
|
+
const isEntry = (_a = bootstrap.cache.hashes) == null ? void 0 : _a.find((hash) => hash.tracking === getTracking);
|
|
7020
|
+
const isHashed = (_c = (_b = isEntry == null ? void 0 : isEntry.hashes) == null ? void 0 : _b.includes(getHash)) != null ? _c : false;
|
|
7021
|
+
const isNodeFiltering = settings.GlobalSettings.EventFiltering.NodeLocationFiltering;
|
|
7022
|
+
const getFeature = features.find((feature) => feature.properties.metadata.tracking === getTracking);
|
|
7023
|
+
if (isHashed || event.properties.status_metadata.is_expired) return;
|
|
7024
|
+
SetHash(event, isEntry);
|
|
7025
|
+
if (isNodeFiltering) {
|
|
7026
|
+
yield UpdateNode(event);
|
|
7027
|
+
if (!event.properties.metadata.filtered_proximity && !EnumGlobalFilter.includes(event.properties.event.toLowerCase())) {
|
|
7028
|
+
return;
|
|
7029
|
+
}
|
|
7030
|
+
}
|
|
7031
|
+
const isRatelimited = SetTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
|
|
7032
|
+
if (!isRatelimited.limited) {
|
|
7033
|
+
SetEventEmit({
|
|
7034
|
+
event: `onEventStatus`,
|
|
7035
|
+
metadata: {
|
|
7036
|
+
type: getFeature ? `Updated` : `New`,
|
|
7037
|
+
event
|
|
7038
|
+
},
|
|
7039
|
+
message: `[${getFeature ? "Updated" : "New"}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
|
|
7040
|
+
});
|
|
7041
|
+
}
|
|
7042
|
+
if (settings.GlobalSettings.EventManagement) {
|
|
7043
|
+
if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
|
|
7044
|
+
if (getFeature) {
|
|
7045
|
+
const getIndex = features.indexOf(getFeature);
|
|
7046
|
+
const cHistory = (_f = (_e = (_d = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _d.metadata) == null ? void 0 : _e.history) != null ? _f : [];
|
|
7047
|
+
const cLocations = (_i = (_h = (_g = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _g.locations) == null ? void 0 : _h.split(";").map((l) => l.trim())) != null ? _i : [];
|
|
7048
|
+
const cUgc = (_l = (_k = (_j = getFeature == null ? void 0 : getFeature.properties) == null ? void 0 : _j.geocode) == null ? void 0 : _k.ugc) != null ? _l : [];
|
|
7049
|
+
const iHistory = (_o = (_n = (_m = event.properties) == null ? void 0 : _m.metadata) == null ? void 0 : _n.history) != null ? _o : [];
|
|
7050
|
+
const iLocations = (_r = (_q = (_p = event.properties) == null ? void 0 : _p.locations) == null ? void 0 : _q.split(";").map((l) => l.trim())) != null ? _r : [];
|
|
7051
|
+
const iUgc = (_u = (_t = (_s = event.properties) == null ? void 0 : _s.geocode) == null ? void 0 : _t.ugc) != null ? _u : [];
|
|
7052
|
+
const mHistory = [...cHistory, ...iHistory].filter((v, i, a) => a.indexOf(v) === i).filter((v, i, a) => a.findIndex((h) => h.description === v.description && h.issued === v.issued) === i);
|
|
7053
|
+
const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join("; ");
|
|
7054
|
+
const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
|
|
7055
|
+
bootstrap.cache.events.features[getIndex] = __spreadProps(__spreadValues({}, event), {
|
|
7056
|
+
properties: __spreadProps(__spreadValues({}, event.properties), {
|
|
7057
|
+
metadata: __spreadProps(__spreadValues({}, (_v = event == null ? void 0 : event.properties) == null ? void 0 : _v.metadata), {
|
|
7058
|
+
history: mHistory
|
|
7059
|
+
}),
|
|
7060
|
+
locations: mLocations,
|
|
7061
|
+
geocode: __spreadProps(__spreadValues({}, (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.geocode), {
|
|
7062
|
+
ugc: mUgc
|
|
7063
|
+
})
|
|
6920
7064
|
})
|
|
6921
|
-
})
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
7065
|
+
});
|
|
7066
|
+
tasked.push(bootstrap.cache.events.features[getIndex]);
|
|
7067
|
+
} else {
|
|
7068
|
+
features.push(event);
|
|
7069
|
+
tasked.push(event);
|
|
7070
|
+
}
|
|
6927
7071
|
}
|
|
6928
7072
|
}
|
|
6929
7073
|
}
|
|
7074
|
+
yield Tasks(tasked);
|
|
7075
|
+
SetEventEmit({ event: `onEventCache`, metadata: bootstrap.cache.events, limited: true });
|
|
6930
7076
|
});
|
|
6931
7077
|
|
|
6932
|
-
// src/@
|
|
6933
|
-
var
|
|
6934
|
-
cancellation: `{EVENT} has been allowed to expire. This
|
|
7078
|
+
// src/@enums/Strings.ts
|
|
7079
|
+
var EnumStrings = {
|
|
7080
|
+
cancellation: `{EVENT} has been allowed to expire. This event is no longer in effect.`
|
|
6935
7081
|
};
|
|
6936
7082
|
|
|
6937
|
-
// src/@manager/
|
|
6938
|
-
var
|
|
7083
|
+
// src/@manager/RemoveEvent.ts
|
|
7084
|
+
var RemoveEvent = (event, isTimeBasedExpiration) => __async(null, null, function* () {
|
|
6939
7085
|
const gTracking = event.properties.metadata.tracking;
|
|
6940
7086
|
const isTrackingEventLogged = bootstrap.cache.events.features.find((f) => {
|
|
6941
7087
|
var _a, _b;
|
|
@@ -6946,35 +7092,35 @@ var rmEvent = (event, isTimeBasedExpiration) => __async(null, null, function* ()
|
|
|
6946
7092
|
event.properties.expires = (/* @__PURE__ */ new Date()).toISOString();
|
|
6947
7093
|
event.properties.status = `Expired`;
|
|
6948
7094
|
event.properties.status_metadata.is_expired = true;
|
|
6949
|
-
const description = isTimeBasedExpiration ?
|
|
6950
|
-
event.properties.description =
|
|
7095
|
+
const description = isTimeBasedExpiration ? EnumStrings.cancellation.replace(`{SENDER}`, event.properties.geocode.office.name).replace(`{EVENT}`, event.properties.event) : event.properties.description;
|
|
7096
|
+
event.properties.description = description;
|
|
7097
|
+
event.properties.metadata.raw = isTimeBasedExpiration ? description : event.properties.metadata.raw;
|
|
6951
7098
|
event.properties.metadata.history.push({
|
|
6952
|
-
description,
|
|
7099
|
+
description: isTimeBasedExpiration ? description : event.properties.description,
|
|
6953
7100
|
issued: event.properties.expires,
|
|
6954
7101
|
status: event.properties.status
|
|
6955
7102
|
});
|
|
6956
7103
|
bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(isTrackingEventLogged), 1);
|
|
6957
7104
|
bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== gTracking);
|
|
6958
7105
|
if (!isStatement) {
|
|
6959
|
-
|
|
7106
|
+
SetEventEmit({
|
|
6960
7107
|
event: `onEventStatus`,
|
|
6961
7108
|
metadata: { type: `Removed`, event },
|
|
6962
7109
|
message: `[Removed] ${event.properties.event} (${event.properties.status}) (${gTracking})`
|
|
6963
7110
|
});
|
|
6964
|
-
yield
|
|
7111
|
+
yield Tasks([event]);
|
|
6965
7112
|
}
|
|
6966
|
-
|
|
6967
|
-
setTimeoutAction({ identifier: gTracking + `notify.server`, expire: true });
|
|
7113
|
+
SetTimeoutAction({ identifier: gTracking, expire: true });
|
|
6968
7114
|
}
|
|
6969
|
-
|
|
7115
|
+
SetEventEmit({
|
|
6970
7116
|
event: `onEventCache`,
|
|
6971
7117
|
metadata: bootstrap.cache.events,
|
|
6972
7118
|
limited: true
|
|
6973
7119
|
});
|
|
6974
7120
|
});
|
|
6975
7121
|
|
|
6976
|
-
// src/@
|
|
6977
|
-
var
|
|
7122
|
+
// src/@enums/States.ts
|
|
7123
|
+
var EnumStates = {
|
|
6978
7124
|
"AL": "Alabama",
|
|
6979
7125
|
"AK": "Alaska",
|
|
6980
7126
|
"AZ": "Arizona",
|
|
@@ -7028,8 +7174,8 @@ var dict_states = {
|
|
|
7028
7174
|
"DC": "District of Columbia"
|
|
7029
7175
|
};
|
|
7030
7176
|
|
|
7031
|
-
// src/@modules/@utilities/
|
|
7032
|
-
var
|
|
7177
|
+
// src/@modules/@utilities/GetLatestIssuance.ts
|
|
7178
|
+
var GetLatestIssuance = () => {
|
|
7033
7179
|
const now = /* @__PURE__ */ new Date();
|
|
7034
7180
|
const current = now.getUTCHours() * 100 + now.getUTCMinutes();
|
|
7035
7181
|
const issuances = [100, 600, 1300, 1630, 2e3];
|
|
@@ -7042,11 +7188,12 @@ var getLatestIssuance = () => {
|
|
|
7042
7188
|
return latest.toString().padStart(4, "0");
|
|
7043
7189
|
};
|
|
7044
7190
|
|
|
7045
|
-
// src/@building/
|
|
7046
|
-
var
|
|
7191
|
+
// src/@building/GetEventAttachments.ts
|
|
7192
|
+
var GetEventAttachments = (event) => {
|
|
7047
7193
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
7048
7194
|
let attachments = [];
|
|
7049
|
-
const
|
|
7195
|
+
const settings = bootstrap.settings;
|
|
7196
|
+
const issuanceTime = GetLatestIssuance();
|
|
7050
7197
|
const spcNumber = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.discussion_parameters) == null ? void 0 : _b.discussion_number;
|
|
7051
7198
|
const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
|
|
7052
7199
|
const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
|
|
@@ -7063,34 +7210,36 @@ var getEventAttachments = (event) => {
|
|
|
7063
7210
|
if (events.find((e) => e.target === event.properties.event)) {
|
|
7064
7211
|
attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target.toLowerCase() === event.properties.event.toLowerCase()).attachment });
|
|
7065
7212
|
}
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
const
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
|
|
7078
|
-
const filtered = feeds.filter((feed) => tags.includes(feed.type));
|
|
7079
|
-
if (filtered.length > 0) {
|
|
7080
|
-
filtered.map((filtered2) => {
|
|
7081
|
-
if (!attachments.some((a) => a.link === filtered2.link)) {
|
|
7082
|
-
attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
|
|
7083
|
-
}
|
|
7213
|
+
if (settings.BroadcastifySettings.BroadcastifyAttachments) {
|
|
7214
|
+
for (const location of locations) {
|
|
7215
|
+
if (EnumExpressions.location.test(location)) {
|
|
7216
|
+
const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
|
|
7217
|
+
const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
|
|
7218
|
+
const state = EnumStates[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
|
|
7219
|
+
const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
|
|
7220
|
+
const typeOrder = ["Other", "Public Safety"];
|
|
7221
|
+
const indexA = typeOrder.indexOf(a.type);
|
|
7222
|
+
const indexB = typeOrder.indexOf(b.type);
|
|
7223
|
+
return indexA - indexB;
|
|
7084
7224
|
});
|
|
7225
|
+
const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
|
|
7226
|
+
const filtered = feeds.filter((feed) => tags.includes(feed.type));
|
|
7227
|
+
if (filtered.length > 0) {
|
|
7228
|
+
filtered.map((filtered2) => {
|
|
7229
|
+
if (!attachments.some((a) => a.link === filtered2.link)) {
|
|
7230
|
+
attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
|
|
7231
|
+
}
|
|
7232
|
+
});
|
|
7233
|
+
}
|
|
7085
7234
|
}
|
|
7086
7235
|
}
|
|
7087
7236
|
}
|
|
7088
7237
|
return attachments;
|
|
7089
7238
|
};
|
|
7090
7239
|
|
|
7091
|
-
// src/@
|
|
7240
|
+
// src/@manager/ValidateEvents.ts
|
|
7092
7241
|
var import_crypto = require("crypto");
|
|
7093
|
-
var
|
|
7242
|
+
var ValidateEvents = (events) => __async(null, null, function* () {
|
|
7094
7243
|
const tick = performance.now();
|
|
7095
7244
|
if (events.length === 0) return;
|
|
7096
7245
|
const configurations = bootstrap.settings;
|
|
@@ -7108,21 +7257,21 @@ var validateEvents = (events) => __async(null, null, function* () {
|
|
|
7108
7257
|
}
|
|
7109
7258
|
const isFiltered = (define2) => {
|
|
7110
7259
|
var _a, _b, _c, _d;
|
|
7111
|
-
const
|
|
7112
|
-
const zones =
|
|
7113
|
-
const icao =
|
|
7114
|
-
if (
|
|
7115
|
-
|
|
7260
|
+
const properties = define2.properties;
|
|
7261
|
+
const zones = properties.geocode.ugc;
|
|
7262
|
+
const icao = properties.geocode.office.office;
|
|
7263
|
+
if (properties.status_metadata.is_test) {
|
|
7264
|
+
SetEventEmit({ event: `onTestProduct`, metadata: define2 });
|
|
7116
7265
|
if (bools == null ? void 0 : bools.IgnoreTestProducts) return true;
|
|
7117
7266
|
}
|
|
7118
|
-
if (
|
|
7119
|
-
|
|
7120
|
-
|
|
7267
|
+
if (properties.status_metadata.is_expired) {
|
|
7268
|
+
SetEventEmit({ event: `onExpiredProduct`, metadata: define2 });
|
|
7269
|
+
RemoveEvent(define2, false);
|
|
7121
7270
|
return true;
|
|
7122
7271
|
}
|
|
7123
|
-
if (((_b = (_a =
|
|
7124
|
-
const isSPC = (_d = (_c =
|
|
7125
|
-
|
|
7272
|
+
if (((_b = (_a = properties.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties.metadata.source != `events.api`) {
|
|
7273
|
+
const isSPC = (_d = (_c = properties.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
|
|
7274
|
+
SetEventEmit({ event: isSPC ? `onStormPredictionWatch` : `onNonStormPredictionWatch`, metadata: define2 });
|
|
7126
7275
|
if ((bools == null ? void 0 : bools.SPCWatchesOnly) && !isSPC) {
|
|
7127
7276
|
return true;
|
|
7128
7277
|
}
|
|
@@ -7133,43 +7282,43 @@ var validateEvents = (events) => __async(null, null, function* () {
|
|
|
7133
7282
|
for (const key in sets) {
|
|
7134
7283
|
const setting = sets[key];
|
|
7135
7284
|
const values = [...setting];
|
|
7136
|
-
if (key === "ListeningEvents" && setting.size > 0 && !
|
|
7137
|
-
|
|
7285
|
+
if (key === "ListeningEvents" && setting.size > 0 && !GetMatched(values, define2.properties.event)) {
|
|
7286
|
+
SetEventEmit({
|
|
7138
7287
|
event: `onFilteredEvent`,
|
|
7139
7288
|
metadata: define2
|
|
7140
7289
|
});
|
|
7141
7290
|
return true;
|
|
7142
7291
|
}
|
|
7143
|
-
if (key === "IgnoredEvents" && setting.size > 0 &&
|
|
7144
|
-
|
|
7292
|
+
if (key === "IgnoredEvents" && setting.size > 0 && GetMatched(values, define2.properties.event)) {
|
|
7293
|
+
SetEventEmit({
|
|
7145
7294
|
event: `onIgnoredEvent`,
|
|
7146
7295
|
metadata: define2
|
|
7147
7296
|
});
|
|
7148
7297
|
return true;
|
|
7149
7298
|
}
|
|
7150
7299
|
if (key === "ListeningICAO" && setting.size > 0 && icao != null && !setting.has(icao.toLowerCase())) {
|
|
7151
|
-
|
|
7300
|
+
SetEventEmit({
|
|
7152
7301
|
event: `onFilteredICAO`,
|
|
7153
7302
|
metadata: define2
|
|
7154
7303
|
});
|
|
7155
7304
|
return true;
|
|
7156
7305
|
}
|
|
7157
7306
|
if (key === "IgnoredICAO" && setting.size > 0 && icao != null && setting.has(icao.toLowerCase())) {
|
|
7158
|
-
|
|
7307
|
+
SetEventEmit({
|
|
7159
7308
|
event: `onIgnoredICAO`,
|
|
7160
7309
|
metadata: define2
|
|
7161
7310
|
});
|
|
7162
7311
|
return true;
|
|
7163
7312
|
}
|
|
7164
|
-
if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((
|
|
7165
|
-
|
|
7313
|
+
if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.toLowerCase()))) {
|
|
7314
|
+
SetEventEmit({
|
|
7166
7315
|
event: `onFilteredUGC`,
|
|
7167
7316
|
metadata: define2
|
|
7168
7317
|
});
|
|
7169
7318
|
return true;
|
|
7170
7319
|
}
|
|
7171
|
-
if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((
|
|
7172
|
-
|
|
7320
|
+
if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc) => setting.has(ugc.substring(0, 2).toLowerCase()))) {
|
|
7321
|
+
SetEventEmit({
|
|
7173
7322
|
event: `onFilteredState`,
|
|
7174
7323
|
metadata: define2
|
|
7175
7324
|
});
|
|
@@ -7180,37 +7329,28 @@ var validateEvents = (events) => __async(null, null, function* () {
|
|
|
7180
7329
|
};
|
|
7181
7330
|
const filtering = events.filter((event) => {
|
|
7182
7331
|
bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
|
|
7183
|
-
const define2 =
|
|
7332
|
+
const define2 = GetEventSignature(event);
|
|
7184
7333
|
const pre = __spreadProps(__spreadValues({}, define2), { properties: __spreadProps(__spreadValues({}, define2.properties), { metadata: __spreadValues({}, define2.properties.metadata) }) });
|
|
7185
|
-
const
|
|
7334
|
+
const properties = define2.properties;
|
|
7186
7335
|
delete pre.properties.metadata.ms;
|
|
7187
7336
|
delete pre.properties.metadata.header;
|
|
7188
|
-
const enhanced =
|
|
7337
|
+
const enhanced = properties.event = GetEventEnhancedName(event);
|
|
7189
7338
|
const filtered = isFiltered(define2);
|
|
7190
7339
|
if (!filtered) {
|
|
7191
|
-
event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ?
|
|
7192
|
-
|
|
7340
|
+
event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? GetEventGeometry(event) : null;
|
|
7341
|
+
properties.metadata.attachments = GetEventAttachments(event);
|
|
7193
7342
|
}
|
|
7194
|
-
|
|
7195
|
-
|
|
7343
|
+
properties.metadata.hash = (0, import_crypto.createHash)("sha256").update(JSON.stringify(pre)).digest("hex");
|
|
7344
|
+
SetEventEmit({ event: `onProductType${enhanced.replace(/\s+/g, "")}`, metadata: define2 });
|
|
7196
7345
|
return !filtered;
|
|
7197
7346
|
});
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
}
|
|
7202
|
-
}
|
|
7203
|
-
yield updateNode();
|
|
7204
|
-
setEventEmit({
|
|
7205
|
-
event: `onEventCache`,
|
|
7206
|
-
metadata: bootstrap.cache.events,
|
|
7207
|
-
limited: true
|
|
7208
|
-
});
|
|
7209
|
-
setDebug({ title: `@building.validate`, message: `Filtered ${filtering.length} events which took ${performance.now() - tick} ms` });
|
|
7347
|
+
SetDebug({ title: `ValidateEvents (PRE) (${filtering.length}/${events.length})`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
7348
|
+
yield MakeEvents(filtering);
|
|
7349
|
+
SetDebug({ title: `MakeEvents (${filtering.length}/${events.length})`, message: `${Math.round(performance.now() - tick)}ms` });
|
|
7210
7350
|
});
|
|
7211
7351
|
|
|
7212
|
-
// src/@building/
|
|
7213
|
-
var
|
|
7352
|
+
// src/@building/CreateEvent.ts
|
|
7353
|
+
var CreateEvent = (stanza, ignorePushing) => __async(null, null, function* () {
|
|
7214
7354
|
const settings = bootstrap.settings;
|
|
7215
7355
|
const StanzaSettings = settings.NOAAWeatherWireServiceSettings.StanzaSettings;
|
|
7216
7356
|
const isVtecEvent = stanza.isVTEC && stanza.isUGC;
|
|
@@ -7219,26 +7359,26 @@ var createEvent = (stanza, ignorePushing) => __async(null, null, function* () {
|
|
|
7219
7359
|
const isNWWS = stanza.isNWWS;
|
|
7220
7360
|
switch (true) {
|
|
7221
7361
|
case !isNWWS:
|
|
7222
|
-
yield
|
|
7362
|
+
yield ParseAPI(stanza);
|
|
7223
7363
|
break;
|
|
7224
7364
|
case (isNWWS && !StanzaSettings.DisableVTEC && isVtecEvent):
|
|
7225
|
-
yield
|
|
7365
|
+
yield ParseVTEC(stanza);
|
|
7226
7366
|
break;
|
|
7227
7367
|
case (isNWWS && !StanzaSettings.DisableUGC && isUgcEvent):
|
|
7228
|
-
yield
|
|
7368
|
+
yield ParseUGC(stanza);
|
|
7229
7369
|
break;
|
|
7230
7370
|
case (isNWWS && !StanzaSettings.DisableText && isTextEvent):
|
|
7231
|
-
yield
|
|
7371
|
+
yield ParseText(stanza);
|
|
7232
7372
|
break;
|
|
7233
7373
|
}
|
|
7234
7374
|
if (!ignorePushing) {
|
|
7235
|
-
|
|
7375
|
+
yield ValidateEvents(bootstrap.cache.processed);
|
|
7236
7376
|
}
|
|
7237
7377
|
return "nothing picked";
|
|
7238
7378
|
});
|
|
7239
7379
|
|
|
7240
|
-
// src/@modules/@database/
|
|
7241
|
-
var
|
|
7380
|
+
// src/@modules/@database/ImportStanza.ts
|
|
7381
|
+
var ImportStanza = (stanza) => __async(null, null, function* () {
|
|
7242
7382
|
const settings = bootstrap.settings;
|
|
7243
7383
|
try {
|
|
7244
7384
|
if (!settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
|
|
@@ -7254,17 +7394,17 @@ var importStanza = (stanza) => __async(null, null, function* () {
|
|
|
7254
7394
|
}
|
|
7255
7395
|
}
|
|
7256
7396
|
} catch (error) {
|
|
7257
|
-
|
|
7397
|
+
SetWarning({ message: `An error occurred while importing stanza: ${error.message}` });
|
|
7258
7398
|
}
|
|
7259
7399
|
});
|
|
7260
7400
|
|
|
7261
|
-
// src/@modules/@xmpp/
|
|
7262
|
-
var
|
|
7401
|
+
// src/@modules/@xmpp/StanzaXMPP.ts
|
|
7402
|
+
var StanzaXMPP = () => {
|
|
7263
7403
|
bootstrap.session_xmpp.on(`stanza`, (stanza) => __async(null, null, function* () {
|
|
7264
7404
|
var _a, _b, _c, _d;
|
|
7265
7405
|
const msgFrom = (_b = (_a = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _a.from) != null ? _b : ``;
|
|
7266
7406
|
const msgType = (_d = (_c = stanza == null ? void 0 : stanza.attrs) == null ? void 0 : _c.type) != null ? _d : ``;
|
|
7267
|
-
|
|
7407
|
+
SetEventEmit({
|
|
7268
7408
|
event: `onServiceStatus`,
|
|
7269
7409
|
metadata: {
|
|
7270
7410
|
message: stanza,
|
|
@@ -7274,18 +7414,18 @@ var xStanza = () => {
|
|
|
7274
7414
|
});
|
|
7275
7415
|
bootstrap.cache.lastStanza = Date.now();
|
|
7276
7416
|
if (stanza.is(`message`)) {
|
|
7277
|
-
const result =
|
|
7417
|
+
const result = ValidateStanza({ stanza });
|
|
7278
7418
|
const isSkippable = result.isIgnored || result.isCapEvent || result.isCapEvent && !result.isCapAreaDescription;
|
|
7279
7419
|
if (isSkippable) {
|
|
7280
7420
|
return;
|
|
7281
7421
|
}
|
|
7282
|
-
yield
|
|
7283
|
-
yield
|
|
7422
|
+
yield CreateEvent(result);
|
|
7423
|
+
yield ImportStanza(result);
|
|
7284
7424
|
}
|
|
7285
7425
|
if (stanza.is(`presence`) && msgFrom.startsWith("nwws@conference.nwws-oi.weather.gov/")) {
|
|
7286
7426
|
const getOccupant = msgFrom.split(`/`).slice(1).join(`/`);
|
|
7287
7427
|
const getAvailability = msgType === `unavailable`;
|
|
7288
|
-
|
|
7428
|
+
SetEventEmit({
|
|
7289
7429
|
event: `onServiceStatus`,
|
|
7290
7430
|
metadata: {
|
|
7291
7431
|
message: `Occupant ${getOccupant} has ${getAvailability ? `left` : `joined`} the room`,
|
|
@@ -7298,8 +7438,8 @@ var xStanza = () => {
|
|
|
7298
7438
|
}));
|
|
7299
7439
|
};
|
|
7300
7440
|
|
|
7301
|
-
// src/@modules/@xmpp/
|
|
7302
|
-
var
|
|
7441
|
+
// src/@modules/@xmpp/DeployXMPP.ts
|
|
7442
|
+
var DeployXMPP = () => __async(null, null, function* () {
|
|
7303
7443
|
var _a, _b;
|
|
7304
7444
|
let session;
|
|
7305
7445
|
const settings = bootstrap.settings;
|
|
@@ -7311,13 +7451,13 @@ var xDeploy = () => __async(null, null, function* () {
|
|
|
7311
7451
|
password: settings.NOAAWeatherWireServiceSettings.CredentialSettings.Password
|
|
7312
7452
|
});
|
|
7313
7453
|
try {
|
|
7314
|
-
yield
|
|
7315
|
-
yield
|
|
7316
|
-
yield
|
|
7317
|
-
yield
|
|
7454
|
+
yield OfflineXMPP();
|
|
7455
|
+
yield ErrorXMPP();
|
|
7456
|
+
yield StanzaXMPP();
|
|
7457
|
+
yield OnlineXMPP();
|
|
7318
7458
|
yield session.start();
|
|
7319
7459
|
} catch (error) {
|
|
7320
|
-
|
|
7460
|
+
SetEventEmit({
|
|
7321
7461
|
event: `onServiceStatus`,
|
|
7322
7462
|
metadata: {
|
|
7323
7463
|
message: `Error occured while starting XMPP Session: ${error}`,
|
|
@@ -7329,8 +7469,8 @@ var xDeploy = () => __async(null, null, function* () {
|
|
|
7329
7469
|
}
|
|
7330
7470
|
});
|
|
7331
7471
|
|
|
7332
|
-
// src/@
|
|
7333
|
-
var
|
|
7472
|
+
// src/@enums/Shapefiles.ts
|
|
7473
|
+
var EnumShapefiles = [
|
|
7334
7474
|
{ name: "us_counties", id: "C", link: "https://www.weather.gov/source/gis/Shapefiles/County/c_16ap26.zip" },
|
|
7335
7475
|
{ name: "us_states_territories", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/County/s_16ap26.zip" },
|
|
7336
7476
|
{ name: "fire_weather_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/fz16ap26.zip" },
|
|
@@ -7342,8 +7482,8 @@ var dict_shapefiles = [
|
|
|
7342
7482
|
{ name: "high_seas_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/hz17fe26.zip" }
|
|
7343
7483
|
];
|
|
7344
7484
|
|
|
7345
|
-
// src/@modules/@utilities/
|
|
7346
|
-
var
|
|
7485
|
+
// src/@modules/@utilities/SetSleep.ts
|
|
7486
|
+
var SetSleep = (options) => __async(null, null, function* () {
|
|
7347
7487
|
return new Promise((resolve6) => {
|
|
7348
7488
|
setTimeout(() => {
|
|
7349
7489
|
resolve6();
|
|
@@ -7351,31 +7491,31 @@ var setSleep = (options) => __async(null, null, function* () {
|
|
|
7351
7491
|
});
|
|
7352
7492
|
});
|
|
7353
7493
|
|
|
7354
|
-
// src/@modules/@database/
|
|
7355
|
-
var
|
|
7494
|
+
// src/@modules/@database/ImportShapefiles.ts
|
|
7495
|
+
var import_fs3 = require("fs");
|
|
7356
7496
|
var import_path3 = require("path");
|
|
7357
7497
|
var import_jszip = require("jszip");
|
|
7358
7498
|
var import_shapefile = require("shapefile");
|
|
7359
|
-
var
|
|
7499
|
+
var ImportShapefiles = () => __async(null, null, function* () {
|
|
7360
7500
|
var _a, _b;
|
|
7361
7501
|
const settings = bootstrap.settings;
|
|
7362
7502
|
try {
|
|
7363
7503
|
const tShapefiles = bootstrap.database.prepare(`SELECT COUNT(*) AS count FROM shapefiles`).get().count;
|
|
7364
7504
|
if (tShapefiles === 0) {
|
|
7365
|
-
yield
|
|
7366
|
-
for (const shapefile of
|
|
7505
|
+
yield SetSleep({ timeout: 1e3 });
|
|
7506
|
+
for (const shapefile of EnumShapefiles) {
|
|
7367
7507
|
const response2 = yield fetch(shapefile.link);
|
|
7368
7508
|
const arrayBuff = yield response2.arrayBuffer();
|
|
7369
7509
|
const content = yield (0, import_jszip.loadAsync)(arrayBuff);
|
|
7370
7510
|
const directory = (0, import_path3.resolve)(__dirname, `../../shapefiles`);
|
|
7371
|
-
if (!(0,
|
|
7372
|
-
(0,
|
|
7511
|
+
if (!(0, import_fs3.existsSync)(directory)) {
|
|
7512
|
+
(0, import_fs3.mkdirSync)(directory, { recursive: true });
|
|
7373
7513
|
}
|
|
7374
7514
|
for (const file of Object.keys(content.files)) {
|
|
7375
7515
|
if (file.endsWith(".shp") || file.endsWith(".dbf")) {
|
|
7376
7516
|
const data = yield content.files[file].async(`nodebuffer`);
|
|
7377
7517
|
const output = (0, import_path3.resolve)(directory, `${(_a = shapefile == null ? void 0 : shapefile.name) != null ? _a : ``}_${(_b = shapefile == null ? void 0 : shapefile.id) != null ? _b : ``}${(0, import_path3.extname)(file)}`);
|
|
7378
|
-
(0,
|
|
7518
|
+
(0, import_fs3.writeFileSync)(output, data);
|
|
7379
7519
|
}
|
|
7380
7520
|
}
|
|
7381
7521
|
const filepath = (0, import_path3.resolve)(__dirname, "../../shapefiles", shapefile.name + "_" + shapefile.id);
|
|
@@ -7383,43 +7523,43 @@ var importShapefiles = () => __async(null, null, function* () {
|
|
|
7383
7523
|
filepath,
|
|
7384
7524
|
filepath
|
|
7385
7525
|
);
|
|
7386
|
-
|
|
7526
|
+
SetWarning({ message: `Importing ${features.length} features from ${shapefile.name}_${shapefile.id} for Shapefiles` });
|
|
7387
7527
|
const insert = bootstrap.database.prepare(`INSERT OR REPLACE INTO shapefiles (id, location, geometry) VALUES (?, ?, ?)`);
|
|
7388
7528
|
const transaction = bootstrap.database.transaction((entries) => {
|
|
7389
7529
|
var _a2, _b2, _c;
|
|
7390
7530
|
for (const entry of entries) {
|
|
7391
|
-
const { properties
|
|
7531
|
+
const { properties, geometry } = entry;
|
|
7392
7532
|
let final2, location;
|
|
7393
|
-
if (
|
|
7394
|
-
final2 = `${
|
|
7395
|
-
location = `${
|
|
7396
|
-
} else if (
|
|
7397
|
-
final2 = `${
|
|
7398
|
-
location = `${
|
|
7399
|
-
} else if (
|
|
7400
|
-
final2 = `${
|
|
7401
|
-
location = `${(_b2 =
|
|
7533
|
+
if (properties.FIPS) {
|
|
7534
|
+
final2 = `${properties.STATE}${shapefile.id}${properties.FIPS.substring(2)}`;
|
|
7535
|
+
location = `${properties.COUNTYNAME}, ${properties.STATE}`;
|
|
7536
|
+
} else if (properties.FULLSTAID) {
|
|
7537
|
+
final2 = `${properties.ST}${shapefile.id}${properties.WFO}`;
|
|
7538
|
+
location = `${properties.CITY}, ${properties.STATE}`;
|
|
7539
|
+
} else if (properties.STATE) {
|
|
7540
|
+
final2 = `${properties.STATE}${shapefile.id}${(_a2 = properties.ZONE) != null ? _a2 : properties.SITE_ID}`;
|
|
7541
|
+
location = `${(_b2 = properties.NAME) != null ? _b2 : `${properties.RFC_NAME} ${properties.RFC_CITY}`}, ${properties.STATE}`;
|
|
7402
7542
|
} else {
|
|
7403
|
-
final2 = (_c =
|
|
7404
|
-
location =
|
|
7543
|
+
final2 = (_c = properties.ID) != null ? _c : properties.WFO;
|
|
7544
|
+
location = properties.NAME;
|
|
7405
7545
|
}
|
|
7406
7546
|
insert.run(final2, location, JSON.stringify(geometry));
|
|
7407
7547
|
}
|
|
7408
7548
|
});
|
|
7409
|
-
(0,
|
|
7410
|
-
(0,
|
|
7549
|
+
(0, import_fs3.unlinkSync)(`${filepath}.shp`);
|
|
7550
|
+
(0, import_fs3.unlinkSync)(`${filepath}.dbf`);
|
|
7411
7551
|
transaction(features);
|
|
7412
7552
|
}
|
|
7413
|
-
(0,
|
|
7553
|
+
(0, import_fs3.rm)((0, import_path3.resolve)(__dirname, "../../shapefiles"), { recursive: true, force: true }, () => {
|
|
7414
7554
|
});
|
|
7415
7555
|
}
|
|
7416
7556
|
} catch (error) {
|
|
7417
|
-
|
|
7557
|
+
SetWarning({ message: `An error occurred while compiling shapefiles: ${error.message}` });
|
|
7418
7558
|
}
|
|
7419
7559
|
});
|
|
7420
7560
|
|
|
7421
|
-
// src/@modules/@database/
|
|
7422
|
-
var
|
|
7561
|
+
// src/@modules/@database/ImportBroadcastify.ts
|
|
7562
|
+
var ImportBroadcastify = () => __async(null, null, function* () {
|
|
7423
7563
|
const settings = bootstrap.settings;
|
|
7424
7564
|
const isBroadcastifyImported = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
|
|
7425
7565
|
if (!settings.BroadcastifySettings.BroadcastifyAttachments) {
|
|
@@ -7428,7 +7568,7 @@ var importBroadcastify = () => __async(null, null, function* () {
|
|
|
7428
7568
|
if (isBroadcastifyImported) {
|
|
7429
7569
|
return;
|
|
7430
7570
|
}
|
|
7431
|
-
const broadcastify = yield
|
|
7571
|
+
const broadcastify = yield CreateHttp({
|
|
7432
7572
|
url: settings.BroadcastifySettings.BroadcastifyDatabase,
|
|
7433
7573
|
timeout: 5e3
|
|
7434
7574
|
});
|
|
@@ -7443,7 +7583,7 @@ var importBroadcastify = () => __async(null, null, function* () {
|
|
|
7443
7583
|
});
|
|
7444
7584
|
const batch = [];
|
|
7445
7585
|
for (const state of states) {
|
|
7446
|
-
|
|
7586
|
+
SetWarning({ message: `Importing ${state.counties.length} counties from ${state.state} for Broadcastify` });
|
|
7447
7587
|
for (const county of state.counties) {
|
|
7448
7588
|
const countyName = county.county;
|
|
7449
7589
|
for (const feed of county.feeds) {
|
|
@@ -7459,17 +7599,20 @@ var importBroadcastify = () => __async(null, null, function* () {
|
|
|
7459
7599
|
}
|
|
7460
7600
|
transaction(batch);
|
|
7461
7601
|
}
|
|
7602
|
+
if (broadcastify.error) {
|
|
7603
|
+
SetWarning({ message: `Error importing Broadcastify data: ${broadcastify.message}` });
|
|
7604
|
+
}
|
|
7462
7605
|
});
|
|
7463
7606
|
|
|
7464
|
-
// src/@modules/@database/
|
|
7465
|
-
var
|
|
7607
|
+
// src/@modules/@database/InitializeDatabase.ts
|
|
7608
|
+
var import_fs4 = require("fs");
|
|
7466
7609
|
var import_better_sqlite3 = __toESM(require("better-sqlite3"));
|
|
7467
|
-
var
|
|
7610
|
+
var InitializeDatabase = () => __async(null, null, function* () {
|
|
7468
7611
|
const settings = bootstrap.settings;
|
|
7469
7612
|
try {
|
|
7470
|
-
if (!(0,
|
|
7471
|
-
(0,
|
|
7472
|
-
|
|
7613
|
+
if (!(0, import_fs4.existsSync)(settings.Database)) {
|
|
7614
|
+
(0, import_fs4.writeFileSync)(settings.Database, "");
|
|
7615
|
+
SetWarning({ message: `Creating new database at ${settings.Database}` });
|
|
7473
7616
|
}
|
|
7474
7617
|
bootstrap.database = new import_better_sqlite3.default(settings.Database);
|
|
7475
7618
|
bootstrap.database.prepare(`CREATE TABLE IF NOT EXISTS stanzas ( id INTEGER PRIMARY KEY AUTOINCREMENT, type TEXT, issued TEXT, stanza TEXT )`).run();
|
|
@@ -7477,18 +7620,18 @@ var initializeDatabase = () => __async(null, null, function* () {
|
|
|
7477
7620
|
const isNeedingShapefiles = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='shapefiles';`).get();
|
|
7478
7621
|
const isNeedingBroadcastify = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
|
|
7479
7622
|
if (!isNeedingShapefiles || !isNeedingBroadcastify) {
|
|
7480
|
-
|
|
7481
|
-
yield
|
|
7482
|
-
yield
|
|
7483
|
-
|
|
7623
|
+
SetWarning({ message: `Required database tables are currently building, please ${bootstrap.ansi_colors.RED}DO NOT${bootstrap.ansi_colors.RESET} close your terminal. The building will not finish and will remain incomplete. If you do mess up, you will need to delete ${settings.Database} and restart the application.` });
|
|
7624
|
+
yield ImportBroadcastify();
|
|
7625
|
+
yield ImportShapefiles();
|
|
7626
|
+
SetWarning({ message: `Building has completed, you can now continue or close the terminal` });
|
|
7484
7627
|
}
|
|
7485
7628
|
} catch (error) {
|
|
7486
|
-
|
|
7629
|
+
SetWarning({ message: `An error occurred while initializing the database: ${error.message}` });
|
|
7487
7630
|
}
|
|
7488
7631
|
});
|
|
7489
7632
|
|
|
7490
|
-
// src/@modules/@database/
|
|
7491
|
-
var
|
|
7633
|
+
// src/@modules/@database/GetCachedEvents.ts
|
|
7634
|
+
var GetCachedEvents = () => __async(null, null, function* () {
|
|
7492
7635
|
var _a;
|
|
7493
7636
|
try {
|
|
7494
7637
|
const settings = bootstrap.settings;
|
|
@@ -7496,7 +7639,7 @@ var getCachedEvents = () => __async(null, null, function* () {
|
|
|
7496
7639
|
if (settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
|
|
7497
7640
|
const max = (_a = settings.NOAAWeatherWireServiceSettings.CacheSettings.MaxRetentionHistory) != null ? _a : 500;
|
|
7498
7641
|
const get = yield bootstrap.database.prepare(`SELECT * FROM stanzas ORDER BY rowid DESC LIMIT ?`).all(max);
|
|
7499
|
-
|
|
7642
|
+
SetWarning({ message: `Fetched ${get.length} cached stanzas from the database in ${Math.floor(performance.now() - tick)} ms` });
|
|
7500
7643
|
let events = get.map((row) => JSON.parse(row.stanza)).filter((stanza) => {
|
|
7501
7644
|
if (!stanza) {
|
|
7502
7645
|
return;
|
|
@@ -7505,21 +7648,21 @@ var getCachedEvents = () => __async(null, null, function* () {
|
|
|
7505
7648
|
return !isSkippable;
|
|
7506
7649
|
});
|
|
7507
7650
|
events = events.sort((a, b) => b.issued - a.issued);
|
|
7508
|
-
yield Promise.all(events.map((event) =>
|
|
7509
|
-
|
|
7510
|
-
|
|
7651
|
+
yield Promise.all(events.map((event) => CreateEvent(event, true)));
|
|
7652
|
+
SetWarning({ message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` });
|
|
7653
|
+
yield ValidateEvents(bootstrap.cache.processed);
|
|
7511
7654
|
}
|
|
7512
7655
|
} catch (error) {
|
|
7513
|
-
|
|
7656
|
+
SetWarning({ message: `An error occurred while fetching cached stanzas: ${error.message} -> ${error.stack}` });
|
|
7514
7657
|
}
|
|
7515
7658
|
});
|
|
7516
7659
|
|
|
7517
|
-
// src/@modules/@xmpp/
|
|
7518
|
-
var
|
|
7660
|
+
// src/@modules/@xmpp/ReconnectXMPP.ts
|
|
7661
|
+
var ReconnectXMPP = (interval) => __async(null, null, function* () {
|
|
7519
7662
|
const settings = bootstrap.settings;
|
|
7520
7663
|
const lastStanza = Date.now() - bootstrap.cache.lastStanza;
|
|
7521
7664
|
if (interval < 15) {
|
|
7522
|
-
|
|
7665
|
+
SetWarning({ message: `Reconnection interval of ${interval} seconds is too low, setting to 15 seconds` });
|
|
7523
7666
|
interval = 15;
|
|
7524
7667
|
bootstrap.settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval = 15;
|
|
7525
7668
|
}
|
|
@@ -7533,7 +7676,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
|
|
|
7533
7676
|
bootstrap.cache.isConnected = false;
|
|
7534
7677
|
bootstrap.cache.tReconnects += 1;
|
|
7535
7678
|
try {
|
|
7536
|
-
|
|
7679
|
+
SetEventEmit({
|
|
7537
7680
|
event: `onServiceStatus`,
|
|
7538
7681
|
metadata: {
|
|
7539
7682
|
message: `Attempting to reconnect to XMPP Service (Reconnect Attempt ${bootstrap.cache.tReconnects})`,
|
|
@@ -7551,7 +7694,7 @@ var xReconnect = (interval) => __async(null, null, function* () {
|
|
|
7551
7694
|
yield bootstrap.session_xmpp.start().catch(() => {
|
|
7552
7695
|
});
|
|
7553
7696
|
} catch (error) {
|
|
7554
|
-
|
|
7697
|
+
SetWarning({ message: `XMPP Reconnect Failed - ${error.message}` });
|
|
7555
7698
|
} finally {
|
|
7556
7699
|
bootstrap.cache.isReconnecting = false;
|
|
7557
7700
|
}
|
|
@@ -7559,26 +7702,26 @@ var xReconnect = (interval) => __async(null, null, function* () {
|
|
|
7559
7702
|
}
|
|
7560
7703
|
});
|
|
7561
7704
|
|
|
7562
|
-
// src/@modules/@utilities/
|
|
7563
|
-
var
|
|
7705
|
+
// src/@modules/@utilities/SetCronSchedule.ts
|
|
7706
|
+
var import_fs5 = require("fs");
|
|
7564
7707
|
var import_path4 = require("path");
|
|
7565
|
-
var
|
|
7708
|
+
var SetCronSchedule = () => __async(null, null, function* () {
|
|
7566
7709
|
const settings = bootstrap.settings;
|
|
7567
7710
|
const TTL = settings.GlobalSettings.ArchiveSettings.TTL;
|
|
7568
7711
|
const TTLCUT = Date.now() - TTL * 1e3;
|
|
7569
7712
|
const walk = (dir) => {
|
|
7570
|
-
if ((0,
|
|
7571
|
-
const entries = (0,
|
|
7713
|
+
if ((0, import_fs5.existsSync)(dir)) {
|
|
7714
|
+
const entries = (0, import_fs5.readdirSync)(dir, { withFileTypes: true });
|
|
7572
7715
|
for (const entry of entries) {
|
|
7573
7716
|
const fullPath = (0, import_path4.join)(dir, entry.name);
|
|
7574
7717
|
if (entry.isDirectory()) {
|
|
7575
7718
|
walk(fullPath);
|
|
7576
7719
|
continue;
|
|
7577
7720
|
}
|
|
7578
|
-
const stats = (0,
|
|
7721
|
+
const stats = (0, import_fs5.statSync)(fullPath);
|
|
7579
7722
|
if (stats.mtime.getTime() < TTLCUT) {
|
|
7580
7723
|
try {
|
|
7581
|
-
(0,
|
|
7724
|
+
(0, import_fs5.unlinkSync)(fullPath);
|
|
7582
7725
|
} catch (err) {
|
|
7583
7726
|
console.error(`Failed to delete ${fullPath}:`, err);
|
|
7584
7727
|
}
|
|
@@ -7588,20 +7731,20 @@ var setCronSchedule = () => __async(null, null, function* () {
|
|
|
7588
7731
|
};
|
|
7589
7732
|
walk(settings.GlobalSettings.ArchiveSettings.TextDirectory);
|
|
7590
7733
|
walk(settings.GlobalSettings.ArchiveSettings.EasDirectory);
|
|
7591
|
-
walk(settings.GlobalSettings.ArchiveSettings.
|
|
7734
|
+
walk(settings.GlobalSettings.ArchiveSettings.JSONDirectory);
|
|
7592
7735
|
if (settings.EnableWireService) {
|
|
7593
7736
|
if (settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.Enabled) {
|
|
7594
|
-
void
|
|
7737
|
+
void ReconnectXMPP(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
|
|
7595
7738
|
}
|
|
7596
7739
|
} else {
|
|
7597
|
-
const response2 = yield
|
|
7740
|
+
const response2 = yield CreateHttp({
|
|
7598
7741
|
url: settings.NationalWeatherServiceSettings.EventsEndpoint,
|
|
7599
7742
|
headers: {
|
|
7600
7743
|
"User-Agent": "@atmosx/event-product-parser"
|
|
7601
7744
|
}
|
|
7602
7745
|
});
|
|
7603
7746
|
if (response2.error) {
|
|
7604
|
-
return
|
|
7747
|
+
return SetEventEmit({
|
|
7605
7748
|
event: `onServiceStatus`,
|
|
7606
7749
|
metadata: {
|
|
7607
7750
|
type: "fetch-api",
|
|
@@ -7611,7 +7754,7 @@ var setCronSchedule = () => __async(null, null, function* () {
|
|
|
7611
7754
|
}
|
|
7612
7755
|
});
|
|
7613
7756
|
}
|
|
7614
|
-
|
|
7757
|
+
SetEventEmit({
|
|
7615
7758
|
event: `onServiceStatus`,
|
|
7616
7759
|
metadata: {
|
|
7617
7760
|
message: `Fetched latest events from National Weather Service API`,
|
|
@@ -7620,18 +7763,18 @@ var setCronSchedule = () => __async(null, null, function* () {
|
|
|
7620
7763
|
error: false
|
|
7621
7764
|
}
|
|
7622
7765
|
});
|
|
7623
|
-
|
|
7766
|
+
yield CreateEvent({ message: response2.message, isNWWS: false });
|
|
7624
7767
|
}
|
|
7625
7768
|
});
|
|
7626
7769
|
|
|
7627
|
-
// src/@manager/
|
|
7628
|
-
var
|
|
7770
|
+
// src/@manager/UpdateEvents.ts
|
|
7771
|
+
var UpdateEvents = (selectedEvent) => __async(null, null, function* () {
|
|
7629
7772
|
const events = bootstrap.cache.events.features;
|
|
7630
7773
|
function update(event) {
|
|
7631
7774
|
return __async(this, null, function* () {
|
|
7632
7775
|
if (new Date(event.properties.expires) < /* @__PURE__ */ new Date()) {
|
|
7633
|
-
|
|
7634
|
-
yield
|
|
7776
|
+
SetEventEmit({ event: `onExpiredProduct`, metadata: event });
|
|
7777
|
+
yield RemoveEvent(event, true);
|
|
7635
7778
|
}
|
|
7636
7779
|
});
|
|
7637
7780
|
}
|
|
@@ -7645,41 +7788,41 @@ var updateEvents = (selectedEvent) => __async(null, null, function* () {
|
|
|
7645
7788
|
}
|
|
7646
7789
|
});
|
|
7647
7790
|
|
|
7648
|
-
// src/@core/
|
|
7791
|
+
// src/@core/StartService.ts
|
|
7649
7792
|
var import_croner = require("croner");
|
|
7650
|
-
var
|
|
7793
|
+
var StartService = (configurations) => __async(null, null, function* () {
|
|
7651
7794
|
if (!bootstrap.isReady) {
|
|
7652
|
-
return
|
|
7795
|
+
return SetWarning({
|
|
7653
7796
|
message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
|
|
7654
7797
|
});
|
|
7655
7798
|
}
|
|
7656
|
-
const settings =
|
|
7799
|
+
const settings = SetSettings(configurations);
|
|
7657
7800
|
bootstrap.isReady = true;
|
|
7658
|
-
yield
|
|
7801
|
+
yield InitializeDatabase();
|
|
7659
7802
|
if (settings.EnableWireService) {
|
|
7660
7803
|
(() => __async(null, null, function* () {
|
|
7661
|
-
yield
|
|
7662
|
-
yield
|
|
7804
|
+
yield GetCachedEvents();
|
|
7805
|
+
yield DeployXMPP();
|
|
7663
7806
|
}))();
|
|
7664
7807
|
}
|
|
7665
|
-
yield
|
|
7808
|
+
yield SetCronSchedule();
|
|
7666
7809
|
let scheduleInterval = !settings.EnableWireService ? settings.NationalWeatherServiceSettings.CallbackInterval : 1;
|
|
7667
7810
|
if (!settings.EnableWireService && scheduleInterval < 15) {
|
|
7668
|
-
|
|
7811
|
+
SetWarning({ message: `Schedule interval of ${scheduleInterval} seconds is too low, setting to 15 seconds` });
|
|
7669
7812
|
bootstrap.settings.NationalWeatherServiceSettings.CallbackInterval = 15;
|
|
7670
7813
|
scheduleInterval = 15;
|
|
7671
7814
|
}
|
|
7672
7815
|
bootstrap.cron = new import_croner.Cron(`*/${scheduleInterval} * * * * *`, () => __async(null, null, function* () {
|
|
7673
|
-
yield
|
|
7816
|
+
yield SetCronSchedule();
|
|
7674
7817
|
}));
|
|
7675
7818
|
bootstrap.cron = new import_croner.Cron(`* * * * * *`, () => __async(null, null, function* () {
|
|
7676
|
-
yield
|
|
7677
|
-
yield
|
|
7819
|
+
yield UpdateNode();
|
|
7820
|
+
yield UpdateEvents();
|
|
7678
7821
|
}));
|
|
7679
7822
|
});
|
|
7680
7823
|
|
|
7681
|
-
// src/@core/
|
|
7682
|
-
var
|
|
7824
|
+
// src/@core/StopService.ts
|
|
7825
|
+
var StopService = () => __async(null, null, function* () {
|
|
7683
7826
|
if (bootstrap.isReady) {
|
|
7684
7827
|
bootstrap.isReady = false;
|
|
7685
7828
|
if (bootstrap.session_xmpp) {
|
|
@@ -7694,15 +7837,15 @@ var stopService = () => __async(null, null, function* () {
|
|
|
7694
7837
|
}
|
|
7695
7838
|
});
|
|
7696
7839
|
|
|
7697
|
-
// src/@core/
|
|
7698
|
-
var
|
|
7840
|
+
// src/@core/SetNode.ts
|
|
7841
|
+
var SetNode = (options) => {
|
|
7699
7842
|
const nodes = bootstrap.cache.nodes.features;
|
|
7700
7843
|
const exists = nodes.find((node) => node.properties.identifier === options.identifier);
|
|
7701
7844
|
if (options.delete) {
|
|
7702
7845
|
if (exists) {
|
|
7703
7846
|
const index = nodes.indexOf(exists);
|
|
7704
7847
|
nodes.splice(index, 1);
|
|
7705
|
-
return
|
|
7848
|
+
return SetEventEmit({
|
|
7706
7849
|
event: `onNodeDelete`,
|
|
7707
7850
|
metadata: {
|
|
7708
7851
|
type: `node-delete`,
|
|
@@ -7710,7 +7853,7 @@ var setNode = (options) => {
|
|
|
7710
7853
|
}
|
|
7711
7854
|
});
|
|
7712
7855
|
}
|
|
7713
|
-
return
|
|
7856
|
+
return SetWarning({ message: `Node with identifier '${options.identifier}' not found.` });
|
|
7714
7857
|
}
|
|
7715
7858
|
if (exists) {
|
|
7716
7859
|
const index = nodes.indexOf(exists);
|
|
@@ -7720,7 +7863,7 @@ var setNode = (options) => {
|
|
|
7720
7863
|
coordinates: [options.coordinates.longitude, options.coordinates.latitude]
|
|
7721
7864
|
}
|
|
7722
7865
|
});
|
|
7723
|
-
return
|
|
7866
|
+
return SetEventEmit({
|
|
7724
7867
|
event: `onNodeUpdate`,
|
|
7725
7868
|
metadata: {
|
|
7726
7869
|
type: `node-update`,
|
|
@@ -7738,7 +7881,7 @@ var setNode = (options) => {
|
|
|
7738
7881
|
identifier: options.identifier
|
|
7739
7882
|
}
|
|
7740
7883
|
});
|
|
7741
|
-
return
|
|
7884
|
+
return SetEventEmit({
|
|
7742
7885
|
event: `onNodeAdd`,
|
|
7743
7886
|
metadata: {
|
|
7744
7887
|
type: `node-add`,
|
|
@@ -7747,34 +7890,53 @@ var setNode = (options) => {
|
|
|
7747
7890
|
});
|
|
7748
7891
|
};
|
|
7749
7892
|
|
|
7750
|
-
// src/@core/
|
|
7751
|
-
var
|
|
7893
|
+
// src/@core/GetEvents.ts
|
|
7894
|
+
var GetEvents = () => {
|
|
7752
7895
|
return bootstrap.cache.events;
|
|
7753
7896
|
};
|
|
7754
7897
|
|
|
7755
|
-
// src/@core/
|
|
7756
|
-
var
|
|
7898
|
+
// src/@core/GetNodes.ts
|
|
7899
|
+
var GetNodes = () => {
|
|
7757
7900
|
return bootstrap.cache.nodes;
|
|
7758
7901
|
};
|
|
7759
7902
|
|
|
7760
|
-
// src/@core/
|
|
7761
|
-
var
|
|
7903
|
+
// src/@core/ManualEvent.ts
|
|
7904
|
+
var ManualEvent = (options) => __async(null, null, function* () {
|
|
7905
|
+
var _a;
|
|
7762
7906
|
const isCapEvent = options.message.includes(`<?xml`);
|
|
7763
7907
|
const isCapAreaDescription = options.message.includes(`<areaDesc>`);
|
|
7764
|
-
const isVTEC = options.message.match(
|
|
7765
|
-
const isUGC = options.message.match(
|
|
7766
|
-
const
|
|
7767
|
-
|
|
7768
|
-
|
|
7908
|
+
const isVTEC = options.message.match(EnumExpressions.pvtec) != null;
|
|
7909
|
+
const isUGC = options.message.match(EnumExpressions.ugc1) != null;
|
|
7910
|
+
const attributes = {
|
|
7911
|
+
"xmlns": "@atmosx/event-product-parser",
|
|
7912
|
+
"id": "manual_processor.0000",
|
|
7913
|
+
"issue": (/* @__PURE__ */ new Date()).toISOString(),
|
|
7914
|
+
"ttaaii": "XXXXX",
|
|
7915
|
+
"cccc": "XXX",
|
|
7916
|
+
"awipsid": (_a = options.awipsid) != null ? _a : "XXXXXX"
|
|
7917
|
+
};
|
|
7918
|
+
const getType = GetAwipsType({ attributes });
|
|
7919
|
+
const result = {
|
|
7920
|
+
message: options.message,
|
|
7921
|
+
attributes,
|
|
7922
|
+
isCapEvent,
|
|
7923
|
+
isVTEC,
|
|
7924
|
+
isUGC,
|
|
7925
|
+
isCapAreaDescription,
|
|
7926
|
+
isIgnored: false,
|
|
7927
|
+
isNWWS: true,
|
|
7928
|
+
getType
|
|
7929
|
+
};
|
|
7930
|
+
yield CreateEvent(result);
|
|
7769
7931
|
});
|
|
7770
7932
|
|
|
7771
|
-
// src/@core/
|
|
7772
|
-
var
|
|
7933
|
+
// src/@core/GetRandomEvent.ts
|
|
7934
|
+
var GetRandomEvent = () => {
|
|
7773
7935
|
return bootstrap.cache.events.features[Math.floor(Math.random() * bootstrap.cache.events.features.length)];
|
|
7774
7936
|
};
|
|
7775
7937
|
|
|
7776
|
-
// src/@core/
|
|
7777
|
-
var
|
|
7938
|
+
// src/@core/QueryStanza.ts
|
|
7939
|
+
var QueryStanza = (options) => __async(null, null, function* () {
|
|
7778
7940
|
var _a;
|
|
7779
7941
|
const get = yield bootstrap.database.prepare(
|
|
7780
7942
|
`SELECT * FROM stanzas WHERE stanza LIKE ? LIMIT ?`
|
|
@@ -7783,11 +7945,11 @@ var query = (options) => __async(null, null, function* () {
|
|
|
7783
7945
|
return events;
|
|
7784
7946
|
});
|
|
7785
7947
|
|
|
7786
|
-
// src/@core/
|
|
7787
|
-
var
|
|
7948
|
+
// src/@core/ClearEvents.ts
|
|
7949
|
+
var ClearEvents = () => {
|
|
7788
7950
|
bootstrap.cache.events.features = [];
|
|
7789
7951
|
bootstrap.cache.hashes = [];
|
|
7790
|
-
|
|
7952
|
+
SetEventEmit({
|
|
7791
7953
|
event: `onEventCache`,
|
|
7792
7954
|
metadata: bootstrap.cache.events,
|
|
7793
7955
|
message: `Manually cleared event cache.`
|
|
@@ -7798,17 +7960,17 @@ var clearEvents = () => {
|
|
|
7798
7960
|
var Manager = class {
|
|
7799
7961
|
constructor(settings) {
|
|
7800
7962
|
this.trycatch();
|
|
7801
|
-
|
|
7963
|
+
StartService(settings);
|
|
7802
7964
|
}
|
|
7803
7965
|
on(event, callback) {
|
|
7804
|
-
|
|
7966
|
+
CreateListener(event, callback);
|
|
7805
7967
|
}
|
|
7806
7968
|
trycatch() {
|
|
7807
7969
|
process.on("uncaughtException", (err) => {
|
|
7808
7970
|
var _a, _b;
|
|
7809
7971
|
const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND", "ECONNREFUSED", "EPIPE", "EADDRINUSE", "EALREADY", "EACCES", "EAGAIN", "EHOSTDOWN", "STARTTLS_FAILURE"];
|
|
7810
7972
|
if (ignored.includes(err == null ? void 0 : err.code)) {
|
|
7811
|
-
|
|
7973
|
+
SetEventEmit({
|
|
7812
7974
|
event: `onServiceStatus`,
|
|
7813
7975
|
metadata: {
|
|
7814
7976
|
message: `Ignored Critical Error: ${(_a = err == null ? void 0 : err.code) != null ? _a : "Unknown error code"}. This may indicate a connection issue. Attempting to continue...`,
|
|
@@ -7819,25 +7981,25 @@ var Manager = class {
|
|
|
7819
7981
|
});
|
|
7820
7982
|
return;
|
|
7821
7983
|
}
|
|
7822
|
-
|
|
7984
|
+
SetWarning({ message: `Uncaught Exception: ${err instanceof Error ? (_b = err.stack) != null ? _b : err.message : String(err)}` });
|
|
7823
7985
|
});
|
|
7824
7986
|
}
|
|
7825
7987
|
};
|
|
7826
7988
|
var index_default = Manager;
|
|
7827
7989
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7828
7990
|
0 && (module.exports = {
|
|
7991
|
+
ClearEvents,
|
|
7992
|
+
GenerateEASMessage,
|
|
7993
|
+
GetCleanedEvent,
|
|
7994
|
+
GetEventGeometry,
|
|
7995
|
+
GetEvents,
|
|
7996
|
+
GetNodes,
|
|
7997
|
+
GetRandomEvent,
|
|
7829
7998
|
Manager,
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
manualEvent,
|
|
7837
|
-
query,
|
|
7838
|
-
setEasTone,
|
|
7839
|
-
setNode,
|
|
7840
|
-
setSettings,
|
|
7841
|
-
startService,
|
|
7842
|
-
stopService
|
|
7999
|
+
ManualEvent,
|
|
8000
|
+
QueryStanza,
|
|
8001
|
+
SetNode,
|
|
8002
|
+
SetSettings,
|
|
8003
|
+
StartService,
|
|
8004
|
+
StopService
|
|
7843
8005
|
});
|