@atmosx/event-product-parser 3.0.63 → 3.0.75

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 (164) hide show
  1. package/.github/docs/docs-functions.md +1 -1
  2. package/.github/docs/docs-general-configurations.md +1 -11
  3. package/.github/docs/docs-integrations.md +3 -2
  4. package/README.md +4 -4
  5. package/dist/cjs/index.cjs +3590 -623
  6. package/dist/esm/index.mjs +3589 -624
  7. package/package.json +11 -4
  8. package/src/bootstrap.ts +50 -33
  9. package/src/{@building → building}/CreateEvent.ts +10 -10
  10. package/src/{@building → building}/GetCleanedEvent.ts +2 -2
  11. package/src/{@building → building}/GetEventAttachments.ts +12 -10
  12. package/src/building/GetEventDirection.ts +28 -0
  13. package/src/{@building → building}/GetEventEnhancedName.ts +5 -6
  14. package/src/{@building → building}/GetEventGeometry.ts +19 -13
  15. package/src/{@building → building}/GetEventHeader.ts +4 -4
  16. package/src/{@building → building}/GetEventNodes.ts +16 -14
  17. package/src/{@building → building}/GetEventOffice.ts +5 -5
  18. package/src/building/GetEventPopulation.ts +58 -0
  19. package/src/{@building → building}/GetEventProperties.ts +23 -18
  20. package/src/{@building → building}/GetEventSignature.ts +8 -8
  21. package/src/{@building → building}/GetEventTags.ts +3 -3
  22. package/src/{@core/CreateListener.ts → building/GetEventTheme.ts} +8 -6
  23. package/src/{@building → building}/GetEventTracking.ts +6 -6
  24. package/src/{@modules/@eas/GenerateEASMessage.ts → components/audio/GenerateAudioMessage.ts} +32 -33
  25. package/src/{@modules/@eas → components/audio/components}/GetCleanDescription.ts +2 -2
  26. package/src/{@modules/@eas → components/audio/components}/GetFloatPCM16.ts +2 -2
  27. package/src/{@modules/@eas → components/audio/components}/GetMergedPCM16.ts +2 -2
  28. package/src/{@modules/@eas → components/audio/components}/GetPCM16.ts +2 -2
  29. package/src/{@modules/@eas → components/audio/components}/GetPCMToFloat.ts +2 -2
  30. package/src/{@modules/@eas → components/audio/components}/GetSampledPCM16.ts +2 -2
  31. package/src/{@modules/@eas → components/audio/components}/GetTTS.ts +5 -3
  32. package/src/{@modules/@eas → components/audio/components}/GetWavPCM16.ts +2 -2
  33. package/src/{@modules/@eas → components/audio/components}/SetAFSK.ts +2 -2
  34. package/src/{@modules/@eas → components/audio/components}/SetAsciiToBits.ts +2 -2
  35. package/src/{@modules/@eas → components/audio/components}/SetAttentionTone.ts +2 -2
  36. package/src/{@modules/@eas → components/audio/components}/SetNoise.ts +4 -4
  37. package/src/{@modules/@eas → components/audio/components}/SetRadioEffect.ts +4 -4
  38. package/src/{@modules/@eas → components/audio/components}/SetSameHeader.ts +5 -5
  39. package/src/{@modules/@utilities/SetWarning.ts → components/database/CreateQuery.ts} +18 -13
  40. package/src/{@modules/@database → components/database}/GetCachedEvents.ts +14 -9
  41. package/src/components/database/ImportBoundaries.ts +168 -0
  42. package/src/{@modules/@database → components/database}/ImportBroadcastify.ts +8 -17
  43. package/src/components/database/ImportCities.ts +87 -0
  44. package/src/{@modules/@database → components/database}/ImportShapefiles.ts +14 -16
  45. package/src/{@modules/@database → components/database}/ImportStanza.ts +13 -17
  46. package/src/components/database/InitializeDatabase.ts +71 -0
  47. package/src/components/images/GenerateGraphic.ts +242 -0
  48. package/src/components/images/components/CreateRectangle.ts +22 -0
  49. package/src/components/images/components/CreateText.ts +22 -0
  50. package/src/components/images/modules/CreateSVG.ts +37 -0
  51. package/src/components/images/modules/GetGeographicalBoundaries.ts +72 -0
  52. package/src/components/images/modules/GetGeographicalCities.ts +58 -0
  53. package/src/components/images/modules/GetGeographicalEvents.ts +48 -0
  54. package/src/components/images/modules/GetGeometryBounds.ts +82 -0
  55. package/src/components/images/modules/GetParsedBoundary.ts +58 -0
  56. package/src/components/images/modules/GetSVGPath.ts +53 -0
  57. package/src/components/images/modules/NormalizePolygon.ts +57 -0
  58. package/src/{@modules/@stanza → components/stanza}/GetAwipsType.ts +4 -4
  59. package/src/{@modules/@stanza → components/stanza}/ValidateStanza.ts +6 -6
  60. package/src/{@modules/@utilities → components/utilities}/CreateHttp.ts +2 -2
  61. package/src/{@parsers/@text → components/utilities}/GetEmbededText.ts +6 -4
  62. package/src/{@modules/@utilities → components/utilities}/GetFormattedTime.ts +2 -2
  63. package/src/{@modules/@utilities → components/utilities}/GetLatestIssuance.ts +2 -2
  64. package/src/{@modules/@utilities → components/utilities}/GetMatched.ts +2 -2
  65. package/src/{@modules/@utilities → components/utilities}/GetShapeNearestPoint.ts +2 -2
  66. package/src/{@parsers/@text → components/utilities}/GetStringText.ts +7 -7
  67. package/src/components/utilities/GetUnionPolygon.ts +36 -0
  68. package/src/{@modules/@utilities → components/utilities}/QueueManager.ts +2 -2
  69. package/src/{@modules/@utilities → components/utilities}/SetCronSchedule.ts +37 -25
  70. package/src/{@modules/@utilities → components/utilities}/SetDebug.ts +4 -4
  71. package/src/{@modules/@utilities → components/utilities}/SetEventEmit.ts +8 -7
  72. package/src/{@modules/@utilities → components/utilities}/SetSettings.ts +4 -4
  73. package/src/{@modules/@utilities → components/utilities}/SetSleep.ts +2 -2
  74. package/src/{@modules/@utilities → components/utilities}/SetTimeoutAction.ts +3 -3
  75. package/src/components/utilities/SetWarning.ts +47 -0
  76. package/src/{@modules/@xmpp → components/xmpp}/DeployXMPP.ts +12 -12
  77. package/src/{@modules/@xmpp → components/xmpp}/ErrorXMPP.ts +3 -3
  78. package/src/{@modules/@xmpp → components/xmpp}/OfflineXMPP.ts +4 -4
  79. package/src/{@modules/@xmpp → components/xmpp}/OnlineXMPP.ts +5 -5
  80. package/src/{@modules/@xmpp → components/xmpp}/ReconnectXMPP.ts +6 -6
  81. package/src/{@modules/@xmpp → components/xmpp}/StanzaXMPP.ts +8 -8
  82. package/src/{@core → core}/ClearEvents.ts +4 -4
  83. package/src/{@core → core}/GetEvents.ts +3 -3
  84. package/src/{@core → core}/GetNodes.ts +3 -3
  85. package/src/{@core → core}/GetRandomEvent.ts +3 -3
  86. package/src/{@core → core}/GetVersion.ts +3 -3
  87. package/src/{@core → core}/ManualEvent.ts +6 -6
  88. package/src/{@core → core}/QueryStanza.ts +9 -8
  89. package/src/{@core → core}/SetNode.ts +5 -5
  90. package/src/{@core → core}/StartService.ts +13 -12
  91. package/src/{@core → core}/StopService.ts +3 -3
  92. package/src/{@enums → enums}/AWIPS.ts +2 -2
  93. package/src/{@enums → enums}/Actions.ts +2 -2
  94. package/src/{@enums → enums}/Cancellation.ts +2 -2
  95. package/src/{@enums → enums}/Causes.ts +2 -2
  96. package/src/{@enums → enums}/Correlations.ts +2 -2
  97. package/src/{@enums → enums}/Enhanced.ts +4 -3
  98. package/src/{@enums → enums}/Events.ts +2 -2
  99. package/src/{@enums → enums}/Expressions.ts +2 -2
  100. package/src/{@enums → enums}/GlobalFilter.ts +2 -2
  101. package/src/{@enums → enums}/Hail.ts +2 -2
  102. package/src/{@enums → enums}/ICAO.ts +2 -2
  103. package/src/{@enums → enums}/Matches.ts +8 -3
  104. package/src/{@enums → enums}/Products.ts +2 -2
  105. package/src/{@enums → enums}/Records.ts +2 -2
  106. package/src/{@enums → enums}/Severity.ts +2 -2
  107. package/src/{@enums → enums}/Shapefiles.ts +2 -2
  108. package/src/{@enums → enums}/States.ts +68 -4
  109. package/src/{@enums → enums}/Status.ts +2 -2
  110. package/src/{@enums → enums}/Strings.ts +2 -2
  111. package/src/{@enums → enums}/Tags.ts +8 -3
  112. package/src/{@enums → enums}/Testing.ts +2 -2
  113. package/src/enums/Themes.ts +70 -0
  114. package/src/{@events → events}/ParseAPI.ts +28 -17
  115. package/src/{@events → events}/ParseText.ts +13 -11
  116. package/src/{@events → events}/ParseUGC.ts +15 -14
  117. package/src/{@events → events}/ParseVTEC.ts +18 -16
  118. package/src/index.ts +49 -32
  119. package/src/{@manager → manager}/MakeEvents.ts +16 -28
  120. package/src/{@manager → manager}/RemoveEvent.ts +9 -9
  121. package/src/{@manager → manager}/SetHash.ts +5 -5
  122. package/src/{@manager → manager}/UpdateEvents.ts +6 -6
  123. package/src/{@manager → manager}/UpdateNode.ts +6 -6
  124. package/src/{@manager → manager}/ValidateEvents.ts +31 -20
  125. package/src/{@parsers/@hvtec → parsers/hvtec}/HVExtract.ts +7 -7
  126. package/src/{@parsers/@text → parsers/text}/GetDescriptionFromProduct.ts +3 -3
  127. package/src/parsers/text/GetPolygonFromProduct.ts +71 -0
  128. package/src/{@parsers/@text → parsers/text}/GetTextFromProduct.ts +2 -2
  129. package/src/{@parsers/@ugc → parsers/ugc}/GetCache.ts +4 -4
  130. package/src/{@parsers/@ugc → parsers/ugc}/GetExpiry.ts +2 -2
  131. package/src/{@parsers/@ugc → parsers/ugc}/GetHeader.ts +3 -3
  132. package/src/{@parsers/@ugc → parsers/ugc}/GetLocations.ts +9 -9
  133. package/src/parsers/ugc/GetZonePolygon.ts +73 -0
  134. package/src/{@parsers/@ugc → parsers/ugc}/GetZones.ts +2 -2
  135. package/src/{@parsers/@ugc → parsers/ugc}/SetCache.ts +4 -4
  136. package/src/{@parsers/@ugc → parsers/ugc}/UGCExtract.ts +9 -9
  137. package/src/{@parsers/@vtec → parsers/vtec}/GetExpiry.ts +2 -2
  138. package/src/{@parsers/@vtec → parsers/vtec}/VTECExtract.ts +9 -9
  139. package/src/{@types-lower → static}/Attributes.ts +2 -3
  140. package/src/{@types-lower → static}/Event.ts +7 -6
  141. package/src/{@types-lower → static}/Properties.ts +17 -4
  142. package/src/{@types-lower → static}/Stanza.ts +3 -3
  143. package/src/{@tasks → tasks}/CreateTasks.ts +40 -34
  144. package/src/{@tasks → tasks}/TaskGenerateJSON.ts +2 -2
  145. package/src/{@tasks → tasks}/TaskGenerateText.ts +2 -2
  146. package/src/{@tasks → tasks}/TaskSendNTFY.ts +29 -25
  147. package/src/{@tasks → tasks}/TaskSendWebhook.ts +22 -15
  148. package/src/{@types → types}/Actions.ts +3 -3
  149. package/src/{@types → types}/HVTEC.ts +2 -2
  150. package/src/{@types → types}/Hash.ts +2 -2
  151. package/src/types/Nodes.ts +29 -0
  152. package/src/{@types → types}/Settings.ts +17 -8
  153. package/src/{@types → types}/StanzaCompiled.ts +3 -3
  154. package/src/{@types → types}/UGC.ts +2 -2
  155. package/src/{@types → types}/VTEC.ts +2 -2
  156. package/tools/build.js +2 -0
  157. package/tsconfig.json +25 -18
  158. package/src/@modules/@database/InitializeDatabase.ts +0 -59
  159. package/src/@modules/@utilities/GetSettings.ts +0 -25
  160. package/src/@modules/@utilities/SetListener.ts +0 -30
  161. package/src/@parsers/@text/GetPolygonFromProduct.ts +0 -53
  162. package/src/@parsers/@text/GetXML.ts +0 -61
  163. package/src/@parsers/@ugc/GetZonePolygon.ts +0 -111
  164. package/src/@tasks/TaskGenerateAudio.ts +0 -34
@@ -11,9 +11,9 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
@@ -11,19 +11,19 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeVTEC } from "types/VTEC"
21
- import { EnumExpressions } from "@enums/Expressions"
22
- import { EnumProducts } from "@enums/Products"
23
- import { EnumEvents } from "@enums/Events"
24
- import { EnumActions } from "@enums/Actions"
25
- import { EnumStatus } from "@enums/Status"
26
- import { GetExpiry } from "./GetExpiry"
20
+ import { TypeVTEC } from "Types/VTEC"
21
+ import { EnumExpressions } from "@Enums/Expressions"
22
+ import { EnumProducts } from "@Enums/Products"
23
+ import { EnumEvents } from "@Enums/Events"
24
+ import { EnumActions } from "@Enums/Actions"
25
+ import { EnumStatus } from "@Enums/Status"
26
+ import { GetExpiry } from "@ParsingVTEC/GetExpiry"
27
27
 
28
28
  export const VTECExtract = (message: string): TypeVTEC[] | null => {
29
29
  if (!message) return null;
@@ -11,13 +11,12 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
-
21
20
  export type TypeAttributes = {
22
21
  xmlns: string
23
22
  id: string
@@ -11,20 +11,20 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeEventProperties as BaseTypeEventProperties } from "./Properties"
21
- import { TypeHVTEC } from "types/HVTEC"
22
- import { TypeVTEC } from "types/VTEC"
20
+ import { TypeEventProperties as BaseTypeEventProperties } from "StaticTypes/Properties"
21
+ import { TypeHVTEC } from "Types/HVTEC"
22
+ import { TypeVTEC } from "Types/VTEC"
23
23
 
24
24
  export type TypeEvent = {
25
25
  type: string
26
26
  geometry: {
27
- type: string
27
+ type: "Polygon" | "MultiPolygon"
28
28
  coordinates: number[][]
29
29
  }
30
30
  properties: {
@@ -33,6 +33,7 @@ export type TypeEvent = {
33
33
  status: string
34
34
  issued: string
35
35
  expires: string
36
+ theme: string
36
37
  status_metadata?: {
37
38
  is_issued?: boolean
38
39
  is_updated?: boolean
@@ -11,18 +11,26 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeAttributes } from "./Attributes"
20
+ import { TypeAttributes } from "StaticTypes/Attributes"
21
+
22
+ export type TypeCities = {
23
+ name: string
24
+ state: string
25
+ county: string
26
+ population: number
27
+ }
21
28
 
22
29
  export type TypeEventProperties = {
23
30
  locations: string
24
31
  locations_array: string[]
25
- location_states: string[]
32
+ regions: string[]
33
+ regions_string: string
26
34
  description: string
27
35
  attributes?: TypeAttributes
28
36
  geocode: {
@@ -32,6 +40,10 @@ export type TypeEventProperties = {
32
40
  }
33
41
  organization: string
34
42
  ugc: string[]
43
+ census?: {
44
+ population?: number
45
+ cities?: TypeCities[]
46
+ }
35
47
  polygon: string
36
48
  polygon_generated: boolean
37
49
  }
@@ -43,6 +55,7 @@ export type TypeEventProperties = {
43
55
  impacts: string
44
56
  estimated_hail_size: string
45
57
  estimated_wind_gusts: string
58
+ direction: string
46
59
  damage_threat: string
47
60
  tornado_threat: string
48
61
  flood_threat: string
@@ -11,13 +11,13 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- export type TypeStanza = { // This should be the only thing that isn't touched
20
+ export type TypeStanza = {
21
21
  getChild(arg0: string): unknown
22
22
  is(arg0: string): unknown
23
23
  name: string
@@ -11,64 +11,75 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
  */
18
18
 
19
- import { TypeSettings } from "types/Settings"
20
- import { TypeEvent } from "types-lower/Event"
21
- import { TypeActions } from "types/Actions"
22
- import { Bootstrap } from "@bootstrap"
23
- import { SetDebug } from "@utilities/SetDebug"
24
- import { GetMatched } from "@utilities/GetMatched"
25
- import { GetStringText } from "@parsers/text/GetStringText"
26
- import { GetCleanedEvent } from "@building/GetCleanedEvent"
27
- import { TaskGenerateAudio } from "@tasks/TaskGenerateAudio"
28
- import { TaskGenerateText } from "@tasks/TaskGenerateText"
29
- import { TaskGenerateJSON } from "@tasks/TaskGenerateJSON"
30
- import { TaskSendNTFY } from "@tasks/TaskSendNTFY"
31
- import { TaskSendWebhook } from "@tasks/TaskSendWebhook"
32
- import { QueueManager } from "@utilities/QueueManager"
19
+ import { TypeSettings } from "Types/Settings"
20
+ import { TypeEvent } from "StaticTypes/Event"
21
+ import { TypeActions } from "Types/Actions"
22
+ import { Bootstrap } from "@Bootstrap"
23
+ import { SetDebug } from "@Utilities/SetDebug"
24
+ import { GetMatched } from "@Utilities/GetMatched"
25
+ import { GetStringText } from "@Utilities/GetStringText"
26
+ import { GetCleanedEvent } from "@Building/GetCleanedEvent"
27
+ import { GenerateAudioMessage } from "@Audio/GenerateAudioMessage"
28
+ import { TaskGenerateText } from "@Tasks/TaskGenerateText"
29
+ import { TaskGenerateJSON } from "@Tasks/TaskGenerateJSON"
30
+ import { TaskSendNTFY } from "@Tasks/TaskSendNTFY"
31
+ import { TaskSendWebhook } from "@Tasks/TaskSendWebhook"
32
+ import { GenerateGraphic } from "@Image/GenerateGraphic"
33
+ import { QueueManager } from "@Utilities/QueueManager"
33
34
 
34
35
  const Webhooks = new QueueManager({ Concurrency: 1 });
35
36
  const NTFY = new QueueManager({ Concurrency: 5 });
36
37
 
37
38
  export const CreateTasks = async (events: TypeEvent[]): Promise<void> => {
38
- const tick = performance.now()
39
+
39
40
  const settings = Bootstrap.Settings as TypeSettings;
40
41
  const { ActionSettings, GlobalSettings, NotifyServer } = settings;
41
42
  const actions = ActionSettings as TypeActions[];
42
-
43
43
  for (const event of events) {
44
+ const tick = performance.now()
44
45
  const { properties } = event;
45
46
  const isActioning = Array.isArray(actions) && actions.length > 0;
46
47
  if (!isActioning) { continue }
47
-
48
48
  for (const action of actions) {
49
49
  const { Events, Webhook, NotificationServer, Uploads } = action;
50
50
  const isValidAction = GetMatched({ Strings: Events, String: properties.event });
51
+
51
52
  if ((Events.length == 0 || isValidAction)) {
52
53
  const a = performance.now();
53
- const [eas, text, json] = await Promise.all([
54
- Uploads?.EAS ? TaskGenerateAudio({
55
- Filename: (`${properties.event}_${properties.metadata.tracking}`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim(),
56
- Description: properties.description,
54
+ const [audio, text, json, image] = await Promise.all([
55
+ Uploads?.AUDIO && GlobalSettings?.ArchiveSettings?.AudioDirectory ? GenerateAudioMessage({
56
+ Directory: GlobalSettings?.ArchiveSettings?.AudioDirectory + `/${properties?.regions_string ?? `MC`}`,
57
+ Title: (`${properties.event}_${properties.metadata.tracking}`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim(),
58
+ Message: properties.description,
57
59
  Header: properties.metadata.header
58
60
  }).then((result) => { return result; }) : Promise.resolve(null),
59
61
 
60
- Uploads?.TEXT ? TaskGenerateText({
62
+ Uploads?.TEXT && GlobalSettings?.ArchiveSettings?.TextDirectory ? TaskGenerateText({
61
63
  String: properties.metadata.raw,
62
- Directory: GlobalSettings?.ArchiveSettings?.TextDirectory,
64
+ Directory: GlobalSettings?.ArchiveSettings?.TextDirectory + `/${properties?.regions_string ?? `MC`}`,
63
65
  Filename: (`${properties.event}_${properties.metadata.tracking}.txt`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim()
64
66
  }).then((result) => { return result; }) : Promise.resolve(null),
65
67
 
66
- Uploads?.JSON ? TaskGenerateJSON({
68
+ Uploads?.JSON && GlobalSettings?.ArchiveSettings?.JSONDirectory ? TaskGenerateJSON({
67
69
  String: JSON.stringify(GetCleanedEvent(event), null, 2),
68
- Directory: GlobalSettings?.ArchiveSettings?.JSONDirectory,
70
+ Directory: GlobalSettings?.ArchiveSettings?.JSONDirectory + `/${properties?.regions_string ?? `MC`}`,
69
71
  Filename: (`${properties.event}_${properties.metadata.tracking}.json`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim()
70
72
  }).then((result) => { return result; }) : Promise.resolve(null),
73
+
74
+ Uploads?.IMAGE && GlobalSettings?.ArchiveSettings?.ImageDirectory ? GenerateGraphic({
75
+ Event: event,
76
+ File: {
77
+ Directory: GlobalSettings?.ArchiveSettings?.ImageDirectory + `/${properties?.regions_string ?? `MC`}`,
78
+ Name: (`${properties.event}_${properties.metadata.tracking}.png`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim()
79
+ }
80
+ }).then((result) => { return result; }) : Promise.resolve(null)
71
81
  ]);
82
+
72
83
 
73
84
  SetDebug({ Title: `Tasks/Generative`, Message: `${Math.round(performance.now() - a)}ms` })
74
85
 
@@ -76,11 +87,6 @@ export const CreateTasks = async (events: TypeEvent[]): Promise<void> => {
76
87
  await Promise.all([
77
88
  NotificationServer?.Enabled && NotifyServer?.Enabled && NotificationServer?.Topic ? NTFY.enqueue(() => TaskSendNTFY({
78
89
  Event: event,
79
- Toggles: {
80
- EAS: Uploads?.EAS,
81
- Json: Uploads?.JSON,
82
- Text: Uploads?.TEXT
83
- },
84
90
  Priority: NotificationServer?.Priority ?? 5,
85
91
  Body: GetStringText(event),
86
92
  Topic: NotificationServer?.Topic
@@ -95,8 +101,9 @@ export const CreateTasks = async (events: TypeEvent[]): Promise<void> => {
95
101
  Ratelimit: Webhook?.Ratelimit
96
102
  },
97
103
  Attachments: {
104
+ Image: image,
98
105
  Text: text,
99
- EAS: eas,
106
+ Audio: audio,
100
107
  Json: json
101
108
  }
102
109
  })) : Promise.resolve(null)
@@ -106,5 +113,4 @@ export const CreateTasks = async (events: TypeEvent[]): Promise<void> => {
106
113
  }
107
114
  SetDebug({ Title: `Tasks/CompletedEventTask`, Message: `${Math.round(performance.now() - tick)}ms` })
108
115
  }
109
- SetDebug({ Title: `Tasks/Global`, Message: `${Math.round(performance.now() - tick)}ms` })
110
116
  }
@@ -11,9 +11,9 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
@@ -11,9 +11,9 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
@@ -11,30 +11,25 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeEvent } from "types-lower/Event"
21
- import { Bootstrap } from "@bootstrap"
22
- import { CreateHttp } from "@utilities/CreateHttp";
23
- import { SetDebug } from "@utilities/SetDebug";
20
+ import { TypeEvent } from "StaticTypes/Event"
21
+ import { Bootstrap } from "@Bootstrap"
22
+ import { CreateHttp } from "@Utilities/CreateHttp";
23
+ import { SetDebug } from "@Utilities/SetDebug";
24
24
 
25
25
  interface TaskSendNTFYOptions {
26
- Event: TypeEvent;
27
- Toggles?: {
28
- EAS?: boolean;
29
- Json?: boolean;
30
- Text?: boolean;
31
- },
32
- Priority: string | number;
33
- Body: string;
34
- Topic: string;
26
+ Event: TypeEvent
27
+ Priority: string | number
28
+ Body: string
29
+ Topic: string
35
30
  }
36
31
 
37
- export const TaskSendNTFY = async function({ Event, Toggles, Priority, Body, Topic }: TaskSendNTFYOptions): Promise<void> {
32
+ export const TaskSendNTFY = async function({ Event, Priority, Body, Topic }: TaskSendNTFYOptions): Promise<void> {
38
33
  const { properties } = Event;
39
34
 
40
35
  const configurations = Bootstrap.Settings.NotifyServer;
@@ -42,30 +37,38 @@ export const TaskSendNTFY = async function({ Event, Toggles, Priority, Body, Top
42
37
  Username: configurations.Credentials.Username,
43
38
  Password: configurations.Credentials.Password
44
39
  } : undefined;
45
- const image = properties.metadata.attachments?.find(a => a.name === "Image: Graphic");
46
40
 
41
+ const image = configurations?.MediaStorage?.IMAGE ? { link: `${configurations?.MediaStorage?.IMAGE}/${properties.regions_string}//${properties?.event}_${properties?.metadata?.tracking}.png` } : undefined;
42
+ const SPCGraphic = properties?.metadata?.attachments?.find(a => a.name === "Image: SPC Graphic")
43
+
47
44
  const buttons = [
48
- ...(Toggles?.EAS && configurations?.MediaStorage?.EAS ? [{
45
+ ...(configurations?.MediaStorage?.AUDIO ? [{
49
46
  "action": "view",
50
- "label": "Listen",
51
- "url": `${configurations.MediaStorage.EAS}/${properties.event}_${properties.metadata.tracking}.wav`,
47
+ "label": "View Audio",
48
+ "url": `${configurations.MediaStorage.AUDIO}/${properties.regions_string}/${properties.event}_${properties.metadata.tracking}.wav`,
52
49
  }] : []),
53
- ...(Toggles?.Text && configurations?.MediaStorage?.TEXT ? [{
50
+ ...(configurations?.MediaStorage?.TEXT ? [{
54
51
  "action": "view",
55
52
  "label": "View Text",
56
- "url": `${configurations.MediaStorage.TEXT}/${properties.event}_${properties.metadata.tracking}.txt`,
53
+ "url": `${configurations.MediaStorage.TEXT}/${properties.regions_string}/${properties.event}_${properties.metadata.tracking}.txt`,
57
54
  }] : []),
58
- ...(image ? [{
55
+ ...(SPCGraphic ? [{
59
56
  "action": "view",
60
- "label": "View Image",
61
- "url": image.link,
57
+ "label": "View Graphic",
58
+ "url": SPCGraphic.link,
62
59
  }] : []),
60
+ ... [{
61
+ "action": "copy",
62
+ "label": "Copy Card",
63
+ "value": `${properties.event} (${properties.status})\n${Body}\nTags: ${properties.parameters.tags?.join(",") ?? "N/A"}`
64
+ }]
63
65
  ];
64
66
 
65
67
  const headers = {
66
68
  "Title": `${properties.event} (${properties.status})`,
67
69
  "Tags": properties.parameters.tags?.join(",") ?? "N/A",
68
70
  "Priority": Priority ?? "5",
71
+ ...(image && { "Attach": image.link }),
69
72
  ...(buttons.length > 0 && { "Actions": JSON.stringify(buttons) }),
70
73
  };
71
74
 
@@ -82,6 +85,7 @@ export const TaskSendNTFY = async function({ Event, Toggles, Priority, Body, Top
82
85
  SetDebug({ Title: `Tasks/NTFY`, Message: `Failed to send notification to topic "${topic}": ${response.message}` })
83
86
  }
84
87
  }
88
+
85
89
  const topics = [
86
90
  Topic,
87
91
  ...(properties.metadata.filtered_proximity ? [`${Topic}-LOCAL`] : []),
@@ -11,17 +11,16 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeEvent } from "types-lower/Event"
21
- import { CreateHttp } from "@utilities/CreateHttp";
22
- import { SetTimeoutAction } from "@utilities/SetTimeoutAction";
23
- import { GetEmebedText } from "@parsers/text/GetEmbededText";
24
- import { parentPort } from "worker_threads"
20
+ import { TypeEvent } from "StaticTypes/Event"
21
+ import { CreateHttp } from "@Utilities/CreateHttp";
22
+ import { SetTimeoutAction } from "@Utilities/SetTimeoutAction";
23
+ import { GetEmbededText } from "@Utilities/GetEmbededText";
25
24
  import { readFile } from "fs/promises"
26
25
 
27
26
  interface TaskSendWebhookOptions {
@@ -34,8 +33,9 @@ interface TaskSendWebhookOptions {
34
33
  Ratelimit: number;
35
34
  };
36
35
  Attachments: {
36
+ Image?: string;
37
37
  Text?: string;
38
- EAS?: string;
38
+ Audio?: string;
39
39
  Json?: string;
40
40
  }
41
41
  }
@@ -52,9 +52,10 @@ export const TaskSendWebhook = async function({ Event, Webhook, Attachments }: T
52
52
  const newForm = new FormData();
53
53
  const newEmbed = {
54
54
  title: `${properties.event} (${properties.status})`,
55
- description: GetEmebedText(Event),
56
- fields: [],
55
+ description: GetEmbededText(Event),
56
+ fields: [] as { name: string, value: string }[],
57
57
  color: 16711680,
58
+ thumbnail: Attachments?.Image ? { url: `attachment://${properties.event}_${properties.status}_${properties.metadata.tracking}.png` } : undefined,
58
59
  timestamp: new Date().toISOString(),
59
60
  footer: { text: Webhook.Title ?? `AtmosphericX` }
60
61
  };
@@ -74,15 +75,21 @@ export const TaskSendWebhook = async function({ Event, Webhook, Attachments }: T
74
75
  value: attachments.map(attachment => `- [${attachment.name.length > 45 ? attachment.name.substring(0, 45) + '...' : attachment.name}](${attachment.link})`).join('\n')
75
76
  });
76
77
  }
78
+
79
+ if (Attachments?.Image) {
80
+ const file = await readFile(Attachments.Image);
81
+ newForm.append("attachmentImage", new Blob([Buffer.from(file)], {type: "image/png"}), `${properties.event}_${properties.status}_${properties.metadata.tracking}.png`)
82
+ }
83
+
77
84
  if (Attachments?.Text) {
78
- newForm.append("fUpload", new Blob([Buffer.from(Attachments.Text)], {type: "application/text"}), `${properties.event}_${properties.status}_${properties.metadata.tracking}.txt`)
85
+ newForm.append("attachmentText", new Blob([Buffer.from(Attachments.Text)], {type: "application/text"}), `${properties.event}_${properties.status}_${properties.metadata.tracking}.txt`)
79
86
  }
80
87
  if (Attachments?.Json) {
81
- newForm.append("fUpload2", new Blob([Buffer.from(Attachments.Json)], {type: "application/json"}), `${properties.event}_${properties.status}_${properties.metadata.tracking}.json`)
88
+ newForm.append("attachmentJson", new Blob([Buffer.from(Attachments.Json)], {type: "application/json"}), `${properties.event}_${properties.status}_${properties.metadata.tracking}.json`)
82
89
  }
83
- if (Attachments?.EAS) {
84
- const file = await readFile(Attachments.EAS);
85
- newForm.append("fUpload3", new Blob([Buffer.from(file)], {type: "application/wav"}), `${properties.event}_${properties.status}_${properties.metadata.tracking}.wav`)
90
+ if (Attachments?.Audio) {
91
+ const file = await readFile(Attachments.Audio);
92
+ newForm.append("attachmentAudio", new Blob([Buffer.from(file)], {type: "application/wav"}), `${properties.event}_${properties.status}_${properties.metadata.tracking}.wav`)
86
93
  }
87
94
 
88
95
  newForm.append("payload_json", JSON.stringify({
@@ -11,9 +11,9 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
@@ -32,6 +32,6 @@ export type TypeActions = {
32
32
  Priority?: string | number
33
33
  }
34
34
  Uploads?: {
35
- TEXT?: boolean, EAS?: boolean, JSON?: boolean
35
+ TEXT?: boolean, AUDIO?: boolean, JSON?: boolean, IMAGE?: boolean
36
36
  }
37
37
  }
@@ -11,9 +11,9 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
@@ -11,9 +11,9 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
@@ -0,0 +1,29 @@
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: https://atmosphericx.scriptkitty.cafe/documentation
15
+
16
+ Independent Package: @atmosx/event-product-parser
17
+
18
+ */
19
+
20
+ export type TypeNode = {
21
+ type: string
22
+ geometry: {
23
+ type: string
24
+ coordinates: number[]
25
+ }
26
+ properties: {
27
+ identifier: string
28
+ }
29
+ }
@@ -11,18 +11,20 @@
11
11
  Created with ♥ by the AtmosphericX Team (KiyoWx, StarflightWx, & CJ Ziegler)
12
12
  Discord: https://atmosphericx-discord.scriptkitty.cafe
13
13
  Ko-Fi: https://ko-fi.com/k3yomi
14
- Documentation: http://localhost/documentation | https://atmosphericx.scriptkitty.cafe/documentation
14
+ Documentation: https://atmosphericx.scriptkitty.cafe/documentation
15
15
 
16
- Internal Package: @atmosx/event-product-parser
16
+ Independent Package: @atmosx/event-product-parser
17
17
 
18
18
  */
19
19
 
20
- import { TypeActions } from "types/Actions"
20
+ import { TypeActions } from "Types/Actions"
21
21
 
22
22
  type TypeTimezones = string | "CST" | "CDT" | "MDT" | "MST" | "EST" | "EDT" | "HST" | "HDT" | "PDT" | "UTC"
23
23
 
24
24
  export type TypeSettings = {
25
+ Timezone?: TypeTimezones
25
26
  Database: string
27
+ DebugDisableAllEvents: boolean
26
28
  EnableWireService: boolean
27
29
  EnableJournal: boolean
28
30
  EnableDebugging: boolean
@@ -56,14 +58,18 @@ export type TypeSettings = {
56
58
  BroadcastifyDatabase: string
57
59
  BroadcastifyTags: string[]
58
60
  },
61
+ BoundarySettings: {
62
+ BoundaryDatabase: string
63
+ CityDatabase: string
64
+ },
59
65
  NotifyServer: {
60
66
  Enabled: boolean
61
67
  Server: string
62
- Timezone?: TypeTimezones
63
68
  MediaStorage: {
64
69
  TEXT?: string
65
70
  JSON?: string
66
- EAS?: string
71
+ AUDIO?: string
72
+ IMAGE?: string
67
73
  }
68
74
  Credentials?: {
69
75
  Username: string | void
@@ -76,7 +82,7 @@ export type TypeSettings = {
76
82
  DisableGeometryParsing: boolean
77
83
  UseShapefileCoordinates: boolean
78
84
  SPCWatchesOnly: boolean
79
- ShapefileSkipPoints: number
85
+ CensusPopulationData: boolean
80
86
  NodeTTL: number
81
87
  NodeMaxDistance: number
82
88
  EventFiltering: {
@@ -89,12 +95,15 @@ export type TypeSettings = {
89
95
  NodeLocationFiltering: boolean
90
96
  IgnoreTestProducts: boolean
91
97
  },
98
+ Themes: { Event: string, RGB: string }[]
92
99
  ArchiveSettings: {
93
100
  TTL: number
101
+ ImageDirectory: string
94
102
  JSONDirectory: string
95
103
  TextDirectory: string
96
- EasDirectory: string
97
- EasToneout: string
104
+ AudioDirectory: string
105
+ Logo: string
106
+ AudioToneout: string
98
107
  }
99
108
  }
100
109
  }