@atmosx/event-product-parser 2.0.16 → 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.
Files changed (136) hide show
  1. package/README.md +248 -187
  2. package/dist/cjs/index.cjs +12218 -3139
  3. package/dist/esm/index.mjs +12401 -3327
  4. package/dist/index.d.mts +235 -0
  5. package/dist/index.d.ts +235 -0
  6. package/package.json +6 -4
  7. package/src/@building/building.clean.ts +30 -0
  8. package/src/@building/building.create.ts +42 -0
  9. package/src/@building/building.enhance.ts +56 -0
  10. package/src/@building/building.geometry.ts +48 -0
  11. package/src/@building/building.headers.ts +37 -0
  12. package/src/@building/building.office.ts +43 -0
  13. package/src/@building/building.polygon.ts +71 -0
  14. package/src/@building/building.properties.ts +89 -0
  15. package/src/@building/building.signature.ts +61 -0
  16. package/src/@building/building.tags.ts +24 -0
  17. package/src/@building/building.tracking.ts +68 -0
  18. package/src/@building/building.validate.ts +147 -0
  19. package/src/@core/core.getEvents.ts +25 -0
  20. package/src/@core/core.getNodes.ts +25 -0
  21. package/src/@core/core.getRandomEvent.ts +25 -0
  22. package/src/@core/core.getVersion.ts +25 -0
  23. package/src/@core/core.listener.ts +24 -0
  24. package/src/@core/core.setNode.ts +81 -0
  25. package/src/@core/core.start.ts +59 -0
  26. package/src/@core/core.stop.ts +32 -0
  27. package/src/@dictionaries/dictionaries.betterEventNames.ts +89 -0
  28. package/src/@dictionaries/dictionaries.eventActions.ts +28 -0
  29. package/src/@dictionaries/{awips.ts → dictionaries.eventAwipAbreviations.ts} +13 -7
  30. package/src/@dictionaries/dictionaries.eventCancelMessages.ts +30 -0
  31. package/src/@dictionaries/dictionaries.eventCauses.ts +36 -0
  32. package/src/@dictionaries/dictionaries.eventProducts.ts +25 -0
  33. package/src/@dictionaries/dictionaries.eventRecords.ts +25 -0
  34. package/src/@dictionaries/dictionaries.eventSeverity.ts +27 -0
  35. package/src/@dictionaries/dictionaries.eventStatus.ts +31 -0
  36. package/src/@dictionaries/{signatures.ts → dictionaries.eventTags.ts} +13 -68
  37. package/src/@dictionaries/dictionaries.eventTypes.ts +82 -0
  38. package/src/@dictionaries/dictionaries.eventsOffshore.ts +31 -0
  39. package/src/@dictionaries/dictionaries.hailStrings.ts +33 -0
  40. package/src/@dictionaries/{icao.ts → dictionaries.officeICAOs.ts} +13 -6
  41. package/src/@dictionaries/dictionaries.regExp.ts +28 -0
  42. package/src/@dictionaries/dictionaries.shapefileLinks.ts +36 -0
  43. package/src/@dictionaries/dictionaries.statusCorrelationText.ts +40 -0
  44. package/src/@dictionaries/dictionaries.testSignatures.ts +24 -0
  45. package/src/@dictionaries/dictionaries.transcribedMessageReplacements.ts +68 -0
  46. package/src/@events/events.api.ts +113 -0
  47. package/src/@events/events.text.ts +79 -0
  48. package/src/@events/events.ugc.ts +83 -0
  49. package/src/@events/events.vtec.ts +87 -0
  50. package/src/@manager/manager.mkEvent.ts +95 -0
  51. package/src/@manager/manager.rmEvent.ts +46 -0
  52. package/src/@manager/manager.setHash.ts +37 -0
  53. package/src/@manager/manager.updateNodes.ts +55 -0
  54. package/src/@manager/manager.updateWebhooks.ts +50 -0
  55. package/src/@modules/@database/database.cache.ts +48 -0
  56. package/src/@modules/@database/database.init.ts +45 -0
  57. package/src/@modules/@database/database.shapefiles.ts +96 -0
  58. package/src/@modules/@database/database.stanza.ts +48 -0
  59. package/src/@modules/@eas/eas.getFloatPCM16.ts +29 -0
  60. package/src/@modules/@eas/eas.getMergedPCM16.ts +32 -0
  61. package/src/@modules/@eas/eas.getPCM16.ts +52 -0
  62. package/src/@modules/@eas/eas.getPCMToFloat.ts +26 -0
  63. package/src/@modules/@eas/eas.getSampledPCM16.ts +36 -0
  64. package/src/@modules/@eas/eas.getWavPCM16.ts +52 -0
  65. package/src/@modules/@eas/eas.setAFSK.ts +52 -0
  66. package/src/@modules/@eas/eas.setAsciiToBits.ts +32 -0
  67. package/src/@modules/@eas/eas.setAttentionTone.ts +40 -0
  68. package/src/@modules/@eas/eas.setEasTone.ts +137 -0
  69. package/src/@modules/@eas/eas.setNoise.ts +31 -0
  70. package/src/@modules/@eas/eas.setRadioEffect.ts +49 -0
  71. package/src/@modules/@eas/eas.setSameHeader.ts +45 -0
  72. package/src/@modules/@stanza/stanza.getAwipsType.ts +46 -0
  73. package/src/@modules/@stanza/stanza.validate.ts +50 -0
  74. package/src/@modules/@utilities/utilities.createHttp.ts +85 -0
  75. package/src/@modules/@utilities/utilities.createWebhook.ts +100 -0
  76. package/src/@modules/@utilities/utilities.getFormattedTime.ts +43 -0
  77. package/src/@modules/@utilities/utilities.getSettings.ts +25 -0
  78. package/src/@modules/@utilities/utilities.getShapeNearestPoint.ts +114 -0
  79. package/src/@modules/@utilities/utilities.setCronSchedule.ts +65 -0
  80. package/src/@modules/@utilities/utilities.setEventEmit.ts +41 -0
  81. package/src/@modules/@utilities/utilities.setListener.ts +30 -0
  82. package/src/@modules/@utilities/utilities.setSettings.ts +42 -0
  83. package/src/@modules/@utilities/utilities.setSleep.ts +33 -0
  84. package/src/@modules/@utilities/utilities.setTimeoutAction.ts +59 -0
  85. package/src/@modules/@utilities/utilities.setWarning.ts +34 -0
  86. package/src/@modules/@xmpp/xmpp.xDeploy.ts +58 -0
  87. package/src/@modules/@xmpp/xmpp.xError.ts +29 -0
  88. package/src/@modules/@xmpp/xmpp.xOffline.ts +38 -0
  89. package/src/@modules/@xmpp/xmpp.xOnline.ts +45 -0
  90. package/src/@modules/@xmpp/xmpp.xReconnect.ts +64 -0
  91. package/src/@modules/@xmpp/xmpp.xStanza.ts +63 -0
  92. package/src/@parsers/@hvtec/hvtec.extract.ts +40 -0
  93. package/src/@parsers/@pvtec/pvtec.expires.ts +26 -0
  94. package/src/@parsers/@pvtec/pvtec.extract.ts +49 -0
  95. package/src/@parsers/@text/text.getDescriptionFromProduct.ts +53 -0
  96. package/src/@parsers/@text/text.getPolygonFromProduct.ts +32 -0
  97. package/src/@parsers/@text/text.getTextFromProduct.ts +43 -0
  98. package/src/@parsers/@text/text.getXML.ts +61 -0
  99. package/src/@parsers/@ugc/ugc.coordinates.ts +110 -0
  100. package/src/@parsers/@ugc/ugc.expiry.ts +32 -0
  101. package/src/@parsers/@ugc/ugc.extract.ts +37 -0
  102. package/src/@parsers/@ugc/ugc.header.ts +30 -0
  103. package/src/@parsers/@ugc/ugc.locations.ts +29 -0
  104. package/src/@parsers/@ugc/ugc.zones.ts +52 -0
  105. package/src/@types/type.event.ts +67 -0
  106. package/src/@types/type.properties.ts +75 -0
  107. package/src/@types/types.attributes.ts +28 -0
  108. package/src/@types/types.compiled.ts +35 -0
  109. package/src/@types/types.hash.ts +24 -0
  110. package/src/@types/types.hvtec.ts +25 -0
  111. package/src/@types/types.pvtec.ts +30 -0
  112. package/src/@types/types.settings.ts +76 -0
  113. package/src/@types/types.stanza.ts +37 -0
  114. package/src/@types/types.ugc.ts +24 -0
  115. package/src/@types/types.webhook.ts +26 -0
  116. package/src/bootstrap.ts +85 -163
  117. package/src/index.ts +47 -216
  118. package/test.js +78 -51
  119. package/tsup.config.ts +1 -0
  120. package/src/@dictionaries/events.ts +0 -168
  121. package/src/@parsers/@events/api.ts +0 -146
  122. package/src/@parsers/@events/cap.ts +0 -123
  123. package/src/@parsers/@events/text.ts +0 -104
  124. package/src/@parsers/@events/ugc.ts +0 -107
  125. package/src/@parsers/@events/vtec.ts +0 -76
  126. package/src/@parsers/events.ts +0 -392
  127. package/src/@parsers/hvtec.ts +0 -46
  128. package/src/@parsers/pvtec.ts +0 -72
  129. package/src/@parsers/stanza.ts +0 -97
  130. package/src/@parsers/text.ts +0 -165
  131. package/src/@parsers/ugc.ts +0 -247
  132. package/src/@submodules/database.ts +0 -201
  133. package/src/@submodules/eas.ts +0 -490
  134. package/src/@submodules/utils.ts +0 -191
  135. package/src/@submodules/xmpp.ts +0 -142
  136. package/src/types.ts +0 -259
@@ -0,0 +1,25 @@
1
+ /*
2
+ _ _ _ __ __
3
+ /\ | | | | (_) \ \ / /
4
+ / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
+ / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
+ /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
+ | |
9
+ |_|
10
+
11
+ Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
+ Discord: https://atmosphericx-discord.scriptkitty.cafe
13
+ Ko-Fi: https://ko-fi.com/k3yomi
14
+ Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
15
+
16
+ Internal Package: @atmosx/event-product-parser
17
+
18
+ */
19
+
20
+ export type TypeHVTEC = {
21
+ hvtec: string
22
+ severity: string
23
+ cause: string
24
+ record: string
25
+ }
@@ -0,0 +1,30 @@
1
+ /*
2
+ _ _ _ __ __
3
+ /\ | | | | (_) \ \ / /
4
+ / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
+ / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
+ /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
+ | |
9
+ |_|
10
+
11
+ Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
+ Discord: https://atmosphericx-discord.scriptkitty.cafe
13
+ Ko-Fi: https://ko-fi.com/k3yomi
14
+ Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
15
+
16
+ Internal Package: @atmosx/event-product-parser
17
+
18
+ */
19
+
20
+ export type TypePVTEC = {
21
+ vtec: string
22
+ product: string
23
+ tracking: string
24
+ event: string
25
+ status: string
26
+ organization: string
27
+ expires: string
28
+ is_watch: boolean
29
+ prediction_center: boolean
30
+ }
@@ -0,0 +1,76 @@
1
+ /*
2
+ _ _ _ __ __
3
+ /\ | | | | (_) \ \ / /
4
+ / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
+ / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
+ /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
+ | |
9
+ |_|
10
+
11
+ Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
+ Discord: https://atmosphericx-discord.scriptkitty.cafe
13
+ Ko-Fi: https://ko-fi.com/k3yomi
14
+ Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
15
+
16
+ Internal Package: @atmosx/event-product-parser
17
+
18
+ */
19
+
20
+ import { TypeWebhook } from "./types.webhook"
21
+
22
+ export type TypeSettings = {
23
+ Database: string
24
+ EnableWireService: boolean
25
+ EnableJournal: boolean
26
+ NOAAWeatherWireServiceSettings: {
27
+ ReconnectionSettings: {
28
+ Enabled: boolean
29
+ ReconnectionInterval: number
30
+ }
31
+ CredentialSettings: {
32
+ Username: string | void
33
+ Password: string | void
34
+ Nickname: string | void
35
+ }
36
+ CacheSettings: {
37
+ Enabled: boolean
38
+ MaxDatabaseHistory: number
39
+ MaxRetentionHistory: number
40
+ }
41
+ StanzaSettings: {
42
+ DisableUGC: boolean
43
+ DisableVTEC: boolean
44
+ DisableText: boolean
45
+ }
46
+ }
47
+ NationalWeatherServiceSettings: {
48
+ CallbackInterval: number
49
+ EventsEndpoint: string
50
+ }
51
+ GlobalSettings: {
52
+ EventManagement: boolean
53
+ BetterEventNames: boolean
54
+ DisableGeometryParsing: boolean
55
+ UseShapefileCoordinates: boolean
56
+ SPCWatchesOnly: boolean
57
+ ShapefileSkipPoints: number
58
+ NodeTTL: number
59
+ NodeMinDistance: number
60
+ WebhookSettings?: TypeWebhook
61
+ EventFiltering: {
62
+ ListeningEvents: string[]
63
+ ListeningICAO: string[]
64
+ ListeningUGC: string[]
65
+ ListeningStates: string[]
66
+ IgnoredICAO: string[]
67
+ IgnoredEvents: string[]
68
+ NodeLocationFiltering: boolean
69
+ IgnoreTestProducts: boolean
70
+ },
71
+ EASSettings: {
72
+ ArchiveDirectory: string,
73
+ IntroWavFile: string,
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,37 @@
1
+ /*
2
+ _ _ _ __ __
3
+ /\ | | | | (_) \ \ / /
4
+ / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
+ / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
+ /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
+ | |
9
+ |_|
10
+
11
+ Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
+ Discord: https://atmosphericx-discord.scriptkitty.cafe
13
+ Ko-Fi: https://ko-fi.com/k3yomi
14
+ Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
15
+
16
+ Internal Package: @atmosx/event-product-parser
17
+
18
+ */
19
+
20
+ export type TypeStanza = {
21
+ getChild(arg0: string): unknown
22
+ is(arg0: string): unknown
23
+ name: string
24
+ parent: TypeStanza | null
25
+ children: any
26
+ attrs: {
27
+ xmlns: string
28
+ id: string
29
+ issue: string
30
+ ttaaii: string
31
+ cccc: string
32
+ awipsid: string
33
+ from: string
34
+ to: string
35
+ type: string
36
+ }
37
+ }
@@ -0,0 +1,24 @@
1
+ /*
2
+ _ _ _ __ __
3
+ /\ | | | | (_) \ \ / /
4
+ / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
+ / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
+ /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
+ | |
9
+ |_|
10
+
11
+ Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
+ Discord: https://atmosphericx-discord.scriptkitty.cafe
13
+ Ko-Fi: https://ko-fi.com/k3yomi
14
+ Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
15
+
16
+ Internal Package: @atmosx/event-product-parser
17
+
18
+ */
19
+
20
+ export type TypeUGC = {
21
+ zones: string[]
22
+ locations: string[]
23
+ expires: string
24
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ _ _ _ __ __
3
+ /\ | | | | (_) \ \ / /
4
+ / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
+ / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
+ /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
+ | |
9
+ |_|
10
+
11
+ Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
+ Discord: https://atmosphericx-discord.scriptkitty.cafe
13
+ Ko-Fi: https://ko-fi.com/k3yomi
14
+ Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
15
+
16
+ Internal Package: @atmosx/event-product-parser
17
+
18
+ */
19
+
20
+ export type TypeWebhook = {
21
+ webhook: string
22
+ title: string
23
+ message: string
24
+ rate: number
25
+ events: string[]
26
+ }
package/src/bootstrap.ts CHANGED
@@ -1,182 +1,104 @@
1
1
  /*
2
- _ _ __ __
2
+ _ _ _ __ __
3
3
  /\ | | | | (_) \ \ / /
4
4
  / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
5
  / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
6
  / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
7
  /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
- | |
8
+ | |
9
9
  |_|
10
-
11
- Written by: k3yomi@GitHub
12
- */
13
-
14
- import * as fs from 'fs';
15
- import * as path from 'path';
16
- import * as events from 'events';
17
- import * as xmpp from '@xmpp/client';
18
- import * as shapefile from 'shapefile';
19
- import * as xml2js from 'xml2js';
20
- import * as jobs from 'croner';
21
- import * as polygonClipping from 'polygon-clipping';
22
- import sqlite3 from 'better-sqlite3';
23
- import crypto from 'crypto';
24
- import os from 'os';
25
- import say from 'say';
26
- import child from 'child_process';
27
- import jszip from 'jszip';
28
-
29
10
 
30
- import * as dictEvents from './@dictionaries/events';
31
- import * as dictAwips from './@dictionaries/awips';
32
- import * as dictSignatures from './@dictionaries/signatures';
33
- import * as dictICAOs from './@dictionaries/icao';
11
+ Created with by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
+ Discord: https://atmosphericx-discord.scriptkitty.cafe
13
+ Ko-Fi: https://ko-fi.com/k3yomi
14
+ Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
34
15
 
16
+ Internal Package: @atmosx/event-product-parser
35
17
 
18
+ */
36
19
 
37
- export const packages = {
38
- fs, path, events, xmpp,
39
- shapefile, xml2js, sqlite3, jobs,
40
- crypto, os, say, child, polygonClipping, jszip
41
- };
20
+ import path from 'path'
21
+ import { EventEmitter } from 'node:events';
42
22
 
43
- export const cache = {
23
+ export const bootstrap = {
24
+ version: `3.0.1`,
44
25
  isReady: true,
45
- sigHalt: false,
46
- isConnected: false,
47
- attemptingReconnect: false,
48
- totalReconnects: 0,
49
- lastStanza: null,
50
- session: null,
51
- lastConnect: null,
52
- db: null,
53
- lastWarn: null,
54
- totalLocationWarns: 0,
55
- events: new events.EventEmitter(),
56
- isProcessingAudioQueue: false,
57
- audioQueue: [],
58
- };
59
-
60
- export const settings = {
61
- database: path.join(process.cwd(), 'shapefiles.db'),
62
- is_wire: true,
63
- journal: true,
64
- noaa_weather_wire_service_settings: {
65
- reconnection_settings: {
66
- enabled: true,
67
- interval: 60,
68
- },
69
- credentials: {
70
- username: null,
71
- password: null,
72
- nickname: "AtmosphericX Standalone Parser",
73
- },
74
- cache: {
75
- enabled: true,
76
- max_db_history: 5000,
77
- max_db_cache_size: 1000,
78
- },
79
- preferences: {
80
- disable_ugc: false,
81
- disable_vtec: false,
82
- disable_text: false,
83
- cap_only: false,
84
- }
26
+ ratelimits: {},
27
+ session_xmpp: null,
28
+ database: null,
29
+ cron: null,
30
+ listener: new EventEmitter(),
31
+ ansi_colors: {
32
+ RED: `\x1b[31m`, GREEN: `\x1b[32m`, YELLOW: `\x1b[33m`,
33
+ BLUE: `\x1b[34m`, MAGENTA: `\x1b[35m`, CYAN: `\x1b[36m`,
34
+ WHITE: `\x1b[37m`, RESET: `\x1b[0m`
85
35
  },
86
- national_weather_service_settings: {
87
- interval: 15,
88
- endpoint: `https://api.weather.gov/alerts/active`,
36
+ cache: {
37
+ lastStanza: null,
38
+ isConnected: false,
39
+ isReconnecting: false,
40
+ tReconnects: 0,
41
+ sigHault: false,
42
+ events: {type: "FeatureCollection", features: []},
43
+ nodes: {type: "FeatureCollection", features: []},
44
+ hashes: [],
89
45
  },
90
- global_settings: {
91
- parent_events_only: true,
92
- better_event_parsing: true,
93
- ignore_geometry_parsing: false,
94
- shapefile_coordinates: false,
95
- shapefile_skip: 15,
96
- filtering: {
97
- events: [],
98
- filtered_icao: [],
99
- ignored_icao: [],
100
- ignored_events: [`Xx`, `Test Message`],
101
- ugc_filter: [],
102
- state_filter: [],
103
- check_expired: true,
104
- ignore_test_products: true,
46
+ settings: {
47
+ Database: path.join(process.cwd(), 'shapefiles.db'),
48
+ EnableWireService: true,
49
+ EnableJournal: true,
50
+ NOAAWeatherWireServiceSettings: {
51
+ ReconnectionSettings: {
52
+ Enabled: true,
53
+ ReconnectionInterval: 60,
54
+ },
55
+ CredentialSettings: {
56
+ Username: null,
57
+ Password: null,
58
+ Nickname: "@atmosx/event-product-parser/3.0",
59
+ },
60
+ CacheSettings: {
61
+ Enabled: true,
62
+ MaxDatabaseHistory: 5000,
63
+ MaxRetentionHistory: 1000,
64
+ },
65
+ StanzaSettings: {
66
+ DisableUGC: false,
67
+ DisableVTEC: false,
68
+ DisableText: false,
69
+ }
70
+ },
71
+ NationalWeatherServiceSettings: {
72
+ CallbackInterval: 15,
73
+ EventsEndpoint: `https://api.weather.gov/alerts/active`,
105
74
  },
106
- eas_settings: {
107
- directory: null,
108
- intro_wav: null,
75
+ WebhookSettings: [],
76
+ GlobalSettings: {
77
+ EventManagement: true,
78
+ BetterEventNames: true,
79
+ DisableGeometryParsing: false,
80
+ UseShapefileCoordinates: false,
81
+ SPCWatchesOnly: true,
82
+ ShapefileSkipPoints: 15,
83
+ NodeTTL: 60,
84
+ NodeMinDistance: 120,
85
+ EventFiltering: {
86
+ ListeningEvents: [],
87
+ ListeningICAO: [],
88
+ ListeningUGC: [],
89
+ ListeningStates: [],
90
+ IgnoredICAO: [],
91
+ IgnoredEvents: [`Test Message`],
92
+ NodeLocationFiltering: false,
93
+ IgnoreTestProducts: true,
94
+ },
95
+ EASSettings: {
96
+ ArchiveDirectory: null,
97
+ IntroWavFile: null,
98
+ }
109
99
  }
110
- }
111
- };
100
+ },
101
+ }
102
+
112
103
 
113
104
 
114
- export const definitions = {
115
- events: dictEvents.events,
116
- actions: dictEvents.actions,
117
- status: dictEvents.status,
118
- productTypes: dictEvents.types,
119
- correlations: dictEvents.status_correlations,
120
- offshore: dictEvents.offshore,
121
- awips: dictAwips.awips,
122
- causes: dictEvents.causes,
123
- records: dictEvents.records,
124
- severity: dictEvents.severity,
125
- cancelSignatures: dictSignatures.cancel_signatures,
126
- messageSignatures: dictSignatures.message_signatures,
127
- tags: dictSignatures.tags,
128
- ICAO: dictICAOs.icaos,
129
- enhancedEvents: [
130
- {"Tornado Warning": {
131
- "Tornado Emergency": { description: "tornado emergency", condition: (tornadoThreatTag: string) => tornadoThreatTag === 'OBSERVED'},
132
- "PDS Tornado Warning": { description: "particularly dangerous situation", condition: (damageThreatTag: string) => damageThreatTag === 'CONSIDERABLE'},
133
- "Confirmed Tornado Warning": { condition: (tornadoThreatTag: string) => tornadoThreatTag === 'OBSERVED'},
134
- "Radar Indicated Tornado Warning": {condition: (tornadoThreatTag: string) => tornadoThreatTag !== 'OBSERVED'},
135
- }},
136
- {"Special Marine Warning": {
137
- "Tornadic Special Marine Warning": {condition: (tornadoThreatTag: string) => tornadoThreatTag === 'POSSIBLE'},
138
- }},
139
- {"Tornado Watch": {
140
- "PDS Tornado Watch": { description: "particularly dangerous situation"}
141
- }},
142
- {"Flash Flood Warning": {
143
- "Flash Flood Emergency": { description: "flash flood emergency", },
144
- "Considerable Flash Flood Warning": { condition: (damageThreatTag: string) => damageThreatTag === 'CONSIDERABLE' },
145
- }},
146
- {"Severe Thunderstorm Warning": {
147
- "EDS Severe Thunderstorm Warning": {description: "extremely dangerous situation"},
148
- "Destructive Severe Thunderstorm Warning": {condition: (damageThreatTag: string) => damageThreatTag === 'DESTRUCTIVE'},
149
- "Considerable Severe Thunderstorm Warning": {condition: (damageThreatTag: string) => damageThreatTag === 'CONSIDERABLE'},
150
- }},
151
- ],
152
- shapefiles_directory: [
153
- {name: "us_counties", id: "C", link: "https://www.weather.gov/source/gis/Shapefiles/County/c_16ap26.zip"},
154
- {name: "us_states_territories", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/County/s_16ap26.zip"},
155
- {name: "fire_weather_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/fz16ap26.zip"},
156
- {name: "costal_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/mz16ap26.zip"},
157
- {name: "offshore_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/oz16ap26.zip"},
158
- {name: "public_forecast_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/z_16ap26.zip"},
159
- {name: "county_warning_areas", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/w_16ap26.zip"},
160
- {name: "river_forecast_boundaries", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/Misc/rf05mr24.zip"},
161
- {name: "high_seas_marine_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/hz17fe26.zip"}
162
- ],
163
- regular_expressions: {
164
- 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"),
165
- 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"),
166
- wmo: new RegExp(`[A-Z0-9]{6}\\s[A-Z]{4}\\s\\d{6}`, "imu"),
167
- ugc1: new RegExp(`(\\w{2}[CZ](\\d{3}((-|>)\\s?(\\n\\n)?))+)`, "imu"),
168
- ugc2: new RegExp(`(\\d{6}(-|>)\\s?(\\n\\n)?)`, "imu"),
169
- ugc3: new RegExp(`(\\d{6})(?=-|$)`, "imu"),
170
- dateline: new RegExp(`\\d{3,4}\\s*(AM|PM)?\\s*[A-Z]{2,4}\\s+[A-Z]{3,}\\s+[A-Z]{3,}\\s+\\d{1,2}\\s+\\d{4}`, "gim"),
171
- },
172
- messages: {
173
- shapefile_creation: `DO NOT EXIT UNTIL THE SHAPEFILES ARE DONE COMPLETING! IF YOU CLOSE YOUR PROJECT, THE SHAPEFILES WILL NOT BE CREATED AND YOU WILL NEED TO DELETE ${settings.database} AND RESTART TO CREATE THEM AGAIN!`,
174
- shapefile_creation_finished: `Shapefiles have finished completing and you can now use the parser.`,
175
- not_ready: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`,
176
- invalid_nickname: `The nickname you provided is invalid, please provide a valid nickname to continue.`,
177
- eas_no_directory: `You have not set a directory for EAS audio files to be saved to, please set the 'directory' setting in the global settings to enable EAS audio generation.`,
178
- reconnect_too_fast: `The client is attempting to reconnect too fast. This may be due to network instability. Reconnection attempt has been halted for safety.`,
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
- dump_cache_complete: `Completed dumping all cached alert files.`,
181
- }
182
- };