@atmosx/event-product-parser 2.0.11 → 2.0.13
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/.vscode/settings.json +4 -0
- package/dist/cjs/index.cjs +22 -14
- package/dist/esm/index.mjs +22 -14
- package/package.json +1 -1
- package/src/@parsers/events.ts +1 -1
- package/src/@parsers/text.ts +1 -1
- package/src/bootstrap.ts +2 -10
- package/src/index.ts +23 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -4865,7 +4865,7 @@ var definitions = {
|
|
|
4865
4865
|
"Radar Indicated Tornado Warning": { condition: (tornadoThreatTag) => tornadoThreatTag !== "OBSERVED" }
|
|
4866
4866
|
} },
|
|
4867
4867
|
{ "Special Marine Warning": {
|
|
4868
|
-
"Tornadic Special Marine Warning": { condition: (tornadoThreatTag) => tornadoThreatTag
|
|
4868
|
+
"Tornadic Special Marine Warning": { condition: (tornadoThreatTag) => tornadoThreatTag === "POSSIBLE" }
|
|
4869
4869
|
} },
|
|
4870
4870
|
{ "Tornado Watch": {
|
|
4871
4871
|
"PDS Tornado Watch": { description: "particularly dangerous situation" }
|
|
@@ -4910,18 +4910,6 @@ var definitions = {
|
|
|
4910
4910
|
dump_cache_complete: `Completed dumping all cached alert files.`
|
|
4911
4911
|
}
|
|
4912
4912
|
};
|
|
4913
|
-
process.on("uncaughtException", (err) => {
|
|
4914
|
-
if ((err == null ? void 0 : err.code) === "ETIMEDOUT") {
|
|
4915
|
-
return;
|
|
4916
|
-
}
|
|
4917
|
-
if ((err == null ? void 0 : err.code) === "ECONNRESET") {
|
|
4918
|
-
return;
|
|
4919
|
-
}
|
|
4920
|
-
if ((err == null ? void 0 : err.code) === "EHOSTUNREACH") {
|
|
4921
|
-
return;
|
|
4922
|
-
}
|
|
4923
|
-
throw err;
|
|
4924
|
-
});
|
|
4925
4913
|
|
|
4926
4914
|
// src/@parsers/text.ts
|
|
4927
4915
|
var TextParser = class {
|
|
@@ -6024,7 +6012,7 @@ var EventParser = class {
|
|
|
6024
6012
|
if (!conditionMet) continue;
|
|
6025
6013
|
}
|
|
6026
6014
|
if (!conditionMet && condition.condition) {
|
|
6027
|
-
const tagToCheck = baseEvent.includes("Tornado") ? tornadoThreatTag : damageThreatTag;
|
|
6015
|
+
const tagToCheck = baseEvent.includes("Tornado") || baseEvent.includes("Special Marine Warning") ? tornadoThreatTag : damageThreatTag;
|
|
6028
6016
|
conditionMet = condition.condition(tagToCheck);
|
|
6029
6017
|
}
|
|
6030
6018
|
if (conditionMet) {
|
|
@@ -7338,6 +7326,7 @@ var eas_default = EAS;
|
|
|
7338
7326
|
// src/index.ts
|
|
7339
7327
|
var Manager = class {
|
|
7340
7328
|
constructor(metadata) {
|
|
7329
|
+
this.sigCatch();
|
|
7341
7330
|
this.start(metadata);
|
|
7342
7331
|
}
|
|
7343
7332
|
/**
|
|
@@ -7537,6 +7526,25 @@ var Manager = class {
|
|
|
7537
7526
|
}
|
|
7538
7527
|
});
|
|
7539
7528
|
}
|
|
7529
|
+
/**
|
|
7530
|
+
* @function sigCatch
|
|
7531
|
+
* @description
|
|
7532
|
+
* Sets up a global handler for uncaught exceptions, ignoring specific error codes
|
|
7533
|
+
*
|
|
7534
|
+
* @async
|
|
7535
|
+
* @returns void
|
|
7536
|
+
*/
|
|
7537
|
+
sigCatch() {
|
|
7538
|
+
process.on("uncaughtException", (err) => {
|
|
7539
|
+
var _a;
|
|
7540
|
+
const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "STARTTLS_FAILURE"];
|
|
7541
|
+
if (ignored.includes(err == null ? void 0 : err.code)) {
|
|
7542
|
+
utils_default.warn(`XMPP Critical Error: ${(_a = err == null ? void 0 : err.code) != null ? _a : "Unknown error code"}. This may indicate a connection issue. Attempting to continue...`);
|
|
7543
|
+
return;
|
|
7544
|
+
}
|
|
7545
|
+
utils_default.warn(`Uncaught Exception: ${err instanceof Error ? err.stack || err.message : String(err)}`);
|
|
7546
|
+
});
|
|
7547
|
+
}
|
|
7540
7548
|
};
|
|
7541
7549
|
var index_default = Manager;
|
|
7542
7550
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/esm/index.mjs
CHANGED
|
@@ -4853,7 +4853,7 @@ var definitions = {
|
|
|
4853
4853
|
"Radar Indicated Tornado Warning": { condition: (tornadoThreatTag) => tornadoThreatTag !== "OBSERVED" }
|
|
4854
4854
|
} },
|
|
4855
4855
|
{ "Special Marine Warning": {
|
|
4856
|
-
"Tornadic Special Marine Warning": { condition: (tornadoThreatTag) => tornadoThreatTag
|
|
4856
|
+
"Tornadic Special Marine Warning": { condition: (tornadoThreatTag) => tornadoThreatTag === "POSSIBLE" }
|
|
4857
4857
|
} },
|
|
4858
4858
|
{ "Tornado Watch": {
|
|
4859
4859
|
"PDS Tornado Watch": { description: "particularly dangerous situation" }
|
|
@@ -4898,18 +4898,6 @@ var definitions = {
|
|
|
4898
4898
|
dump_cache_complete: `Completed dumping all cached alert files.`
|
|
4899
4899
|
}
|
|
4900
4900
|
};
|
|
4901
|
-
process.on("uncaughtException", (err) => {
|
|
4902
|
-
if ((err == null ? void 0 : err.code) === "ETIMEDOUT") {
|
|
4903
|
-
return;
|
|
4904
|
-
}
|
|
4905
|
-
if ((err == null ? void 0 : err.code) === "ECONNRESET") {
|
|
4906
|
-
return;
|
|
4907
|
-
}
|
|
4908
|
-
if ((err == null ? void 0 : err.code) === "EHOSTUNREACH") {
|
|
4909
|
-
return;
|
|
4910
|
-
}
|
|
4911
|
-
throw err;
|
|
4912
|
-
});
|
|
4913
4901
|
|
|
4914
4902
|
// src/@parsers/text.ts
|
|
4915
4903
|
var TextParser = class {
|
|
@@ -6012,7 +6000,7 @@ var EventParser = class {
|
|
|
6012
6000
|
if (!conditionMet) continue;
|
|
6013
6001
|
}
|
|
6014
6002
|
if (!conditionMet && condition.condition) {
|
|
6015
|
-
const tagToCheck = baseEvent.includes("Tornado") ? tornadoThreatTag : damageThreatTag;
|
|
6003
|
+
const tagToCheck = baseEvent.includes("Tornado") || baseEvent.includes("Special Marine Warning") ? tornadoThreatTag : damageThreatTag;
|
|
6016
6004
|
conditionMet = condition.condition(tagToCheck);
|
|
6017
6005
|
}
|
|
6018
6006
|
if (conditionMet) {
|
|
@@ -7326,6 +7314,7 @@ var eas_default = EAS;
|
|
|
7326
7314
|
// src/index.ts
|
|
7327
7315
|
var Manager = class {
|
|
7328
7316
|
constructor(metadata) {
|
|
7317
|
+
this.sigCatch();
|
|
7329
7318
|
this.start(metadata);
|
|
7330
7319
|
}
|
|
7331
7320
|
/**
|
|
@@ -7525,6 +7514,25 @@ var Manager = class {
|
|
|
7525
7514
|
}
|
|
7526
7515
|
});
|
|
7527
7516
|
}
|
|
7517
|
+
/**
|
|
7518
|
+
* @function sigCatch
|
|
7519
|
+
* @description
|
|
7520
|
+
* Sets up a global handler for uncaught exceptions, ignoring specific error codes
|
|
7521
|
+
*
|
|
7522
|
+
* @async
|
|
7523
|
+
* @returns void
|
|
7524
|
+
*/
|
|
7525
|
+
sigCatch() {
|
|
7526
|
+
process.on("uncaughtException", (err) => {
|
|
7527
|
+
var _a;
|
|
7528
|
+
const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "STARTTLS_FAILURE"];
|
|
7529
|
+
if (ignored.includes(err == null ? void 0 : err.code)) {
|
|
7530
|
+
utils_default.warn(`XMPP Critical Error: ${(_a = err == null ? void 0 : err.code) != null ? _a : "Unknown error code"}. This may indicate a connection issue. Attempting to continue...`);
|
|
7531
|
+
return;
|
|
7532
|
+
}
|
|
7533
|
+
utils_default.warn(`Uncaught Exception: ${err instanceof Error ? err.stack || err.message : String(err)}`);
|
|
7534
|
+
});
|
|
7535
|
+
}
|
|
7528
7536
|
};
|
|
7529
7537
|
var index_default = Manager;
|
|
7530
7538
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atmosx/event-product-parser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.013",
|
|
4
4
|
"description": "NOAA Weather Wire & NWS API Parser - Built for standalone and Project AtmosphericX Integration.",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
package/src/@parsers/events.ts
CHANGED
|
@@ -142,7 +142,7 @@ export class EventParser {
|
|
|
142
142
|
if (!conditionMet) continue;
|
|
143
143
|
}
|
|
144
144
|
if (!conditionMet && condition.condition) {
|
|
145
|
-
const tagToCheck = baseEvent.includes('Tornado') ? tornadoThreatTag : damageThreatTag;
|
|
145
|
+
const tagToCheck = baseEvent.includes('Tornado') || baseEvent.includes('Special Marine Warning') ? tornadoThreatTag : damageThreatTag;
|
|
146
146
|
conditionMet = condition.condition(tagToCheck);
|
|
147
147
|
}
|
|
148
148
|
if (conditionMet) {
|
package/src/@parsers/text.ts
CHANGED
|
@@ -30,7 +30,7 @@ export class TextParser {
|
|
|
30
30
|
* @param {string[]} [removal=[]]
|
|
31
31
|
* @returns {string | null}
|
|
32
32
|
*/
|
|
33
|
-
public static textProductToString(message: string,value: string,removal: string[] = []): string | null {
|
|
33
|
+
public static textProductToString(message: string, value: string, removal: string[] = []): string | null {
|
|
34
34
|
const lines = message.split('\n');
|
|
35
35
|
for (const line of lines) {
|
|
36
36
|
if (line.includes(value)) {
|
package/src/bootstrap.ts
CHANGED
|
@@ -135,7 +135,7 @@ export const definitions = {
|
|
|
135
135
|
"Radar Indicated Tornado Warning": {condition: (tornadoThreatTag: string) => tornadoThreatTag !== 'OBSERVED'},
|
|
136
136
|
}},
|
|
137
137
|
{"Special Marine Warning": {
|
|
138
|
-
"Tornadic Special Marine Warning": {condition: (tornadoThreatTag: string) => tornadoThreatTag
|
|
138
|
+
"Tornadic Special Marine Warning": {condition: (tornadoThreatTag: string) => tornadoThreatTag === 'POSSIBLE'},
|
|
139
139
|
}},
|
|
140
140
|
{"Tornado Watch": {
|
|
141
141
|
"PDS Tornado Watch": { description: "particularly dangerous situation"}
|
|
@@ -179,12 +179,4 @@ export const definitions = {
|
|
|
179
179
|
dump_cache: `Found {count} cached events and will begin dumping them shortly. This may take a while depending on the number of cached events.`,
|
|
180
180
|
dump_cache_complete: `Completed dumping all cached alert files.`,
|
|
181
181
|
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
process.on('uncaughtException', (err: any) => {
|
|
186
|
-
if (err?.code === 'ETIMEDOUT') { return; }
|
|
187
|
-
if (err?.code === 'ECONNRESET') { return; }
|
|
188
|
-
if (err?.code === 'EHOSTUNREACH') { return; }
|
|
189
|
-
throw err;
|
|
190
|
-
})
|
|
182
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -27,7 +27,10 @@ import UGCParser from './@parsers/ugc';
|
|
|
27
27
|
export class Manager {
|
|
28
28
|
isNoaaWeatherWireService: boolean
|
|
29
29
|
job: any
|
|
30
|
-
constructor(metadata: types.ClientSettingsTypes) {
|
|
30
|
+
constructor(metadata: types.ClientSettingsTypes) {
|
|
31
|
+
this.sigCatch();
|
|
32
|
+
this.start(metadata)
|
|
33
|
+
}
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* @function setDisplayName
|
|
@@ -211,6 +214,25 @@ export class Manager {
|
|
|
211
214
|
this.isNoaaWeatherWireService = false;
|
|
212
215
|
}
|
|
213
216
|
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @function sigCatch
|
|
220
|
+
* @description
|
|
221
|
+
* Sets up a global handler for uncaught exceptions, ignoring specific error codes
|
|
222
|
+
*
|
|
223
|
+
* @async
|
|
224
|
+
* @returns void
|
|
225
|
+
*/
|
|
226
|
+
private sigCatch() {
|
|
227
|
+
process.on('uncaughtException', (err: any) => {
|
|
228
|
+
const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'STARTTLS_FAILURE'];
|
|
229
|
+
if (ignored.includes(err?.code)) {
|
|
230
|
+
Utils.warn(`XMPP Critical Error: ${err?.code ?? 'Unknown error code'}. This may indicate a connection issue. Attempting to continue...`);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
Utils.warn(`Uncaught Exception: ${err instanceof Error ? err.stack || err.message : String(err)}`);
|
|
234
|
+
})
|
|
235
|
+
}
|
|
214
236
|
}
|
|
215
237
|
|
|
216
238
|
export default Manager;
|