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