@atmosx/event-product-parser 3.0.3 → 3.0.4
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/README.md +11 -1
- package/dist/cjs/index.cjs +8 -7
- package/dist/esm/index.mjs +8 -7
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +5 -3
- package/src/@core/core.start.ts +2 -2
- package/src/@manager/manager.mkEvent.ts +2 -1
- package/src/@modules/@utilities/utilities.setWarning.ts +2 -2
- package/src/index.ts +2 -2
package/README.md
CHANGED
|
@@ -153,6 +153,17 @@ const Client = new Manager({
|
|
|
153
153
|
|
|
154
154
|
## Events and Listeners
|
|
155
155
|
|
|
156
|
+
### Event `*`
|
|
157
|
+
Triggers for every event and product received by the parser. This is useful if you want to handle all events with a single listener.
|
|
158
|
+
```ts
|
|
159
|
+
Client.on(`*`, (data: any) => {
|
|
160
|
+
/*
|
|
161
|
+
event: string
|
|
162
|
+
data: object
|
|
163
|
+
*/
|
|
164
|
+
})
|
|
165
|
+
```
|
|
166
|
+
|
|
156
167
|
### Event `onServiceStatus`
|
|
157
168
|
Triggers when an update to the XMPP / API service status occurs.
|
|
158
169
|
```ts
|
|
@@ -333,7 +344,6 @@ await setEasTone(event.properties.description, event.properties.metadata.header)
|
|
|
333
344
|
[Contributing](/CONTRIBUTING.md) |
|
|
334
345
|
[License](/LICENSE) |
|
|
335
346
|
[Security](/SECURITY.md) |
|
|
336
|
-
[Changelogs](/CHANGELOGS.md) |
|
|
337
347
|
|
|
338
348
|
## Acknowledgements
|
|
339
349
|
- [k3yomi](https://github.com/k3yomi)
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -10762,9 +10762,9 @@ var setTimeoutAction = (options) => {
|
|
|
10762
10762
|
var setWarning = (options) => {
|
|
10763
10763
|
var _a, _b;
|
|
10764
10764
|
const settings = bootstrap.settings;
|
|
10765
|
-
bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}
|
|
10765
|
+
bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
|
|
10766
10766
|
if (settings.EnableJournal) {
|
|
10767
|
-
console.log(`${(_b = options.title) != null ? _b : `[${bootstrap.ansi_colors.YELLOW}
|
|
10767
|
+
console.log(`${(_b = options.title) != null ? _b : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
|
|
10768
10768
|
}
|
|
10769
10769
|
};
|
|
10770
10770
|
|
|
@@ -15132,12 +15132,13 @@ var mkEvent = (event) => __async(null, null, function* () {
|
|
|
15132
15132
|
})
|
|
15133
15133
|
})
|
|
15134
15134
|
});
|
|
15135
|
+
updateWebhooks(bootstrap.cache.events.features[getIndex]);
|
|
15135
15136
|
} else {
|
|
15136
15137
|
features.push(event);
|
|
15138
|
+
updateWebhooks(event);
|
|
15137
15139
|
}
|
|
15138
15140
|
}
|
|
15139
15141
|
}
|
|
15140
|
-
updateWebhooks(event);
|
|
15141
15142
|
});
|
|
15142
15143
|
|
|
15143
15144
|
// src/@manager/manager.rmEvent.ts
|
|
@@ -16148,13 +16149,13 @@ var updateEvents = (selectedEvent) => __async(null, null, function* () {
|
|
|
16148
16149
|
|
|
16149
16150
|
// src/@core/core.start.ts
|
|
16150
16151
|
var import_croner = require("croner");
|
|
16151
|
-
var startService = (
|
|
16152
|
+
var startService = (configurations) => __async(null, null, function* () {
|
|
16152
16153
|
if (!bootstrap.isReady) {
|
|
16153
16154
|
return setWarning({
|
|
16154
16155
|
message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
|
|
16155
16156
|
});
|
|
16156
16157
|
}
|
|
16157
|
-
setSettings(
|
|
16158
|
+
const settings = setSettings(configurations);
|
|
16158
16159
|
bootstrap.isReady = true;
|
|
16159
16160
|
yield initializeDatabase();
|
|
16160
16161
|
if (settings.EnableWireService) {
|
|
@@ -16674,12 +16675,12 @@ var Manager = class {
|
|
|
16674
16675
|
trycatch() {
|
|
16675
16676
|
process.on("uncaughtException", (err) => {
|
|
16676
16677
|
var _a;
|
|
16677
|
-
const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "STARTTLS_FAILURE"];
|
|
16678
|
+
const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND", "ECONNREFUSED", "EPIPE", "EADDRINUSE", "EALREADY", "EACCES", "EAGAIN", "EHOSTDOWN", "STARTTLS_FAILURE"];
|
|
16678
16679
|
if (ignored.includes(err == null ? void 0 : err.code)) {
|
|
16679
16680
|
setEventEmit({
|
|
16680
16681
|
event: `onServiceStatus`,
|
|
16681
16682
|
metadata: {
|
|
16682
|
-
message: `
|
|
16683
|
+
message: `Ignored Critical Error: ${(_a = err == null ? void 0 : err.code) != null ? _a : "Unknown error code"}. This may indicate a connection issue. Attempting to continue...`,
|
|
16683
16684
|
data: {},
|
|
16684
16685
|
type: `error`,
|
|
16685
16686
|
error: true
|
package/dist/esm/index.mjs
CHANGED
|
@@ -10744,9 +10744,9 @@ var setTimeoutAction = (options) => {
|
|
|
10744
10744
|
var setWarning = (options) => {
|
|
10745
10745
|
var _a, _b;
|
|
10746
10746
|
const settings = bootstrap.settings;
|
|
10747
|
-
bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}
|
|
10747
|
+
bootstrap.listener.emit(`log`, `${(_a = options.title) != null ? _a : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
|
|
10748
10748
|
if (settings.EnableJournal) {
|
|
10749
|
-
console.log(`${(_b = options.title) != null ? _b : `[${bootstrap.ansi_colors.YELLOW}
|
|
10749
|
+
console.log(`${(_b = options.title) != null ? _b : `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`);
|
|
10750
10750
|
}
|
|
10751
10751
|
};
|
|
10752
10752
|
|
|
@@ -15114,12 +15114,13 @@ var mkEvent = (event) => __async(null, null, function* () {
|
|
|
15114
15114
|
})
|
|
15115
15115
|
})
|
|
15116
15116
|
});
|
|
15117
|
+
updateWebhooks(bootstrap.cache.events.features[getIndex]);
|
|
15117
15118
|
} else {
|
|
15118
15119
|
features.push(event);
|
|
15120
|
+
updateWebhooks(event);
|
|
15119
15121
|
}
|
|
15120
15122
|
}
|
|
15121
15123
|
}
|
|
15122
|
-
updateWebhooks(event);
|
|
15123
15124
|
});
|
|
15124
15125
|
|
|
15125
15126
|
// src/@manager/manager.rmEvent.ts
|
|
@@ -16130,13 +16131,13 @@ var updateEvents = (selectedEvent) => __async(null, null, function* () {
|
|
|
16130
16131
|
|
|
16131
16132
|
// src/@core/core.start.ts
|
|
16132
16133
|
import { Cron } from "croner";
|
|
16133
|
-
var startService = (
|
|
16134
|
+
var startService = (configurations) => __async(null, null, function* () {
|
|
16134
16135
|
if (!bootstrap.isReady) {
|
|
16135
16136
|
return setWarning({
|
|
16136
16137
|
message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
|
|
16137
16138
|
});
|
|
16138
16139
|
}
|
|
16139
|
-
setSettings(
|
|
16140
|
+
const settings = setSettings(configurations);
|
|
16140
16141
|
bootstrap.isReady = true;
|
|
16141
16142
|
yield initializeDatabase();
|
|
16142
16143
|
if (settings.EnableWireService) {
|
|
@@ -16656,12 +16657,12 @@ var Manager = class {
|
|
|
16656
16657
|
trycatch() {
|
|
16657
16658
|
process.on("uncaughtException", (err) => {
|
|
16658
16659
|
var _a;
|
|
16659
|
-
const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "STARTTLS_FAILURE"];
|
|
16660
|
+
const ignored = ["ETIMEDOUT", "ECONNRESET", "EHOSTUNREACH", "ENOTFOUND", "ECONNREFUSED", "EPIPE", "EADDRINUSE", "EALREADY", "EACCES", "EAGAIN", "EHOSTDOWN", "STARTTLS_FAILURE"];
|
|
16660
16661
|
if (ignored.includes(err == null ? void 0 : err.code)) {
|
|
16661
16662
|
setEventEmit({
|
|
16662
16663
|
event: `onServiceStatus`,
|
|
16663
16664
|
metadata: {
|
|
16664
|
-
message: `
|
|
16665
|
+
message: `Ignored Critical Error: ${(_a = err == null ? void 0 : err.code) != null ? _a : "Unknown error code"}. This may indicate a connection issue. Attempting to continue...`,
|
|
16665
16666
|
data: {},
|
|
16666
16667
|
type: `error`,
|
|
16667
16668
|
error: true
|
package/dist/index.d.mts
CHANGED
|
@@ -202,7 +202,7 @@ declare const getEventGeometry: (event: TypeEvent) => Promise<GetGeometryRespons
|
|
|
202
202
|
|
|
203
203
|
declare const getCleanedEvent: <T extends Record<string, any>>(event: T) => T;
|
|
204
204
|
|
|
205
|
-
declare const startService: (
|
|
205
|
+
declare const startService: (configurations: TypeSettings) => Promise<void>;
|
|
206
206
|
|
|
207
207
|
declare const stopService: () => Promise<void>;
|
|
208
208
|
|
package/dist/index.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ declare const getEventGeometry: (event: TypeEvent) => Promise<GetGeometryRespons
|
|
|
202
202
|
|
|
203
203
|
declare const getCleanedEvent: <T extends Record<string, any>>(event: T) => T;
|
|
204
204
|
|
|
205
|
-
declare const startService: (
|
|
205
|
+
declare const startService: (configurations: TypeSettings) => Promise<void>;
|
|
206
206
|
|
|
207
207
|
declare const stopService: () => Promise<void>;
|
|
208
208
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atmosx/event-product-parser",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "NOAA Weather Wire & NWS API Parser - Built for standalone and Project AtmosphericX Integration.",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -33,12 +33,14 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/AtmosphericX/event-product-parser#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"express-ws": "5.0.2",
|
|
37
|
+
"express": "5.2.1",
|
|
36
38
|
"@xmpp/client": "0.14.0",
|
|
37
|
-
"better-sqlite3": "12.
|
|
39
|
+
"better-sqlite3": "12.9.0",
|
|
38
40
|
"croner": "10.0.1",
|
|
39
41
|
"jszip": "3.10.1",
|
|
40
42
|
"polygon-clipping": "0.15.7",
|
|
41
|
-
"request": "
|
|
43
|
+
"request": "2.88.2",
|
|
42
44
|
"say": "0.16.0",
|
|
43
45
|
"shapefile": "0.6.6",
|
|
44
46
|
"typescript": "5.9.3",
|
package/src/@core/core.start.ts
CHANGED
|
@@ -29,13 +29,13 @@ import { updateNode } from "../@manager/manager.updateNodes";
|
|
|
29
29
|
import { updateEvents } from "../@manager/manager.updateEvents";
|
|
30
30
|
import { Cron } from "croner";
|
|
31
31
|
|
|
32
|
-
export const startService = async (
|
|
32
|
+
export const startService = async (configurations: TypeSettings): Promise<void> => {
|
|
33
33
|
if (!bootstrap.isReady) {
|
|
34
34
|
return setWarning({
|
|
35
35
|
message: `You can not create another instance without shutting down the current one first, please make sure to call the stop() method first!`
|
|
36
36
|
})
|
|
37
37
|
}
|
|
38
|
-
setSettings(
|
|
38
|
+
const settings = setSettings(configurations);
|
|
39
39
|
bootstrap.isReady = true;
|
|
40
40
|
await initializeDatabase();
|
|
41
41
|
if (settings.EnableWireService) {
|
|
@@ -86,10 +86,11 @@ export const mkEvent = async (event: TypeEvent): Promise<void> => {
|
|
|
86
86
|
},
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
+
updateWebhooks(bootstrap.cache.events.features[getIndex])
|
|
89
90
|
} else {
|
|
90
91
|
features.push(event)
|
|
92
|
+
updateWebhooks(event)
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
|
-
updateWebhooks(event)
|
|
95
96
|
}
|
|
@@ -27,8 +27,8 @@ interface SetWarningOptions {
|
|
|
27
27
|
|
|
28
28
|
export const setWarning = (options: SetWarningOptions): void => {
|
|
29
29
|
const settings = bootstrap.settings as TypeSettings;
|
|
30
|
-
bootstrap.listener.emit(`log`, `${options.title ?? `[${bootstrap.ansi_colors.YELLOW}
|
|
30
|
+
bootstrap.listener.emit(`log`, `${options.title ?? `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`)
|
|
31
31
|
if (settings.EnableJournal) {
|
|
32
|
-
console.log(`${options.title ?? `[${bootstrap.ansi_colors.YELLOW}
|
|
32
|
+
console.log(`${options.title ?? `[${bootstrap.ansi_colors.YELLOW}@atmosx/product-parser${bootstrap.ansi_colors.RESET}]`} ${options.message}`)
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -42,12 +42,12 @@ export class Manager {
|
|
|
42
42
|
|
|
43
43
|
trycatch() {
|
|
44
44
|
process.on('uncaughtException', (err: any) => {
|
|
45
|
-
const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'STARTTLS_FAILURE'];
|
|
45
|
+
const ignored = ['ETIMEDOUT', 'ECONNRESET', 'EHOSTUNREACH', 'ENOTFOUND', 'ECONNREFUSED', 'EPIPE', 'EADDRINUSE', 'EALREADY', 'EACCES', 'EAGAIN', 'EHOSTDOWN', 'STARTTLS_FAILURE'];
|
|
46
46
|
if (ignored.includes(err?.code)) {
|
|
47
47
|
setEventEmit({
|
|
48
48
|
event: `onServiceStatus`,
|
|
49
49
|
metadata: {
|
|
50
|
-
message: `
|
|
50
|
+
message: `Ignored Critical Error: ${err?.code ?? 'Unknown error code'}. This may indicate a connection issue. Attempting to continue...`,
|
|
51
51
|
data: {},
|
|
52
52
|
type: `error`,
|
|
53
53
|
error: true
|