@atmosx/event-product-parser 3.0.622 → 3.1.0

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 (199) hide show
  1. package/.github/CHANGELOGS.md +52 -0
  2. package/.github/CODE_OF_CONDUCT.md +24 -1
  3. package/.github/CONTRIBUTING.md +22 -3
  4. package/.github/FUNDING.yaml +3 -0
  5. package/.github/LICENSE +24 -1
  6. package/.github/SECURITY.md +25 -6
  7. package/.github/docs/chapters/general-configurations.md +109 -0
  8. package/.github/docs/chapters/sources-and-attributes.md +219 -0
  9. package/README.md +56 -148
  10. package/dist/{cjs/index.cjs → index.cjs} +4486 -1471
  11. package/package.json +13 -8
  12. package/pnpm-workspace.yaml +1 -0
  13. package/src/bootstrap.ts +66 -51
  14. package/src/components/audio/GenerateAudioMessage.ts +149 -0
  15. package/src/{@modules/@eas → components/audio/components}/GetCleanDescription.ts +2 -2
  16. package/src/{@modules/@eas → components/audio/components}/GetFloatPCM16.ts +2 -2
  17. package/src/{@modules/@eas → components/audio/components}/GetMergedPCM16.ts +2 -2
  18. package/src/{@modules/@eas → components/audio/components}/GetPCM16.ts +13 -8
  19. package/src/{@modules/@eas → components/audio/components}/GetPCMToFloat.ts +2 -2
  20. package/src/{@modules/@eas → components/audio/components}/GetSampledPCM16.ts +14 -8
  21. package/src/{@modules/@eas → components/audio/components}/GetTTS.ts +15 -8
  22. package/src/{@modules/@eas → components/audio/components}/GetWavPCM16.ts +7 -7
  23. package/src/{@modules/@eas → components/audio/components}/SetAFSK.ts +13 -8
  24. package/src/{@modules/@eas → components/audio/components}/SetAsciiToBits.ts +2 -2
  25. package/src/{@modules/@eas → components/audio/components}/SetAttentionTone.ts +11 -6
  26. package/src/{@modules/@eas → components/audio/components}/SetNoise.ts +12 -7
  27. package/src/{@modules/@eas → components/audio/components}/SetRadioEffect.ts +12 -7
  28. package/src/{@modules/@eas → components/audio/components}/SetSameHeader.ts +22 -14
  29. package/src/components/database/CreateQuery.ts +39 -0
  30. package/src/components/database/InitializeDatabase.ts +71 -0
  31. package/src/components/database/imports/Boundaires.ts +168 -0
  32. package/src/{@modules/@database/ImportBroadcastify.ts → components/database/imports/Broadcastify.ts} +15 -25
  33. package/src/components/database/imports/Census.ts +87 -0
  34. package/src/{@modules/@database/ImportShapefiles.ts → components/database/imports/Shapefiles.ts} +18 -21
  35. package/src/{@modules/@database/ImportStanza.ts → components/database/imports/Stanza.ts} +15 -19
  36. package/src/components/events/CreateEvents.ts +88 -0
  37. package/src/components/events/FilterEvents.ts +149 -0
  38. package/src/{@building/CreateEvent.ts → components/events/ProcessStanza.ts} +22 -22
  39. package/src/components/events/RemoveEvents.ts +74 -0
  40. package/src/{@building → components/events/components}/GetCleanedEvent.ts +2 -2
  41. package/src/{@building → components/events/components}/GetEventAttachments.ts +14 -12
  42. package/src/components/events/components/GetEventDirection.ts +28 -0
  43. package/src/{@building → components/events/components}/GetEventEnhancedName.ts +5 -6
  44. package/src/{@building → components/events/components}/GetEventGeometry.ts +19 -13
  45. package/src/{@building → components/events/components}/GetEventHeader.ts +13 -13
  46. package/src/components/events/components/GetEventMerged.ts +51 -0
  47. package/src/{@building → components/events/components}/GetEventNodes.ts +20 -18
  48. package/src/{@building → components/events/components}/GetEventOffice.ts +13 -13
  49. package/src/components/events/components/GetEventPopulation.ts +58 -0
  50. package/src/components/events/components/GetEventProperties.ts +106 -0
  51. package/src/{@building → components/events/components}/GetEventSignature.ts +9 -9
  52. package/src/{@building → components/events/components}/GetEventTags.ts +3 -3
  53. package/src/{@core/CreateListener.ts → components/events/components/GetEventTheme.ts} +8 -6
  54. package/src/components/events/components/GetEventTracking.ts +64 -0
  55. package/src/{@modules/@database → components/events/utilities}/GetCachedEvents.ts +18 -14
  56. package/src/{@manager → components/events/utilities}/SetHash.ts +18 -13
  57. package/src/{@manager → components/events/utilities}/UpdateEvents.ts +12 -12
  58. package/src/{@manager → components/events/utilities}/UpdateNode.ts +14 -14
  59. package/src/{@parsers/@text → components/formatting}/GetEmbededText.ts +12 -6
  60. package/src/{@parsers/@text → components/formatting}/GetStringText.ts +13 -9
  61. package/src/{@modules/@utilities → components/geometry}/GetShapeNearestPoint.ts +24 -19
  62. package/src/components/geometry/GetUnionPolygon.ts +36 -0
  63. package/src/components/images/GenerateGraphic.ts +242 -0
  64. package/src/components/images/components/CreateRectangle.ts +22 -0
  65. package/src/components/images/components/CreateText.ts +22 -0
  66. package/src/components/images/modules/CreateSVG.ts +37 -0
  67. package/src/components/images/modules/GetGeographicalBoundaries.ts +72 -0
  68. package/src/components/images/modules/GetGeographicalCities.ts +58 -0
  69. package/src/components/images/modules/GetGeographicalEvents.ts +48 -0
  70. package/src/components/images/modules/GetGeometryBounds.ts +82 -0
  71. package/src/components/images/modules/GetParsedBoundary.ts +58 -0
  72. package/src/components/images/modules/GetSVGPath.ts +53 -0
  73. package/src/components/images/modules/NormalizePolygon.ts +57 -0
  74. package/src/{@modules/@stanza → components/stanza}/GetAwipsType.ts +16 -17
  75. package/src/{@modules/@stanza → components/stanza}/ValidateStanza.ts +27 -15
  76. package/src/{@modules/@utilities → components/utilities}/CreateHttp.ts +26 -26
  77. package/src/components/utilities/EmitThread.ts +97 -0
  78. package/src/{@modules/@utilities → components/utilities}/GetLatestIssuance.ts +2 -2
  79. package/src/{@modules/@utilities → components/utilities}/GetMatched.ts +10 -5
  80. package/src/{@modules/@utilities → components/utilities}/QueueManager.ts +7 -8
  81. package/src/{@modules/@utilities → components/utilities}/SetDebug.ts +13 -13
  82. package/src/components/utilities/SetEventEmit.ts +42 -0
  83. package/src/{@modules/@utilities → components/utilities}/SetSettings.ts +7 -7
  84. package/src/{@modules/@utilities → components/utilities}/SetSleep.ts +5 -5
  85. package/src/components/utilities/SetTimeoutAction.ts +64 -0
  86. package/src/components/utilities/SetWarning.ts +47 -0
  87. package/src/{@modules/@xmpp → components/xmpp}/DeployXMPP.ts +20 -20
  88. package/src/{@modules/@xmpp → components/xmpp}/ErrorXMPP.ts +6 -6
  89. package/src/{@modules/@xmpp → components/xmpp}/OfflineXMPP.ts +13 -13
  90. package/src/{@modules/@xmpp → components/xmpp}/OnlineXMPP.ts +18 -18
  91. package/src/components/xmpp/ReconnectXMPP.ts +64 -0
  92. package/src/{@modules/@xmpp → components/xmpp}/StanzaXMPP.ts +26 -26
  93. package/src/{@enums → enums}/AWIPS.ts +2 -2
  94. package/src/{@enums → enums}/Actions.ts +2 -2
  95. package/src/{@enums → enums}/Cancellation.ts +2 -2
  96. package/src/{@enums → enums}/Causes.ts +2 -2
  97. package/src/{@enums → enums}/Correlations.ts +2 -2
  98. package/src/{@enums → enums}/Enhanced.ts +4 -3
  99. package/src/{@enums → enums}/Events.ts +2 -2
  100. package/src/{@enums → enums}/Expressions.ts +3 -3
  101. package/src/{@enums → enums}/GlobalFilter.ts +2 -2
  102. package/src/{@enums → enums}/Hail.ts +2 -2
  103. package/src/{@enums → enums}/ICAO.ts +2 -2
  104. package/src/{@enums → enums}/Matches.ts +8 -3
  105. package/src/{@enums → enums}/Products.ts +2 -2
  106. package/src/{@enums → enums}/Records.ts +2 -2
  107. package/src/{@enums → enums}/Severity.ts +2 -2
  108. package/src/{@enums → enums}/Shapefiles.ts +2 -2
  109. package/src/{@enums → enums}/States.ts +68 -4
  110. package/src/{@enums → enums}/Status.ts +2 -2
  111. package/src/{@enums → enums}/Strings.ts +2 -2
  112. package/src/{@enums → enums}/Tags.ts +8 -3
  113. package/src/{@enums → enums}/Testing.ts +2 -2
  114. package/src/enums/Themes.ts +70 -0
  115. package/src/events/ParseAPI.ts +133 -0
  116. package/src/{@events → events}/ParseText.ts +24 -22
  117. package/src/{@events → events}/ParseUGC.ts +27 -26
  118. package/src/{@events → events}/ParseVTEC.ts +37 -36
  119. package/src/{@core → exports}/ClearEvents.ts +9 -9
  120. package/src/{@core → exports}/GetEvents.ts +4 -4
  121. package/src/exports/GetNearestCity.ts +45 -0
  122. package/src/{@core → exports}/GetNodes.ts +4 -4
  123. package/src/{@core → exports}/GetRandomEvent.ts +4 -4
  124. package/src/{@core → exports}/GetVersion.ts +4 -4
  125. package/src/{@core → exports}/ManualEvent.ts +24 -24
  126. package/src/{@core → exports}/QueryStanza.ts +12 -11
  127. package/src/exports/SetNode.ts +100 -0
  128. package/src/{@core → exports}/StartService.ts +22 -21
  129. package/src/{@core → exports}/StopService.ts +10 -10
  130. package/src/index.ts +55 -37
  131. package/src/{@parsers/@hvtec → parsers/hvtec}/HVExtract.ts +7 -7
  132. package/src/{@parsers/@text → parsers/text}/GetDescriptionFromProduct.ts +20 -21
  133. package/src/parsers/text/GetPolygonFromProduct.ts +71 -0
  134. package/src/{@parsers/@text → parsers/text}/GetTextFromProduct.ts +12 -12
  135. package/src/parsers/ugc/GetCache.ts +24 -0
  136. package/src/{@parsers/@ugc → parsers/ugc}/GetExpiry.ts +2 -2
  137. package/src/{@parsers/@ugc/GetUGCHeader.ts → parsers/ugc/GetHeader.ts} +4 -4
  138. package/src/{@parsers/@ugc → parsers/ugc}/GetLocations.ts +10 -10
  139. package/src/parsers/ugc/GetZonePolygon.ts +73 -0
  140. package/src/{@parsers/@ugc → parsers/ugc}/GetZones.ts +3 -3
  141. package/src/{@parsers/@ugc → parsers/ugc}/SetCache.ts +13 -8
  142. package/src/{@parsers/@ugc → parsers/ugc}/UGCExtract.ts +14 -14
  143. package/src/{@parsers/@pvtec → parsers/vtec}/GetExpiry.ts +2 -2
  144. package/src/{@parsers/@pvtec → parsers/vtec}/VTECExtract.ts +17 -17
  145. package/src/tasks/CreateTasks.ts +116 -0
  146. package/src/{@tasks → tasks}/TaskGenerateJSON.ts +10 -11
  147. package/src/{@tasks → tasks}/TaskGenerateText.ts +11 -12
  148. package/src/tasks/TaskSendNTFY.ts +96 -0
  149. package/src/tasks/TaskSendWebhook.ts +107 -0
  150. package/src/{@types → types/event}/Attributes.ts +2 -3
  151. package/src/{@types → types/event}/Event.ts +8 -7
  152. package/src/{@types → types/event}/HVTEC.ts +2 -2
  153. package/src/{@types → types/event}/Properties.ts +17 -4
  154. package/src/{@types → types/event}/Stanza.ts +2 -2
  155. package/src/{@types → types/event}/VTEC.ts +8 -8
  156. package/src/{@types → types/standard}/Actions.ts +3 -3
  157. package/src/{@types → types/standard}/Hash.ts +5 -5
  158. package/src/{@modules/@utilities/GetSettings.ts → types/standard/Nodes.ts} +15 -7
  159. package/src/{@types → types/standard}/Settings.ts +19 -12
  160. package/src/{@types → types/standard}/StanzaCompiled.ts +15 -15
  161. package/src/{@types → types/standard}/UGC.ts +5 -5
  162. package/tools/build.js +2 -15
  163. package/tsconfig.json +29 -17
  164. package/.github/SUPPORTED_EVENTS.md +0 -370
  165. package/.github/docs/docs-functions.md +0 -30
  166. package/.github/docs/docs-general-configurations.md +0 -209
  167. package/.github/docs/docs-integrations.md +0 -37
  168. package/.github/docs/docs-listeners.md +0 -28
  169. package/.github/docs/docs-source-configuration.md +0 -218
  170. package/.github/docs/docs-technical.md +0 -50
  171. package/.github/logo.png +0 -0
  172. package/.github/samples/SAMPLE_EAS_GENERATION.wav +0 -0
  173. package/.github/samples/SAMPLE_GEOJSON.json +0 -204
  174. package/.github/samples/SAMPLE_TEXT_PRODUCT.txt +0 -119
  175. package/dist/esm/index.mjs +0 -22298
  176. package/src/@building/GetEventProperties.ts +0 -101
  177. package/src/@building/GetEventTracking.ts +0 -68
  178. package/src/@core/SetNode.ts +0 -87
  179. package/src/@events/ParseAPI.ts +0 -122
  180. package/src/@manager/MakeEvents.ts +0 -109
  181. package/src/@manager/RemoveEvent.ts +0 -70
  182. package/src/@manager/ValidateEvents.ts +0 -141
  183. package/src/@modules/@database/InitializeDatabase.ts +0 -59
  184. package/src/@modules/@eas/GenerateEASMessage.ts +0 -152
  185. package/src/@modules/@utilities/GetFormattedTime.ts +0 -43
  186. package/src/@modules/@utilities/SetCronSchedule.ts +0 -94
  187. package/src/@modules/@utilities/SetEventEmit.ts +0 -41
  188. package/src/@modules/@utilities/SetListener.ts +0 -30
  189. package/src/@modules/@utilities/SetTimeoutAction.ts +0 -64
  190. package/src/@modules/@utilities/SetWarning.ts +0 -34
  191. package/src/@modules/@xmpp/ReconnectXMPP.ts +0 -64
  192. package/src/@parsers/@text/GetPolygonFromProduct.ts +0 -53
  193. package/src/@parsers/@text/GetXML.ts +0 -61
  194. package/src/@parsers/@ugc/GetCache.ts +0 -24
  195. package/src/@parsers/@ugc/GetZonePolygon.ts +0 -111
  196. package/src/@tasks/CreateTasks.ts +0 -110
  197. package/src/@tasks/TaskGenerateAudio.ts +0 -35
  198. package/src/@tasks/TaskSendNTFY.ts +0 -93
  199. package/src/@tasks/TaskSendWebhook.ts +0 -101
@@ -1,101 +0,0 @@
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 { 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
-
32
- interface GetEventPropertiesOptions {
33
- message: string
34
- attributes: TypeAttributes
35
- ugc?: TypeUGC
36
- pVtec?: TypePVTEC
37
- hVtec?: TypeHVTEC
38
- }
39
-
40
- export const GetEventProperties = (options: GetEventPropertiesOptions): TypeEventProperties => {
41
- const organization = options.message.match(EnumExpressions.wmo)?.[0] ?? null
42
- const polygons = getPolygonFromProduct(options.message)
43
- const properties = {
44
- locations: options?.ugc?.locations?.join(`; `) ?? null,
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
- )],
51
- description: GetDescriptionFromProduct({ message: options.message, handle: options?.pVtec?.vtec ?? null }),
52
- attributes: options.attributes,
53
- geocode: {
54
- office: GetEventOffice({ attributes: options.attributes, organization: organization, pVtec: options.pVtec }),
55
- organization: organization,
56
- ugc: options?.ugc?.zones ?? [],
57
- polygon: polygons.length > 0 ? Buffer.from(JSON.stringify([polygons])).toString('base64') : null,
58
- polygon_generated: polygons.length > 0 ? true : false
59
- },
60
- parameters: {
61
- tags: GetEventTags(options.message),
62
- instructions: GetTextFromProduct({ message: options.message, find: [`For your protection`, `do not`, `use extreme caution`], append: `...`, removal: [`.`]}) ?? null,
63
- source: GetTextFromProduct({ message: options.message, find: [`SOURCE...`], removal: [`.`]}) ?? null,
64
- hazards: GetTextFromProduct({ message: options.message, find: [`HAZARD...`], removal: [`.`]}) ?? null,
65
- impacts: GetTextFromProduct({ message: options.message, find: [`IMPACT...`], removal: [`.`]}) ?? null,
66
- estimated_hail_size: GetTextFromProduct({ message: options.message, find: [`MAX HAIL SIZE...`, `HAIL...`], removal: ['in']}) ?? null,
67
- estimated_wind_gusts: GetTextFromProduct({ message: options.message, find: [`MAX WIND GUST...`, `WIND...`]}) ?? null,
68
- damage_threat: GetTextFromProduct({ message: options.message, find: [`DAMAGE THREAT...`], removal: []}) ?? null,
69
- tornado_threat: GetTextFromProduct({ message: options.message, find: [`TORNADO...`, `WATERSPOUT...`] }) ?? null,
70
- flood_threat: GetTextFromProduct({ message: options.message, find: [`FLASH FLOOD...`]}) ?? null,
71
- wind_threat: GetTextFromProduct({ message: options.message, find: [`WIND THREAT...`]}) ?? null,
72
- hail_threat: GetTextFromProduct({ message: options.message, find: [`HAIL THREAT...`], removal: []}) ?? null,
73
- },
74
- discussion_parameters: {
75
- discussion_number: GetTextFromProduct({ message: options.message, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })?.toString()?.padStart(4, "0") ?? null,
76
- discussion_concerning: GetTextFromProduct({ message: options.message, find: [`Concerning...`] }) ?? null,
77
- discussion_max_tornado: GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] }) ?? null,
78
- discussion_max_hail: GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK HAIL SIZE...`] }) ?? null,
79
- discussion_max_wind: GetTextFromProduct({ message: options.message, find: [`MOST PROBABLE PEAK WIND GUST...`] }) ?? null,
80
- discussion_watch_issuance: GetTextFromProduct({ message: options.message, find: [`Probability of Watch Issuance...`], removal: [`percent`]}) ?? null,
81
- },
82
- watch_parameters: {
83
- watch_number: options?.pVtec?.is_watch ? ( GetTextFromProduct({ message: options.message, find: [`ITIES FOR`, `UPDATE FOR`, `Watch Number `], removal: [`%`, `<`, `:`] })?.replace(/(WT|WS|)/g, '')?.trim()?.toString()?.padStart(4, "0") ?? options?.pVtec?.tracking?.slice(-4)?.toString()?.padStart(4, "0") ?? null) : null,
84
- watch_type: options.message.includes(`TORNADO WATCH`) ? `Tornado` : options?.message.includes(`SEVERE`) ? `Severe` : null,
85
- additional_tornadoes_probability: GetTextFromProduct({ message: options.message, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
86
- strong_tornadoes_probability: GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
87
- severe_wind_probability: GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
88
- severe_hail_probability: GetTextFromProduct({ message: options.message, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
89
- hail_2in_probability: GetTextFromProduct({ message: options.message, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] }) ?? null,
90
- combined_hail_wind_probability: GetTextFromProduct({ message: options.message, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
91
- max_hail_in: GetTextFromProduct({ message: options.message, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] }) ?? null,
92
- max_wind_surface: GetTextFromProduct({ message: options.message, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] }) ?? null,
93
- max_tops_x100feet: GetTextFromProduct({ message: options.message, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] }) ?? null,
94
- pds_watch: (GetTextFromProduct({ message: options.message, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES` ? true : null)
95
- }
96
- }
97
- if (isNaN(Number(properties.watch_parameters.watch_number))) {
98
- properties.watch_parameters.watch_number = null
99
- }
100
- return properties;
101
- }
@@ -1,68 +0,0 @@
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 { TypeAttributes } from "types/Attributes"
21
- import { TypeEventProperties } from "types/Properties"
22
- import { TypeStanzaCompiled } from "types/StanzaCompiled"
23
- import { TypePVTEC } from "types/VTEC"
24
-
25
- interface GetTrackingOptions {
26
- type: `RAW` | `VTEC` | `API`
27
- stanza?: TypeStanzaCompiled
28
- attributes?: TypeAttributes
29
- properties?: TypeEventProperties
30
- organization?: {
31
- wmoidentifier: string
32
- featureId: string
33
- }
34
- vtec?: TypePVTEC
35
- }
36
-
37
- export const GetEventTracking = (options: GetTrackingOptions): string => {
38
- const properties = options.properties
39
- const attributes = options.attributes
40
- const stanza = options.stanza
41
- const vtec = options.vtec
42
- if (options.type === `RAW`) {
43
- const getWatchNumber = properties.watch_parameters.watch_number ?? null
44
- if (getWatchNumber) {
45
- return `${properties.geocode.office.office}.${stanza.getType.prefix}.A.${getWatchNumber}`
46
- }
47
- return `${properties.geocode.office.office}.${attributes.ttaaii}.${attributes.id.slice(-4).replace(`.`, ``) ?? '0'}`
48
- }
49
- if (options.type === `VTEC`) {
50
- return vtec.tracking;
51
- }
52
- if (options.type === `API`) {
53
- if (options.vtec) {
54
- const vtecValue = Array.isArray(options.vtec)
55
- ? options.vtec[0].vtec : options.vtec?.vtec;
56
- const splitPVTEC = vtecValue.split('.');
57
- return `${splitPVTEC[2]}.${splitPVTEC[3]}.${splitPVTEC[4]}.${splitPVTEC[5]}`;
58
- }
59
- const wmoMatch = options.organization?.wmoidentifier?.match(/([A-Z]{4}\d{2})\s+([A-Z]{4})/);
60
- const station = wmoMatch?.[2] ?? '---';
61
- if (options.organization.featureId) {
62
- const idMatch = options.organization.featureId.match(/([a-f0-9]+)\.(\d+)\.(\d+)$/);
63
- return `${station}.${idMatch?.[0]?.replace(/\./g, '') ?? '---'}`;
64
- }
65
- const id = wmoMatch?.[1] ?? '---';
66
- return `${station}.${id?.replace(/\./g, '') ?? '---'}`;
67
- }
68
- }
@@ -1,87 +0,0 @@
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 "@utilities/SetWarning"
22
- import { SetEventEmit } from "@utilities/SetEventEmit"
23
-
24
- interface GetNodeOptions {
25
- identifier: string
26
- delete?: boolean
27
- coordinates: { longitude: number; latitude: number }
28
- }
29
-
30
- export const SetNode = (options: GetNodeOptions) => {
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
- SetWarning({ message: `Node with identifier '${options.identifier}' deleted.` })
38
- return SetEventEmit({
39
- event: `onNodeDelete`,
40
- metadata: {
41
- type: `node-delete`,
42
- node: exists
43
- }
44
- })
45
- }
46
- return SetWarning({ message: `Node with identifier '${options.identifier}' not found.` })
47
- }
48
- if (exists) {
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
- }
53
- nodes[index] = {
54
- ...exists,
55
- geometry: {
56
- type: "Point",
57
- coordinates: [options.coordinates.longitude, options.coordinates.latitude]
58
- }
59
- };
60
- SetWarning({ message: `Node with identifier '${options.identifier}' updated.` })
61
- return SetEventEmit({
62
- event: `onNodeUpdate`,
63
- metadata: {
64
- type: `node-update`,
65
- node: nodes[index]
66
- }
67
- })
68
- }
69
- nodes.push({
70
- type: "Feature",
71
- geometry: {
72
- type: "Point",
73
- coordinates: [options.coordinates.longitude, options.coordinates.latitude]
74
- },
75
- properties: {
76
- identifier: options.identifier
77
- }
78
- });
79
- SetWarning({ message: `Node with identifier '${options.identifier}' added.` })
80
- return SetEventEmit({
81
- event: `onNodeAdd`,
82
- metadata: {
83
- type: `node-add`,
84
- node: nodes[nodes.length - 1]
85
- }
86
- })
87
- }
@@ -1,122 +0,0 @@
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 { 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
-
30
- export const ParseAPI = async (stanza: TypeStanzaCompiled): Promise<void> => {
31
- const messages = Object.values(JSON.parse(stanza.message).features) as any;
32
- for (const feature of messages) {
33
- const tick = performance.now();
34
- const pVtec = VTECExtract(feature?.properties?.parameters?.VTEC?.[0]) ?? null as TypePVTEC[]
35
- bootstrap.cache.processed.push({
36
- type: `Feature`,
37
- geometry: {
38
- type: `Point`,
39
- coordinates: []
40
- },
41
- properties: {
42
- event: feature?.properties?.event ?? null,
43
- parent: feature?.properties?.event ?? null,
44
- status: feature?.properties?.messageType ?? null,
45
- issued: feature?.properties?.sent ? new Date(feature?.properties?.sent).toISOString() : null,
46
- expires: feature?.properties?.expires ? new Date(feature?.properties?.expires).toISOString() : null,
47
- locations: feature?.properties?.areaDesc ?? null,
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
- )],
54
- description: feature?.properties?.description ?? null,
55
- attributes: feature?.properties?.attributes ?? {},
56
- geocode: {
57
- office: {
58
- office: pVtec ? pVtec?.[0]?.tracking.split(`.`)[0] : null,
59
- name: EnumICAO[pVtec ? pVtec?.[0]?.tracking.split(`.`)[0] : null] ?? null,
60
- },
61
- organization: feature?.properties?.parameters?.WMOidentifier?.[0],
62
- ugc: feature?.properties?.geocode?.UGC ?? [],
63
- polygon: feature?.geometry?.coordinates.length > 0 ? Buffer.from(JSON.stringify([feature?.geometry?.coordinates[0]])).toString('base64') : null,
64
- polygon_generated: feature?.geometry?.coordinates.length > 0 ? true : false,
65
- },
66
- parameters: {
67
- tags: GetEventTags(feature?.properties?.description),
68
- instructions: feature?.properties?.instruction ?? null,
69
- source: GetTextFromProduct({ message: feature?.properties?.description, find: [`SOURCE...`], removal: [`.`]}) ?? null,
70
- hazards: GetTextFromProduct({ message: feature?.properties?.description, find: [`HAZARD...`], removal: [`.`]}) ?? null,
71
- impacts: GetTextFromProduct({ message: feature?.properties?.description, find: [`IMPACT...`], removal: [`.`]}) ?? null,
72
- estimated_hail_size: feature?.properties?.parameters?.maxHailSize?.[0] ?? null,
73
- estimated_wind_gusts: feature?.properties?.parameters?.maxWindGust?.[0] ?? null,
74
- damage_threat: feature?.properties?.parameters?.thunderstormDamageThreat?.[0] ?? null,
75
- tornado_threat: feature?.properties?.parameters?.tornadoDetection?.[0] ?? null,
76
- flood_threat: feature?.properties?.parameters?.floodDetection?.[0] ?? null,
77
- wind_threat: feature?.properties?.parameters?.windThreat?.[0] ?? null,
78
- hail_threat: feature?.properties?.parameters?.hailThreat?.[0] ?? null,
79
- },
80
- discussion_parameters: {
81
- discussion_number: GetTextFromProduct({ message: feature?.properties?.description, find: [`Mesoscale Discussion `], removal: [`Mesoscale Discussion`, `Number`, `...`] })?.toString()?.padStart(4, "0") ?? null,
82
- discussion_concerning: GetTextFromProduct({ message: feature?.properties?.description, find: [`Concerning...`] }) ?? null,
83
- discussion_max_tornado: GetTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK TORNADO INTENSITY...`] }) ?? null,
84
- discussion_max_hail: GetTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK HAIL SIZE...`] }) ?? null,
85
- discussion_max_wind: GetTextFromProduct({ message: feature?.properties?.description, find: [`MOST PROBABLE PEAK WIND GUST...`] }) ?? null,
86
- discussion_watch_issuance: GetTextFromProduct({ message: feature?.properties?.description, find: [`Probability of Watch Issuance...`], removal: [`percent`]}) ?? null,
87
- },
88
- watch_parameters: {
89
- 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),
90
- watch_type: feature?.properties?.description.includes(`TORNADO WATCH`) ? `Tornado` : feature?.properties?.description.includes(`SEVERE`) ? `Severe` : null,
91
- additional_tornadoes_probability: GetTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 2 OR MORE TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
92
- strong_tornadoes_probability: GetTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 1 OR MORE STRONG /EF2-EF5/ TORNADOES`], removal: [`%`, `<`, `:`] }) ?? null,
93
- severe_wind_probability: GetTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 10 OR MORE SEVERE WIND EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
94
- severe_hail_probability: GetTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 10 OR MORE SEVERE HAIL EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
95
- hail_2in_probability: GetTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 1 OR MORE HAIL EVENTS >= 2 INCHES`], removal: [`%`, `<`, `:`] }) ?? null,
96
- combined_hail_wind_probability: GetTextFromProduct({ message: feature?.properties?.description, find: [`PROB OF 6 OR MORE COMBINED SEVERE HAIL/WIND EVENTS`], removal: [`%`, `<`, `:`] }) ?? null,
97
- max_hail_in: GetTextFromProduct({ message: feature?.properties?.description, find: [`MAX HAIL /INCHES/`], removal: [`%`, `<`, `:`] }) ?? null,
98
- max_wind_surface: GetTextFromProduct({ message: feature?.properties?.description, find: [`MAX WIND GUSTS SURFACE /KNOTS/`], removal: [`%`, `<`, `:`] }) ?? null,
99
- max_tops_x100feet: GetTextFromProduct({ message: feature?.properties?.description, find: [`MAX TOPS /X 100 FEET/`], removal: [`%`, `<`, `:`] }) ?? null,
100
- pds_watch: (GetTextFromProduct({ message: feature?.properties?.description, find: [`PARTICULARLY DANGEROUS SITUATION`], removal: [`%`, `<`, `:`] }) === `YES`)
101
- },
102
- metadata: {
103
- ms: performance.now() - tick,
104
- source: `events.api`,
105
- tracking: GetEventTracking({ type: `API`, organization: { wmoidentifier: feature?.properties?.parameters?.WMOidentifier?.[0], featureId: feature?.id}, vtec: pVtec?.[0]}),
106
- header: `ZCZC-ATMOSX-${feature?.properties?.parameters?.WMOidentifier}`,
107
- vtec: pVtec?.[0],
108
- hvtec: null,
109
- raw: feature?.properties?.description,
110
- history: [
111
- {
112
- description: feature?.properties?.description,
113
- issued: feature?.properties?.sent ? new Date(feature?.properties?.sent).toISOString() : null,
114
- status: feature?.properties?.messageType ?? null,
115
- }
116
- ]
117
- }
118
- }
119
- })
120
- SetDebug({ title: `ParseAPI`, message: `${Math.round(performance.now() - tick)}ms` })
121
- }
122
- }
@@ -1,109 +0,0 @@
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 { TypeEvent } from "types/Event"
21
- import { TypeSettings } from "types/Settings"
22
- import { EnumGlobalFilter } from "@enums/GlobalFilter"
23
- import { bootstrap } from "@bootstrap"
24
- import { CreateTasks } from "@tasks/CreateTasks"
25
- import { SetHash } from "@manager/SetHash"
26
- import { UpdateNode } from "@manager/UpdateNode"
27
- import { SetEventEmit } from "@utilities/SetEventEmit"
28
- import { SetTimeoutAction } from "@utilities/SetTimeoutAction"
29
-
30
-
31
- export const MakeEvents = async (events: TypeEvent[]): Promise<void> => {
32
- let tasked = [];
33
- const settings = bootstrap.settings as TypeSettings;
34
- if (events.length === 0) return
35
- await Promise.all(events.map(async event => {
36
- const features = bootstrap.cache.events.features;
37
- const getHash = event.properties.metadata.hash;
38
- const getTracking = event.properties.metadata.tracking;
39
- const isEntry = bootstrap.cache.hashes?.find(hash => hash.tracking === getTracking)
40
- const isHashed = isEntry?.hashes?.includes(getHash) ?? false;
41
- const isNodeFiltering = settings.GlobalSettings.EventFiltering.NodeLocationFiltering
42
- const getNodes = bootstrap.cache.nodes.features;
43
- const getFeature = features.find(feature => feature.properties.metadata.tracking === getTracking);
44
-
45
- if (isHashed || event.properties.status_metadata.is_expired) return
46
- SetHash(event, isEntry)
47
- await UpdateNode(event);
48
- if (isNodeFiltering && getNodes.length > 0) {
49
- if (!event.properties.metadata.filtered_proximity && !EnumGlobalFilter.includes(event.properties.event.toLowerCase())) {
50
- return
51
- }
52
- }
53
-
54
- const isRatelimited = SetTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true })
55
- const isLocal = event.properties.metadata.filtered_proximity ? `[LOCAL] ` : ``;
56
- if (!isRatelimited.limited) {
57
- SetEventEmit({
58
- event: `onEventStatus`,
59
- metadata: {
60
- type: getFeature ? `Updated` : `New`,
61
- event: event
62
- },
63
- message: `${isLocal}[${getFeature ? 'Updated' : 'New'}] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
64
- })
65
- }
66
-
67
- if (settings.GlobalSettings.EventManagement) {
68
- if (event.properties.status_metadata.is_issued || event.properties.status_metadata.is_updated) {
69
- if (getFeature) {
70
- const getIndex = features.indexOf(getFeature);
71
- const cHistory = getFeature?.properties?.metadata?.history ?? [];
72
- const cLocations = getFeature?.properties?.locations?.split(";").map((l: string) => l.trim()) ?? [];
73
- const cUgc = getFeature?.properties?.geocode?.ugc ?? [];
74
-
75
- const iHistory = event.properties?.metadata?.history ?? [];
76
- const iLocations = event.properties?.locations?.split(";").map((l: string) => l.trim()) ?? [];
77
- const iUgc = event.properties?.geocode?.ugc ?? [];
78
-
79
- const mHistory = [...cHistory, ...iHistory].filter((v, i, a) => a.indexOf(v) === i).filter((v, i, a) => a.findIndex(h => h.description === v.description && h.issued === v.issued) === i);
80
- const mLocations = [...cLocations, ...iLocations].filter((v, i, a) => a.indexOf(v) === i).join('; ');
81
- const mUgc = [...cUgc, ...iUgc].filter((v, i, a) => a.indexOf(v) === i);
82
-
83
- bootstrap.cache.events.features[getIndex] = {
84
- ...event,
85
- properties: {
86
- ...event.properties,
87
- metadata: {
88
- ...event?.properties?.metadata,
89
- history: mHistory
90
- },
91
- locations: mLocations,
92
- geocode: {
93
- ...event?.properties?.geocode,
94
- ugc: mUgc
95
- },
96
- }
97
- };
98
-
99
- tasked.push(bootstrap.cache.events.features[getIndex])
100
- } else {
101
- features.push(event);
102
- tasked.push(event)
103
- }
104
- }
105
- }
106
- }))
107
- SetEventEmit({ event: `onEventCache`, metadata: bootstrap.cache.events, limited: true })
108
- return await CreateTasks(tasked)
109
- }
@@ -1,70 +0,0 @@
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 { TypeEvent } from "types/Event"
21
- import { EnumStrings } from "@enums/Strings"
22
- import { bootstrap } from "@bootstrap"
23
- import { SetEventEmit } from "@utilities/SetEventEmit"
24
- import { SetTimeoutAction } from "@utilities/SetTimeoutAction"
25
- import { CreateTasks } from "@tasks/CreateTasks"
26
-
27
-
28
- export const RemoveEvent = async (event: TypeEvent, isTimeBasedExpiration: boolean):Promise<void> => {
29
- const gTracking = event.properties.metadata.tracking;
30
- const isTrackingEventLogged = bootstrap.cache.events.features
31
- .find(f => f?.properties?.metadata?.tracking === gTracking);
32
- const isStatement = event.properties.status_metadata.is_statement;
33
-
34
- if (isTrackingEventLogged) {
35
- event.properties.expires = new Date().toISOString();
36
- event.properties.status = `Expired`;
37
- event.properties.status_metadata.is_expired = true;
38
-
39
- const description = isTimeBasedExpiration ? EnumStrings.cancellation
40
- .replace(`{SENDER}`, event.properties.geocode.office.name)
41
- .replace(`{EVENT}`, event.properties.event) : event.properties.description
42
- event.properties.description = description;
43
- event.properties.metadata.raw = isTimeBasedExpiration ? description : event.properties.metadata.raw;
44
- event.properties.metadata.history.push({
45
- description: isTimeBasedExpiration ? description : event.properties.description,
46
- issued: event.properties.expires,
47
- status: event.properties.status
48
- })
49
-
50
- bootstrap.cache.events.features
51
- .splice(bootstrap.cache.events.features.indexOf(isTrackingEventLogged), 1);
52
- bootstrap.cache.hashes = bootstrap.cache.hashes
53
- .filter(hash => hash.tracking !== gTracking);
54
-
55
- if (!isStatement) {
56
- SetEventEmit({
57
- event: `onEventStatus`,
58
- metadata: { type: `Removed`, event: event },
59
- message: `[Removed] ${event.properties.event} (${event.properties.status}) (${gTracking})`
60
- })
61
- CreateTasks([event])
62
- }
63
- SetTimeoutAction({ identifier: gTracking, expire: true })
64
- }
65
- SetEventEmit({
66
- event: `onEventCache`,
67
- metadata: bootstrap.cache.events,
68
- limited: true
69
- })
70
- }