@atmosx/event-product-parser 3.0.46 → 3.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/cjs/index.cjs +381 -206
- package/dist/esm/index.mjs +381 -206
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/package.json +1 -1
- package/src/@building/building.attachments.ts +47 -6
- package/src/@building/building.properties.ts +1 -0
- package/src/@building/building.signature.ts +1 -1
- package/src/@core/core.createEvent.ts +1 -0
- package/src/@dictionaries/dictionaries.cancellation.ts +1 -0
- package/src/@dictionaries/dictionaries.expressions.ts +1 -0
- package/src/@dictionaries/dictionaries.states.ts +72 -0
- package/src/@events/events.api.ts +1 -0
- package/src/@manager/manager.updateListener.ts +105 -66
- package/src/@modules/@database/database.broadcastify.ts +67 -0
- package/src/@modules/@database/database.init.ts +14 -1
- package/src/@modules/@database/database.shapefiles.ts +1 -4
- package/src/@modules/@utilities/utilities.createHttp.ts +56 -47
- package/src/@modules/@utilities/utilities.setCronSchedule.ts +1 -0
- package/src/@modules/@xmpp/xmpp.xReconnect.ts +1 -1
- package/src/@parsers/@text/text.getEmbed.ts +0 -2
- package/src/@types/type.event.ts +1 -1
- package/src/@types/type.listener.ts +1 -1
- package/src/@types/type.properties.ts +1 -0
- package/src/@types/type.settings.ts +7 -1
- package/src/bootstrap.ts +7 -1
- package/test.js +12 -4
- /package/src/@dictionaries/{dictionaries.test.ts → dictionaries.testing.ts} +0 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -10511,7 +10511,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
10511
10511
|
var import_path = __toESM(require("path"));
|
|
10512
10512
|
var import_node_events = require("events");
|
|
10513
10513
|
var bootstrap = {
|
|
10514
|
-
version: `3.0.
|
|
10514
|
+
version: `3.0.47`,
|
|
10515
10515
|
isReady: true,
|
|
10516
10516
|
ratelimits: {},
|
|
10517
10517
|
session_xmpp: null,
|
|
@@ -10567,6 +10567,11 @@ var bootstrap = {
|
|
|
10567
10567
|
CallbackInterval: 15,
|
|
10568
10568
|
EventsEndpoint: `https://api.weather.gov/alerts/active`
|
|
10569
10569
|
},
|
|
10570
|
+
BroadcastifySettings: {
|
|
10571
|
+
BroadcastifyAttachments: true,
|
|
10572
|
+
BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
|
|
10573
|
+
BroadcastifyTags: [`Ham`, `Air`, `Fire`, `Public Safety`, `Weather`, `EMS`, `Police`, `Rail`]
|
|
10574
|
+
},
|
|
10570
10575
|
ListenerSettings: [],
|
|
10571
10576
|
GlobalSettings: {
|
|
10572
10577
|
EventManagement: true,
|
|
@@ -10589,6 +10594,7 @@ var bootstrap = {
|
|
|
10589
10594
|
},
|
|
10590
10595
|
ArchiveSettings: {
|
|
10591
10596
|
TTL: 60,
|
|
10597
|
+
EventDirectory: null,
|
|
10592
10598
|
TextDirectory: null,
|
|
10593
10599
|
EasDirectory: null,
|
|
10594
10600
|
EasToneout: null
|
|
@@ -13607,6 +13613,7 @@ var xError = () => {
|
|
|
13607
13613
|
|
|
13608
13614
|
// src/@dictionaries/dictionaries.expressions.ts
|
|
13609
13615
|
var dict_expressions = {
|
|
13616
|
+
location: new RegExp(/^([A-Za-z.\-' ]+),\s*([A-Z]{2})$/),
|
|
13610
13617
|
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"),
|
|
13611
13618
|
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"),
|
|
13612
13619
|
wmo: new RegExp(`[A-Z0-9]{6}\\s[A-Z]{4}\\s\\d{6}`, "imu"),
|
|
@@ -14414,54 +14421,55 @@ var getEventTags = (message) => {
|
|
|
14414
14421
|
|
|
14415
14422
|
// src/@building/building.properties.ts
|
|
14416
14423
|
var properties = (options) => {
|
|
14417
|
-
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;
|
|
14424
|
+
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;
|
|
14418
14425
|
const organization = (_b = (_a = options.message.match(dict_expressions.wmo)) == null ? void 0 : _a[0]) != null ? _b : null;
|
|
14419
14426
|
const polygons = getPolygonFromProduct(options.message);
|
|
14420
14427
|
const properties2 = {
|
|
14421
14428
|
locations: (_e = (_d = (_c = options == null ? void 0 : options.ugc) == null ? void 0 : _c.locations) == null ? void 0 : _d.join(`; `)) != null ? _e : null,
|
|
14422
|
-
|
|
14429
|
+
locations_array: (_g = (_f = options == null ? void 0 : options.ugc) == null ? void 0 : _f.locations) != null ? _g : [],
|
|
14430
|
+
description: getDescriptionFromProduct({ message: options.message, handle: (_i = (_h = options == null ? void 0 : options.pVtec) == null ? void 0 : _h.vtec) != null ? _i : null }),
|
|
14423
14431
|
attributes: options.attributes,
|
|
14424
14432
|
geocode: {
|
|
14425
14433
|
office: getEventOffice({ attributes: options.attributes, organization, pVtec: options.pVtec }),
|
|
14426
14434
|
organization,
|
|
14427
|
-
ugc: (
|
|
14435
|
+
ugc: (_k = (_j = options == null ? void 0 : options.ugc) == null ? void 0 : _j.zones) != null ? _k : [],
|
|
14428
14436
|
polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString("base64") : null,
|
|
14429
14437
|
polygon_generated: polygons.length > 0 ? true : false
|
|
14430
14438
|
},
|
|
14431
14439
|
parameters: {
|
|
14432
14440
|
tags: getEventTags(options.message),
|
|
14433
|
-
instructions: (
|
|
14434
|
-
source: (
|
|
14435
|
-
hazards: (
|
|
14436
|
-
impacts: (
|
|
14437
|
-
estimated_hail_size: (
|
|
14438
|
-
estimated_wind_gusts: (
|
|
14439
|
-
damage_threat: (
|
|
14440
|
-
tornado_threat: (
|
|
14441
|
-
flood_threat: (
|
|
14442
|
-
wind_threat: (
|
|
14443
|
-
hail_threat: (
|
|
14441
|
+
instructions: (_l = getTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`] })) != null ? _l : null,
|
|
14442
|
+
source: (_m = getTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`] })) != null ? _m : null,
|
|
14443
|
+
hazards: (_n = getTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`] })) != null ? _n : null,
|
|
14444
|
+
impacts: (_o = getTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`] })) != null ? _o : null,
|
|
14445
|
+
estimated_hail_size: (_p = getTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ["in"] })) != null ? _p : null,
|
|
14446
|
+
estimated_wind_gusts: (_q = getTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`] })) != null ? _q : null,
|
|
14447
|
+
damage_threat: (_r = getTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: [] })) != null ? _r : null,
|
|
14448
|
+
tornado_threat: (_s = getTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] })) != null ? _s : null,
|
|
14449
|
+
flood_threat: (_t = getTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`] })) != null ? _t : null,
|
|
14450
|
+
wind_threat: (_u = getTextFromProduct({ message: options.message, find: [`WIND THREAT...`] })) != null ? _u : null,
|
|
14451
|
+
hail_threat: (_v = getTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: [] })) != null ? _v : null
|
|
14444
14452
|
},
|
|
14445
14453
|
discussion_parameters: {
|
|
14446
|
-
discussion_number: (
|
|
14447
|
-
discussion_concerning: (
|
|
14448
|
-
discussion_max_tornado: (
|
|
14449
|
-
discussion_max_hail: (
|
|
14450
|
-
discussion_max_wind: (
|
|
14451
|
-
discussion_watch_issuance: (
|
|
14454
|
+
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,
|
|
14455
|
+
discussion_concerning: (_z = getTextFromProduct({ message: options.message, find: [`Concerning...`] })) != null ? _z : null,
|
|
14456
|
+
discussion_max_tornado: (_A = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] })) != null ? _A : null,
|
|
14457
|
+
discussion_max_hail: (_B = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] })) != null ? _B : null,
|
|
14458
|
+
discussion_max_wind: (_C = getTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] })) != null ? _C : null,
|
|
14459
|
+
discussion_watch_issuance: (_D = getTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`] })) != null ? _D : null
|
|
14452
14460
|
},
|
|
14453
14461
|
watch_parameters: {
|
|
14454
|
-
watch_number: ((
|
|
14462
|
+
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),
|
|
14455
14463
|
watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : (options == null ? void 0 : options.message.includes(`SEVERE`)) ? `Severe` : null,
|
|
14456
|
-
additional_tornadoes_probability: (
|
|
14457
|
-
strong_tornadoes_probability: (
|
|
14458
|
-
severe_wind_probability: (
|
|
14459
|
-
severe_hail_probability: (
|
|
14460
|
-
hail_2in_probability: (
|
|
14461
|
-
combined_hail_wind_probability: (
|
|
14462
|
-
max_hail_in: (
|
|
14463
|
-
max_wind_surface: (
|
|
14464
|
-
max_tops_x100feet: (
|
|
14464
|
+
additional_tornadoes_probability: (_P = getTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _P : null,
|
|
14465
|
+
strong_tornadoes_probability: (_Q = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] })) != null ? _Q : null,
|
|
14466
|
+
severe_wind_probability: (_R = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _R : null,
|
|
14467
|
+
severe_hail_probability: (_S = getTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _S : null,
|
|
14468
|
+
hail_2in_probability: (_T = getTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] })) != null ? _T : null,
|
|
14469
|
+
combined_hail_wind_probability: (_U = getTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] })) != null ? _U : null,
|
|
14470
|
+
max_hail_in: (_V = getTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] })) != null ? _V : null,
|
|
14471
|
+
max_wind_surface: (_W = getTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] })) != null ? _W : null,
|
|
14472
|
+
max_tops_x100feet: (_X = getTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] })) != null ? _X : null,
|
|
14465
14473
|
pds_watch: getTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES` ? true : null
|
|
14466
14474
|
}
|
|
14467
14475
|
};
|
|
@@ -14679,6 +14687,7 @@ var dict_cancellation = [
|
|
|
14679
14687
|
"has been cancelled",
|
|
14680
14688
|
"subsided sufficiently for the advisory to be cancelled",
|
|
14681
14689
|
"has been cancelled",
|
|
14690
|
+
"no tsunami threat from a nearby earthquake",
|
|
14682
14691
|
"will be allowed to expire",
|
|
14683
14692
|
"has diminished",
|
|
14684
14693
|
"and no longer",
|
|
@@ -14687,7 +14696,7 @@ var dict_cancellation = [
|
|
|
14687
14696
|
"has weakened below severe"
|
|
14688
14697
|
];
|
|
14689
14698
|
|
|
14690
|
-
// src/@dictionaries/dictionaries.
|
|
14699
|
+
// src/@dictionaries/dictionaries.testing.ts
|
|
14691
14700
|
var dict_testing = [
|
|
14692
14701
|
`This is a test message`,
|
|
14693
14702
|
`Monitoring message only.`,
|
|
@@ -15227,7 +15236,7 @@ var setEasTone = (options) => __async(null, null, function* () {
|
|
|
15227
15236
|
|
|
15228
15237
|
// src/@parsers/@text/text.getEmbed.ts
|
|
15229
15238
|
var getEmebed = (event) => {
|
|
15230
|
-
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
|
|
15239
|
+
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;
|
|
15231
15240
|
const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
|
|
15232
15241
|
const isStatement = event.properties.status_metadata.is_statement;
|
|
15233
15242
|
const isExpired = event.properties.status_metadata.is_expired;
|
|
@@ -15259,12 +15268,7 @@ var getEmebed = (event) => {
|
|
|
15259
15268
|
line(`**Tags:**`, ((_sa = (_ra = (_qa = event == null ? void 0 : event.properties) == null ? void 0 : _qa.parameters) == null ? void 0 : _ra.tags) == null ? void 0 : _sa.length) > 0 ? (_ua = (_ta = event == null ? void 0 : event.properties) == null ? void 0 : _ta.parameters) == null ? void 0 : _ua.tags.join(", ") : null, !isExpired),
|
|
15260
15269
|
line(`**Sender:**`, ((_xa = (_wa = (_va = event == null ? void 0 : event.properties) == null ? void 0 : _va.geocode) == null ? void 0 : _wa.office) == null ? void 0 : _xa.name) ? `${(_Aa = (_za = (_ya = event == null ? void 0 : event.properties) == null ? void 0 : _ya.geocode) == null ? void 0 : _za.office) == null ? void 0 : _Aa.name} (${(_Da = (_Ca = (_Ba = event == null ? void 0 : event.properties) == null ? void 0 : _Ba.geocode) == null ? void 0 : _Ca.office) == null ? void 0 : _Da.office})` : (_Ga = (_Fa = (_Ea = event == null ? void 0 : event.properties) == null ? void 0 : _Ea.geocode) == null ? void 0 : _Fa.office) == null ? void 0 : _Ga.office),
|
|
15261
15270
|
line(`**Tracking:**`, (_Ia = (_Ha = event == null ? void 0 : event.properties) == null ? void 0 : _Ha.metadata) == null ? void 0 : _Ia.tracking),
|
|
15262
|
-
line(`**Logs:**`, ((_La = (_Ka = (_Ja = event == null ? void 0 : event.properties) == null ? void 0 : _Ja.metadata) == null ? void 0 : _Ka.history) == null ? void 0 : _La.length) > 0 ? (_Na = (_Ma = event == null ? void 0 : event.properties) == null ? void 0 : _Ma.metadata) == null ? void 0 : _Na.history.length : null)
|
|
15263
|
-
line(``, ((_Qa = (_Pa = (_Oa = event == null ? void 0 : event.properties) == null ? void 0 : _Oa.metadata) == null ? void 0 : _Pa.attachments) == null ? void 0 : _Qa.length) > 0 ? `**Attachments:** ${(_Sa = (_Ra = event == null ? void 0 : event.properties) == null ? void 0 : _Ra.metadata) == null ? void 0 : _Sa.attachments.map((attachment) => {
|
|
15264
|
-
var _a2, _b2;
|
|
15265
|
-
return `[Attachment #${((_b2 = (_a2 = event == null ? void 0 : event.properties) == null ? void 0 : _a2.metadata) == null ? void 0 : _b2.attachments.indexOf(attachment)) + 1}](${attachment})`;
|
|
15266
|
-
}).join(" | ")}` : null),
|
|
15267
|
-
line(``, ((_Ta = event == null ? void 0 : event.properties) == null ? void 0 : _Ta.description) ? "```\n" + ((_Ua = event == null ? void 0 : event.properties) == null ? void 0 : _Ua.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n")) + "\n```" : null, !isExpired)
|
|
15271
|
+
line(`**Logs:**`, ((_La = (_Ka = (_Ja = event == null ? void 0 : event.properties) == null ? void 0 : _Ja.metadata) == null ? void 0 : _Ka.history) == null ? void 0 : _La.length) > 0 ? (_Na = (_Ma = event == null ? void 0 : event.properties) == null ? void 0 : _Ma.metadata) == null ? void 0 : _Na.history.length : null)
|
|
15268
15272
|
].filter(Boolean).join("\n");
|
|
15269
15273
|
};
|
|
15270
15274
|
|
|
@@ -15272,57 +15276,66 @@ var getEmebed = (event) => {
|
|
|
15272
15276
|
var import_request = __toESM(require("request"));
|
|
15273
15277
|
var createHttp = (options) => __async(null, null, function* () {
|
|
15274
15278
|
return new Promise((resolve6, reject) => {
|
|
15275
|
-
var _a, _b, _c, _d, _e;
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
|
|
15288
|
-
|
|
15289
|
-
|
|
15290
|
-
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
(0, import_request.default)(requestOptions, (error, response2, body) => {
|
|
15294
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
15295
|
-
if (error) {
|
|
15296
|
-
return resolve6({
|
|
15297
|
-
error: true,
|
|
15298
|
-
options: requestOptions,
|
|
15299
|
-
status: -1,
|
|
15300
|
-
message: (_a2 = error.message) != null ? _a2 : `Unknown Error`
|
|
15301
|
-
});
|
|
15302
|
-
}
|
|
15303
|
-
if (response2.statusCode < 200 || response2.statusCode >= 300) {
|
|
15304
|
-
return resolve6({
|
|
15305
|
-
error: true,
|
|
15306
|
-
options: requestOptions,
|
|
15307
|
-
status: (_b2 = response2.statusCode) != null ? _b2 : -1,
|
|
15308
|
-
message: `HTTP Status Code ${(_c2 = response2.statusCode) != null ? _c2 : `Unknown Status Code`} (${body})`
|
|
15309
|
-
});
|
|
15279
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15280
|
+
try {
|
|
15281
|
+
const requestOptions = {
|
|
15282
|
+
url: (_a = options.url) != null ? _a : `https://api.weather.gov/alerts/active`,
|
|
15283
|
+
headers: (_b = options.headers) != null ? _b : {
|
|
15284
|
+
"User-Agent": "AtmosphericX",
|
|
15285
|
+
"Accept": "application/geo+json, text/plain, */*; q=0.9",
|
|
15286
|
+
"Accept-Language": "en-US,en;q=0.9"
|
|
15287
|
+
},
|
|
15288
|
+
method: (_c = options.method) != null ? _c : `GET`,
|
|
15289
|
+
timeout: (_d = options.timeout) != null ? _d : 1e4,
|
|
15290
|
+
proxy: (_e = options.proxy) != null ? _e : null,
|
|
15291
|
+
maxRedirects: 1
|
|
15292
|
+
};
|
|
15293
|
+
if (options.formData) {
|
|
15294
|
+
requestOptions["formData"] = options.formData;
|
|
15295
|
+
} else if (options.body) {
|
|
15296
|
+
requestOptions["body"] = options.body;
|
|
15310
15297
|
}
|
|
15311
|
-
|
|
15312
|
-
|
|
15313
|
-
|
|
15298
|
+
(0, import_request.default)(requestOptions, (error, response2, body) => {
|
|
15299
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
15300
|
+
if (error) {
|
|
15301
|
+
return resolve6({
|
|
15302
|
+
error: true,
|
|
15303
|
+
options: requestOptions,
|
|
15304
|
+
status: -1,
|
|
15305
|
+
message: (_a2 = error.message) != null ? _a2 : `Unknown Error`
|
|
15306
|
+
});
|
|
15307
|
+
}
|
|
15308
|
+
if (response2.statusCode < 200 || response2.statusCode >= 300) {
|
|
15309
|
+
return resolve6({
|
|
15310
|
+
error: true,
|
|
15311
|
+
options: requestOptions,
|
|
15312
|
+
status: (_b2 = response2.statusCode) != null ? _b2 : -1,
|
|
15313
|
+
message: `HTTP Status Code ${(_c2 = response2.statusCode) != null ? _c2 : `Unknown Status Code`} (${body})`
|
|
15314
|
+
});
|
|
15315
|
+
}
|
|
15316
|
+
if (body == void 0 || body == null) {
|
|
15317
|
+
return resolve6({
|
|
15318
|
+
error: true,
|
|
15319
|
+
options: requestOptions,
|
|
15320
|
+
status: (_d2 = response2.statusCode) != null ? _d2 : -1,
|
|
15321
|
+
message: `Empty Response Body`
|
|
15322
|
+
});
|
|
15323
|
+
}
|
|
15324
|
+
resolve6({
|
|
15325
|
+
error: false,
|
|
15314
15326
|
options: requestOptions,
|
|
15315
|
-
status: (
|
|
15316
|
-
message:
|
|
15327
|
+
status: (_e2 = response2.statusCode) != null ? _e2 : -1,
|
|
15328
|
+
message: body
|
|
15317
15329
|
});
|
|
15318
|
-
}
|
|
15319
|
-
resolve6({
|
|
15320
|
-
error: false,
|
|
15321
|
-
options: requestOptions,
|
|
15322
|
-
status: (_e2 = response2.statusCode) != null ? _e2 : -1,
|
|
15323
|
-
message: body
|
|
15324
15330
|
});
|
|
15325
|
-
})
|
|
15331
|
+
} catch (error) {
|
|
15332
|
+
return resolve6({
|
|
15333
|
+
error: true,
|
|
15334
|
+
options: {},
|
|
15335
|
+
status: -1,
|
|
15336
|
+
message: (_f = error.message) != null ? _f : `Unknown Error`
|
|
15337
|
+
});
|
|
15338
|
+
}
|
|
15326
15339
|
});
|
|
15327
15340
|
});
|
|
15328
15341
|
|
|
@@ -15334,86 +15347,119 @@ var updateListener = (event) => __async(null, null, function* () {
|
|
|
15334
15347
|
const settings = bootstrap.settings;
|
|
15335
15348
|
const listeners2 = settings.ListenerSettings;
|
|
15336
15349
|
const properties2 = event.properties;
|
|
15337
|
-
|
|
15338
|
-
|
|
15339
|
-
|
|
15340
|
-
|
|
15341
|
-
|
|
15350
|
+
const metadata = {
|
|
15351
|
+
file: null,
|
|
15352
|
+
eas: null,
|
|
15353
|
+
name: properties2.event,
|
|
15354
|
+
status: properties2.status,
|
|
15355
|
+
description: properties2.description,
|
|
15356
|
+
tracking: properties2.metadata.tracking,
|
|
15357
|
+
header: properties2.metadata.header,
|
|
15358
|
+
raw: properties2.metadata.raw,
|
|
15359
|
+
expired: properties2.status_metadata.is_expired,
|
|
15360
|
+
attachments: properties2.metadata.attachments
|
|
15361
|
+
};
|
|
15362
|
+
for (const listener2 of listeners2) {
|
|
15363
|
+
const events = listener2 == null ? void 0 : listener2.events;
|
|
15364
|
+
const webhook = listener2 == null ? void 0 : listener2.webhook;
|
|
15365
|
+
const uploads = listener2 == null ? void 0 : listener2.uploads;
|
|
15366
|
+
const isMatched = events.some((pattern) => {
|
|
15342
15367
|
if (!pattern) return false;
|
|
15343
|
-
if (pattern === "*" || pattern ===
|
|
15368
|
+
if (pattern === "*" || pattern === metadata.name) return true;
|
|
15344
15369
|
if (pattern.includes("*")) {
|
|
15345
15370
|
const regex = "^" + pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*") + "$";
|
|
15346
|
-
return new RegExp(regex).test(
|
|
15371
|
+
return new RegExp(regex).test(metadata.name);
|
|
15347
15372
|
}
|
|
15348
15373
|
return false;
|
|
15349
15374
|
});
|
|
15350
|
-
if ((events == null ? void 0 : events.length) == 0 ||
|
|
15351
|
-
|
|
15352
|
-
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
|
|
15356
|
-
message: properties2.description,
|
|
15357
|
-
header: properties2.metadata.header
|
|
15375
|
+
if ((events == null ? void 0 : events.length) == 0 || isMatched) {
|
|
15376
|
+
if (uploads == null ? void 0 : uploads.eas) {
|
|
15377
|
+
metadata.eas = yield setEasTone({
|
|
15378
|
+
title: `${metadata.name}_${metadata.status}_${metadata.tracking}`,
|
|
15379
|
+
message: metadata.description,
|
|
15380
|
+
header: metadata.header
|
|
15358
15381
|
});
|
|
15359
15382
|
}
|
|
15360
|
-
if (
|
|
15361
|
-
const
|
|
15362
|
-
if (
|
|
15363
|
-
if (!(0, import_fs3.existsSync)(
|
|
15364
|
-
(0, import_fs3.mkdirSync)(
|
|
15383
|
+
if (uploads == null ? void 0 : uploads.file) {
|
|
15384
|
+
const fDestination = settings.GlobalSettings.ArchiveSettings.TextDirectory;
|
|
15385
|
+
if (fDestination) {
|
|
15386
|
+
if (!(0, import_fs3.existsSync)(fDestination)) {
|
|
15387
|
+
(0, import_fs3.mkdirSync)(fDestination, { recursive: true });
|
|
15365
15388
|
}
|
|
15366
|
-
if ((0, import_fs3.existsSync)(`${
|
|
15367
|
-
(0, import_fs3.appendFileSync)(`${
|
|
15389
|
+
if ((0, import_fs3.existsSync)(`${fDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.txt`)) {
|
|
15390
|
+
(0, import_fs3.appendFileSync)(`${fDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.txt`, metadata.raw);
|
|
15368
15391
|
} else {
|
|
15369
|
-
(0, import_fs3.writeFileSync)(`${
|
|
15392
|
+
(0, import_fs3.writeFileSync)(`${fDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.txt`, metadata.raw);
|
|
15370
15393
|
}
|
|
15371
15394
|
}
|
|
15372
|
-
file =
|
|
15395
|
+
metadata.file = metadata.raw;
|
|
15373
15396
|
}
|
|
15374
|
-
if (
|
|
15375
|
-
const
|
|
15376
|
-
if (
|
|
15377
|
-
|
|
15378
|
-
|
|
15379
|
-
body = body.substring(0, 1900) + "\n\n[Message truncated due to length]";
|
|
15380
|
-
const blocks = ((_a = body.match(/```/g)) != null ? _a : []).length;
|
|
15381
|
-
if (blocks % 2 !== 0) body += "```";
|
|
15382
|
-
}
|
|
15383
|
-
if (properties2.description.length < 25) {
|
|
15384
|
-
continue;
|
|
15385
|
-
}
|
|
15386
|
-
const form = new import_form_data.default();
|
|
15387
|
-
const embed = {
|
|
15388
|
-
title: `${properties2.event} (${properties2.status})`,
|
|
15389
|
-
description: body,
|
|
15390
|
-
color: 16711680,
|
|
15391
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
15392
|
-
image: {},
|
|
15393
|
-
footer: { text: (_b = sWebhook.title) != null ? _b : `AtmosphericX` }
|
|
15394
|
-
};
|
|
15395
|
-
form.append("payload_json", JSON.stringify({
|
|
15396
|
-
username: (_c = sWebhook.title) != null ? _c : "AtmosphericX",
|
|
15397
|
-
content: (_d = sWebhook.message) != null ? _d : "",
|
|
15398
|
-
embeds: [embed]
|
|
15399
|
-
}));
|
|
15400
|
-
if (sUploads == null ? void 0 : sUploads.file) {
|
|
15401
|
-
form.append("fUpload", Buffer.from(file), { filename: `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`, contentType: "application/text" });
|
|
15397
|
+
if (uploads == null ? void 0 : uploads.event) {
|
|
15398
|
+
const eDestination = settings.GlobalSettings.ArchiveSettings.EventDirectory;
|
|
15399
|
+
if (eDestination) {
|
|
15400
|
+
if (!(0, import_fs3.existsSync)(eDestination)) {
|
|
15401
|
+
(0, import_fs3.mkdirSync)(eDestination, { recursive: true });
|
|
15402
15402
|
}
|
|
15403
|
-
|
|
15404
|
-
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
|
|
15403
|
+
(0, import_fs3.writeFileSync)(`${eDestination}/${metadata.name}_${metadata.status}_${metadata.tracking}.json`, JSON.stringify(getCleanedEvent(event), null, 2));
|
|
15404
|
+
}
|
|
15405
|
+
}
|
|
15406
|
+
if (webhook.enabled && webhook.destination) {
|
|
15407
|
+
const ratelimit = setTimeoutAction({ identifier: webhook.destination, interval: webhook.ratelimit, max: webhook.ratelimit, addTime: true });
|
|
15408
|
+
const form = new import_form_data.default();
|
|
15409
|
+
const embed = {
|
|
15410
|
+
title: `${metadata.name} (${metadata.status})`,
|
|
15411
|
+
description: getEmebed(event),
|
|
15412
|
+
fields: [],
|
|
15413
|
+
color: 16711680,
|
|
15414
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
15415
|
+
footer: { text: (_a = webhook.title) != null ? _a : `AtmosphericX` }
|
|
15416
|
+
};
|
|
15417
|
+
if (ratelimit.limited) {
|
|
15418
|
+
return;
|
|
15419
|
+
}
|
|
15420
|
+
if (metadata.description && !metadata.expired) {
|
|
15421
|
+
if (metadata.description.length > 900) {
|
|
15422
|
+
metadata.description = metadata.description.substring(0, 900) + "\n\n[Message truncated due to length]";
|
|
15408
15423
|
}
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
|
|
15414
|
-
|
|
15424
|
+
embed.fields.push({
|
|
15425
|
+
name: "Description",
|
|
15426
|
+
value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
|
|
15427
|
+
});
|
|
15428
|
+
}
|
|
15429
|
+
if (((_b = metadata.attachments) == null ? void 0 : _b.length) > 0) {
|
|
15430
|
+
metadata.attachments = metadata.attachments.slice(0, 5);
|
|
15431
|
+
embed.fields.push({
|
|
15432
|
+
name: "Attachments",
|
|
15433
|
+
value: metadata.attachments.map((attachment) => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + "..." : attachment.name}](${attachment.link})`).join("\n")
|
|
15415
15434
|
});
|
|
15416
15435
|
}
|
|
15436
|
+
if (uploads == null ? void 0 : uploads.file) {
|
|
15437
|
+
form.append("fUpload", Buffer.from(metadata.file), {
|
|
15438
|
+
filename: `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}.txt`,
|
|
15439
|
+
contentType: "application/text"
|
|
15440
|
+
});
|
|
15441
|
+
}
|
|
15442
|
+
if (uploads == null ? void 0 : uploads.eas) {
|
|
15443
|
+
if (metadata.eas) {
|
|
15444
|
+
const file = (0, import_fs3.readFileSync)(metadata.eas);
|
|
15445
|
+
form.append("fEas", Buffer.from(file), {
|
|
15446
|
+
filename: `${properties2.event}_${properties2.status}_${properties2.metadata.tracking}_eas.mp3`,
|
|
15447
|
+
contentType: "audio/mpeg"
|
|
15448
|
+
});
|
|
15449
|
+
}
|
|
15450
|
+
}
|
|
15451
|
+
form.append("payload_json", JSON.stringify({
|
|
15452
|
+
username: (_c = webhook.title) != null ? _c : "AtmosphericX",
|
|
15453
|
+
content: (_d = webhook.message) != null ? _d : "",
|
|
15454
|
+
embeds: [embed]
|
|
15455
|
+
}));
|
|
15456
|
+
yield createHttp({
|
|
15457
|
+
url: webhook.destination,
|
|
15458
|
+
timeout: 5e3,
|
|
15459
|
+
method: `POST`,
|
|
15460
|
+
headers: form.getHeaders(),
|
|
15461
|
+
body: form
|
|
15462
|
+
});
|
|
15417
15463
|
}
|
|
15418
15464
|
}
|
|
15419
15465
|
}
|
|
@@ -15687,13 +15733,70 @@ var getLatestIssuance = () => {
|
|
|
15687
15733
|
return latest.toString().padStart(4, "0");
|
|
15688
15734
|
};
|
|
15689
15735
|
|
|
15736
|
+
// src/@dictionaries/dictionaries.states.ts
|
|
15737
|
+
var dict_states = {
|
|
15738
|
+
"AL": "Alabama",
|
|
15739
|
+
"AK": "Alaska",
|
|
15740
|
+
"AZ": "Arizona",
|
|
15741
|
+
"AR": "Arkansas",
|
|
15742
|
+
"CA": "California",
|
|
15743
|
+
"CO": "Colorado",
|
|
15744
|
+
"CT": "Connecticut",
|
|
15745
|
+
"DE": "Delaware",
|
|
15746
|
+
"FL": "Florida",
|
|
15747
|
+
"GA": "Georgia",
|
|
15748
|
+
"HI": "Hawaii",
|
|
15749
|
+
"ID": "Idaho",
|
|
15750
|
+
"IL": "Illinois",
|
|
15751
|
+
"IN": "Indiana",
|
|
15752
|
+
"IA": "Iowa",
|
|
15753
|
+
"KS": "Kansas",
|
|
15754
|
+
"KY": "Kentucky",
|
|
15755
|
+
"LA": "Louisiana",
|
|
15756
|
+
"ME": "Maine",
|
|
15757
|
+
"MD": "Maryland",
|
|
15758
|
+
"MA": "Massachusetts",
|
|
15759
|
+
"MI": "Michigan",
|
|
15760
|
+
"MN": "Minnesota",
|
|
15761
|
+
"MS": "Mississippi",
|
|
15762
|
+
"MO": "Missouri",
|
|
15763
|
+
"MT": "Montana",
|
|
15764
|
+
"NE": "Nebraska",
|
|
15765
|
+
"NV": "Nevada",
|
|
15766
|
+
"NH": "New Hampshire",
|
|
15767
|
+
"NJ": "New Jersey",
|
|
15768
|
+
"NM": "New Mexico",
|
|
15769
|
+
"NY": "New York",
|
|
15770
|
+
"NC": "North Carolina",
|
|
15771
|
+
"ND": "North Dakota",
|
|
15772
|
+
"OH": "Ohio",
|
|
15773
|
+
"OK": "Oklahoma",
|
|
15774
|
+
"OR": "Oregon",
|
|
15775
|
+
"PA": "Pennsylvania",
|
|
15776
|
+
"RI": "Rhode Island",
|
|
15777
|
+
"SC": "South Carolina",
|
|
15778
|
+
"SD": "South Dakota",
|
|
15779
|
+
"TN": "Tennessee",
|
|
15780
|
+
"TX": "Texas",
|
|
15781
|
+
"UT": "Utah",
|
|
15782
|
+
"VT": "Vermont",
|
|
15783
|
+
"VA": "Virginia",
|
|
15784
|
+
"WA": "Washington",
|
|
15785
|
+
"WV": "West Virginia",
|
|
15786
|
+
"WI": "Wisconsin",
|
|
15787
|
+
"WY": "Wyoming",
|
|
15788
|
+
"DC": "District of Columbia"
|
|
15789
|
+
};
|
|
15790
|
+
|
|
15690
15791
|
// src/@building/building.attachments.ts
|
|
15691
15792
|
var getEventAttachments = (event) => {
|
|
15692
|
-
var _a, _b, _c, _d;
|
|
15793
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
15794
|
+
let attachments = [];
|
|
15693
15795
|
const latestTime = getLatestIssuance();
|
|
15694
15796
|
const spcNumber = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.discussion_parameters) == null ? void 0 : _b.discussion_number;
|
|
15695
15797
|
const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
|
|
15696
|
-
const
|
|
15798
|
+
const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
|
|
15799
|
+
const events = [
|
|
15697
15800
|
{ target: "Day 1", attachment: `https://www.spc.noaa.gov/products/outlook/day1otlk_${latestTime}.png` },
|
|
15698
15801
|
{ target: "Day 2", attachment: `https://www.spc.noaa.gov/products/outlook/day2otlk.png` },
|
|
15699
15802
|
{ target: "Day 3", attachment: `https://www.spc.noaa.gov/products/outlook/day3otlk.png` },
|
|
@@ -15703,11 +15806,32 @@ var getEventAttachments = (event) => {
|
|
|
15703
15806
|
{ target: "Severe Thunderstorm Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` },
|
|
15704
15807
|
{ target: "PDS Severe Thunderstorm Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` }
|
|
15705
15808
|
];
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15809
|
+
if (events.find((e) => e.target === event.properties.event)) {
|
|
15810
|
+
attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target === event.properties.event).attachment });
|
|
15811
|
+
}
|
|
15812
|
+
for (const location of locations) {
|
|
15813
|
+
if (dict_expressions.location.test(location)) {
|
|
15814
|
+
const lines = [`Northern`, `Southern`, `Eastern`, `Western`, `Inland`, `Costal`, `County`];
|
|
15815
|
+
const county = (_f = location == null ? void 0 : location.split(",")[0]) == null ? void 0 : _f.trim().replace(new RegExp(`^(${lines.join("|")}) `), "");
|
|
15816
|
+
const state = dict_states[(_g = location == null ? void 0 : location.split(",")[1]) == null ? void 0 : _g.trim()];
|
|
15817
|
+
const feeds = bootstrap.database.prepare(`SELECT * FROM broadcastify WHERE state = ? AND county = ?`).all(state, county).sort((a, b) => {
|
|
15818
|
+
const typeOrder = ["Other", "Public Safety"];
|
|
15819
|
+
const indexA = typeOrder.indexOf(a.type);
|
|
15820
|
+
const indexB = typeOrder.indexOf(b.type);
|
|
15821
|
+
return indexA - indexB;
|
|
15822
|
+
});
|
|
15823
|
+
const tags = bootstrap.settings.BroadcastifySettings.BroadcastifyTags;
|
|
15824
|
+
const filtered = feeds.filter((feed) => tags.includes(feed.type));
|
|
15825
|
+
if (filtered.length > 0) {
|
|
15826
|
+
filtered.map((filtered2) => {
|
|
15827
|
+
if (!attachments.some((a) => a.link === filtered2.link)) {
|
|
15828
|
+
attachments.push({ name: `${filtered2.type}: ${filtered2.feed}`, link: filtered2.link });
|
|
15829
|
+
}
|
|
15830
|
+
});
|
|
15831
|
+
}
|
|
15832
|
+
}
|
|
15709
15833
|
}
|
|
15710
|
-
return
|
|
15834
|
+
return attachments;
|
|
15711
15835
|
};
|
|
15712
15836
|
|
|
15713
15837
|
// src/@building/building.validate.ts
|
|
@@ -16255,7 +16379,7 @@ var vtec = (stanza) => __async(null, null, function* () {
|
|
|
16255
16379
|
|
|
16256
16380
|
// src/@events/events.api.ts
|
|
16257
16381
|
var api = (stanza) => __async(null, null, function* () {
|
|
16258
|
-
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;
|
|
16382
|
+
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;
|
|
16259
16383
|
let processed = [];
|
|
16260
16384
|
const messages = Object.values(JSON.parse(stanza.message).features);
|
|
16261
16385
|
for (const feature of messages) {
|
|
@@ -16274,67 +16398,68 @@ var api = (stanza) => __async(null, null, function* () {
|
|
|
16274
16398
|
issued: ((_k = feature == null ? void 0 : feature.properties) == null ? void 0 : _k.sent) ? new Date((_l = feature == null ? void 0 : feature.properties) == null ? void 0 : _l.sent).toISOString() : null,
|
|
16275
16399
|
expires: ((_m = feature == null ? void 0 : feature.properties) == null ? void 0 : _m.expires) ? new Date((_n = feature == null ? void 0 : feature.properties) == null ? void 0 : _n.expires).toISOString() : null,
|
|
16276
16400
|
locations: (_p = (_o = feature == null ? void 0 : feature.properties) == null ? void 0 : _o.areaDesc) != null ? _p : null,
|
|
16277
|
-
|
|
16278
|
-
|
|
16401
|
+
locations_array: ((_q = feature == null ? void 0 : feature.properties) == null ? void 0 : _q.areaDesc) ? (_r = feature == null ? void 0 : feature.properties) == null ? void 0 : _r.areaDesc.split(";") : [],
|
|
16402
|
+
description: (_t = (_s = feature == null ? void 0 : feature.properties) == null ? void 0 : _s.description) != null ? _t : null,
|
|
16403
|
+
attributes: (_v = (_u = feature == null ? void 0 : feature.properties) == null ? void 0 : _u.attributes) != null ? _v : {},
|
|
16279
16404
|
geocode: {
|
|
16280
16405
|
office: {
|
|
16281
|
-
office: pVtec ? (
|
|
16282
|
-
name: (
|
|
16406
|
+
office: pVtec ? (_w = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _w.tracking.split(`.`)[0] : null,
|
|
16407
|
+
name: (_y = dict_icao[pVtec ? (_x = pVtec == null ? void 0 : pVtec[0]) == null ? void 0 : _x.tracking.split(`.`)[0] : null]) != null ? _y : null
|
|
16283
16408
|
},
|
|
16284
|
-
organization: (
|
|
16285
|
-
ugc: (
|
|
16286
|
-
polygon: ((
|
|
16287
|
-
polygon_generated: ((
|
|
16409
|
+
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],
|
|
16410
|
+
ugc: (_E = (_D = (_C = feature == null ? void 0 : feature.properties) == null ? void 0 : _C.geocode) == null ? void 0 : _D.UGC) != null ? _E : [],
|
|
16411
|
+
polygon: ((_F = feature == null ? void 0 : feature.geometry) == null ? void 0 : _F.coordinates.length) > 0 ? Buffer.from(JSON.stringify([(_G = feature == null ? void 0 : feature.geometry) == null ? void 0 : _G.coordinates[0]])).toString("base64") : null,
|
|
16412
|
+
polygon_generated: ((_H = feature == null ? void 0 : feature.geometry) == null ? void 0 : _H.coordinates.length) > 0 ? true : false
|
|
16288
16413
|
},
|
|
16289
16414
|
parameters: {
|
|
16290
|
-
tags: getEventTags((
|
|
16291
|
-
instructions: (
|
|
16292
|
-
source: (
|
|
16293
|
-
hazards: (
|
|
16294
|
-
impacts: (
|
|
16295
|
-
estimated_hail_size: (
|
|
16296
|
-
estimated_wind_gusts: (
|
|
16297
|
-
damage_threat: (
|
|
16298
|
-
tornado_threat: (
|
|
16299
|
-
flood_threat: (
|
|
16300
|
-
wind_threat: (
|
|
16301
|
-
hail_threat: (
|
|
16415
|
+
tags: getEventTags((_I = feature == null ? void 0 : feature.properties) == null ? void 0 : _I.description),
|
|
16416
|
+
instructions: (_K = (_J = feature == null ? void 0 : feature.properties) == null ? void 0 : _J.instruction) != null ? _K : null,
|
|
16417
|
+
source: (_M = getTextFromProduct({ message: (_L = feature == null ? void 0 : feature.properties) == null ? void 0 : _L.description, find: [`SOURCE...`], removal: [`.`] })) != null ? _M : null,
|
|
16418
|
+
hazards: (_O = getTextFromProduct({ message: (_N = feature == null ? void 0 : feature.properties) == null ? void 0 : _N.description, find: [`HAZARD...`], removal: [`.`] })) != null ? _O : null,
|
|
16419
|
+
impacts: (_Q = getTextFromProduct({ message: (_P = feature == null ? void 0 : feature.properties) == null ? void 0 : _P.description, find: [`IMPACT...`], removal: [`.`] })) != null ? _Q : null,
|
|
16420
|
+
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,
|
|
16421
|
+
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,
|
|
16422
|
+
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,
|
|
16423
|
+
tornado_threat: (_ea = (_da = (_ca = (_ba = feature == null ? void 0 : feature.properties) == null ? void 0 : _ba.parameters) == null ? void 0 : _ca.tornadoDetection) == null ? void 0 : _da[0]) != null ? _ea : null,
|
|
16424
|
+
flood_threat: (_ia = (_ha = (_ga = (_fa = feature == null ? void 0 : feature.properties) == null ? void 0 : _fa.parameters) == null ? void 0 : _ga.floodDetection) == null ? void 0 : _ha[0]) != null ? _ia : null,
|
|
16425
|
+
wind_threat: (_ma = (_la = (_ka = (_ja = feature == null ? void 0 : feature.properties) == null ? void 0 : _ja.parameters) == null ? void 0 : _ka.windThreat) == null ? void 0 : _la[0]) != null ? _ma : null,
|
|
16426
|
+
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
|
|
16302
16427
|
},
|
|
16303
16428
|
discussion_parameters: {
|
|
16304
|
-
discussion_number: (
|
|
16305
|
-
discussion_concerning: (
|
|
16306
|
-
discussion_max_tornado: (
|
|
16307
|
-
discussion_max_hail: (
|
|
16308
|
-
discussion_max_wind: (
|
|
16309
|
-
discussion_watch_issuance: (
|
|
16429
|
+
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,
|
|
16430
|
+
discussion_concerning: (_wa = getTextFromProduct({ message: (_va = feature == null ? void 0 : feature.properties) == null ? void 0 : _va.description, find: [`Concerning...`] })) != null ? _wa : null,
|
|
16431
|
+
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,
|
|
16432
|
+
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,
|
|
16433
|
+
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,
|
|
16434
|
+
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
|
|
16310
16435
|
},
|
|
16311
16436
|
watch_parameters: {
|
|
16312
|
-
watch_number: ((
|
|
16313
|
-
watch_type: ((
|
|
16314
|
-
additional_tornadoes_probability: (
|
|
16315
|
-
strong_tornadoes_probability: (
|
|
16316
|
-
severe_wind_probability: (
|
|
16317
|
-
severe_hail_probability: (
|
|
16318
|
-
hail_2in_probability: (
|
|
16319
|
-
combined_hail_wind_probability: (
|
|
16320
|
-
max_hail_in: (
|
|
16321
|
-
max_wind_surface: (
|
|
16322
|
-
max_tops_x100feet: (
|
|
16323
|
-
pds_watch: getTextFromProduct({ message: (
|
|
16437
|
+
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),
|
|
16438
|
+
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,
|
|
16439
|
+
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,
|
|
16440
|
+
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,
|
|
16441
|
+
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,
|
|
16442
|
+
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,
|
|
16443
|
+
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,
|
|
16444
|
+
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,
|
|
16445
|
+
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,
|
|
16446
|
+
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,
|
|
16447
|
+
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,
|
|
16448
|
+
pds_watch: getTextFromProduct({ message: (_jb = feature == null ? void 0 : feature.properties) == null ? void 0 : _jb.description, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`
|
|
16324
16449
|
},
|
|
16325
16450
|
metadata: {
|
|
16326
16451
|
ms: performance.now() - tick,
|
|
16327
16452
|
source: `events.api`,
|
|
16328
|
-
tracking: getEventTracking({ type: `API`, organization: { wmoidentifier: (
|
|
16329
|
-
header: `ZCZC-ATMOSX-${(
|
|
16453
|
+
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] }),
|
|
16454
|
+
header: `ZCZC-ATMOSX-${(_ob = (_nb = feature == null ? void 0 : feature.properties) == null ? void 0 : _nb.parameters) == null ? void 0 : _ob.WMOidentifier}`,
|
|
16330
16455
|
vtec: pVtec == null ? void 0 : pVtec[0],
|
|
16331
16456
|
hvtec: null,
|
|
16332
|
-
raw: (
|
|
16457
|
+
raw: (_pb = feature == null ? void 0 : feature.properties) == null ? void 0 : _pb.description,
|
|
16333
16458
|
history: [
|
|
16334
16459
|
{
|
|
16335
|
-
description: (
|
|
16336
|
-
issued: ((
|
|
16337
|
-
status: (
|
|
16460
|
+
description: (_qb = feature == null ? void 0 : feature.properties) == null ? void 0 : _qb.description,
|
|
16461
|
+
issued: ((_rb = feature == null ? void 0 : feature.properties) == null ? void 0 : _rb.sent) ? new Date((_sb = feature == null ? void 0 : feature.properties) == null ? void 0 : _sb.sent).toISOString() : null,
|
|
16462
|
+
status: (_ub = (_tb = feature == null ? void 0 : feature.properties) == null ? void 0 : _tb.messageType) != null ? _ub : null
|
|
16338
16463
|
}
|
|
16339
16464
|
]
|
|
16340
16465
|
}
|
|
@@ -16491,7 +16616,6 @@ var importShapefiles = () => __async(null, null, function* () {
|
|
|
16491
16616
|
const tShapefiles = bootstrap.database.prepare(`SELECT COUNT(*) AS count FROM shapefiles`).get().count;
|
|
16492
16617
|
if (tShapefiles === 0) {
|
|
16493
16618
|
yield setSleep({ timeout: 1e3 });
|
|
16494
|
-
setWarning({ message: `Shapefiles are currently building, please DO NOT close your terminal. The shapefiles will not finish and will remain incomplete. If you do mess up, you will need to delete ${settings.Database} and restart the application.` });
|
|
16495
16619
|
for (const shapefile of dict_shapefiles) {
|
|
16496
16620
|
const response2 = yield fetch(shapefile.link);
|
|
16497
16621
|
const arrayBuff = yield response2.arrayBuffer();
|
|
@@ -16512,7 +16636,7 @@ var importShapefiles = () => __async(null, null, function* () {
|
|
|
16512
16636
|
filepath,
|
|
16513
16637
|
filepath
|
|
16514
16638
|
);
|
|
16515
|
-
setWarning({ message: `Importing ${features.length} features from ${shapefile.name}_${shapefile.id}` });
|
|
16639
|
+
setWarning({ message: `Importing ${features.length} features from ${shapefile.name}_${shapefile.id} for Shapefiles` });
|
|
16516
16640
|
const insert = bootstrap.database.prepare(`INSERT OR REPLACE INTO shapefiles (id, location, geometry) VALUES (?, ?, ?)`);
|
|
16517
16641
|
const transaction = bootstrap.database.transaction((entries) => {
|
|
16518
16642
|
var _a2, _b2, _c;
|
|
@@ -16537,10 +16661,8 @@ var importShapefiles = () => __async(null, null, function* () {
|
|
|
16537
16661
|
});
|
|
16538
16662
|
import_fs4.default.unlinkSync(`${filepath}.shp`);
|
|
16539
16663
|
import_fs4.default.unlinkSync(`${filepath}.dbf`);
|
|
16540
|
-
setWarning({ message: `Cleaned up temporary files for ${shapefile.name}_${shapefile.id}` });
|
|
16541
16664
|
transaction(features);
|
|
16542
16665
|
}
|
|
16543
|
-
setWarning({ message: `Shapefiles have finished compiling, you can now continue and close this terminal` });
|
|
16544
16666
|
import_fs4.default.rm((0, import_path3.resolve)(__dirname, "../../shapefiles"), { recursive: true, force: true }, () => {
|
|
16545
16667
|
});
|
|
16546
16668
|
}
|
|
@@ -16549,6 +16671,49 @@ var importShapefiles = () => __async(null, null, function* () {
|
|
|
16549
16671
|
}
|
|
16550
16672
|
});
|
|
16551
16673
|
|
|
16674
|
+
// src/@modules/@database/database.broadcastify.ts
|
|
16675
|
+
var importBroadcastify = () => __async(null, null, function* () {
|
|
16676
|
+
const settings = bootstrap.settings;
|
|
16677
|
+
const isBroadcastifyImported = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
|
|
16678
|
+
if (!settings.BroadcastifySettings.BroadcastifyAttachments) {
|
|
16679
|
+
return;
|
|
16680
|
+
}
|
|
16681
|
+
if (isBroadcastifyImported) {
|
|
16682
|
+
return;
|
|
16683
|
+
}
|
|
16684
|
+
const broadcastify = yield createHttp({
|
|
16685
|
+
url: settings.BroadcastifySettings.BroadcastifyDatabase,
|
|
16686
|
+
timeout: 5e3
|
|
16687
|
+
});
|
|
16688
|
+
if (!broadcastify.error) {
|
|
16689
|
+
bootstrap.database.prepare(`CREATE TABLE broadcastify ( state TEXT, county TEXT, feed TEXT, type TEXT, link TEXT);`).run();
|
|
16690
|
+
const states = JSON.parse(broadcastify.message);
|
|
16691
|
+
const insert = bootstrap.database.prepare(`INSERT INTO broadcastify (state, county, feed, type, link) VALUES (?, ?, ?, ?, ?)`);
|
|
16692
|
+
const transaction = bootstrap.database.transaction((rows) => {
|
|
16693
|
+
for (const row of rows) {
|
|
16694
|
+
insert.run(row);
|
|
16695
|
+
}
|
|
16696
|
+
});
|
|
16697
|
+
const batch = [];
|
|
16698
|
+
for (const state of states) {
|
|
16699
|
+
setWarning({ message: `Importing ${state.counties.length} counties from ${state.state} for Broadcastify` });
|
|
16700
|
+
for (const county of state.counties) {
|
|
16701
|
+
const countyName = county.county;
|
|
16702
|
+
for (const feed of county.feeds) {
|
|
16703
|
+
batch.push([
|
|
16704
|
+
state.state,
|
|
16705
|
+
countyName,
|
|
16706
|
+
feed.name,
|
|
16707
|
+
feed.type,
|
|
16708
|
+
feed.link
|
|
16709
|
+
]);
|
|
16710
|
+
}
|
|
16711
|
+
}
|
|
16712
|
+
}
|
|
16713
|
+
transaction(batch);
|
|
16714
|
+
}
|
|
16715
|
+
});
|
|
16716
|
+
|
|
16552
16717
|
// src/@modules/@database/database.init.ts
|
|
16553
16718
|
var initializeDatabase = () => __async(null, null, function* () {
|
|
16554
16719
|
const settings = bootstrap.settings;
|
|
@@ -16560,7 +16725,14 @@ var initializeDatabase = () => __async(null, null, function* () {
|
|
|
16560
16725
|
bootstrap.database = new import_better_sqlite3.default(settings.Database);
|
|
16561
16726
|
bootstrap.database.prepare(`CREATE TABLE IF NOT EXISTS stanzas ( id INTEGER PRIMARY KEY AUTOINCREMENT, type TEXT, issued TEXT, stanza TEXT )`).run();
|
|
16562
16727
|
bootstrap.database.prepare(`CREATE TABLE IF NOT EXISTS shapefiles (id TEXT PRIMARY KEY, location TEXT, geometry TEXT)`).run();
|
|
16563
|
-
|
|
16728
|
+
const isNeedingShapefiles = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='shapefiles';`).get();
|
|
16729
|
+
const isNeedingBroadcastify = bootstrap.database.prepare(`SELECT name FROM sqlite_master WHERE type='table' AND name='broadcastify';`).get();
|
|
16730
|
+
if (!isNeedingShapefiles || !isNeedingBroadcastify) {
|
|
16731
|
+
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.` });
|
|
16732
|
+
yield importBroadcastify();
|
|
16733
|
+
yield importShapefiles();
|
|
16734
|
+
setWarning({ message: `Building has completed, you can now continue or close the terminal` });
|
|
16735
|
+
}
|
|
16564
16736
|
} catch (error) {
|
|
16565
16737
|
setWarning({ message: `An error occurred while initializing the database: ${error.message}` });
|
|
16566
16738
|
}
|
|
@@ -16621,7 +16793,8 @@ var xReconnect = (interval) => __async(null, null, function* () {
|
|
|
16621
16793
|
},
|
|
16622
16794
|
type: `reconnect`,
|
|
16623
16795
|
error: true
|
|
16624
|
-
}
|
|
16796
|
+
},
|
|
16797
|
+
message: `Attempting to reconnect to XMPP Service (Reconnect Attempt ${bootstrap.cache.tReconnects})`
|
|
16625
16798
|
});
|
|
16626
16799
|
yield bootstrap.session_xmpp.stop().catch(() => {
|
|
16627
16800
|
});
|
|
@@ -16665,6 +16838,7 @@ var setCronSchedule = () => __async(null, null, function* () {
|
|
|
16665
16838
|
};
|
|
16666
16839
|
walk(settings.GlobalSettings.ArchiveSettings.TextDirectory);
|
|
16667
16840
|
walk(settings.GlobalSettings.ArchiveSettings.EasDirectory);
|
|
16841
|
+
walk(settings.GlobalSettings.ArchiveSettings.EventDirectory);
|
|
16668
16842
|
if (settings.EnableWireService) {
|
|
16669
16843
|
if (settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.Enabled) {
|
|
16670
16844
|
void xReconnect(settings.NOAAWeatherWireServiceSettings.ReconnectionSettings.ReconnectionInterval);
|
|
@@ -16849,6 +17023,7 @@ var createEvent2 = (options) => {
|
|
|
16849
17023
|
issued: options.issued.toISOString(),
|
|
16850
17024
|
expires: options.expires.toISOString(),
|
|
16851
17025
|
locations: options.locations,
|
|
17026
|
+
locations_array: options.locations ? options.locations.split(";") : [],
|
|
16852
17027
|
description: options.description,
|
|
16853
17028
|
geocode: {
|
|
16854
17029
|
office: {
|