atmosx-nwws-parser 1.0.185 → 1.0.201

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 (78) hide show
  1. package/README.md +3 -86
  2. package/dist/cjs/bootstrap.cjs +1000 -0
  3. package/dist/cjs/database.cjs +1105 -0
  4. package/dist/cjs/dictionaries/awips.cjs +370 -0
  5. package/dist/cjs/dictionaries/events.cjs +139 -0
  6. package/dist/cjs/dictionaries/icao.cjs +265 -0
  7. package/dist/cjs/dictionaries/offshore.cjs +40 -0
  8. package/dist/cjs/dictionaries/signatures.cjs +132 -0
  9. package/dist/cjs/eas.cjs +2851 -0
  10. package/dist/cjs/helper.cjs +3008 -0
  11. package/dist/cjs/parsers/events.cjs +2851 -0
  12. package/dist/cjs/parsers/stanza.cjs +1099 -0
  13. package/dist/cjs/parsers/text.cjs +1133 -0
  14. package/dist/cjs/parsers/types/api.cjs +2851 -0
  15. package/dist/cjs/parsers/types/cap.cjs +2851 -0
  16. package/dist/cjs/parsers/types/text.cjs +2851 -0
  17. package/dist/cjs/parsers/types/ugc.cjs +2851 -0
  18. package/dist/cjs/parsers/types/vtec.cjs +2851 -0
  19. package/dist/cjs/parsers/ugc.cjs +1130 -0
  20. package/dist/cjs/parsers/vtec.cjs +1051 -0
  21. package/dist/cjs/types.cjs +17 -0
  22. package/dist/cjs/utils.cjs +2851 -0
  23. package/dist/cjs/xmpp.cjs +2851 -0
  24. package/dist/esm/bootstrap.mjs +963 -0
  25. package/dist/esm/database.mjs +1070 -0
  26. package/dist/esm/dictionaries/awips.mjs +346 -0
  27. package/dist/esm/dictionaries/events.mjs +111 -0
  28. package/dist/esm/dictionaries/icao.mjs +241 -0
  29. package/dist/esm/dictionaries/offshore.mjs +16 -0
  30. package/dist/esm/dictionaries/signatures.mjs +106 -0
  31. package/dist/esm/eas.mjs +2818 -0
  32. package/dist/esm/helper.mjs +2968 -0
  33. package/dist/esm/parsers/events.mjs +2818 -0
  34. package/dist/esm/parsers/stanza.mjs +1063 -0
  35. package/dist/esm/parsers/text.mjs +1097 -0
  36. package/dist/esm/parsers/types/api.mjs +2818 -0
  37. package/dist/esm/parsers/types/cap.mjs +2818 -0
  38. package/dist/esm/parsers/types/text.mjs +2818 -0
  39. package/dist/esm/parsers/types/ugc.mjs +2818 -0
  40. package/dist/esm/parsers/types/vtec.mjs +2818 -0
  41. package/dist/esm/parsers/ugc.mjs +1095 -0
  42. package/dist/esm/parsers/vtec.mjs +1016 -0
  43. package/dist/esm/types.mjs +0 -0
  44. package/dist/esm/utils.mjs +2818 -0
  45. package/dist/esm/xmpp.mjs +2818 -0
  46. package/package.json +47 -29
  47. package/src/bootstrap.ts +171 -0
  48. package/src/database.ts +99 -0
  49. package/src/dictionaries/awips.ts +342 -0
  50. package/src/dictionaries/events.ts +109 -0
  51. package/src/dictionaries/icao.ts +237 -0
  52. package/src/dictionaries/offshore.ts +12 -0
  53. package/src/dictionaries/signatures.ts +103 -0
  54. package/src/eas.ts +428 -0
  55. package/src/helper.ts +167 -0
  56. package/src/parsers/events.ts +289 -0
  57. package/src/parsers/stanza.ts +103 -0
  58. package/src/parsers/text.ts +167 -0
  59. package/src/parsers/types/api.ts +94 -0
  60. package/src/parsers/types/cap.ts +89 -0
  61. package/src/parsers/types/text.ts +54 -0
  62. package/src/parsers/types/ugc.ts +85 -0
  63. package/src/parsers/types/vtec.ts +60 -0
  64. package/src/parsers/ugc.ts +148 -0
  65. package/src/parsers/vtec.ts +66 -0
  66. package/src/types.ts +187 -0
  67. package/src/utils.ts +217 -0
  68. package/src/xmpp.ts +123 -0
  69. package/test.js +1 -36
  70. package/tsconfig.json +14 -0
  71. package/tsup.config.ts +11 -0
  72. package/bootstrap.js +0 -112
  73. package/index.js +0 -264
  74. package/src/events.js +0 -339
  75. package/src/stanza.js +0 -105
  76. package/src/text.js +0 -108
  77. package/src/ugc.js +0 -115
  78. package/src/vtec.js +0 -89
package/README.md CHANGED
@@ -1,89 +1,6 @@
1
- # AtmosphericX - NOAA Weather Wire Service Parser
1
+ # AtmosphericX - NOAA Weather Wire & NWS API Parser
2
2
 
3
3
 
4
- This repository contains the primary parser for AtmosphericX's NOAA Weather Wire Service parser. It is designed to handle real time weather alerts and messages from the National Weather Service using XMPP. If you do not know basic programming, this parser is not for you. It is intended for developers who want to integrate alerts from NOAA Weather Wire easily into their applications or services without hassle. If you wish to use NWWS without programming, feel free to use our project where most of this code was used - [AtmosphericX](https://github.com/k3yomi/AtmosphericX).
4
+ This repository contains the parsing of both NOAA Weather Wire Service and National Weather Service. It is designed to handle real time weather alerts and messages from the National Weather Service using XMPP. If you do not know basic programming, this parser is not for you. It is intended for developers who want to integrate alerts from NOAA Weather Wire easily into their applications or services without hassle. If you wish to use NWWS without programming, feel free to use our project where most of this code was used - AtmosphericX.
5
5
 
6
- ## Installation Guide
7
- To install this package, you can use **NPM** (Node Package Manager). Open your terminal and run the following command:
8
-
9
- ```bash
10
- npm install atmosx-nwws-parser
11
- ```
12
-
13
- ## Usage
14
- ```js
15
- const AtmosXWireParser = require(`atmosx-nwws-parser`);
16
- ```
17
-
18
- ## Configuration and Initialization
19
-
20
- There are several settings you can configure when intializing the parser. Below is the test.js example that shows some of the settings you can use:
21
-
22
- ```js
23
- let Client = new AtmosXWireParser({
24
- alertSettings: {
25
- onlyCap: false, // Set to true to only receive CAP messages only
26
- betterEvents: true, // Set to true to receive better event handling
27
- ugcPolygons: false, // Set to true to receive UGC Polygons instead of reading from raw products.
28
- expiryCheck: true, // Set to true to check for expired alerts and remove them from the list
29
- filteredAlerts: [] // Alerts you want to only log, leave empty to receive all alerts (Ex. ["Tornado Warning", "Radar Indicated Tornado Warning"])
30
- },
31
- xmpp: {
32
- reconnect: true, // Set to true to enable automatic reconnection if you lose connection
33
- reconnectInterval: 60, // Interval in seconds to attempt reconnection
34
- },
35
- cacheSettings: {
36
- maxMegabytes: 2, // Maximum cache size in megabytes
37
- readCache: false, // Set to true if you wish to reupload the cache from earlier (Now supports reading from CAP, SPS, and Alerts)
38
- cacheDir: `./cache`, // Directory for cache files
39
- },
40
- authentication: {
41
- username: `USERNAME_HERE`, // Your XMPP username
42
- password: `PASSWORD_HERE`, // Your XMPP password
43
- display: `DISPLAY_NAME` // Display name for your XMPP client
44
- },
45
- database: `./database.db`, // Path to the SQLite database file (It will be created if it doesn't exist and will be used to store UGC counties and zones.)
46
- });
47
- ```
48
-
49
-
50
- ## Event Handling
51
-
52
- You can handle various events emitted by the parser. Here are some examples:
53
-
54
- ```js
55
- Client.onEvent(`onAlert`, (alerts: Array) => {});
56
- Client.onEvent(`onStormReport`, (report: Object) => {});
57
- Client.onEvent(`onMesoscaleDiscussion`, (discussion: Object) => {});
58
- Client.onEvent(`onMessage`, (stanza: Object) => {});
59
- Client.onEvent(`onOccupant`, (occupant: Object) => {});
60
- Client.onEvent(`onError`, (error: Object) => {});
61
- Client.onEvent(`onReconnect`, (service: Object) => {});
62
-
63
- ```
64
-
65
- ## Functions and Methods
66
- You can also use various functions provided by the parser. Here are some examples:
67
- ```js
68
- // Debugging function to create your own alert manually
69
- Client.forwardCustomStanza(stanza: String, attributes: Object);
70
- ```
71
-
72
- ```js
73
- // Function to set the display name of the XMPP client (Will only set upon reconnect)
74
- Client.setDisplayName(displayName: String);
75
- ```
76
-
77
- ## Error Handling
78
- The parser can emit various errors. Here are some common errors you might encounter:
79
-
80
- **not-authorized**: This error occurs when the parser is not authorized to connect to the XMPP server. Ensure that your username and password are correct.
81
-
82
- **unreachable-host**: This error indicates that the parser cannot reach the XMPP server. Check your internet connection and ensure that the server address is correct.
83
-
84
- **service-error**: This error occurs when there is an issue with the XMPP service. It could be due to server maintenance or other issues. You can try reconnecting after some time.
85
-
86
- **no-database-dir**: This error occurs when the database directory does not exist. Ensure that the directory specified in the `database` setting exists or create it before running the parser.
87
-
88
- ## Credits
89
- This parser is developed and maintained by [K3YOMI](https://github.com/K3YOMI) and the AtmosphericX Team. It is open-source and available for contributions and improvements. If you find any issues or have suggestions, feel free to open an issue or submit a pull request in the repository.
6
+ TODO: Complete later...