@atmosx/event-product-parser 3.0.621 → 3.0.622
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 +6 -4
- package/dist/cjs/index.cjs +21157 -6844
- package/dist/esm/index.mjs +21185 -6872
- package/package.json +9 -8
- package/pnpm-workspace.yaml +3 -0
- package/src/@building/CreateEvent.ts +10 -12
- package/src/@building/GetEventAttachments.ts +5 -5
- package/src/@building/GetEventEnhancedName.ts +2 -4
- package/src/@building/GetEventGeometry.ts +4 -4
- package/src/@building/GetEventHeader.ts +2 -2
- package/src/@building/GetEventNodes.ts +8 -8
- package/src/@building/GetEventOffice.ts +3 -3
- package/src/@building/GetEventProperties.ts +16 -11
- package/src/@building/GetEventSignature.ts +6 -6
- package/src/@building/GetEventTags.ts +1 -1
- package/src/@building/GetEventTracking.ts +4 -4
- package/src/@core/ClearEvents.ts +2 -2
- package/src/@core/CreateListener.ts +1 -1
- package/src/@core/GetEvents.ts +1 -1
- package/src/@core/GetNodes.ts +1 -1
- package/src/@core/GetRandomEvent.ts +1 -1
- package/src/@core/GetVersion.ts +1 -1
- package/src/@core/ManualEvent.ts +3 -4
- package/src/@core/QueryStanza.ts +2 -2
- package/src/@core/SetNode.ts +9 -3
- package/src/@core/StartService.ts +11 -11
- package/src/@core/StopService.ts +1 -1
- package/src/@enums/Tags.ts +1 -1
- package/src/@events/ParseAPI.ts +15 -10
- package/src/@events/ParseText.ts +8 -8
- package/src/@events/ParseUGC.ts +9 -9
- package/src/@events/ParseVTEC.ts +12 -12
- package/src/@manager/MakeEvents.ts +20 -17
- package/src/@manager/RemoveEvent.ts +8 -8
- package/src/@manager/SetHash.ts +3 -3
- package/src/@manager/UpdateEvents.ts +4 -4
- package/src/@manager/UpdateNode.ts +4 -4
- package/src/@manager/ValidateEvents.ts +13 -14
- package/src/@modules/@database/GetCachedEvents.ts +6 -7
- package/src/@modules/@database/ImportBroadcastify.ts +3 -3
- package/src/@modules/@database/ImportShapefiles.ts +11 -11
- package/src/@modules/@database/ImportStanza.ts +4 -4
- package/src/@modules/@database/InitializeDatabase.ts +6 -6
- package/src/@modules/@eas/GenerateEASMessage.ts +26 -18
- package/src/@modules/@eas/GetTTS.ts +2 -2
- package/src/@modules/@eas/SetNoise.ts +2 -2
- package/src/@modules/@eas/SetRadioEffect.ts +2 -2
- package/src/@modules/@eas/SetSameHeader.ts +3 -3
- package/src/@modules/@stanza/GetAwipsType.ts +2 -2
- package/src/@modules/@stanza/ValidateStanza.ts +4 -4
- package/src/@modules/@utilities/GetSettings.ts +2 -2
- package/src/@modules/@utilities/QueueManager.ts +71 -0
- package/src/@modules/@utilities/SetCronSchedule.ts +8 -8
- package/src/@modules/@utilities/SetDebug.ts +2 -2
- package/src/@modules/@utilities/SetEventEmit.ts +3 -3
- package/src/@modules/@utilities/SetListener.ts +1 -1
- package/src/@modules/@utilities/SetSettings.ts +2 -2
- package/src/@modules/@utilities/SetTimeoutAction.ts +1 -1
- package/src/@modules/@utilities/SetWarning.ts +2 -2
- package/src/@modules/@xmpp/DeployXMPP.ts +8 -8
- package/src/@modules/@xmpp/ErrorXMPP.ts +1 -1
- package/src/@modules/@xmpp/OfflineXMPP.ts +2 -2
- package/src/@modules/@xmpp/OnlineXMPP.ts +3 -3
- package/src/@modules/@xmpp/ReconnectXMPP.ts +4 -4
- package/src/@modules/@xmpp/StanzaXMPP.ts +6 -6
- package/src/@parsers/@hvtec/HVExtract.ts +5 -5
- package/src/@parsers/@pvtec/VTECExtract.ts +7 -7
- package/src/@parsers/@text/GetDescriptionFromProduct.ts +1 -1
- package/src/@parsers/@text/GetEmbededText.ts +3 -3
- package/src/@parsers/@text/GetStringText.ts +5 -5
- package/src/@parsers/@ugc/GetCache.ts +1 -1
- package/src/@parsers/@ugc/GetLocations.ts +3 -3
- package/src/@parsers/@ugc/GetUGCHeader.ts +1 -1
- package/src/@parsers/@ugc/GetZonePolygon.ts +2 -2
- package/src/@parsers/@ugc/SetCache.ts +1 -1
- package/src/@parsers/@ugc/UGCExtract.ts +5 -5
- package/src/@tasks/CreateTasks.ts +110 -0
- package/src/@tasks/TaskGenerateAudio.ts +35 -0
- package/src/@tasks/TaskGenerateJSON.ts +35 -0
- package/src/@tasks/TaskGenerateText.ts +35 -0
- package/src/@tasks/TaskSendNTFY.ts +93 -0
- package/src/@tasks/TaskSendWebhook.ts +101 -0
- package/src/@types/Event.ts +3 -3
- package/src/@types/Properties.ts +2 -1
- package/src/@types/Settings.ts +1 -1
- package/src/@types/StanzaCompiled.ts +1 -1
- package/src/bootstrap.ts +3 -3
- package/src/index.ts +21 -19
- package/tools/build.js +45 -0
- package/tsconfig.json +20 -1
- package/src/@manager/Tasks.ts +0 -246
- package/tsup.config.ts +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atmosx/event-product-parser",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.622",
|
|
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",
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"start": "cd ./test && node ./index.js",
|
|
14
|
-
"build": "
|
|
15
|
-
"
|
|
16
|
-
"publish
|
|
14
|
+
"build": "node ./tools/build.js && cd ./test && node index.js",
|
|
15
|
+
"watch": "node ./tools/build.js --watch",
|
|
16
|
+
"publish": "node ./tools/build.js && npm publish --access public",
|
|
17
|
+
"publish-beta-branch": "node ./tools/build.js && npm publish --tag v3-beta-branch --access public"
|
|
17
18
|
},
|
|
18
19
|
"keywords": [
|
|
19
20
|
"NWWS",
|
|
@@ -32,17 +33,17 @@
|
|
|
32
33
|
},
|
|
33
34
|
"homepage": "https://github.com/AtmosphericX/event-product-parser#readme",
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@atmosx/event-product-parser": "link:",
|
|
36
36
|
"@xmpp/client": "0.14.0",
|
|
37
37
|
"better-sqlite3": "12.9.0",
|
|
38
38
|
"croner": "10.0.1",
|
|
39
|
+
"esbuild": "^0.28.1",
|
|
40
|
+
"fast-glob": "^3.3.3",
|
|
39
41
|
"jszip": "3.10.1",
|
|
40
42
|
"polygon-clipping": "0.15.7",
|
|
41
43
|
"shapefile": "0.6.6",
|
|
42
44
|
"typescript": "5.9.3"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
|
-
"@types/node": "25.2.0"
|
|
46
|
-
"tsup": "8.5.1"
|
|
47
|
+
"@types/node": "25.2.0"
|
|
47
48
|
}
|
|
48
|
-
}
|
|
49
|
+
}
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeStanzaCompiled } from "
|
|
21
|
-
import { TypeSettings } from "
|
|
22
|
-
import { bootstrap } from "
|
|
23
|
-
import { ParseText } from "
|
|
24
|
-
import { ParseUGC } from "
|
|
25
|
-
import { ParseVTEC } from "
|
|
26
|
-
import { ParseAPI } from "
|
|
27
|
-
import { ValidateEvents } from "
|
|
20
|
+
import { TypeStanzaCompiled } from "types/StanzaCompiled"
|
|
21
|
+
import { TypeSettings } from "types/Settings"
|
|
22
|
+
import { bootstrap } from "@bootstrap"
|
|
23
|
+
import { ParseText } from "@events/ParseText"
|
|
24
|
+
import { ParseUGC } from "@events/ParseUGC"
|
|
25
|
+
import { ParseVTEC } from "@events/ParseVTEC"
|
|
26
|
+
import { ParseAPI } from "@events/ParseAPI"
|
|
27
|
+
import { ValidateEvents } from "@manager/ValidateEvents"
|
|
28
28
|
|
|
29
|
-
export const CreateEvent = async (stanza: TypeStanzaCompiled
|
|
29
|
+
export const CreateEvent = async (stanza: TypeStanzaCompiled): Promise<void | string> => {
|
|
30
30
|
const settings = bootstrap.settings as TypeSettings
|
|
31
31
|
const StanzaSettings = settings.NOAAWeatherWireServiceSettings.StanzaSettings;
|
|
32
32
|
|
|
@@ -49,8 +49,6 @@ export const CreateEvent = async (stanza: TypeStanzaCompiled, ignorePushing?: bo
|
|
|
49
49
|
await ParseText(stanza)
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
await ValidateEvents(bootstrap.cache.processed)
|
|
54
|
-
}
|
|
52
|
+
await ValidateEvents(bootstrap.cache.processed)
|
|
55
53
|
return 'nothing picked';
|
|
56
54
|
}
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeEvent } from "
|
|
21
|
-
import { bootstrap } from "
|
|
22
|
-
import { EnumStates } from "
|
|
23
|
-
import { EnumExpressions } from "
|
|
24
|
-
import { GetLatestIssuance } from "
|
|
20
|
+
import { TypeEvent } from "types/Event"
|
|
21
|
+
import { bootstrap } from "@bootstrap"
|
|
22
|
+
import { EnumStates } from "@enums/States"
|
|
23
|
+
import { EnumExpressions } from "@enums/Expressions"
|
|
24
|
+
import { GetLatestIssuance } from "@utilities/GetLatestIssuance"
|
|
25
25
|
|
|
26
26
|
interface GetEventAttachmentsResponse {
|
|
27
27
|
name: string
|
|
@@ -17,10 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeEvent } from "
|
|
21
|
-
import {
|
|
22
|
-
import { EnumEnhanced } from "../@enums/Enhanced"
|
|
23
|
-
import { bootstrap } from "../bootstrap"
|
|
20
|
+
import { TypeEvent } from "types/Event"
|
|
21
|
+
import { EnumEnhanced } from "@enums/Enhanced"
|
|
24
22
|
|
|
25
23
|
export const GetEventEnhancedName = (event: TypeEvent): string => {
|
|
26
24
|
let name = event?.properties?.event;
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeSettings } from "
|
|
21
|
-
import { TypeEvent } from "
|
|
22
|
-
import { GetSettings } from "
|
|
23
|
-
import { getZonePolygon } from "
|
|
20
|
+
import { TypeSettings } from "types/Settings"
|
|
21
|
+
import { TypeEvent } from "types/Event"
|
|
22
|
+
import { GetSettings } from "@utilities/GetSettings"
|
|
23
|
+
import { getZonePolygon } from "@parsers/ugc/GetZonePolygon"
|
|
24
24
|
|
|
25
25
|
interface GetGeometryResponse {
|
|
26
26
|
type: `Polygon` | `MultiPolygon`
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypePVTEC } from "
|
|
21
|
-
import { TypeEventProperties } from "
|
|
20
|
+
import { TypePVTEC } from "types/VTEC"
|
|
21
|
+
import { TypeEventProperties } from "types/Properties"
|
|
22
22
|
|
|
23
23
|
interface GetHeaderOptions {
|
|
24
24
|
properties: TypeEventProperties
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeEvent } from "
|
|
21
|
-
import { bootstrap } from "
|
|
22
|
-
import { GetEventGeometry } from "
|
|
23
|
-
import { GetShapeNearestPoint } from "
|
|
20
|
+
import { TypeEvent } from "types/Event"
|
|
21
|
+
import { bootstrap } from "@bootstrap"
|
|
22
|
+
import { GetEventGeometry } from "@building/GetEventGeometry"
|
|
23
|
+
import { GetShapeNearestPoint } from "@utilities/GetShapeNearestPoint"
|
|
24
24
|
|
|
25
25
|
interface GetEventNodesResponse {
|
|
26
26
|
nodes: {
|
|
@@ -38,7 +38,7 @@ interface GetEventNodesResponse {
|
|
|
38
38
|
export const GetEventNodes = async (event: TypeEvent): Promise<GetEventNodesResponse> => {
|
|
39
39
|
const nodes = bootstrap.cache.nodes.features;
|
|
40
40
|
if (!nodes || nodes.length === 0) {
|
|
41
|
-
return { nodes: [], filtered:
|
|
41
|
+
return { nodes: [], filtered: false, updated: Date.now() };
|
|
42
42
|
}
|
|
43
43
|
const metadata = { nodes: [], proximity: false, filtered: false };
|
|
44
44
|
const geometry = await GetEventGeometry(event);
|
|
@@ -59,11 +59,11 @@ export const GetEventNodes = async (event: TypeEvent): Promise<GetEventNodesResp
|
|
|
59
59
|
kilometers,
|
|
60
60
|
proximity: false
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
if (miles != null && (bootstrap.settings.GlobalSettings.EventFiltering.NodeLocationFiltering) && (miles < bootstrap.settings.GlobalSettings.NodeMaxDistance)) {
|
|
64
|
-
metadata.proximity = true;
|
|
62
|
+
if (miles != null && (miles < bootstrap.settings.GlobalSettings.NodeMaxDistance)) {
|
|
65
63
|
info.proximity = true;
|
|
64
|
+
metadata.proximity = true;
|
|
66
65
|
}
|
|
66
|
+
metadata.nodes.push(info)
|
|
67
67
|
}
|
|
68
68
|
return {
|
|
69
69
|
nodes: metadata.nodes,
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "
|
|
21
|
-
import { TypePVTEC } from "
|
|
22
|
-
import { EnumICAO } from "
|
|
20
|
+
import { TypeAttributes } from "types/Attributes"
|
|
21
|
+
import { TypePVTEC } from "types/VTEC"
|
|
22
|
+
import { EnumICAO } from "@enums/ICAO"
|
|
23
23
|
|
|
24
24
|
interface GetOfficeOptions {
|
|
25
25
|
attributes: TypeAttributes
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeEventProperties } from "
|
|
21
|
-
import { TypeAttributes } from "
|
|
22
|
-
import { TypeUGC } from "
|
|
23
|
-
import { TypePVTEC } from "
|
|
24
|
-
import { TypeHVTEC } from "
|
|
25
|
-
import { EnumExpressions } from "
|
|
26
|
-
import { GetDescriptionFromProduct } from "
|
|
27
|
-
import { getPolygonFromProduct } from "
|
|
28
|
-
import { GetTextFromProduct } from "
|
|
29
|
-
import { GetEventOffice } from "
|
|
30
|
-
import { GetEventTags } from "
|
|
20
|
+
import { TypeEventProperties } from "types/Properties"
|
|
21
|
+
import { TypeAttributes } from "types/Attributes"
|
|
22
|
+
import { TypeUGC } from "types/UGC"
|
|
23
|
+
import { TypePVTEC } from "types/VTEC"
|
|
24
|
+
import { TypeHVTEC } from "types/HVTEC"
|
|
25
|
+
import { EnumExpressions } from "@enums/Expressions"
|
|
26
|
+
import { GetDescriptionFromProduct } from "@parsers/text/GetDescriptionFromProduct"
|
|
27
|
+
import { getPolygonFromProduct } from "@parsers/text/GetPolygonFromProduct"
|
|
28
|
+
import { GetTextFromProduct } from "@parsers/text/GetTextFromProduct"
|
|
29
|
+
import { GetEventOffice } from "@building/GetEventOffice"
|
|
30
|
+
import { GetEventTags } from "@building/GetEventTags"
|
|
31
31
|
|
|
32
32
|
interface GetEventPropertiesOptions {
|
|
33
33
|
message: string
|
|
@@ -43,6 +43,11 @@ export const GetEventProperties = (options: GetEventPropertiesOptions): TypeEven
|
|
|
43
43
|
const properties = {
|
|
44
44
|
locations: options?.ugc?.locations?.join(`; `) ?? null,
|
|
45
45
|
locations_array: options?.ugc?.locations ?? [],
|
|
46
|
+
location_states: [...new Set(
|
|
47
|
+
options?.ugc?.locations
|
|
48
|
+
?.map((location: string) => location.match(/,\s*([A-Z]{2})\b/)?.[1])
|
|
49
|
+
.filter(Boolean) ?? []
|
|
50
|
+
)],
|
|
46
51
|
description: GetDescriptionFromProduct({ message: options.message, handle: options?.pVtec?.vtec ?? null }),
|
|
47
52
|
attributes: options.attributes,
|
|
48
53
|
geocode: {
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeEvent } from "
|
|
21
|
-
import { EnumCorrelations } from "
|
|
22
|
-
import { EnumCancellation } from "
|
|
23
|
-
import { EnumTesting} from "
|
|
24
|
-
import { EnumProducts } from "
|
|
25
|
-
import { EnumHail } from "
|
|
20
|
+
import { TypeEvent } from "types/Event"
|
|
21
|
+
import { EnumCorrelations } from "@enums/Correlations"
|
|
22
|
+
import { EnumCancellation } from "@enums/Cancellation"
|
|
23
|
+
import { EnumTesting} from "@enums/Testing"
|
|
24
|
+
import { EnumProducts } from "@enums/Products"
|
|
25
|
+
import { EnumHail } from "@enums/Hail"
|
|
26
26
|
|
|
27
27
|
export const GetEventSignature = (event: TypeEvent): TypeEvent => {
|
|
28
28
|
const properties = event?.properties;
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "
|
|
21
|
-
import { TypeEventProperties } from "
|
|
22
|
-
import { TypeStanzaCompiled } from "
|
|
23
|
-
import { TypePVTEC } from "
|
|
20
|
+
import { TypeAttributes } from "types/Attributes"
|
|
21
|
+
import { TypeEventProperties } from "types/Properties"
|
|
22
|
+
import { TypeStanzaCompiled } from "types/StanzaCompiled"
|
|
23
|
+
import { TypePVTEC } from "types/VTEC"
|
|
24
24
|
|
|
25
25
|
interface GetTrackingOptions {
|
|
26
26
|
type: `RAW` | `VTEC` | `API`
|
package/src/@core/ClearEvents.ts
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { bootstrap } from "
|
|
21
|
-
import { SetEventEmit } from "
|
|
20
|
+
import { bootstrap } from "@bootstrap"
|
|
21
|
+
import { SetEventEmit } from "@utilities/SetEventEmit"
|
|
22
22
|
|
|
23
23
|
export const ClearEvents = (): void => {
|
|
24
24
|
bootstrap.cache.events.features = [];
|
package/src/@core/GetEvents.ts
CHANGED
package/src/@core/GetNodes.ts
CHANGED
package/src/@core/GetVersion.ts
CHANGED
package/src/@core/ManualEvent.ts
CHANGED
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { CreateEvent } from "../@building/CreateEvent";
|
|
20
|
+
import { EnumExpressions } from "@enums/Expressions"
|
|
21
|
+
import { GetAwipsType } from "@stanza/GetAwipsType"
|
|
22
|
+
import { CreateEvent } from "@building/CreateEvent"
|
|
24
23
|
|
|
25
24
|
interface CreateEventOptions {
|
|
26
25
|
message: string
|
package/src/@core/QueryStanza.ts
CHANGED
package/src/@core/SetNode.ts
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { bootstrap } from "
|
|
21
|
-
import { SetWarning } from "
|
|
22
|
-
import { SetEventEmit } from "
|
|
20
|
+
import { bootstrap } from "@bootstrap"
|
|
21
|
+
import { SetWarning } from "@utilities/SetWarning"
|
|
22
|
+
import { SetEventEmit } from "@utilities/SetEventEmit"
|
|
23
23
|
|
|
24
24
|
interface GetNodeOptions {
|
|
25
25
|
identifier: string
|
|
@@ -34,6 +34,7 @@ export const SetNode = (options: GetNodeOptions) => {
|
|
|
34
34
|
if (exists) {
|
|
35
35
|
const index = nodes.indexOf(exists);
|
|
36
36
|
nodes.splice(index, 1);
|
|
37
|
+
SetWarning({ message: `Node with identifier '${options.identifier}' deleted.` })
|
|
37
38
|
return SetEventEmit({
|
|
38
39
|
event: `onNodeDelete`,
|
|
39
40
|
metadata: {
|
|
@@ -46,6 +47,9 @@ export const SetNode = (options: GetNodeOptions) => {
|
|
|
46
47
|
}
|
|
47
48
|
if (exists) {
|
|
48
49
|
const index = nodes.indexOf(exists);
|
|
50
|
+
if (exists.geometry.coordinates[0] === options.coordinates.longitude && exists.geometry.coordinates[1] === options.coordinates.latitude) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
49
53
|
nodes[index] = {
|
|
50
54
|
...exists,
|
|
51
55
|
geometry: {
|
|
@@ -53,6 +57,7 @@ export const SetNode = (options: GetNodeOptions) => {
|
|
|
53
57
|
coordinates: [options.coordinates.longitude, options.coordinates.latitude]
|
|
54
58
|
}
|
|
55
59
|
};
|
|
60
|
+
SetWarning({ message: `Node with identifier '${options.identifier}' updated.` })
|
|
56
61
|
return SetEventEmit({
|
|
57
62
|
event: `onNodeUpdate`,
|
|
58
63
|
metadata: {
|
|
@@ -71,6 +76,7 @@ export const SetNode = (options: GetNodeOptions) => {
|
|
|
71
76
|
identifier: options.identifier
|
|
72
77
|
}
|
|
73
78
|
});
|
|
79
|
+
SetWarning({ message: `Node with identifier '${options.identifier}' added.` })
|
|
74
80
|
return SetEventEmit({
|
|
75
81
|
event: `onNodeAdd`,
|
|
76
82
|
metadata: {
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeSettings } from "
|
|
21
|
-
import { bootstrap } from "
|
|
22
|
-
import { SetWarning } from "
|
|
23
|
-
import { SetSettings } from "
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { UpdateNode } from "
|
|
29
|
-
import { UpdateEvents } from "
|
|
30
|
-
import { Cron } from "croner"
|
|
20
|
+
import { TypeSettings } from "types/Settings"
|
|
21
|
+
import { bootstrap } from "@bootstrap"
|
|
22
|
+
import { SetWarning } from "@utilities/SetWarning"
|
|
23
|
+
import { SetSettings } from "@utilities/SetSettings"
|
|
24
|
+
import { SetCronSchedule } from "@utilities/SetCronSchedule"
|
|
25
|
+
import { DeployXMPP } from "@xmpp/DeployXMPP"
|
|
26
|
+
import { InitializeDatabase } from "@database/InitializeDatabase"
|
|
27
|
+
import { GetCachedEvents } from "@database/GetCachedEvents"
|
|
28
|
+
import { UpdateNode } from "@manager/UpdateNode"
|
|
29
|
+
import { UpdateEvents } from "@manager/UpdateEvents"
|
|
30
|
+
import { Cron } from "croner"
|
|
31
31
|
|
|
32
32
|
export const StartService = async (configurations: TypeSettings): Promise<void> => {
|
|
33
33
|
if (!bootstrap.isReady) {
|
package/src/@core/StopService.ts
CHANGED
package/src/@enums/Tags.ts
CHANGED
|
@@ -148,7 +148,7 @@ export const EnumTags = {
|
|
|
148
148
|
{ match: /Source\.\.\.Doppler Radar/i, tag: "Confirmed By Radar" },
|
|
149
149
|
{ match: /Source\.\.\.Automated Gauges/i, tag: "Confirmed By Automated Gauges" },
|
|
150
150
|
{ match: /Source\.\.\.Radar Confirmed/i, tag: "Confirmed By Radar" },
|
|
151
|
-
{ match: /Source\.\.\.Radar Indicated/i, tag: "Indicated
|
|
151
|
+
{ match: /Source\.\.\.Radar Indicated/i, tag: "Radar Indicated" },
|
|
152
152
|
{ match: /Source\.\.\.Public/i, tag: "Confirmed By Public" },
|
|
153
153
|
{ match: /Source\.\.\.Amateur Radio/i, tag: "Confirmed By Amateur Radio" },
|
|
154
154
|
{ match: /Source\.\.\.Emergency Management/i, tag: "Confirmed By Emergency Management" },
|
package/src/@events/ParseAPI.ts
CHANGED
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeStanzaCompiled } from "
|
|
21
|
-
import { TypePVTEC } from "
|
|
22
|
-
import { EnumICAO } from "
|
|
23
|
-
import { bootstrap } from "
|
|
24
|
-
import { GetEventTracking } from "
|
|
25
|
-
import { VTECExtract } from "
|
|
26
|
-
import { GetEventTags } from "
|
|
27
|
-
import { GetTextFromProduct } from "
|
|
28
|
-
import { SetDebug } from "
|
|
20
|
+
import { TypeStanzaCompiled } from "types/StanzaCompiled"
|
|
21
|
+
import { TypePVTEC } from "types/VTEC"
|
|
22
|
+
import { EnumICAO } from "@enums/ICAO"
|
|
23
|
+
import { bootstrap } from "@bootstrap"
|
|
24
|
+
import { GetEventTracking } from "@building/GetEventTracking"
|
|
25
|
+
import { VTECExtract } from "@parsers/pvtec/VTECExtract"
|
|
26
|
+
import { GetEventTags } from "@building/GetEventTags"
|
|
27
|
+
import { GetTextFromProduct } from "@parsers/text/GetTextFromProduct"
|
|
28
|
+
import { SetDebug } from "@utilities/SetDebug"
|
|
29
29
|
|
|
30
30
|
export const ParseAPI = async (stanza: TypeStanzaCompiled): Promise<void> => {
|
|
31
31
|
const messages = Object.values(JSON.parse(stanza.message).features) as any;
|
|
@@ -45,7 +45,12 @@ export const ParseAPI = async (stanza: TypeStanzaCompiled): Promise<void> => {
|
|
|
45
45
|
issued: feature?.properties?.sent ? new Date(feature?.properties?.sent).toISOString() : null,
|
|
46
46
|
expires: feature?.properties?.expires ? new Date(feature?.properties?.expires).toISOString() : null,
|
|
47
47
|
locations: feature?.properties?.areaDesc ?? null,
|
|
48
|
-
locations_array: feature?.properties?.areaDesc ? feature?.properties?.areaDesc.split(';') : [],
|
|
48
|
+
locations_array: feature?.properties?.areaDesc ? feature?.properties?.areaDesc.split('; ') : [],
|
|
49
|
+
location_states: [...new Set(
|
|
50
|
+
feature?.properties?.areaDesc?.split(';')
|
|
51
|
+
?.map((location: string) => location.match(/,\s*([A-Z]{2})\b/)?.[1])
|
|
52
|
+
.filter(Boolean) ?? []
|
|
53
|
+
)],
|
|
49
54
|
description: feature?.properties?.description ?? null,
|
|
50
55
|
attributes: feature?.properties?.attributes ?? {},
|
|
51
56
|
geocode: {
|
package/src/@events/ParseText.ts
CHANGED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "
|
|
21
|
-
import { TypeStanzaCompiled } from "
|
|
22
|
-
import { EnumMatches } from "
|
|
23
|
-
import { bootstrap } from "
|
|
24
|
-
import { GetEventProperties } from "
|
|
25
|
-
import { GetEventHeader } from "
|
|
26
|
-
import { GetEventTracking } from "
|
|
27
|
-
import { SetDebug } from "
|
|
20
|
+
import { TypeAttributes } from "types/Attributes"
|
|
21
|
+
import { TypeStanzaCompiled } from "types/StanzaCompiled"
|
|
22
|
+
import { EnumMatches } from "@enums/Matches"
|
|
23
|
+
import { bootstrap } from "@bootstrap"
|
|
24
|
+
import { GetEventProperties } from "@building/GetEventProperties"
|
|
25
|
+
import { GetEventHeader } from "@building/GetEventHeader"
|
|
26
|
+
import { GetEventTracking } from "@building/GetEventTracking"
|
|
27
|
+
import { SetDebug } from "@utilities/SetDebug"
|
|
28
28
|
|
|
29
29
|
export const ParseText = async (stanza: TypeStanzaCompiled): Promise<void> => {
|
|
30
30
|
const getMessages = stanza?.message
|
package/src/@events/ParseUGC.ts
CHANGED
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "
|
|
21
|
-
import { TypeStanzaCompiled } from "
|
|
22
|
-
import { EnumMatches } from "
|
|
23
|
-
import { bootstrap } from "
|
|
24
|
-
import { ugcExtract } from "
|
|
25
|
-
import { GetEventProperties } from "
|
|
26
|
-
import { GetEventHeader } from "
|
|
27
|
-
import { GetEventTracking } from "
|
|
28
|
-
import { SetDebug } from "
|
|
20
|
+
import { TypeAttributes } from "types/Attributes"
|
|
21
|
+
import { TypeStanzaCompiled } from "types/StanzaCompiled"
|
|
22
|
+
import { EnumMatches } from "@enums/Matches"
|
|
23
|
+
import { bootstrap } from "@bootstrap"
|
|
24
|
+
import { ugcExtract } from "@parsers/ugc/UGCExtract"
|
|
25
|
+
import { GetEventProperties } from "@building/GetEventProperties"
|
|
26
|
+
import { GetEventHeader } from "@building/GetEventHeader"
|
|
27
|
+
import { GetEventTracking } from "@building/GetEventTracking"
|
|
28
|
+
import { SetDebug } from "@utilities/SetDebug"
|
|
29
29
|
|
|
30
30
|
export const ParseUGC = async (stanza: TypeStanzaCompiled): Promise<void> => {
|
|
31
31
|
const getMessages = stanza?.message
|
package/src/@events/ParseVTEC.ts
CHANGED
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "
|
|
21
|
-
import { TypeStanzaCompiled } from "
|
|
22
|
-
import { TypePVTEC } from "
|
|
23
|
-
import { TypeHVTEC } from "
|
|
24
|
-
import { bootstrap } from "
|
|
25
|
-
import { VTECExtract } from "
|
|
26
|
-
import { HVExtract } from "
|
|
27
|
-
import { ugcExtract } from "
|
|
28
|
-
import { GetEventProperties } from "
|
|
29
|
-
import { GetEventHeader } from "
|
|
30
|
-
import { GetEventTracking } from "
|
|
31
|
-
import { SetDebug } from "
|
|
20
|
+
import { TypeAttributes } from "types/Attributes"
|
|
21
|
+
import { TypeStanzaCompiled } from "types/StanzaCompiled"
|
|
22
|
+
import { TypePVTEC } from "types/VTEC"
|
|
23
|
+
import { TypeHVTEC } from "types/HVTEC"
|
|
24
|
+
import { bootstrap } from "@bootstrap"
|
|
25
|
+
import { VTECExtract } from "@parsers/pvtec/VTECExtract"
|
|
26
|
+
import { HVExtract } from "@parsers/hvtec/HVExtract"
|
|
27
|
+
import { ugcExtract } from "@parsers/ugc/UGCExtract"
|
|
28
|
+
import { GetEventProperties } from "@building/GetEventProperties"
|
|
29
|
+
import { GetEventHeader } from "@building/GetEventHeader"
|
|
30
|
+
import { GetEventTracking } from "@building/GetEventTracking"
|
|
31
|
+
import { SetDebug } from "@utilities/SetDebug"
|
|
32
32
|
|
|
33
33
|
export const ParseVTEC = async (stanza: TypeStanzaCompiled): Promise<void> => {
|
|
34
34
|
const getMessages = stanza?.message
|