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