@atmosx/event-product-parser 3.0.42 → 3.0.46

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 (87) hide show
  1. package/README.md +70 -22
  2. package/SUPPORTED_EVENTS.md +369 -0
  3. package/dist/cjs/index.cjs +1990 -1758
  4. package/dist/esm/index.mjs +1560 -1329
  5. package/dist/index.d.mts +44 -20
  6. package/dist/index.d.ts +44 -20
  7. package/package.json +1 -1
  8. package/src/@building/building.attachments.ts +42 -0
  9. package/src/@building/building.create.ts +2 -2
  10. package/src/@building/building.enhance.ts +8 -4
  11. package/src/@building/building.geometry.ts +1 -1
  12. package/src/@building/building.headers.ts +1 -1
  13. package/src/@building/building.office.ts +4 -4
  14. package/src/@building/building.properties.ts +15 -13
  15. package/src/@building/building.signature.ts +11 -11
  16. package/src/@building/building.tags.ts +2 -2
  17. package/src/@building/building.tracking.ts +6 -6
  18. package/src/@building/building.validate.ts +5 -3
  19. package/src/@core/core.createEvent.ts +82 -0
  20. package/src/@core/core.query.ts +1 -1
  21. package/src/@core/core.start.ts +1 -1
  22. package/src/@dictionaries/{dictionaries.eventActions.ts → dictionaries.actions.ts} +1 -1
  23. package/src/@dictionaries/{dictionaries.eventAwipAbreviations.ts → dictionaries.awips.ts} +1 -1
  24. package/src/@dictionaries/{dictionaries.eventCancelMessages.ts → dictionaries.cancellation.ts} +1 -1
  25. package/src/@dictionaries/{dictionaries.eventCauses.ts → dictionaries.causes.ts} +1 -1
  26. package/src/@dictionaries/{dictionaries.statusCorrelationText.ts → dictionaries.correlations.ts} +1 -1
  27. package/src/@dictionaries/{dictionaries.betterEventNames.ts → dictionaries.enhanced.ts} +13 -2
  28. package/src/@dictionaries/{dictionaries.eventTypes.ts → dictionaries.events.ts} +1 -1
  29. package/src/@dictionaries/{dictionaries.regExp.ts → dictionaries.expressions.ts} +1 -1
  30. package/src/@dictionaries/{dictionaries.hailStrings.ts → dictionaries.hail.ts} +4 -1
  31. package/src/@dictionaries/{dictionaries.officeICAOs.ts → dictionaries.icao.ts} +1 -1
  32. package/src/@dictionaries/{dictionaries.eventsMatchText.ts → dictionaries.matches.ts} +1 -1
  33. package/src/@dictionaries/{dictionaries.eventProducts.ts → dictionaries.products.ts} +1 -1
  34. package/src/@dictionaries/{dictionaries.eventRecords.ts → dictionaries.records.ts} +1 -1
  35. package/src/@dictionaries/{dictionaries.eventSeverity.ts → dictionaries.severity.ts} +1 -1
  36. package/src/@dictionaries/{dictionaries.shapefileLinks.ts → dictionaries.shapefiles.ts} +1 -1
  37. package/src/@dictionaries/{dictionaries.eventStatus.ts → dictionaries.status.ts} +1 -1
  38. package/src/@dictionaries/{dictionaries.eventTags.ts → dictionaries.tags.ts} +1 -1
  39. package/src/@dictionaries/{dictionaries.testSignatures.ts → dictionaries.test.ts} +3 -2
  40. package/src/@events/events.api.ts +19 -14
  41. package/src/@events/events.text.ts +5 -4
  42. package/src/@events/events.ugc.ts +5 -4
  43. package/src/@events/events.vtec.ts +5 -4
  44. package/src/@manager/manager.mkEvent.ts +4 -4
  45. package/src/@manager/manager.rmEvent.ts +3 -2
  46. package/src/@manager/manager.setHash.ts +1 -1
  47. package/src/@manager/manager.updateListener.ts +124 -0
  48. package/src/@modules/@database/database.cache.ts +1 -1
  49. package/src/@modules/@database/database.init.ts +1 -1
  50. package/src/@modules/@database/database.shapefiles.ts +3 -3
  51. package/src/@modules/@database/database.stanza.ts +2 -2
  52. package/src/@modules/@eas/eas.getCleanDescription.ts +91 -0
  53. package/src/@modules/@eas/eas.getTTS.ts +54 -0
  54. package/src/@modules/@eas/eas.setEasTone.ts +40 -30
  55. package/src/@modules/@stanza/stanza.getAwipsType.ts +3 -3
  56. package/src/@modules/@stanza/stanza.validate.ts +5 -5
  57. package/src/@modules/@utilities/utilities.getLatestIssuance.ts +32 -0
  58. package/src/@modules/@utilities/utilities.getSettings.ts +1 -1
  59. package/src/@modules/@utilities/utilities.setCronSchedule.ts +30 -2
  60. package/src/@modules/@utilities/utilities.setSettings.ts +1 -1
  61. package/src/@modules/@utilities/utilities.setWarning.ts +1 -1
  62. package/src/@modules/@xmpp/xmpp.xDeploy.ts +1 -1
  63. package/src/@modules/@xmpp/xmpp.xReconnect.ts +1 -1
  64. package/src/@modules/@xmpp/xmpp.xStanza.ts +1 -1
  65. package/src/@parsers/@hvtec/hvtec.extract.ts +9 -9
  66. package/src/@parsers/@pvtec/pvtec.extract.ts +13 -13
  67. package/src/@parsers/@text/text.getDescriptionFromProduct.ts +2 -2
  68. package/src/@parsers/@text/text.getEmbed.ts +60 -0
  69. package/src/@parsers/@ugc/ugc.extract.ts +1 -1
  70. package/src/@parsers/@ugc/ugc.header.ts +3 -3
  71. package/src/@types/{types.compiled.ts → type.compiled.ts} +1 -1
  72. package/src/@types/type.event.ts +6 -4
  73. package/src/@types/{types.webhook.ts → type.listener.ts} +11 -6
  74. package/src/@types/type.properties.ts +10 -8
  75. package/src/@types/{types.settings.ts → type.settings.ts} +7 -5
  76. package/src/bootstrap.ts +7 -5
  77. package/src/index.ts +3 -2
  78. package/test.js +19 -19
  79. package/src/@dictionaries/dictionaries.transcribedMessageReplacements.ts +0 -68
  80. package/src/@manager/manager.createWebhook.ts +0 -117
  81. package/src/@manager/manager.updateWebhooks.ts +0 -49
  82. /package/src/@types/{types.attributes.ts → type.attributes.ts} +0 -0
  83. /package/src/@types/{types.hash.ts → type.hash.ts} +0 -0
  84. /package/src/@types/{types.hvtec.ts → type.hvtec.ts} +0 -0
  85. /package/src/@types/{types.pvtec.ts → type.pvtec.ts} +0 -0
  86. /package/src/@types/{types.stanza.ts → type.stanza.ts} +0 -0
  87. /package/src/@types/{types.ugc.ts → type.ugc.ts} +0 -0
@@ -0,0 +1,82 @@
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 { validateEvents } from "../@building/building.validate";
21
+ import { dict_correlations } from "../@dictionaries/dictionaries.correlations";
22
+
23
+ interface CreateEventOptions {
24
+ event: string
25
+ status: string
26
+ issued: Date
27
+ expires: Date
28
+ locations: string
29
+ description: string
30
+ coordinates: number[][]
31
+ }
32
+
33
+ export const createEvent = (options: CreateEventOptions): void => {
34
+ const tick = performance.now()
35
+ validateEvents([{
36
+ type: `Feature`,
37
+ geometry: {
38
+ type: `Point`,
39
+ coordinates: options.coordinates
40
+ },
41
+ properties: {
42
+ event: options.event,
43
+ parent: options.event,
44
+ status: options.status,
45
+ issued: options.issued.toISOString(),
46
+ expires: options.expires.toISOString(),
47
+ locations: options.locations,
48
+ description: options.description,
49
+ geocode: {
50
+ office: {
51
+ office: `ATMX`,
52
+ name: `AtmosphericX Manual Event`,
53
+ },
54
+ organization: `AtmosphericX`,
55
+ ugc: [],
56
+ polygon: options.coordinates.length > 0 ? Buffer.from(JSON.stringify([options.coordinates[0]])).toString('base64') : null,
57
+ polygon_generated: options.coordinates.length > 0 ? true : false,
58
+ },
59
+ status_metadata: {
60
+ is_issued: options.status == `Issued`,
61
+ is_updated: options.status == `Updated`,
62
+ is_expired: options.status == `Expired`,
63
+ is_test: options.status == `Test`,
64
+ is_statement: options.status == `Statement`
65
+ },
66
+ metadata: {
67
+ ms: performance.now() - tick,
68
+ source: `events.manual`,
69
+ tracking: `ATMX-M-W-01`,
70
+ header: `ZCZC-ATMOSX-ATMX-M-W-01`,
71
+ raw: options.description,
72
+ history: [
73
+ {
74
+ description: options.description,
75
+ issued: options.issued.toISOString(),
76
+ status: options.status ?? null,
77
+ }
78
+ ]
79
+ }
80
+ }
81
+ }])
82
+ }
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- import { TypeStanza } from "../@types/types.stanza";
20
+ import { TypeStanza } from "../@types/type.stanza";
21
21
  import { bootstrap } from "../bootstrap";
22
22
 
23
23
  interface QueryOptions {
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- import { TypeSettings } from "../@types/types.settings";
20
+ import { TypeSettings } from "../@types/type.settings";
21
21
  import { bootstrap } from "../bootstrap";
22
22
  import { setWarning } from "../@modules/@utilities/utilities.setWarning"
23
23
  import { setSettings } from "../@modules/@utilities/utilities.setSettings"
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventActions: Record<string, string> = {
20
+ export const dict_actions: Record<string, string> = {
21
21
  "W": "Warning",
22
22
  "F": "Forecast",
23
23
  "A": "Watch",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventAwipAbreviations: Record<string, string> = {
20
+ export const dict_awips: Record<string, string> = {
21
21
  ABV: `rawinsonde-data-above-100-millibars`,
22
22
  ADA: `alarm-alert-administrative-message`,
23
23
  ADM: `alert-administrative-message`,
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventCancelMessages: string[] = [
20
+ export const dict_cancellation: string[] = [
21
21
  "has been cancelled",
22
22
  "subsided sufficiently for the advisory to be cancelled",
23
23
  "has been cancelled",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventCauses : Record<string, string> = {
20
+ export const dict_causes: Record<string, string> = {
21
21
  "SM": "Snow Melt",
22
22
  "RS": "Rain/Snow Melt",
23
23
  "ER": "Excessive Rain",
@@ -26,7 +26,7 @@ type TypeCorrelations = {
26
26
  isStatement: boolean
27
27
  }
28
28
 
29
- export const statusCorrelationText: TypeCorrelations[] = [
29
+ export const dict_correlations: TypeCorrelations[] = [
30
30
  {type: "Statement", name: "Statement", isCancel: false, isUpdate: false, isIssued: true, isStatement: true},
31
31
  {type: "Update", name: "Updated", isCancel: false, isUpdate: true, isIssued: false, isStatement: false},
32
32
  {type: "Cancel", name: "Cancelled", isCancel: true, isUpdate: false, isIssued: false, isStatement: false},
@@ -22,9 +22,10 @@ type EnhancedEventType = {
22
22
  append?: boolean
23
23
  tornado?: string
24
24
  damage?: string
25
+ pdswatch?: boolean
25
26
  }
26
27
 
27
- export const betterEventNames: Record<string, Record<string, EnhancedEventType>> = {
28
+ export const dict_enhanced: Record<string, Record<string, EnhancedEventType>> = {
28
29
  "Tornado Warning": {
29
30
  "Tornado Emergency": {
30
31
  description: "tornado emergency"
@@ -42,6 +43,11 @@ export const betterEventNames: Record<string, Record<string, EnhancedEventType>>
42
43
  },
43
44
  "Radar Indicated Tornado Warning": { },
44
45
  },
46
+ "Fire Weather Warning": {
47
+ "PDS Fire Weather Warning": {
48
+ description: "particularly dangerous situation",
49
+ },
50
+ },
45
51
  "Blizzard Warning": {
46
52
  "PDS Blizzard Warning": {
47
53
  description: "particularly dangerous situation",
@@ -59,7 +65,12 @@ export const betterEventNames: Record<string, Record<string, EnhancedEventType>>
59
65
  },
60
66
  "Tornado Watch": {
61
67
  "PDS Tornado Watch": {
62
- description: "particularly dangerous situation"
68
+ pdswatch: true,
69
+ }
70
+ },
71
+ "Severe Thunderstorm Watch": {
72
+ "PDS Severe Thunderstorm Watch": {
73
+ pdswatch: true
63
74
  }
64
75
  },
65
76
  "Flash Flood Warning": {
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventTypes: Record<string, string> = {
20
+ export const dict_events: Record<string, string> = {
21
21
  "AF": "Ashfall",
22
22
  "AS": "Air Stagnation",
23
23
  "BH": "Beach Hazard",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const regExp: { [key: string]: RegExp } = {
20
+ export const dict_expressions: { [key: string]: RegExp } = {
21
21
  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"),
22
22
  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"),
23
23
  wmo: new RegExp(`[A-Z0-9]{6}\\s[A-Z]{4}\\s\\d{6}`, "imu"),
@@ -17,8 +17,11 @@
17
17
 
18
18
  */
19
19
 
20
- export const hailStrings: Record<string, string> = {
20
+ export const dict_hail: Record<string, string> = {
21
+ ".25": "Pea",
22
+ ".50": "Penny",
21
23
  ".75": "Penny",
24
+ "Up to .75": "Penny",
22
25
  ".88": "Nickel",
23
26
  "0.75": "Penny",
24
27
  "0.88": "Nickel",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const officeICAOs: Record<string, string> = {
20
+ export const dict_icao: Record<string, string> = {
21
21
  "KLUB": "Lubbock, TX",
22
22
  "KLCH": "Lake Charles, LA",
23
23
  "TSTL": "St. Louis, MO",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventsMatchText: Record<string, string> = {
20
+ export const dict_matches: Record<string, string> = {
21
21
  "Special Weather Statement": "Special Weather Statement",
22
22
  "Hurricane Warning": "Hurricane Warning",
23
23
  "Hurricane Force Wind Warning": "Hurricane Force Wind Warning",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventProducts: Record<string, string> = {
20
+ export const dict_products: Record<string, string> = {
21
21
  "O": "Operational Product",
22
22
  "T": "Test Product",
23
23
  "E": "Experimental Product",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventRecords: Record<string, string> = {
20
+ export const dict_records: Record<string, string> = {
21
21
  "NO": "No Record Expected",
22
22
  "NR": "Near Record or possible record",
23
23
  "UU": "Unknown history of records",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventSeverity: Record<string, string> = {
20
+ export const dict_severity: Record<string, string> = {
21
21
  N: "Not Expected",
22
22
  0: "Areal Flood or FF Product",
23
23
  1: "Minor",
@@ -23,7 +23,7 @@ interface ShapefilesResponse {
23
23
  link: string
24
24
  }
25
25
 
26
- export const shapefileLinks: ShapefilesResponse[] = [
26
+ export const dict_shapefiles: ShapefilesResponse[] = [
27
27
  {name: "us_counties", id: "C", link: "https://www.weather.gov/source/gis/Shapefiles/County/c_16ap26.zip"},
28
28
  {name: "us_states_territories", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/County/s_16ap26.zip"},
29
29
  {name: "fire_weather_zones", id: "Z", link: "https://www.weather.gov/source/gis/Shapefiles/WSOM/fz16ap26.zip"},
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventStatus: Record<string, string> = {
20
+ export const dict_status: Record<string, string> = {
21
21
  "NEW": "Issued",
22
22
  "CON": "Updated",
23
23
  "EXT": "Extended",
@@ -17,7 +17,7 @@
17
17
 
18
18
  */
19
19
 
20
- export const eventTags: Record<string, string> = {
20
+ export const dict_tags: Record<string, string> = {
21
21
  "FROSTBITE AND HYPOTHERMIA ARE LIKELY": "Frostbite and Hypothermia Likely",
22
22
  "LICKELY BECOME SLICK AND HAZARDOUS": "Slick and Hazardous Roads",
23
23
  "SLIPPERY ROAD CONDITIONS": "Slippery Roads",
@@ -17,8 +17,9 @@
17
17
 
18
18
  */
19
19
 
20
- export const testSignatures: string[] = [
20
+ export const dict_testing: string[] = [
21
21
  `This is a test message`,
22
22
  `Monitoring message only.`,
23
- `THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY`
23
+ `THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY`,
24
+ "TEST MESSAGE"
24
25
  ]
@@ -17,21 +17,23 @@
17
17
 
18
18
  */
19
19
 
20
- import { TypeStanzaCompiled } from "../@types/types.compiled"
20
+ import { TypeStanzaCompiled } from "../@types/type.compiled"
21
21
  import { TypeEvent } from "../@types/type.event";
22
22
  import { getEventTracking } from "../@building/building.tracking";
23
23
  import { validateEvents } from "../@building/building.validate";
24
- import { getEventOffice } from "../@building/building.office";
24
+ import { pvExtract } from "../@parsers/@pvtec/pvtec.extract"
25
25
  import { getEventTags } from "../@building/building.tags";
26
26
  import { getTextFromProduct } from "../@parsers/@text/text.getTextFromProduct";
27
- import { officeICAOs } from "../@dictionaries/dictionaries.officeICAOs";
27
+ import { dict_icao } from "../@dictionaries/dictionaries.icao";
28
+ import { TypePVTEC } from "../@types/type.pvtec";
29
+
28
30
 
29
31
  export const api = async (stanza: TypeStanzaCompiled): Promise<void> => {
30
32
  let processed: TypeEvent[] = [];
31
33
  const messages = Object.values(JSON.parse(stanza.message).features) as any;
32
34
  for (const feature of messages) {
33
35
  const tick = performance.now();
34
- const pVtec = feature?.properties?.parameters?.VTEC?.[0] ?? null
36
+ const pVtec = pvExtract(feature?.properties?.parameters?.VTEC?.[0]) ?? null as TypePVTEC[]
35
37
  processed.push({
36
38
  type: `Feature`,
37
39
  geometry: {
@@ -49,8 +51,8 @@ export const api = async (stanza: TypeStanzaCompiled): Promise<void> => {
49
51
  attributes: feature?.properties?.attributes ?? {},
50
52
  geocode: {
51
53
  office: {
52
- office: pVtec ? pVtec.split(`.`)[2] : null,
53
- name: officeICAOs[pVtec ? pVtec.split(`.`)[2] : null] ?? null,
54
+ office: pVtec ? pVtec?.[0]?.tracking.split(`.`)[0] : null,
55
+ name: dict_icao[pVtec ? pVtec?.[0]?.tracking.split(`.`)[0] : null] ?? null,
54
56
  },
55
57
  organization: feature?.properties?.parameters?.WMOidentifier?.[0],
56
58
  ugc: feature?.properties?.geocode?.UGC ?? [],
@@ -71,14 +73,16 @@ export const api = async (stanza: TypeStanzaCompiled): Promise<void> => {
71
73
  wind_threat: feature?.properties?.parameters?.windThreat?.[0] ?? null,
72
74
  hail_threat: feature?.properties?.parameters?.hailThreat?.[0] ?? null,
73
75
  },
74
- spc_parameters: {
75
- spc_max_tornado: getTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] }) ?? null,
76
- spc_max_hail: getTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] }) ?? null,
77
- spc_max_wind: getTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK WIND GUST...`] }) ?? null,
78
- spc_watch_issuance: getTextFromProduct({ message: feature?.properties?.description, find: [`Probability of Watch Issuance...`], removal: [`percent`]}) ?? null,
76
+ discussion_parameters: {
77
+ discussion_number: getTextFromProduct({ message: feature?.properties?.description, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })?.toString()?.padStart(4, "0") ?? null,
78
+ discussion_concerning: getTextFromProduct({ message: feature?.properties?.description, find: [`Concerning...`] }) ?? null,
79
+ discussion_max_tornado: getTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] }) ?? null,
80
+ discussion_max_hail: getTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] }) ?? null,
81
+ discussion_max_wind: getTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK WIND GUST...`] }) ?? null,
82
+ discussion_watch_issuance: getTextFromProduct({ message: feature?.properties?.description, find: [`Probability of Watch Issuance...`], removal: [`percent`]}) ?? null,
79
83
  },
80
84
  watch_parameters: {
81
- watch_number: getTextFromProduct({ message: feature?.properties?.description, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })?.replace(/(WT|WS|)/g, '')?.trim() ?? null,
85
+ watch_number: (pVtec?.[0]?.is_watch) && (getTextFromProduct({ message: feature?.properties?.description, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })?.replace(/(WT|WS|)/g, '')?.trim()?.toString()?.padStart(4, "0") ?? pVtec?.[0]?.tracking?.slice(-4)?.toString()?.padStart(4, "0") ?? null),
82
86
  watch_type: feature?.properties?.description.includes(`TORNADO WATCH`) ? `Tornado` : feature?.properties?.description.includes(`SEVERE`) ? `Severe` : null,
83
87
  additional_tornadoes_probability: getTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
84
88
  strong_tornadoes_probability: getTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
@@ -94,10 +98,11 @@ export const api = async (stanza: TypeStanzaCompiled): Promise<void> => {
94
98
  metadata: {
95
99
  ms: performance.now() - tick,
96
100
  source: `events.api`,
97
- tracking: getEventTracking({ type: `API`, organization: { wmoidentifier: feature?.properties?.parameters?.WMOidentifier?.[0], featureId: feature?.id}, vtec: pVtec}),
101
+ tracking: getEventTracking({ type: `API`, organization: { wmoidentifier: feature?.properties?.parameters?.WMOidentifier?.[0], featureId: feature?.id}, vtec: pVtec?.[0]}),
98
102
  header: `ZCZC-ATMOSX-${feature?.properties?.parameters?.WMOidentifier}`,
99
- vtec: pVtec,
103
+ vtec: pVtec?.[0],
100
104
  hvtec: null,
105
+ raw: feature?.properties?.description,
101
106
  history: [
102
107
  {
103
108
  description: feature?.properties?.description,
@@ -17,12 +17,12 @@
17
17
 
18
18
  */
19
19
 
20
- import { TypeAttributes } from "../@types/types.attributes";
21
- import { TypeStanzaCompiled } from "../@types/types.compiled"
20
+ import { TypeAttributes } from "../@types/type.attributes";
21
+ import { TypeStanzaCompiled } from "../@types/type.compiled"
22
22
  import { TypeEvent } from "../@types/type.event";
23
23
  import { properties } from "../@building/building.properties";
24
24
  import { getEventHeader } from "../@building/building.headers";
25
- import { eventsMatchText } from "../@dictionaries/dictionaries.eventsMatchText";
25
+ import { dict_matches } from "../@dictionaries/dictionaries.matches";
26
26
  import { getEventTracking } from "../@building/building.tracking";
27
27
  import { validateEvents } from "../@building/building.validate";
28
28
 
@@ -40,7 +40,7 @@ export const text = async (stanza: TypeStanzaCompiled): Promise<void> => {
40
40
  const header = getEventHeader({properties: props, getType: stanza.getType})
41
41
  const issued = new Date(attributes.issue)
42
42
  const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1000)
43
- let event = Object.keys(eventsMatchText).find(event => message.toLowerCase().includes(event.toLowerCase()));
43
+ let event = Object.keys(dict_matches).find(event => message.toLowerCase().includes(event.toLowerCase()));
44
44
  let isStatement = false;
45
45
  if (!event) {
46
46
  event = stanza.getType.type.split(`-`).map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `)
@@ -66,6 +66,7 @@ export const text = async (stanza: TypeStanzaCompiled): Promise<void> => {
66
66
  header: header,
67
67
  vtec: null,
68
68
  hvtec: null,
69
+ raw: message,
69
70
  history: [
70
71
  {
71
72
  description: props.description,
@@ -17,10 +17,10 @@
17
17
 
18
18
  */
19
19
 
20
- import { TypeAttributes } from "../@types/types.attributes";
21
- import { TypeStanzaCompiled } from "../@types/types.compiled"
20
+ import { TypeAttributes } from "../@types/type.attributes";
21
+ import { TypeStanzaCompiled } from "../@types/type.compiled"
22
22
  import { TypeEvent } from "../@types/type.event";
23
- import { eventsMatchText } from "../@dictionaries/dictionaries.eventsMatchText";
23
+ import { dict_matches } from "../@dictionaries/dictionaries.matches";
24
24
  import { ugcExtract } from "../@parsers/@ugc/ugc.extract";
25
25
  import { properties } from "../@building/building.properties";
26
26
  import { getEventHeader } from "../@building/building.headers";
@@ -43,7 +43,7 @@ export const ugc = async (stanza: TypeStanzaCompiled): Promise<void> => {
43
43
  const issued = new Date(attributes.issue)
44
44
  const expires = new Date(ugc.expires)
45
45
  const header = getEventHeader({properties: props, getType: stanza.getType })
46
- let event = Object.keys(eventsMatchText).find(event => message.toLowerCase().includes(event.toLowerCase()));
46
+ let event = Object.keys(dict_matches).find(event => message.toLowerCase().includes(event.toLowerCase()));
47
47
  let isStatement = false;
48
48
  if (!event) {
49
49
  event = stanza.getType.type.split(`-`).map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `)
@@ -69,6 +69,7 @@ export const ugc = async (stanza: TypeStanzaCompiled): Promise<void> => {
69
69
  header: header,
70
70
  vtec: null,
71
71
  hvtec: null,
72
+ raw: message,
72
73
  history: [
73
74
  {
74
75
  description: props.description,
@@ -17,11 +17,11 @@
17
17
 
18
18
  */
19
19
 
20
- import { TypeAttributes } from "../@types/types.attributes";
21
- import { TypeStanzaCompiled } from "../@types/types.compiled"
20
+ import { TypeAttributes } from "../@types/type.attributes";
21
+ import { TypeStanzaCompiled } from "../@types/type.compiled"
22
22
  import { TypeEvent } from "../@types/type.event";
23
- import { TypePVTEC } from "../@types/types.pvtec";
24
- import { TypeHVTEC } from "../@types/types.hvtec";
23
+ import { TypePVTEC } from "../@types/type.pvtec";
24
+ import { TypeHVTEC } from "../@types/type.hvtec";
25
25
  import { pvExtract } from "../@parsers/@pvtec/pvtec.extract";
26
26
  import { hvExtract } from "../@parsers/@hvtec/hvtec.extract";
27
27
  import { ugcExtract } from "../@parsers/@ugc/ugc.extract";
@@ -70,6 +70,7 @@ export const vtec = async (stanza: TypeStanzaCompiled): Promise<void> => {
70
70
  header: header,
71
71
  vtec: pv,
72
72
  hvtec: hVtec,
73
+ raw: message,
73
74
  history: [
74
75
  {
75
76
  description: props.description,
@@ -21,9 +21,9 @@ import { setEventEmit } from "../@modules/@utilities/utilities.setEventEmit";
21
21
  import { TypeEvent } from "../@types/type.event";
22
22
  import { bootstrap } from "../bootstrap"
23
23
  import { setHash } from "./manager.setHash";
24
- import { updateWebhooks } from "./manager.updateWebhooks";
24
+ import { updateListener } from "./manager.updateListener";
25
25
  import { updateNode } from "./manager.updateNodes";
26
- import { TypeSettings } from "../@types/types.settings";
26
+ import { TypeSettings } from "../@types/type.settings";
27
27
 
28
28
  export const mkEvent = async (event: TypeEvent): Promise<void> => {
29
29
  const settings = bootstrap.settings as TypeSettings;
@@ -79,10 +79,10 @@ export const mkEvent = async (event: TypeEvent): Promise<void> => {
79
79
  },
80
80
  }
81
81
  };
82
- updateWebhooks(bootstrap.cache.events.features[getIndex])
82
+ updateListener(bootstrap.cache.events.features[getIndex])
83
83
  } else {
84
84
  features.push(event)
85
- updateWebhooks(event)
85
+ updateListener(event)
86
86
  }
87
87
  }
88
88
  }
@@ -20,13 +20,14 @@
20
20
  import { setEventEmit } from "../@modules/@utilities/utilities.setEventEmit";
21
21
  import { TypeEvent } from "../@types/type.event";
22
22
  import { bootstrap } from "../bootstrap"
23
- import { updateWebhooks } from "./manager.updateWebhooks";
23
+ import { updateListener } from "./manager.updateListener";
24
24
 
25
25
  export const rmEvent = (event: TypeEvent): void => {
26
26
  const getEvent = bootstrap.cache.events.features.find(f => f?.properties?.metadata?.tracking === event?.properties?.metadata?.tracking);
27
27
  const cachedStatus = event.properties.status;
28
28
  event.properties.expires = new Date().toISOString();
29
29
  event.properties.status = `Expired`;
30
+ event.properties.status_metadata.is_expired = true;
30
31
  if (getEvent) {
31
32
  setEventEmit({
32
33
  event: `onEventStatus`,
@@ -37,7 +38,7 @@ export const rmEvent = (event: TypeEvent): void => {
37
38
  message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
38
39
  })
39
40
  setEventEmit({ event: `onExpiredProduct`, metadata: event })
40
- if (cachedStatus != `Statement`) updateWebhooks(event)
41
+ if (cachedStatus != `Statement`) updateListener(event)
41
42
  bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(getEvent), 1);
42
43
  bootstrap.cache.hashes = bootstrap.cache.hashes.filter(hash => hash.tracking !== event.properties.metadata.tracking);
43
44
  }
@@ -18,7 +18,7 @@
18
18
  */
19
19
 
20
20
  import { TypeEvent } from "../@types/type.event";
21
- import { TypeHash } from "../@types/types.hash"
21
+ import { TypeHash } from "../@types/type.hash"
22
22
  import { bootstrap } from "../bootstrap"
23
23
 
24
24