@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.
- package/.github/docs/docs-functions.md +1 -1
- package/.github/docs/docs-general-configurations.md +1 -11
- package/.github/docs/docs-integrations.md +3 -2
- package/README.md +4 -4
- package/dist/cjs/index.cjs +3590 -623
- package/dist/esm/index.mjs +3589 -624
- package/package.json +11 -4
- package/src/bootstrap.ts +50 -33
- package/src/{@building → building}/CreateEvent.ts +10 -10
- package/src/{@building → building}/GetCleanedEvent.ts +2 -2
- package/src/{@building → building}/GetEventAttachments.ts +12 -10
- package/src/building/GetEventDirection.ts +28 -0
- package/src/{@building → building}/GetEventEnhancedName.ts +5 -6
- package/src/{@building → building}/GetEventGeometry.ts +19 -13
- package/src/{@building → building}/GetEventHeader.ts +4 -4
- package/src/{@building → building}/GetEventNodes.ts +16 -14
- package/src/{@building → building}/GetEventOffice.ts +5 -5
- package/src/building/GetEventPopulation.ts +58 -0
- package/src/{@building → building}/GetEventProperties.ts +23 -18
- package/src/{@building → building}/GetEventSignature.ts +8 -8
- package/src/{@building → building}/GetEventTags.ts +3 -3
- package/src/{@core/CreateListener.ts → building/GetEventTheme.ts} +8 -6
- package/src/{@building → building}/GetEventTracking.ts +6 -6
- package/src/{@modules/@eas/GenerateEASMessage.ts → components/audio/GenerateAudioMessage.ts} +32 -33
- package/src/{@modules/@eas → components/audio/components}/GetCleanDescription.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetFloatPCM16.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetMergedPCM16.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetPCM16.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetPCMToFloat.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetSampledPCM16.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/GetTTS.ts +5 -3
- package/src/{@modules/@eas → components/audio/components}/GetWavPCM16.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/SetAFSK.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/SetAsciiToBits.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/SetAttentionTone.ts +2 -2
- package/src/{@modules/@eas → components/audio/components}/SetNoise.ts +4 -4
- package/src/{@modules/@eas → components/audio/components}/SetRadioEffect.ts +4 -4
- package/src/{@modules/@eas → components/audio/components}/SetSameHeader.ts +5 -5
- package/src/{@modules/@utilities/SetWarning.ts → components/database/CreateQuery.ts} +18 -13
- package/src/{@modules/@database → components/database}/GetCachedEvents.ts +14 -9
- package/src/components/database/ImportBoundaries.ts +168 -0
- package/src/{@modules/@database → components/database}/ImportBroadcastify.ts +8 -17
- package/src/components/database/ImportCities.ts +87 -0
- package/src/{@modules/@database → components/database}/ImportShapefiles.ts +14 -16
- package/src/{@modules/@database → components/database}/ImportStanza.ts +13 -17
- package/src/components/database/InitializeDatabase.ts +71 -0
- package/src/components/images/GenerateGraphic.ts +242 -0
- package/src/components/images/components/CreateRectangle.ts +22 -0
- package/src/components/images/components/CreateText.ts +22 -0
- package/src/components/images/modules/CreateSVG.ts +37 -0
- package/src/components/images/modules/GetGeographicalBoundaries.ts +72 -0
- package/src/components/images/modules/GetGeographicalCities.ts +58 -0
- package/src/components/images/modules/GetGeographicalEvents.ts +48 -0
- package/src/components/images/modules/GetGeometryBounds.ts +82 -0
- package/src/components/images/modules/GetParsedBoundary.ts +58 -0
- package/src/components/images/modules/GetSVGPath.ts +53 -0
- package/src/components/images/modules/NormalizePolygon.ts +57 -0
- package/src/{@modules/@stanza → components/stanza}/GetAwipsType.ts +4 -4
- package/src/{@modules/@stanza → components/stanza}/ValidateStanza.ts +6 -6
- package/src/{@modules/@utilities → components/utilities}/CreateHttp.ts +2 -2
- package/src/{@parsers/@text → components/utilities}/GetEmbededText.ts +6 -4
- package/src/{@modules/@utilities → components/utilities}/GetFormattedTime.ts +2 -2
- package/src/{@modules/@utilities → components/utilities}/GetLatestIssuance.ts +2 -2
- package/src/{@modules/@utilities → components/utilities}/GetMatched.ts +2 -2
- package/src/{@modules/@utilities → components/utilities}/GetShapeNearestPoint.ts +2 -2
- package/src/{@parsers/@text → components/utilities}/GetStringText.ts +7 -7
- package/src/components/utilities/GetUnionPolygon.ts +36 -0
- package/src/{@modules/@utilities → components/utilities}/QueueManager.ts +2 -2
- package/src/{@modules/@utilities → components/utilities}/SetCronSchedule.ts +37 -25
- package/src/{@modules/@utilities → components/utilities}/SetDebug.ts +4 -4
- package/src/{@modules/@utilities → components/utilities}/SetEventEmit.ts +8 -7
- package/src/{@modules/@utilities → components/utilities}/SetSettings.ts +4 -4
- package/src/{@modules/@utilities → components/utilities}/SetSleep.ts +2 -2
- package/src/{@modules/@utilities → components/utilities}/SetTimeoutAction.ts +3 -3
- package/src/components/utilities/SetWarning.ts +47 -0
- package/src/{@modules/@xmpp → components/xmpp}/DeployXMPP.ts +12 -12
- package/src/{@modules/@xmpp → components/xmpp}/ErrorXMPP.ts +3 -3
- package/src/{@modules/@xmpp → components/xmpp}/OfflineXMPP.ts +4 -4
- package/src/{@modules/@xmpp → components/xmpp}/OnlineXMPP.ts +5 -5
- package/src/{@modules/@xmpp → components/xmpp}/ReconnectXMPP.ts +6 -6
- package/src/{@modules/@xmpp → components/xmpp}/StanzaXMPP.ts +8 -8
- package/src/{@core → core}/ClearEvents.ts +4 -4
- package/src/{@core → core}/GetEvents.ts +3 -3
- package/src/{@core → core}/GetNodes.ts +3 -3
- package/src/{@core → core}/GetRandomEvent.ts +3 -3
- package/src/{@core → core}/GetVersion.ts +3 -3
- package/src/{@core → core}/ManualEvent.ts +6 -6
- package/src/{@core → core}/QueryStanza.ts +9 -8
- package/src/{@core → core}/SetNode.ts +5 -5
- package/src/{@core → core}/StartService.ts +13 -12
- package/src/{@core → core}/StopService.ts +3 -3
- package/src/{@enums → enums}/AWIPS.ts +2 -2
- package/src/{@enums → enums}/Actions.ts +2 -2
- package/src/{@enums → enums}/Cancellation.ts +2 -2
- package/src/{@enums → enums}/Causes.ts +2 -2
- package/src/{@enums → enums}/Correlations.ts +2 -2
- package/src/{@enums → enums}/Enhanced.ts +4 -3
- package/src/{@enums → enums}/Events.ts +2 -2
- package/src/{@enums → enums}/Expressions.ts +2 -2
- package/src/{@enums → enums}/GlobalFilter.ts +2 -2
- package/src/{@enums → enums}/Hail.ts +2 -2
- package/src/{@enums → enums}/ICAO.ts +2 -2
- package/src/{@enums → enums}/Matches.ts +8 -3
- package/src/{@enums → enums}/Products.ts +2 -2
- package/src/{@enums → enums}/Records.ts +2 -2
- package/src/{@enums → enums}/Severity.ts +2 -2
- package/src/{@enums → enums}/Shapefiles.ts +2 -2
- package/src/{@enums → enums}/States.ts +68 -4
- package/src/{@enums → enums}/Status.ts +2 -2
- package/src/{@enums → enums}/Strings.ts +2 -2
- package/src/{@enums → enums}/Tags.ts +8 -3
- package/src/{@enums → enums}/Testing.ts +2 -2
- package/src/enums/Themes.ts +70 -0
- package/src/{@events → events}/ParseAPI.ts +28 -17
- package/src/{@events → events}/ParseText.ts +13 -11
- package/src/{@events → events}/ParseUGC.ts +15 -14
- package/src/{@events → events}/ParseVTEC.ts +18 -16
- package/src/index.ts +49 -32
- package/src/{@manager → manager}/MakeEvents.ts +16 -28
- package/src/{@manager → manager}/RemoveEvent.ts +9 -9
- package/src/{@manager → manager}/SetHash.ts +5 -5
- package/src/{@manager → manager}/UpdateEvents.ts +6 -6
- package/src/{@manager → manager}/UpdateNode.ts +6 -6
- package/src/{@manager → manager}/ValidateEvents.ts +31 -20
- package/src/{@parsers/@hvtec → parsers/hvtec}/HVExtract.ts +7 -7
- package/src/{@parsers/@text → parsers/text}/GetDescriptionFromProduct.ts +3 -3
- package/src/parsers/text/GetPolygonFromProduct.ts +71 -0
- package/src/{@parsers/@text → parsers/text}/GetTextFromProduct.ts +2 -2
- package/src/{@parsers/@ugc → parsers/ugc}/GetCache.ts +4 -4
- package/src/{@parsers/@ugc → parsers/ugc}/GetExpiry.ts +2 -2
- package/src/{@parsers/@ugc → parsers/ugc}/GetHeader.ts +3 -3
- package/src/{@parsers/@ugc → parsers/ugc}/GetLocations.ts +9 -9
- package/src/parsers/ugc/GetZonePolygon.ts +73 -0
- package/src/{@parsers/@ugc → parsers/ugc}/GetZones.ts +2 -2
- package/src/{@parsers/@ugc → parsers/ugc}/SetCache.ts +4 -4
- package/src/{@parsers/@ugc → parsers/ugc}/UGCExtract.ts +9 -9
- package/src/{@parsers/@vtec → parsers/vtec}/GetExpiry.ts +2 -2
- package/src/{@parsers/@vtec → parsers/vtec}/VTECExtract.ts +9 -9
- package/src/{@types-lower → static}/Attributes.ts +2 -3
- package/src/{@types-lower → static}/Event.ts +7 -6
- package/src/{@types-lower → static}/Properties.ts +17 -4
- package/src/{@types-lower → static}/Stanza.ts +3 -3
- package/src/{@tasks → tasks}/CreateTasks.ts +40 -34
- package/src/{@tasks → tasks}/TaskGenerateJSON.ts +2 -2
- package/src/{@tasks → tasks}/TaskGenerateText.ts +2 -2
- package/src/{@tasks → tasks}/TaskSendNTFY.ts +29 -25
- package/src/{@tasks → tasks}/TaskSendWebhook.ts +22 -15
- package/src/{@types → types}/Actions.ts +3 -3
- package/src/{@types → types}/HVTEC.ts +2 -2
- package/src/{@types → types}/Hash.ts +2 -2
- package/src/types/Nodes.ts +29 -0
- package/src/{@types → types}/Settings.ts +17 -8
- package/src/{@types → types}/StanzaCompiled.ts +3 -3
- package/src/{@types → types}/UGC.ts +2 -2
- package/src/{@types → types}/VTEC.ts +2 -2
- package/tools/build.js +2 -0
- package/tsconfig.json +25 -18
- package/src/@modules/@database/InitializeDatabase.ts +0 -59
- package/src/@modules/@utilities/GetSettings.ts +0 -25
- package/src/@modules/@utilities/SetListener.ts +0 -30
- package/src/@parsers/@text/GetPolygonFromProduct.ts +0 -53
- package/src/@parsers/@text/GetXML.ts +0 -61
- package/src/@parsers/@ugc/GetZonePolygon.ts +0 -111
- package/src/@tasks/TaskGenerateAudio.ts +0 -34
|
@@ -11,18 +11,18 @@
|
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeEvent } from "
|
|
21
|
-
import { EnumCorrelations } from "@
|
|
22
|
-
import { EnumCancellation } from "@
|
|
23
|
-
import { EnumTesting} from "@
|
|
24
|
-
import { EnumProducts } from "@
|
|
25
|
-
import { EnumHail } from "@
|
|
20
|
+
import { TypeEvent } from "StaticTypes/Event"
|
|
21
|
+
import { EnumCorrelations } from "@Enums/Correlations"
|
|
22
|
+
import { EnumCancellation } from "@Enums/Cancellation"
|
|
23
|
+
import { EnumTesting} from "@Enums/Testing"
|
|
24
|
+
import { EnumProducts } from "@Enums/Products"
|
|
25
|
+
import { EnumHail } from "@Enums/Hail"
|
|
26
26
|
|
|
27
27
|
export const GetEventSignature = (event: TypeEvent): TypeEvent => {
|
|
28
28
|
const properties = event?.properties;
|
|
@@ -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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { EnumTags } from "@
|
|
20
|
+
import { EnumTags } from "@Enums/Tags"
|
|
21
21
|
|
|
22
22
|
export const GetEventTags = (message: string): string[] => {
|
|
23
23
|
if (!message) return [];
|
|
@@ -11,14 +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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import { Bootstrap } from "@Bootstrap";
|
|
21
|
+
import { EnumThemes } from "@Enums/Themes"
|
|
22
|
+
import { GetMatched } from "@Utilities/GetMatched";
|
|
21
23
|
|
|
22
|
-
export const
|
|
23
|
-
|
|
24
|
-
}
|
|
24
|
+
export const GetEventTheme = (Event: string): string => {
|
|
25
|
+
return Bootstrap.Settings.GlobalSettings.Themes.find(theme => GetMatched({Strings: [theme.Event], String: Event}))?.RGB ?? EnumThemes.find(theme => theme.Event === `Default`)?.RGB ?? `rgb(56, 72, 88)`;
|
|
26
|
+
};
|
|
@@ -11,16 +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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeAttributes } from "
|
|
21
|
-
import { TypeEventProperties } from "
|
|
22
|
-
import { TypeStanzaCompiled } from "
|
|
23
|
-
import { TypeVTEC } from "
|
|
20
|
+
import { TypeAttributes } from "StaticTypes/Attributes"
|
|
21
|
+
import { TypeEventProperties } from "StaticTypes/Properties"
|
|
22
|
+
import { TypeStanzaCompiled } from "Types/StanzaCompiled"
|
|
23
|
+
import { TypeVTEC } from "Types/VTEC"
|
|
24
24
|
|
|
25
25
|
interface GetTrackingOptions {
|
|
26
26
|
Type: `RAW` | `VTEC` | `API`
|
package/src/{@modules/@eas/GenerateEASMessage.ts → components/audio/GenerateAudioMessage.ts}
RENAMED
|
@@ -11,48 +11,47 @@
|
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeSettings } from "
|
|
21
|
-
import { Bootstrap } from "@
|
|
22
|
-
import { GetWavPCM16 } from "@
|
|
23
|
-
import { GetSampledPCM16 } from "@
|
|
24
|
-
import { SetRadioEffect } from "@
|
|
25
|
-
import { SetSameHeader } from "@
|
|
26
|
-
import { SetAttentionTone } from "@
|
|
27
|
-
import { GetMergedPCM16 } from "@
|
|
28
|
-
import { SetNoise } from "@
|
|
29
|
-
import { GetPCM16 } from "@
|
|
30
|
-
import { GetTTS } from "@
|
|
31
|
-
import { GetCleanDescription } from "@
|
|
32
|
-
import { SetWarning } from "@
|
|
33
|
-
import { SetDebug } from "@
|
|
20
|
+
import { TypeSettings } from "Types/Settings"
|
|
21
|
+
import { Bootstrap } from "@Bootstrap"
|
|
22
|
+
import { GetWavPCM16 } from "@AudioComponents/GetWavPCM16"
|
|
23
|
+
import { GetSampledPCM16 } from "@AudioComponents/GetSampledPCM16"
|
|
24
|
+
import { SetRadioEffect } from "@AudioComponents/SetRadioEffect"
|
|
25
|
+
import { SetSameHeader } from "@AudioComponents/SetSameHeader"
|
|
26
|
+
import { SetAttentionTone } from "@AudioComponents/SetAttentionTone"
|
|
27
|
+
import { GetMergedPCM16 } from "@AudioComponents/GetMergedPCM16"
|
|
28
|
+
import { SetNoise } from "@AudioComponents/SetNoise"
|
|
29
|
+
import { GetPCM16 } from "@AudioComponents/GetPCM16"
|
|
30
|
+
import { GetTTS } from "@AudioComponents/GetTTS"
|
|
31
|
+
import { GetCleanDescription } from "@AudioComponents/GetCleanDescription"
|
|
32
|
+
import { SetWarning } from "@Utilities/SetWarning"
|
|
33
|
+
import { SetDebug } from "@Utilities/SetDebug"
|
|
34
34
|
import { join } from "path"
|
|
35
35
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from "fs"
|
|
36
36
|
import { execSync } from "child_process"
|
|
37
37
|
import { platform } from "os"
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
interface GenerateEASMessageOptions {
|
|
39
|
+
interface GenerateAudioMessageOptions {
|
|
41
40
|
Message: string
|
|
42
41
|
Header: string
|
|
42
|
+
Directory?: string
|
|
43
43
|
Title: string
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export const
|
|
46
|
+
export const GenerateAudioMessage = async ({ Message, Directory, Header, Title }: GenerateAudioMessageOptions): Promise<string> => {
|
|
47
47
|
const tick = performance.now()
|
|
48
48
|
const settings = Bootstrap.Settings as TypeSettings;
|
|
49
|
-
const
|
|
50
|
-
const prefix = settings.GlobalSettings.ArchiveSettings.EasToneout;
|
|
49
|
+
const prefix = settings.GlobalSettings.ArchiveSettings.AudioToneout;
|
|
51
50
|
let title = (Title ?? `${Math.random().toString(36).substring(2, 15)}-${Header.replace(/[^a-zA-Z0-9]/g, '')}`).replace(/[\\:*?"<>|]/g, "_").replace(/\s+/g, " ").trim();
|
|
52
51
|
if (!Message || !Header) {
|
|
53
52
|
SetWarning({
|
|
54
|
-
Title: `
|
|
55
|
-
Message: `Message and header are required to generate an
|
|
53
|
+
Title: `Audio`,
|
|
54
|
+
Message: `Message and header are required to generate an audio message.`
|
|
56
55
|
})
|
|
57
56
|
return null;
|
|
58
57
|
}
|
|
@@ -60,25 +59,25 @@ export const GenerateEASMessage = async ({ Message, Header, Title }: GenerateEAS
|
|
|
60
59
|
let buffRadio: any;
|
|
61
60
|
let buffFull: any[] = [];
|
|
62
61
|
|
|
63
|
-
if (!
|
|
62
|
+
if (!Directory) {
|
|
64
63
|
SetWarning({
|
|
65
|
-
Title: `
|
|
66
|
-
Message: `
|
|
64
|
+
Title: `Audio`,
|
|
65
|
+
Message: `Audio directory is not set in the settings. Please set it to generate audio messages.`
|
|
67
66
|
});
|
|
68
67
|
return null;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
if (!existsSync(
|
|
72
|
-
mkdirSync(
|
|
70
|
+
if (!existsSync(Directory)) {
|
|
71
|
+
mkdirSync(Directory, { recursive: true });
|
|
73
72
|
}
|
|
74
|
-
const tmpTTS = join(
|
|
75
|
-
const outTTS = join(
|
|
73
|
+
const tmpTTS = join(Directory, `/${title}-tts.wav`)
|
|
74
|
+
const outTTS = join(Directory, `/${title}.wav`)
|
|
76
75
|
const vPlatform = platform();
|
|
77
76
|
|
|
78
77
|
if (vPlatform === 'darwin') {
|
|
79
78
|
SetWarning({
|
|
80
|
-
Title: `
|
|
81
|
-
Message: `
|
|
79
|
+
Title: `Audio`,
|
|
80
|
+
Message: `Audio tone generation is not supported on macOS.`
|
|
82
81
|
});
|
|
83
82
|
return null
|
|
84
83
|
}
|
|
@@ -104,7 +103,7 @@ export const GenerateEASMessage = async ({ Message, Header, Title }: GenerateEAS
|
|
|
104
103
|
|
|
105
104
|
if (tWav == null) {
|
|
106
105
|
try {
|
|
107
|
-
const converted = join(
|
|
106
|
+
const converted = join(Directory, `/${title}-tts-fixed.wav`)
|
|
108
107
|
execSync(`ffmpeg -y -i "${prefix}" -ar 8000 -ac 1 -sample_fmt s16 "${converted}"`, { stdio: 'ignore' })
|
|
109
108
|
if (existsSync(converted)) {
|
|
110
109
|
tBuffer = readFileSync(converted)
|
|
@@ -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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
*/
|
|
@@ -11,17 +11,18 @@
|
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import { platform } from "os"
|
|
22
|
-
import { writeFileSync } from "fs"
|
|
22
|
+
import { writeFileSync, unlinkSync} from "fs"
|
|
23
23
|
import { execSync } from "child_process"
|
|
24
24
|
|
|
25
|
+
|
|
25
26
|
interface GetTTSOptions {
|
|
26
27
|
Text: string
|
|
27
28
|
OutputPath: string
|
|
@@ -43,6 +44,7 @@ export const GetTTS = async ({ Text, OutputPath }: GetTTSOptions): Promise<void>
|
|
|
43
44
|
`$speak.Dispose();`
|
|
44
45
|
].join(" ");
|
|
45
46
|
execSync(`powershell -Command "${command}"`, { stdio: 'inherit' })
|
|
47
|
+
try{ unlinkSync(txtPath) } catch {}
|
|
46
48
|
} catch(error) {
|
|
47
49
|
console.error('Error occurred while generating TTS:', error);
|
|
48
50
|
}
|
|
@@ -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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
*/
|
|
@@ -11,15 +11,15 @@
|
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { GetPCMToFloat } from "@
|
|
22
|
-
import { GetFloatPCM16 } from "@
|
|
21
|
+
import { GetPCMToFloat } from "@AudioComponents/GetPCMToFloat"
|
|
22
|
+
import { GetFloatPCM16 } from "@AudioComponents/GetFloatPCM16"
|
|
23
23
|
|
|
24
24
|
interface SetNoiseOptions {
|
|
25
25
|
Int16: Int16Array
|
|
@@ -11,15 +11,15 @@
|
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { GetPCMToFloat } from "@
|
|
22
|
-
import { GetFloatPCM16 } from "@
|
|
21
|
+
import { GetPCMToFloat } from "@AudioComponents/GetPCMToFloat"
|
|
22
|
+
import { GetFloatPCM16 } from "@AudioComponents/GetFloatPCM16"
|
|
23
23
|
|
|
24
24
|
interface SetRadioEffectOptions {
|
|
25
25
|
Int16: Int16Array
|
|
@@ -11,16 +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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { SetAFSK } from "@
|
|
22
|
-
import { SetAsciiToBits } from "@
|
|
23
|
-
import { GetMergedPCM16 } from "@
|
|
21
|
+
import { SetAFSK } from "@AudioComponents/SetAFSK"
|
|
22
|
+
import { SetAsciiToBits } from "@AudioComponents/SetAsciiToBits"
|
|
23
|
+
import { GetMergedPCM16 } from "@AudioComponents/GetMergedPCM16"
|
|
24
24
|
|
|
25
25
|
interface SetSameHeaderOptions {
|
|
26
26
|
VTEC: string
|
|
@@ -11,24 +11,29 @@
|
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { Bootstrap } from "@
|
|
21
|
-
import {
|
|
20
|
+
import { Bootstrap } from "@Bootstrap"
|
|
21
|
+
import { SetWarning } from "@Utilities/SetWarning"
|
|
22
22
|
|
|
23
|
-
interface
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
interface CreateQueryOptions {
|
|
24
|
+
Query: string
|
|
25
|
+
Parameters?: unknown[]
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
export const CreateQuery = function({ Query, Parameters }: CreateQueryOptions): any {
|
|
29
|
+
try {
|
|
30
|
+
const parameters = Array.isArray(Parameters) ? Parameters : [];
|
|
31
|
+
const statement = Bootstrap.Database.prepare(Query);
|
|
32
|
+
return /^\s*select/i.test(Query)
|
|
33
|
+
? statement.all(...parameters)
|
|
34
|
+
: statement.run(...parameters);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
SetWarning({Message: `Database Query Error: ${error instanceof Error ? error.stack ?? error.message : String(error)}`})
|
|
37
|
+
throw error;
|
|
33
38
|
}
|
|
34
|
-
}
|
|
39
|
+
};
|
|
@@ -11,16 +11,17 @@
|
|
|
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:
|
|
14
|
+
Documentation: https://atmosphericx.scriptkitty.cafe/documentation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Independent Package: @atmosx/event-product-parser
|
|
17
17
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { TypeSettings } from "
|
|
21
|
-
import { Bootstrap } from "@
|
|
22
|
-
import { SetWarning } from "@
|
|
23
|
-
import { CreateEvent } from "@
|
|
20
|
+
import { TypeSettings } from "Types/Settings"
|
|
21
|
+
import { Bootstrap } from "@Bootstrap"
|
|
22
|
+
import { SetWarning } from "@Utilities/SetWarning"
|
|
23
|
+
import { CreateEvent } from "@Building/CreateEvent"
|
|
24
|
+
import { CreateQuery } from "@Database/CreateQuery"
|
|
24
25
|
|
|
25
26
|
export const GetCachedEvents = async (): Promise<void> => {
|
|
26
27
|
try {
|
|
@@ -28,7 +29,10 @@ export const GetCachedEvents = async (): Promise<void> => {
|
|
|
28
29
|
const tick = performance.now();
|
|
29
30
|
if (settings.NOAAWeatherWireServiceSettings.CacheSettings.Enabled) {
|
|
30
31
|
const max = settings.NOAAWeatherWireServiceSettings.CacheSettings.MaxRetentionHistory ?? 500;
|
|
31
|
-
const get = await
|
|
32
|
+
const get = await CreateQuery({
|
|
33
|
+
Query: `SELECT * FROM stanzas ORDER BY rowid DESC LIMIT ?`,
|
|
34
|
+
Parameters: [max]
|
|
35
|
+
}) as { rowid: number; stanza: string }[];
|
|
32
36
|
SetWarning({ Message: `Fetched ${get.length} cached stanzas from the database in ${Math.floor(performance.now() - tick)} ms` })
|
|
33
37
|
let events = get.map((row) => JSON.parse(row.stanza))
|
|
34
38
|
.filter(stanza => {
|
|
@@ -42,7 +46,8 @@ export const GetCachedEvents = async (): Promise<void> => {
|
|
|
42
46
|
await Promise.all(events.map(event => CreateEvent(event)))
|
|
43
47
|
SetWarning({ Message: `Processed ${events.length} cached stanzas in ${Math.floor(performance.now() - tick)} ms` })
|
|
44
48
|
}
|
|
45
|
-
} catch (error) {
|
|
46
|
-
|
|
49
|
+
} catch (error: unknown) {
|
|
50
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
51
|
+
SetWarning({ Message: `An error occurred while fetching cached stanzas: ${message}` })
|
|
47
52
|
}
|
|
48
53
|
}
|