@atmosx/event-product-parser 3.0.0 → 3.0.1
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 +299 -5
- package/dist/cjs/index.cjs +10188 -237
- package/dist/esm/index.mjs +10186 -237
- package/dist/index.d.mts +235 -0
- package/dist/index.d.ts +235 -0
- package/package.json +4 -3
- package/src/@building/building.clean.ts +1 -1
- package/src/@building/building.create.ts +1 -1
- package/src/@building/building.enhance.ts +1 -1
- package/src/@building/building.geometry.ts +7 -1
- package/src/@building/building.headers.ts +1 -1
- package/src/@building/building.office.ts +1 -1
- package/src/@building/building.polygon.ts +1 -1
- package/src/@building/building.properties.ts +1 -1
- package/src/@building/building.signature.ts +9 -26
- package/src/@building/building.tags.ts +1 -1
- package/src/@building/building.tracking.ts +1 -1
- package/src/@building/building.validate.ts +19 -4
- package/src/@core/core.getEvents.ts +1 -1
- package/src/@core/core.getNodes.ts +1 -1
- package/src/@core/{core.callback.ts → core.getRandomEvent.ts} +3 -17
- package/src/@core/core.getVersion.ts +25 -0
- package/src/@core/core.listener.ts +1 -1
- package/src/@core/core.setNode.ts +2 -2
- package/src/@core/core.start.ts +9 -4
- package/src/@core/core.stop.ts +1 -1
- package/src/@dictionaries/dictionaries.betterEventNames.ts +5 -1
- package/src/@dictionaries/dictionaries.eventActions.ts +1 -1
- package/src/@dictionaries/dictionaries.eventAwipAbreviations.ts +2 -2
- package/src/@dictionaries/dictionaries.eventCancelMessages.ts +2 -1
- package/src/@dictionaries/dictionaries.eventCauses.ts +1 -1
- package/src/@dictionaries/dictionaries.eventProducts.ts +1 -1
- package/src/@dictionaries/dictionaries.eventRecords.ts +1 -1
- package/src/@dictionaries/dictionaries.eventSeverity.ts +1 -1
- package/src/@dictionaries/dictionaries.eventStatus.ts +1 -1
- package/src/@dictionaries/dictionaries.eventTags.ts +1 -1
- package/src/@dictionaries/dictionaries.eventTypes.ts +1 -1
- package/src/@dictionaries/dictionaries.eventsOffshore.ts +1 -1
- package/src/@dictionaries/dictionaries.hailStrings.ts +3 -1
- package/src/@dictionaries/dictionaries.officeICAOs.ts +1 -1
- package/src/@dictionaries/dictionaries.regExp.ts +1 -1
- package/src/@dictionaries/dictionaries.shapefileLinks.ts +1 -1
- package/src/@dictionaries/dictionaries.statusCorrelationText.ts +1 -1
- package/src/@dictionaries/{dictionaries.test_signatures.ts → dictionaries.testSignatures.ts} +3 -2
- package/src/@dictionaries/dictionaries.transcribedMessageReplacements.ts +1 -1
- package/src/@events/events.api.ts +1 -1
- package/src/@events/events.text.ts +1 -1
- package/src/@events/events.ugc.ts +1 -1
- package/src/@events/events.vtec.ts +5 -5
- package/src/@manager/manager.mkEvent.ts +54 -38
- package/src/@manager/manager.rmEvent.ts +3 -1
- package/src/@manager/manager.setHash.ts +2 -2
- package/src/@manager/manager.updateNodes.ts +10 -6
- package/src/@manager/manager.updateWebhooks.ts +50 -0
- package/src/@modules/@database/database.cache.ts +1 -1
- package/src/@modules/@database/database.init.ts +1 -1
- package/src/@modules/@database/database.shapefiles.ts +2 -3
- package/src/@modules/@database/database.stanza.ts +2 -1
- package/src/@modules/@eas/eas.getFloatPCM16.ts +29 -0
- package/src/@modules/@eas/eas.getMergedPCM16.ts +32 -0
- package/src/@modules/@eas/eas.getPCM16.ts +52 -0
- package/src/@modules/@eas/eas.getPCMToFloat.ts +26 -0
- package/src/@modules/@eas/eas.getSampledPCM16.ts +36 -0
- package/src/@modules/@eas/eas.getWavPCM16.ts +52 -0
- package/src/@modules/@eas/eas.setAFSK.ts +52 -0
- package/src/@modules/@eas/eas.setAsciiToBits.ts +32 -0
- package/src/@modules/@eas/eas.setAttentionTone.ts +40 -0
- package/src/@modules/@eas/eas.setEasTone.ts +137 -0
- package/src/@modules/@eas/eas.setNoise.ts +31 -0
- package/src/@modules/@eas/eas.setRadioEffect.ts +49 -0
- package/src/@modules/@eas/eas.setSameHeader.ts +45 -0
- package/src/@modules/@stanza/stanza.getAwipsType.ts +1 -1
- package/src/@modules/@stanza/stanza.validate.ts +1 -1
- package/src/@modules/@utilities/utilities.createHttp.ts +17 -7
- package/src/@modules/@utilities/utilities.createWebhook.ts +100 -0
- package/src/@modules/@utilities/utilities.getFormattedTime.ts +1 -1
- package/src/@modules/@utilities/utilities.getSettings.ts +1 -1
- package/src/@modules/@utilities/utilities.getShapeNearestPoint.ts +1 -1
- package/src/@modules/@utilities/utilities.setCronSchedule.ts +31 -4
- package/src/@modules/@utilities/utilities.setEventEmit.ts +1 -1
- package/src/@modules/@utilities/utilities.setListener.ts +3 -3
- package/src/@modules/@utilities/utilities.setSettings.ts +1 -1
- package/src/@modules/@utilities/utilities.setSleep.ts +3 -3
- package/src/@modules/@utilities/utilities.setTimeoutAction.ts +4 -4
- package/src/@modules/@utilities/utilities.setWarning.ts +3 -3
- package/src/@modules/@xmpp/xmpp.xDeploy.ts +2 -2
- package/src/@modules/@xmpp/xmpp.xError.ts +1 -10
- package/src/@modules/@xmpp/xmpp.xOffline.ts +2 -2
- package/src/@modules/@xmpp/xmpp.xOnline.ts +3 -19
- package/src/@modules/@xmpp/xmpp.xReconnect.ts +7 -2
- package/src/@modules/@xmpp/xmpp.xStanza.ts +3 -3
- package/src/@parsers/@hvtec/hvtec.extract.ts +1 -1
- package/src/@parsers/@pvtec/pvtec.expires.ts +1 -1
- package/src/@parsers/@pvtec/pvtec.extract.ts +3 -4
- package/src/@parsers/@text/text.getDescriptionFromProduct.ts +1 -1
- package/src/@parsers/@text/text.getPolygonFromProduct.ts +1 -1
- package/src/@parsers/@text/text.getTextFromProduct.ts +1 -1
- package/src/@parsers/@text/text.getXML.ts +1 -1
- package/src/@parsers/@ugc/ugc.coordinates.ts +1 -1
- package/src/@parsers/@ugc/ugc.expiry.ts +1 -1
- package/src/@parsers/@ugc/ugc.extract.ts +1 -1
- package/src/@parsers/@ugc/ugc.header.ts +1 -1
- package/src/@parsers/@ugc/ugc.locations.ts +1 -1
- package/src/@parsers/@ugc/ugc.zones.ts +1 -1
- package/src/@types/type.event.ts +12 -12
- package/src/@types/type.properties.ts +1 -1
- package/src/@types/types.attributes.ts +1 -1
- package/src/@types/types.compiled.ts +1 -1
- package/src/@types/types.hash.ts +1 -1
- package/src/@types/types.hvtec.ts +1 -1
- package/src/@types/types.pvtec.ts +2 -1
- package/src/@types/types.settings.ts +10 -5
- package/src/@types/types.stanza.ts +1 -1
- package/src/@types/types.ugc.ts +1 -1
- package/src/@types/types.webhook.ts +26 -0
- package/src/bootstrap.ts +7 -4
- package/src/index.ts +11 -12
- package/test.js +29 -18
- package/tsup.config.ts +1 -0
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
| |
|
|
9
9
|
|_|
|
|
10
10
|
|
|
11
|
-
Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx,
|
|
11
|
+
Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
|
|
12
12
|
Discord: https://atmosphericx-discord.scriptkitty.cafe
|
|
13
13
|
Ko-Fi: https://ko-fi.com/k3yomi
|
|
14
14
|
Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
|
|
@@ -26,12 +26,14 @@ import { setWarning } from './@modules/@utilities/utilities.setWarning';
|
|
|
26
26
|
import { listener } from "./@core/core.listener"
|
|
27
27
|
import { startService } from "./@core/core.start"
|
|
28
28
|
import { stopService } from "./@core/core.stop"
|
|
29
|
+
import { setEasTone } from './@modules/@eas/eas.setEasTone';
|
|
29
30
|
import { setNode } from "./@core/core.setNode"
|
|
30
31
|
import { getEvents } from "./@core/core.getEvents"
|
|
31
32
|
import { getNodes } from "./@core/core.getNodes"
|
|
33
|
+
import { getRandomEvent } from './@core/core.getRandomEvent';
|
|
32
34
|
|
|
33
35
|
export class Manager {
|
|
34
|
-
constructor(settings: TypeSettings) { this.trycatch();startService(settings) }
|
|
36
|
+
constructor(settings: TypeSettings) { this.trycatch(); startService(settings) }
|
|
35
37
|
|
|
36
38
|
on(event: string, callback: () => void) {
|
|
37
39
|
listener(event, callback)
|
|
@@ -42,7 +44,7 @@ export class Manager {
|
|
|
42
44
|
const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'STARTTLS_FAILURE'];
|
|
43
45
|
if (ignored.includes(err?.code)) {
|
|
44
46
|
setEventEmit({
|
|
45
|
-
event: `
|
|
47
|
+
event: `onServiceStatus`,
|
|
46
48
|
metadata: {
|
|
47
49
|
message: `XMPP Critical Error: ${err?.code ?? 'Unknown error code'}. This may indicate a connection issue. Attempting to continue...`,
|
|
48
50
|
data: {},
|
|
@@ -58,15 +60,12 @@ export class Manager {
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
export default Manager;
|
|
63
|
+
export type { TypeEvent } from './@types/type.event';
|
|
61
64
|
export {
|
|
62
|
-
setSettings,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
startService,
|
|
67
|
-
setNode,
|
|
68
|
-
getEvents,
|
|
69
|
-
getNodes,
|
|
65
|
+
setSettings, getEventGeometry,
|
|
66
|
+
getCleanedEvent, stopService,
|
|
67
|
+
startService, setNode, getRandomEvent,
|
|
68
|
+
getEvents, getNodes, setEasTone
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
|
package/test.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
const { Manager, setSettings, getSettings, getListener } = require(`../dist/cjs/index.cjs`)
|
|
2
2
|
|
|
3
3
|
const NOAAWeatherWireService = new Manager({
|
|
4
|
-
|
|
5
|
-
EnableWireService:
|
|
6
|
-
EnableJournal:
|
|
4
|
+
Database: `shapefile-manager.db`,
|
|
5
|
+
EnableWireService: false,
|
|
6
|
+
EnableJournal: true,
|
|
7
7
|
NOAAWeatherWireServiceSettings: {
|
|
8
8
|
ReconnectionSettings: {
|
|
9
9
|
Enabled: true,
|
|
10
10
|
ReconnectionInterval: 60,
|
|
11
11
|
},
|
|
12
12
|
CredentialSettings: {
|
|
13
|
-
Username: `
|
|
14
|
-
Password: `
|
|
15
|
-
Nickname: "
|
|
13
|
+
Username: `username`,
|
|
14
|
+
Password: `password`,
|
|
15
|
+
Nickname: "nickname (@atmosx/event-product-parser/3.0)",
|
|
16
16
|
},
|
|
17
17
|
CacheSettings: {
|
|
18
18
|
Enabled: true,
|
|
19
|
-
MaxDatabaseHistory:
|
|
20
|
-
MaxRetentionHistory:
|
|
19
|
+
MaxDatabaseHistory: 5000,
|
|
20
|
+
MaxRetentionHistory: 555,
|
|
21
21
|
},
|
|
22
22
|
StanzaSettings: {
|
|
23
23
|
DisableUGC: false,
|
|
@@ -26,13 +26,32 @@ const NOAAWeatherWireService = new Manager({
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
NationalWeatherServiceSettings: {
|
|
29
|
-
CallbackInterval:
|
|
29
|
+
CallbackInterval: 30,
|
|
30
30
|
EventsEndpoint: `https://api.weather.gov/alerts/active`,
|
|
31
31
|
},
|
|
32
|
+
WebhookSettings: [
|
|
33
|
+
{
|
|
34
|
+
webhook: "https://discord.com/api/webhooks/XXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
35
|
+
title: "AtmosphericX - (Severe Weather Events)",
|
|
36
|
+
message: `<@user_id>`,
|
|
37
|
+
events: [`Severe Thunderstorm Warning`, `Radar Indicated Tornado Warning`],
|
|
38
|
+
rate: 1,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
webhook: "https://discord.com/api/webhooks/XXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
42
|
+
title: "AtmosphericX - (All Events)",
|
|
43
|
+
message: `<@user_id>`,
|
|
44
|
+
events: [],
|
|
45
|
+
rate: 5,
|
|
46
|
+
}
|
|
47
|
+
],
|
|
32
48
|
GlobalSettings: {
|
|
33
49
|
BetterEventNames: true,
|
|
34
50
|
DisableGeometryParsing: false,
|
|
35
51
|
UseShapefileCoordinates: true,
|
|
52
|
+
SPCWatchesOnly: true,
|
|
53
|
+
NodeTTL: 60,
|
|
54
|
+
NodeMinDistance: 120,
|
|
36
55
|
EventFiltering: {
|
|
37
56
|
ListeningEvents: [
|
|
38
57
|
"Tornado Emergency", "PDS Tornado Warning", "Tornado Warning",
|
|
@@ -59,6 +78,7 @@ const NOAAWeatherWireService = new Manager({
|
|
|
59
78
|
IgnoredEvents: [],
|
|
60
79
|
ListeningUGC: [],
|
|
61
80
|
ListeningStates: [],
|
|
81
|
+
NodeLocationFiltering: false,
|
|
62
82
|
IgnoreTestProducts: true,
|
|
63
83
|
},
|
|
64
84
|
EASSettings: {
|
|
@@ -67,12 +87,3 @@ const NOAAWeatherWireService = new Manager({
|
|
|
67
87
|
}
|
|
68
88
|
}
|
|
69
89
|
})
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
NOAAWeatherWireService.on(`log`, (data) => {
|
|
73
|
-
console.log(data)
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
NOAAWeatherWireService.on(`onEventStatus`, (data) => {
|
|
77
|
-
console.log(`[${data.type}]: ${data.event.properties.event} (${data.event.properties.status}) (${data.event.properties.metadata.tracking})`)
|
|
78
|
-
})
|