atmosx-nwws-parser 1.0.1912 → 1.0.1914

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 CHANGED
@@ -21,7 +21,7 @@ import * as AtmosXWireParser from `atmosx-nwws-parser`; // ESM
21
21
  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:
22
22
 
23
23
  ```js
24
- let Client = new AtmosXWireParser.Parser({
24
+ let Client = new AtmosXWireParser({
25
25
  alertSettings: {
26
26
  onlyCap: false, // Set to true to only receive CAP messages only
27
27
  betterEvents: true, // Set to true to receive better event handling
@@ -361,13 +361,13 @@ var mEvents = /** @class */ (function () {
361
361
  maxWindGust: getWindGusts,
362
362
  thunderstormDamageThreat: [getDamageThreat],
363
363
  },
364
- geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
365
- }
364
+ },
365
+ geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
366
366
  };
367
367
  if (loader.settings.alertSettings.ugcPolygons) {
368
368
  ugcCoordinates = ugc_1.default.getCoordinates(mUgc.zones);
369
369
  if (ugcCoordinates.length > 0) {
370
- alert_2.properties.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] };
370
+ alert_2.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] };
371
371
  }
372
372
  ;
373
373
  }
@@ -458,13 +458,13 @@ var mEvents = /** @class */ (function () {
458
458
  maxWindGust: getWindGusts,
459
459
  thunderstormDamageThreat: [getDamageThreat],
460
460
  },
461
- geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
462
- }
461
+ },
462
+ geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
463
463
  };
464
464
  if (loader.settings.alertSettings.ugcPolygons) {
465
465
  ugcCoordinates = ugc_1.default.getCoordinates(mUgc.zones);
466
466
  if (ugcCoordinates.length > 0) {
467
- alert_3.properties.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] };
467
+ alert_3.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] };
468
468
  }
469
469
  ;
470
470
  }
@@ -84,11 +84,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
84
84
  return (mod && mod.__esModule) ? mod : { "default": mod };
85
85
  };
86
86
  Object.defineProperty(exports, "__esModule", { value: true });
87
- exports.Parser = void 0;
87
+ exports.AtmosXWireParser = void 0;
88
88
  var loader = __importStar(require("../bootstrap"));
89
89
  var stanza_1 = __importDefault(require("./stanza"));
90
- var Parser = /** @class */ (function () {
91
- function Parser(metadata) {
90
+ var AtmosXWireParser = /** @class */ (function () {
91
+ function AtmosXWireParser(metadata) {
92
92
  var _this = this;
93
93
  /**
94
94
  * @function initalizeDatabase
@@ -464,6 +464,7 @@ var Parser = /** @class */ (function () {
464
464
  }
465
465
  }, 1 * 1000);
466
466
  }
467
- return Parser;
467
+ return AtmosXWireParser;
468
468
  }());
469
- exports.Parser = Parser;
469
+ exports.AtmosXWireParser = AtmosXWireParser;
470
+ module.exports = AtmosXWireParser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atmosx-nwws-parser",
3
- "version": "1.0.1912",
3
+ "version": "1.0.1914",
4
4
  "description": "NOAA Weather Wire Parser - Built for standalone and Project AtmosphericX Integration.",
5
5
  "main": "dist/src/helper.js",
6
6
  "types": "src/helper.d.ts",
package/src/events.ts CHANGED
@@ -230,12 +230,12 @@ export class mEvents {
230
230
  maxWindGust: getWindGusts,
231
231
  thunderstormDamageThreat: [getDamageThreat],
232
232
  },
233
- geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
234
- }
233
+ },
234
+ geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
235
235
  };
236
236
  if (loader.settings.alertSettings.ugcPolygons) {
237
237
  const ugcCoordinates = mUgcParser.getCoordinates(mUgc.zones);
238
- if (ugcCoordinates.length > 0) { alert.properties.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] }; };
238
+ if (ugcCoordinates.length > 0) { alert.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] }; };
239
239
  }
240
240
  alerts.push(alert);
241
241
  }
@@ -302,12 +302,12 @@ export class mEvents {
302
302
  maxWindGust: getWindGusts,
303
303
  thunderstormDamageThreat: [getDamageThreat],
304
304
  },
305
- geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
306
- }
305
+ },
306
+ geometry: { type: 'Polygon', coordinates: [getPolygonCoordinates] }
307
307
  };
308
308
  if (loader.settings.alertSettings.ugcPolygons) {
309
309
  const ugcCoordinates = mUgcParser.getCoordinates(mUgc.zones);
310
- if (ugcCoordinates.length > 0) { alert.properties.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] }; };
310
+ if (ugcCoordinates.length > 0) { alert.geometry = { type: 'Polygon', coordinates: [ugcCoordinates] }; };
311
311
  }
312
312
  alerts.push(alert);
313
313
  }
package/src/helper.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  import * as loader from '../bootstrap';
15
15
  import mStanza from './stanza';
16
16
 
17
- export class Parser {
17
+ export class AtmosXWireParser {
18
18
  packages: any;
19
19
  metadata: any;
20
20
  constructor(metadata: any) {
@@ -301,3 +301,7 @@ export class Parser {
301
301
  return () => { loader.statics.events.off(event, callback); }
302
302
  }
303
303
  }
304
+
305
+
306
+
307
+ module.exports = AtmosXWireParser
package/test.js CHANGED
@@ -1,7 +1,6 @@
1
+ const AtmosXWireParser = require(`./dist/src/helper.js`)
1
2
 
2
- AtmosXWireParser = require(`./dist/src/helper.js`)
3
-
4
- let Client = new AtmosXWireParser.Parser({
3
+ let Client = new AtmosXWireParser({
5
4
  database: `./database.db`,
6
5
  authentication: {
7
6
  username: `YOUR_USERNAME`,