@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,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
+ import { setListener } from "../@modules/@utilities/utilities.setListener";
21
+
22
+ export const listener = (event: string, callback: () => void) => {
23
+ setListener({event, callback})
24
+ }
@@ -0,0 +1,81 @@
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 { bootstrap } from "../bootstrap";
21
+ import { setWarning } from "../@modules/@utilities/utilities.setWarning"
22
+ import { setEventEmit } from "../@modules/@utilities/utilities.setEventEmit";
23
+
24
+ interface GetAddChaserOptions {
25
+ identifier: string
26
+ delete?: boolean
27
+ coordinates: { longitude: number; latitude: number }
28
+ }
29
+
30
+ export const setNode = (options: GetAddChaserOptions) => {
31
+ const nodes = bootstrap.cache.nodes.features;
32
+ const exists = nodes.find((node) => node.properties.identifier === options.identifier);
33
+ if (options.delete) {
34
+ if (exists) {
35
+ const index = nodes.indexOf(exists);
36
+ nodes.splice(index, 1);
37
+ return setEventEmit({
38
+ event: `onNodeDelete`,
39
+ metadata: {
40
+ type: `node-delete`,
41
+ node: exists
42
+ }
43
+ })
44
+ }
45
+ return setWarning({ message: `Node with identifier '${options.identifier}' not found.` })
46
+ }
47
+ if (exists) {
48
+ const index = nodes.indexOf(exists);
49
+ nodes[index] = {
50
+ ...exists,
51
+ geometry: {
52
+ type: "Point",
53
+ coordinates: [options.coordinates.longitude, options.coordinates.latitude]
54
+ }
55
+ };
56
+ return setEventEmit({
57
+ event: `onNodeUpdate`,
58
+ metadata: {
59
+ type: `node-update`,
60
+ node: nodes[index]
61
+ }
62
+ })
63
+ }
64
+ nodes.push({
65
+ type: "Feature",
66
+ geometry: {
67
+ type: "Point",
68
+ coordinates: [options.coordinates.longitude, options.coordinates.latitude]
69
+ },
70
+ properties: {
71
+ identifier: options.identifier
72
+ }
73
+ });
74
+ return setEventEmit({
75
+ event: `onNodeAdd`,
76
+ metadata: {
77
+ type: `node-add`,
78
+ node: nodes[nodes.length - 1]
79
+ }
80
+ })
81
+ }
@@ -0,0 +1,59 @@
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 { TypeSettings } from "../@types/types.settings";
21
+ import { bootstrap } from "../bootstrap";
22
+ import { setWarning } from "../@modules/@utilities/utilities.setWarning"
23
+ import { setSettings } from "../@modules/@utilities/utilities.setSettings"
24
+ import { xDeploy } from "../@modules/@xmpp/xmpp.xDeploy"
25
+ import { initializeDatabase } from "../@modules/@database/database.init";
26
+ import { getCachedEvents } from "../@modules/@database/database.cache";
27
+ import { setCronSchedule } from "../@modules/@utilities/utilities.setCronSchedule";
28
+ import { Cron } from "croner";
29
+ import { updateNode } from "../@manager/manager.updateNodes";
30
+
31
+ export const startService = async (settings: TypeSettings): Promise<void> => {
32
+ if (!bootstrap.isReady) {
33
+ return setWarning({
34
+ message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
35
+ })
36
+ }
37
+ setSettings(settings);
38
+ bootstrap.isReady = true;
39
+ await initializeDatabase();
40
+ if (settings.EnableWireService) {
41
+ (async () => {
42
+ await getCachedEvents();
43
+ await xDeploy()
44
+ })();
45
+ }
46
+ await setCronSchedule()
47
+ let scheduleInterval = !settings.EnableWireService ? settings.NationalWeatherServiceSettings.CallbackInterval : 1;
48
+ if (!settings.EnableWireService && scheduleInterval < 15) {
49
+ setWarning({ message: `Schedule Interval of ${scheduleInterval} seconds is too low, setting to 15 seconds` })
50
+ bootstrap.settings.NationalWeatherServiceSettings.CallbackInterval = 15;
51
+ scheduleInterval = 15;
52
+ }
53
+ bootstrap.cron = new Cron(`*/${scheduleInterval} * * * * *`, async () => {
54
+ await setCronSchedule();
55
+ })
56
+ bootstrap.cron = new Cron(`*/1 * * * * *`, async () => {
57
+ await updateNode();
58
+ })
59
+ }
@@ -0,0 +1,32 @@
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 { bootstrap } from "../bootstrap";
21
+
22
+ export const stopService = async (): Promise<void> => {
23
+ if (bootstrap.isReady) {
24
+ bootstrap.isReady = false;
25
+ if (bootstrap.session_xmpp) {
26
+ try { await bootstrap.session_xmpp.stop(); } catch {}
27
+ bootstrap.cache.isConnected = false;
28
+ bootstrap.cache.sigHault = true;
29
+ bootstrap.session_xmpp = null;
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,89 @@
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
+ type EnhancedEventType = {
21
+ description?: string
22
+ append?: boolean
23
+ tornado?: string
24
+ damage?: string
25
+ }
26
+
27
+ export const betterEventNames: Record<string, Record<string, EnhancedEventType>> = {
28
+ "Tornado Warning": {
29
+ "Tornado Emergency": {
30
+ description: "tornado emergency"
31
+ },
32
+ "PDS Tornado Warning": {
33
+ description: "particularly dangerous situation",
34
+ damage: `CONSIDERABLE`
35
+ },
36
+ "Radar Confirmed Tornado Warning": {
37
+ description: "source...radar confirmed tornado.",
38
+ tornado: `OBSERVED`
39
+ },
40
+ "Confirmed Tornado Warning": {
41
+ tornado: `OBSERVED`
42
+ },
43
+ "Radar Indicated Tornado Warning": { },
44
+ },
45
+ "Special Marine Warning": {
46
+ "Special Marine Warning (TPROB)": {
47
+ tornado: `POSSIBLE`
48
+ },
49
+ },
50
+ "Tornado Watch": {
51
+ "PDS Tornado Watch": {
52
+ description: "particularly dangerous situation"
53
+ }
54
+ },
55
+ "Flash Flood Warning": {
56
+ "Flash Flood Emergency": {
57
+ description: "flash flood emergency"
58
+ },
59
+ "Considerable Flash Flood Warning": {
60
+ damage: `CONSIDERABLE`
61
+ },
62
+ },
63
+ "Severe Thunderstorm Warning": {
64
+ "EDS Severe Thunderstorm Warning (TPROB)": {
65
+ description: "extremely dangerous situation",
66
+ tornado: "POSSIBLE"
67
+ },
68
+ "EDS Severe Thunderstorm Warning": {
69
+ description: "extremely dangerous situation"
70
+ },
71
+ "Destructive Severe Thunderstorm Warning (TPROB)": {
72
+ damage: `DESTRUCTIVE`,
73
+ tornado: `POSSIBLE`
74
+ },
75
+ "Destructive Severe Thunderstorm Warning": {
76
+ damage: `DESTRUCTIVE`
77
+ },
78
+ "Considerable Severe Thunderstorm Warning (TPROB)": {
79
+ damage: `CONSIDERABLE`,
80
+ tornado: `POSSIBLE`
81
+ },
82
+ "Considerable Severe Thunderstorm Warning": {
83
+ damage: `CONSIDERABLE`
84
+ },
85
+ "Severe Thunderstorm Warning (TPROB)": {
86
+ tornado: `POSSIBLE`
87
+ },
88
+ },
89
+ }
@@ -0,0 +1,28 @@
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 const eventActions: Record<string, string> = {
21
+ "W": "Warning",
22
+ "F": "Forecast",
23
+ "A": "Watch",
24
+ "O": "Outlook",
25
+ "Y": "Advisory",
26
+ "N": "Synopsis",
27
+ "S": "Statement"
28
+ }
@@ -1,17 +1,23 @@
1
1
  /*
2
- _ _ __ __
2
+ _ _ _ __ __
3
3
  /\ | | | | (_) \ \ / /
4
4
  / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
- / /\ \| __| "_ ` _ \ / _ \/ __| "_ \| "_ \ / _ \ "__| |/ __| > <
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
6
  / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
7
  /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
- | |
8
+ | |
9
9
  |_|
10
-
11
- Written by: KiyoWx (k3yomi)
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
+
12
18
  */
13
19
 
14
- export const awips: Record<string, string> = {
20
+ export const eventAwipAbreviations: Record<string, string> = {
15
21
  ABV: `rawinsonde-data-above-100-millibars`,
16
22
  ADA: `alarm-alert-administrative-message`,
17
23
  ADM: `alert-administrative-message`,
@@ -312,7 +318,7 @@ export const awips: Record<string, string> = {
312
318
  TOE: `telephone-outage-emergency`,
313
319
  TOR: `tornado-warning`,
314
320
  TPT: `temperature-precipitation-table`,
315
- TSU: `tsunami-watch-warning`,
321
+ TSU: `tsunami-watch`,
316
322
  TUV: `ultraviolet-index`,
317
323
  TVL: `travelers-forecast`,
318
324
  TWB: `transcribed-weather-broadcast`,
@@ -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 const eventCancelMessages: string[] = [
21
+ "has been cancelled",
22
+ "subsided sufficiently for the advisory to be cancelled",
23
+ "has been cancelled",
24
+ "will be allowed to expire",
25
+ "has diminished",
26
+ "and no longer",
27
+ "has been replaced",
28
+ "The threat has ended",
29
+ "has weakened below severe"
30
+ ]
@@ -0,0 +1,36 @@
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 const eventCauses : Record<string, string> = {
21
+ "SM": "Snow Melt",
22
+ "RS": "Rain/Snow Melt",
23
+ "ER": "Excessive Rain",
24
+ "DM": "Dam/Levee Failure",
25
+ "IJ": "Ice Jam",
26
+ "GO": "Glacier Lake Outburst",
27
+ "IC": "Ice",
28
+ "FS": "Flash Flood / Storm Surge",
29
+ "FT": "Tidal Effects",
30
+ "ET": "Elevated Upstream Flow",
31
+ "MC": "Other Multiple Causes",
32
+ "WT": "Wind and/or Tidal Effects",
33
+ "DR": "Reservoir Release",
34
+ "UU": "Unknown",
35
+ "OT": "Other Effects"
36
+ }
@@ -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 const eventProducts: Record<string, string> = {
21
+ "O": "Operational Product",
22
+ "T": "Test Product",
23
+ "E": "Experimental Product",
24
+ "X": "Experimental Product (Non-Operational)",
25
+ }
@@ -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 const eventRecords: Record<string, string> = {
21
+ "NO": "No Record Expected",
22
+ "NR": "Near Record or possible record",
23
+ "UU": "Unknown history of records",
24
+ "OO": "Other",
25
+ }
@@ -0,0 +1,27 @@
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 const eventSeverity: Record<string, string> = {
21
+ N: "Not Expected",
22
+ 0: "Areal Flood or FF Product",
23
+ 1: "Minor",
24
+ 2: "Moderate",
25
+ 3: "Major",
26
+ U: "Unknown",
27
+ }
@@ -0,0 +1,31 @@
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 const eventStatus: Record<string, string> = {
21
+ "NEW": "Issued",
22
+ "CON": "Updated",
23
+ "EXT": "Extended",
24
+ "EXA": "Extended",
25
+ "EXB": "Extended",
26
+ "UPG": "Upgraded",
27
+ "COR": "Correction",
28
+ "ROU": "Routine",
29
+ "CAN": "Cancelled",
30
+ "EXP": "Expired"
31
+ }
@@ -1,17 +1,23 @@
1
1
  /*
2
- _ _ __ __
2
+ _ _ _ __ __
3
3
  /\ | | | | (_) \ \ / /
4
4
  / \ | |_ _ __ ___ ___ ___ _ __ | |__ ___ _ __ _ ___ \ V /
5
- / /\ \| __| "_ ` _ \ / _ \/ __| "_ \| "_ \ / _ \ "__| |/ __| > <
5
+ / /\ \| __| '_ ` _ \ / _ \/ __| '_ \| '_ \ / _ \ '__| |/ __| > <
6
6
  / ____ \ |_| | | | | | (_) \__ \ |_) | | | | __/ | | | (__ / . \
7
7
  /_/ \_\__|_| |_| |_|\___/|___/ .__/|_| |_|\___|_| |_|\___/_/ \_\
8
- | |
8
+ | |
9
9
  |_|
10
-
11
- Written by: KiyoWx (k3yomi)
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
+
12
18
  */
13
19
 
14
- export const tags: Record<string, string> = {
20
+ export const eventTags: Record<string, string> = {
15
21
  "FROSTBITE AND HYPOTHERMIA ARE LIKELY": "Frostbite and Hypothermia Likely",
16
22
  "LICKELY BECOME SLICK AND HAZARDOUS": "Slick and Hazardous Roads",
17
23
  "SLIPPERY ROAD CONDITIONS": "Slippery Roads",
@@ -75,65 +81,4 @@ export const tags: Record<string, string> = {
75
81
  "SHOULD EXERCISE CAUTION": "Should Exercise Caution",
76
82
  "LAKE EFFECT SNOW EXPECTED": "Lake Effect Snow Expected",
77
83
  "MODERATE LAKE EFFECT SNOWFALL RATES AND BLOWING SNOW": "Moderate Lake Effect Snowfall and Blowing Snow",
78
- }
79
-
80
- export const cancel_signatures: string[] = [
81
- "subsided sufficiently for the advisory to be cancelled",
82
- "has been cancelled",
83
- "will be allowed to expire",
84
- "has diminished",
85
- "and no longer",
86
- "has been replaced",
87
- "The threat has ended",
88
- "has weakened below severe"
89
- ]
90
-
91
- export const message_signatures: { regex: RegExp, replacement: string }[] = [
92
- { regex: /\*/g, replacement: "" },
93
- { regex: /\.{3,}/g, replacement: "" },
94
- { regex: /\bUTC\b/g, replacement: 'Coordinated Universal Time' },
95
- { regex: /\bGMT\b/g, replacement: 'Greenwich Mean Time' },
96
- { regex: /\bEST\b(?!\w)/g, replacement: 'Eastern Standard Time' },
97
- { regex: /\bEDT\b(?!\w)/g, replacement: 'Eastern Daylight Time' },
98
- { regex: /\bCST\b(?!\w)/g, replacement: 'Central Standard Time' },
99
- { regex: /\bCDT\b(?!\w)/g, replacement: 'Central Daylight Time' },
100
- { regex: /\bMST\b(?!\w)/g, replacement: 'Mountain Standard Time' },
101
- { regex: /\bMDT\b(?!\w)/g, replacement: 'Mountain Daylight Time' },
102
- { regex: /\bPST\b(?!\w)/g, replacement: 'Pacific Standard Time' },
103
- { regex: /\bPDT\b(?!\w)/g, replacement: 'Pacific Daylight Time' },
104
- { regex: /\bAKST\b(?!\w)/g, replacement: 'Alaska Standard Time' },
105
- { regex: /\bAKDT\b(?!\w)/g, replacement: 'Alaska Daylight Time' },
106
- { regex: /\bHST\b(?!\w)/g, replacement: 'Hawaii Standard Time' },
107
- { regex: /\bHDT\b(?!\w)/g, replacement: 'Hawaii Daylight Time' },
108
- { regex: /\bmph\b(?!\w)/g, replacement: 'miles per hour' },
109
- { regex: /\bkm\/h\b(?!\w)/g, replacement: 'kilometers per hour' },
110
- { regex: /\bkmh\b(?!\w)/g, replacement: 'kilometers per hour' },
111
- { regex: /\bkt\b(?!\w)/g, replacement: 'knots' },
112
- { regex: /\bNE\b(?!\w)/g, replacement: 'northeast' },
113
- { regex: /\bNW\b(?!\w)/g, replacement: 'northwest' },
114
- { regex: /\bSE\b(?!\w)/g, replacement: 'southeast' },
115
- { regex: /\bSW\b(?!\w)/g, replacement: 'southwest' },
116
- { regex: /\bNM\b(?!\w)/g, replacement: 'nautical miles' },
117
- { regex: /\bdeg\b(?!\w)/g, replacement: 'degrees' },
118
- { regex: /\btstm\b(?!\w)/g, replacement: 'thunderstorm' },
119
- { regex: /\bmm\b(?!\w)/g, replacement: 'millimeters' },
120
- { regex: /\bcm\b(?!\w)/g, replacement: 'centimeters' },
121
- { regex: /\bin.\b(?!\w)/g, replacement: 'inches' },
122
- { regex: /\bft\b(?!\w)/g, replacement: 'feet' },
123
- { regex: /\bmi\b(?!\w)/g, replacement: 'miles' },
124
- { regex: /\bhr\b(?!\w)/g, replacement: 'hour' },
125
- { regex: /\bhourly\b(?!\w)/g, replacement: 'per hour' },
126
- { regex: /\bkg\b(?!\w)/g, replacement: 'kilograms' },
127
- { regex: /\bg\/kg\b(?!\w)/g, replacement: 'grams per kilogram' },
128
- { regex: /\bmb\b(?!\w)/g, replacement: 'millibars' },
129
- { regex: /\bhPa\b(?!\w)/g, replacement: 'hectopascals' },
130
- { regex: /\bPa\b(?!\w)/g, replacement: 'pascals' },
131
- { regex: /\bKPa\b(?!\w)/g, replacement: 'kilopascals' },
132
- { regex: /\bC\/hr\b(?!\w)/g, replacement: 'degrees Celsius per hour' },
133
- { regex: /\bF\/hr\b(?!\w)/g, replacement: 'degrees Fahrenheit per hour' },
134
- { regex: /\bC\/min\b(?!\w)/g, replacement: 'degrees Celsius per minute' },
135
- { regex: /\bF\/min\b(?!\w)/g, replacement: 'degrees Fahrenheit per minute' },
136
- { regex: /\bC\b(?!\w)/g, replacement: 'degrees Celsius' },
137
- { regex: /\bF\b(?!\w)/g, replacement: 'degrees Fahrenheit' },
138
- ];
139
-
84
+ }