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