atmosx-nwws-parser 1.0.1919 → 1.0.1921
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/dist/{helper.js → cjs/helper.cjs} +1 -1
- package/dist/{helper.mjs → esm/helper.mjs} +1 -1
- package/package.json +44 -43
- package/src/helper.ts +1 -1
- package/tsconfig.json +12 -12
- package/tsup.config.ts +12 -8
- package/dist/events.d.mts +0 -97
- package/dist/events.d.ts +0 -97
- package/dist/events.js +0 -971
- package/dist/events.mjs +0 -936
- package/dist/helper.d.mts +0 -88
- package/dist/helper.d.ts +0 -88
- package/dist/stanza.d.mts +0 -63
- package/dist/stanza.d.ts +0 -63
- package/dist/stanza.js +0 -1067
- package/dist/stanza.mjs +0 -1032
- package/dist/text-parser.d.mts +0 -35
- package/dist/text-parser.d.ts +0 -35
- package/dist/text-parser.js +0 -128
- package/dist/text-parser.mjs +0 -104
- package/dist/ugc.d.mts +0 -44
- package/dist/ugc.d.ts +0 -44
- package/dist/ugc.js +0 -300
- package/dist/ugc.mjs +0 -265
- package/dist/vtec.d.mts +0 -40
- package/dist/vtec.d.ts +0 -40
- package/dist/vtec.js +0 -240
- package/dist/vtec.mjs +0 -204
|
@@ -1083,7 +1083,7 @@ var AtmosXWireParser = class {
|
|
|
1083
1083
|
const shapefiles = [{ id: `C`, file: `USCounties` }, { id: `Z`, file: `ForecastZones` }, { id: `Z`, file: `FireZones` }, { id: `Z`, file: `OffShoreZones` }, { id: `Z`, file: `FireCounties` }, { id: `Z`, file: `Marine` }];
|
|
1084
1084
|
for (let shape of shapefiles) {
|
|
1085
1085
|
const { id, file } = shape;
|
|
1086
|
-
const filepath = path2.
|
|
1086
|
+
const filepath = path2.resolve(__dirname, "../../shapefiles", `${file}`);
|
|
1087
1087
|
const { features } = yield shapefile2.read(filepath, filepath);
|
|
1088
1088
|
console.log(`Importing ${features.length} features from ${file}...`);
|
|
1089
1089
|
for (let feature of features) {
|
|
@@ -1048,7 +1048,7 @@ var AtmosXWireParser = class {
|
|
|
1048
1048
|
const shapefiles = [{ id: `C`, file: `USCounties` }, { id: `Z`, file: `ForecastZones` }, { id: `Z`, file: `FireZones` }, { id: `Z`, file: `OffShoreZones` }, { id: `Z`, file: `FireCounties` }, { id: `Z`, file: `Marine` }];
|
|
1049
1049
|
for (let shape of shapefiles) {
|
|
1050
1050
|
const { id, file } = shape;
|
|
1051
|
-
const filepath = path2.
|
|
1051
|
+
const filepath = path2.resolve(__dirname, "../../shapefiles", `${file}`);
|
|
1052
1052
|
const { features } = yield shapefile2.read(filepath, filepath);
|
|
1053
1053
|
console.log(`Importing ${features.length} features from ${file}...`);
|
|
1054
1054
|
for (let feature of features) {
|
package/package.json
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "atmosx-nwws-parser",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "NOAA Weather Wire Parser - Built for standalone and Project AtmosphericX Integration.",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/K3YOMI/atmosx-nwws-parser.git"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "atmosx-nwws-parser",
|
|
3
|
+
"version": "1.0.1921",
|
|
4
|
+
"description": "NOAA Weather Wire Parser - Built for standalone and Project AtmosphericX Integration.",
|
|
5
|
+
"main": "dist/cjs/helper.cjs",
|
|
6
|
+
"module": "dist/esm/helper.mjs",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/K3YOMI/atmosx-nwws-parser.git"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "cd ./test && node ./index.js",
|
|
13
|
+
"build:tsup": "tsup && cd ./test && node ./index.js",
|
|
14
|
+
"publish": "tsup && npm publish --access public",
|
|
15
|
+
"publish-beta": "tsup && npm publish --tag beta --access public"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"NWWS",
|
|
19
|
+
"NOAA Weather Wire Service",
|
|
20
|
+
"TypeScript",
|
|
21
|
+
"XMPP",
|
|
22
|
+
"Parser",
|
|
23
|
+
"JavaScript",
|
|
24
|
+
"CommonJS",
|
|
25
|
+
"ESM"
|
|
26
|
+
],
|
|
27
|
+
"author": "k3yomi, StarflightWx",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/K3YOMI/atmosx-nwws-parser/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/K3YOMI/atmosx-nwws-parser#readme",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@xmpp/client": "^0.7.3",
|
|
35
|
+
"better-sqlite3": "^11.10.0",
|
|
36
|
+
"shapefile": "^0.6.6",
|
|
37
|
+
"typescript": "^5.9.2",
|
|
38
|
+
"xml2js": "^0.6.2"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^24.5.2",
|
|
42
|
+
"tsup": "^8.5.0"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/src/helper.ts
CHANGED
|
@@ -49,7 +49,7 @@ export class AtmosXWireParser {
|
|
|
49
49
|
const shapefiles = [{ id: `C`, file: `USCounties` }, { id: `Z`, file: `ForecastZones` }, { id: `Z`, file: `FireZones` }, { id: `Z`, file: `OffShoreZones` }, { id: `Z`, file: `FireCounties` }, { id: `Z`, file: `Marine` }]
|
|
50
50
|
for (let shape of shapefiles) {
|
|
51
51
|
const { id, file } = shape;
|
|
52
|
-
const filepath = path.
|
|
52
|
+
const filepath = path.resolve(__dirname, '../../shapefiles', `${file}`);
|
|
53
53
|
const { features } = await shapefile.read(filepath, filepath);
|
|
54
54
|
console.log(`Importing ${features.length} features from ${file}...`);
|
|
55
55
|
for (let feature of features) {
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES6",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Node",
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationDir": "dist/types",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"skipLibCheck": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
14
|
}
|
package/tsup.config.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
4
|
+
entry: ['src/helper.ts'],
|
|
5
|
+
outDir: 'dist',
|
|
6
|
+
format: ['esm', 'cjs'],
|
|
7
|
+
clean: true,
|
|
8
|
+
outExtension({ format }) {
|
|
9
|
+
return { js: format === 'esm' ? '.mjs' : '.cjs' }
|
|
10
|
+
},
|
|
11
|
+
esbuildOptions(options, context) {
|
|
12
|
+
options.outdir = `dist/${context.format}`
|
|
13
|
+
},
|
|
14
|
+
})
|
package/dist/events.d.mts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
declare class mEvents {
|
|
2
|
-
/**
|
|
3
|
-
* @function onEnhanced
|
|
4
|
-
* @description Enhances the event name and tags of an alert object based on its description and parameters.
|
|
5
|
-
*
|
|
6
|
-
* @param {Object} event - The alert object to be enhanced.
|
|
7
|
-
* @return {Object} - The enhanced alert object with updated event name and tags.
|
|
8
|
-
* @example
|
|
9
|
-
* Severe Thunderstorm Warning with "Considerable" damage threat becomes "Considerable Severe Thunderstorm Warning"
|
|
10
|
-
*/
|
|
11
|
-
static onEnhanced(event: any): {
|
|
12
|
-
eventName: string;
|
|
13
|
-
tags: string[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* @function onFinished
|
|
17
|
-
* @description Processes and filters alert objects before emitting the 'onAlert' event. Based on settings, it can enhance event names, filter alerts, and check for expiry.
|
|
18
|
-
*
|
|
19
|
-
* @param {Array} alerts - An array of alert objects to be processed.
|
|
20
|
-
*
|
|
21
|
-
* @emits onAlert - Emitted when alerts are processed and ready.
|
|
22
|
-
*/
|
|
23
|
-
static onFinished(alerts: any): void;
|
|
24
|
-
/**
|
|
25
|
-
* @function newCapAlerts
|
|
26
|
-
* @description Emits the 'onAlert' event with parsed CAP alert objects. (XML Format)
|
|
27
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
28
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
29
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
30
|
-
*
|
|
31
|
-
* @param {Object} stanza - The XMPP stanza containing the CAP alert message.
|
|
32
|
-
*
|
|
33
|
-
* @emits onAlert - Emitted when a new CAP alert is received and parsed.
|
|
34
|
-
*/
|
|
35
|
-
static newCapAlerts(stanza: any): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* @function newRawAlerts
|
|
38
|
-
* @description Emits the 'onAlert' event with parsed raw alert objects.
|
|
39
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
40
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
41
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
42
|
-
*
|
|
43
|
-
* @param {Object} stanza - The XMPP stanza containing the raw alert message.
|
|
44
|
-
*
|
|
45
|
-
* @emits onAlert - Emitted when a new raw alert is received and parsed.
|
|
46
|
-
*/
|
|
47
|
-
static newRawAlerts(stanza: any): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* @function newUnknownAlert
|
|
50
|
-
* @description Emits the 'onAlert' event with parsed unknown alert objects. (Non-CAP, Non-VTEC)
|
|
51
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
52
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
53
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
54
|
-
*
|
|
55
|
-
* @param {Object} stanza - The XMPP stanza containing the raw alert message.
|
|
56
|
-
*
|
|
57
|
-
* @emits onAlert - Emitted when a new raw alert is received and parsed.
|
|
58
|
-
*/
|
|
59
|
-
static newUnknownAlert(stanza: any): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* @function newSpecialWeatherStatement
|
|
62
|
-
* @description Emits the 'onAlert' event with parsed special weather statement alert objects.
|
|
63
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
64
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
65
|
-
*
|
|
66
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
67
|
-
*
|
|
68
|
-
* @param {Object} stanza - The XMPP stanza containing the special weather statement message.
|
|
69
|
-
*
|
|
70
|
-
* @emits onAlert - Emitted when a new special weather statement is received and parsed.
|
|
71
|
-
*/
|
|
72
|
-
static newSpecialWeatherStatement(stanza: any): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* @function newMesoscaleDiscussion
|
|
75
|
-
* @description Emits the 'onMesoscaleDiscussion' event with a parsed mesoscale discussion alert object.
|
|
76
|
-
* The alert object contains various properties such as id, tracking, action, area description, expiration time,
|
|
77
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
78
|
-
* tornado intensity probability, peak wind gust, and peak hail size.
|
|
79
|
-
*
|
|
80
|
-
* @param {Object} stanza - The XMPP stanza containing the mesoscale discussion message.
|
|
81
|
-
*
|
|
82
|
-
* @emits onMesoscaleDiscussion - Emitted when a new mesoscale discussion is received and parsed.
|
|
83
|
-
*/
|
|
84
|
-
static newMesoscaleDiscussion(stanza: any): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* @function newLocalStormReport
|
|
87
|
-
* @description Emits the 'onLocalStormReport' event with the cleaned description of a local storm report. No other additional parsing is
|
|
88
|
-
* done at this time at least.
|
|
89
|
-
*
|
|
90
|
-
* @param {Object} stanza - The XMPP stanza containing the local storm report message.
|
|
91
|
-
*
|
|
92
|
-
* @emits onLocalStormReport - Emitted when a new local storm report is received and parsed.
|
|
93
|
-
*/
|
|
94
|
-
static newLocalStormReport(stanza: any): Promise<void>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export { mEvents as default, mEvents };
|
package/dist/events.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
declare class mEvents {
|
|
2
|
-
/**
|
|
3
|
-
* @function onEnhanced
|
|
4
|
-
* @description Enhances the event name and tags of an alert object based on its description and parameters.
|
|
5
|
-
*
|
|
6
|
-
* @param {Object} event - The alert object to be enhanced.
|
|
7
|
-
* @return {Object} - The enhanced alert object with updated event name and tags.
|
|
8
|
-
* @example
|
|
9
|
-
* Severe Thunderstorm Warning with "Considerable" damage threat becomes "Considerable Severe Thunderstorm Warning"
|
|
10
|
-
*/
|
|
11
|
-
static onEnhanced(event: any): {
|
|
12
|
-
eventName: string;
|
|
13
|
-
tags: string[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* @function onFinished
|
|
17
|
-
* @description Processes and filters alert objects before emitting the 'onAlert' event. Based on settings, it can enhance event names, filter alerts, and check for expiry.
|
|
18
|
-
*
|
|
19
|
-
* @param {Array} alerts - An array of alert objects to be processed.
|
|
20
|
-
*
|
|
21
|
-
* @emits onAlert - Emitted when alerts are processed and ready.
|
|
22
|
-
*/
|
|
23
|
-
static onFinished(alerts: any): void;
|
|
24
|
-
/**
|
|
25
|
-
* @function newCapAlerts
|
|
26
|
-
* @description Emits the 'onAlert' event with parsed CAP alert objects. (XML Format)
|
|
27
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
28
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
29
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
30
|
-
*
|
|
31
|
-
* @param {Object} stanza - The XMPP stanza containing the CAP alert message.
|
|
32
|
-
*
|
|
33
|
-
* @emits onAlert - Emitted when a new CAP alert is received and parsed.
|
|
34
|
-
*/
|
|
35
|
-
static newCapAlerts(stanza: any): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* @function newRawAlerts
|
|
38
|
-
* @description Emits the 'onAlert' event with parsed raw alert objects.
|
|
39
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
40
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
41
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
42
|
-
*
|
|
43
|
-
* @param {Object} stanza - The XMPP stanza containing the raw alert message.
|
|
44
|
-
*
|
|
45
|
-
* @emits onAlert - Emitted when a new raw alert is received and parsed.
|
|
46
|
-
*/
|
|
47
|
-
static newRawAlerts(stanza: any): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* @function newUnknownAlert
|
|
50
|
-
* @description Emits the 'onAlert' event with parsed unknown alert objects. (Non-CAP, Non-VTEC)
|
|
51
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
52
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
53
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
54
|
-
*
|
|
55
|
-
* @param {Object} stanza - The XMPP stanza containing the raw alert message.
|
|
56
|
-
*
|
|
57
|
-
* @emits onAlert - Emitted when a new raw alert is received and parsed.
|
|
58
|
-
*/
|
|
59
|
-
static newUnknownAlert(stanza: any): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* @function newSpecialWeatherStatement
|
|
62
|
-
* @description Emits the 'onAlert' event with parsed special weather statement alert objects.
|
|
63
|
-
* The alert objects contain various properties such as id, tracking, action, area description, expiration time,
|
|
64
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
65
|
-
*
|
|
66
|
-
* tornado detection, max hail size, max wind gust, and thunderstorm damage threat.
|
|
67
|
-
*
|
|
68
|
-
* @param {Object} stanza - The XMPP stanza containing the special weather statement message.
|
|
69
|
-
*
|
|
70
|
-
* @emits onAlert - Emitted when a new special weather statement is received and parsed.
|
|
71
|
-
*/
|
|
72
|
-
static newSpecialWeatherStatement(stanza: any): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* @function newMesoscaleDiscussion
|
|
75
|
-
* @description Emits the 'onMesoscaleDiscussion' event with a parsed mesoscale discussion alert object.
|
|
76
|
-
* The alert object contains various properties such as id, tracking, action, area description, expiration time,
|
|
77
|
-
* issue time, event type, sender information, description, geocode, and parameters like WMO identifier,
|
|
78
|
-
* tornado intensity probability, peak wind gust, and peak hail size.
|
|
79
|
-
*
|
|
80
|
-
* @param {Object} stanza - The XMPP stanza containing the mesoscale discussion message.
|
|
81
|
-
*
|
|
82
|
-
* @emits onMesoscaleDiscussion - Emitted when a new mesoscale discussion is received and parsed.
|
|
83
|
-
*/
|
|
84
|
-
static newMesoscaleDiscussion(stanza: any): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* @function newLocalStormReport
|
|
87
|
-
* @description Emits the 'onLocalStormReport' event with the cleaned description of a local storm report. No other additional parsing is
|
|
88
|
-
* done at this time at least.
|
|
89
|
-
*
|
|
90
|
-
* @param {Object} stanza - The XMPP stanza containing the local storm report message.
|
|
91
|
-
*
|
|
92
|
-
* @emits onLocalStormReport - Emitted when a new local storm report is received and parsed.
|
|
93
|
-
*/
|
|
94
|
-
static newLocalStormReport(stanza: any): Promise<void>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export { mEvents as default, mEvents };
|