atmosx-nwws-parser 1.0.20231 → 1.0.20233
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/cjs/eas.cjs +8 -8
- package/dist/cjs/helper.cjs +8 -8
- package/dist/cjs/parsers/events.cjs +8 -8
- package/dist/cjs/parsers/types/api.cjs +8 -8
- package/dist/cjs/parsers/types/cap.cjs +8 -8
- package/dist/cjs/parsers/types/text.cjs +8 -8
- package/dist/cjs/parsers/types/ugc.cjs +8 -8
- package/dist/cjs/parsers/types/vtec.cjs +8 -8
- package/dist/cjs/utils.cjs +8 -8
- package/dist/cjs/xmpp.cjs +8 -8
- package/dist/esm/eas.mjs +8 -8
- package/dist/esm/helper.mjs +8 -8
- package/dist/esm/parsers/events.mjs +8 -8
- package/dist/esm/parsers/types/api.mjs +8 -8
- package/dist/esm/parsers/types/cap.mjs +8 -8
- package/dist/esm/parsers/types/text.mjs +8 -8
- package/dist/esm/parsers/types/ugc.mjs +8 -8
- package/dist/esm/parsers/types/vtec.mjs +8 -8
- package/dist/esm/utils.mjs +8 -8
- package/dist/esm/xmpp.mjs +8 -8
- package/package.json +1 -1
- package/src/parsers/events.ts +6 -5
package/dist/cjs/eas.cjs
CHANGED
|
@@ -1918,16 +1918,17 @@ var EventParser = class {
|
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
1920
|
const filtered = events2.filter((alert) => {
|
|
1921
|
-
var _a2, _b2,
|
|
1921
|
+
var _a2, _b2, _d2, _e2;
|
|
1922
1922
|
const originalEvent = alert;
|
|
1923
1923
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
1924
1924
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
1925
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
1925
1926
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
1926
1927
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
1927
1928
|
originalEvent.properties.event = eventName;
|
|
1928
1929
|
originalEvent.properties.tags = tags;
|
|
1929
1930
|
}
|
|
1930
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
1931
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
1931
1932
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
1932
1933
|
for (const key in sets) {
|
|
1933
1934
|
const setting = sets[key];
|
|
@@ -1946,17 +1947,15 @@ var EventParser = class {
|
|
|
1946
1947
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
1947
1948
|
}
|
|
1948
1949
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
1949
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
1950
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
1951
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
1952
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
1950
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
1951
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
1952
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
1953
1953
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
1954
1954
|
if (props.description) {
|
|
1955
1955
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
1956
|
-
if (detectedPhrase
|
|
1956
|
+
if (detectedPhrase) {
|
|
1957
1957
|
originalEvent.properties.action_type = "Cancel";
|
|
1958
1958
|
originalEvent.properties.is_cancelled = true;
|
|
1959
|
-
return false;
|
|
1960
1959
|
}
|
|
1961
1960
|
}
|
|
1962
1961
|
if (originalEvent.vtec) {
|
|
@@ -1966,6 +1965,7 @@ var EventParser = class {
|
|
|
1966
1965
|
return false;
|
|
1967
1966
|
}
|
|
1968
1967
|
}
|
|
1968
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
1969
1969
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
1970
1970
|
return true;
|
|
1971
1971
|
});
|
package/dist/cjs/helper.cjs
CHANGED
|
@@ -2342,16 +2342,17 @@ var EventParser = class {
|
|
|
2342
2342
|
}
|
|
2343
2343
|
}
|
|
2344
2344
|
const filtered = events2.filter((alert) => {
|
|
2345
|
-
var _a2, _b2,
|
|
2345
|
+
var _a2, _b2, _d2, _e2;
|
|
2346
2346
|
const originalEvent = alert;
|
|
2347
2347
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2348
2348
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2349
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2349
2350
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2350
2351
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2351
2352
|
originalEvent.properties.event = eventName;
|
|
2352
2353
|
originalEvent.properties.tags = tags;
|
|
2353
2354
|
}
|
|
2354
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2355
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2355
2356
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2356
2357
|
for (const key in sets) {
|
|
2357
2358
|
const setting = sets[key];
|
|
@@ -2370,17 +2371,15 @@ var EventParser = class {
|
|
|
2370
2371
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2371
2372
|
}
|
|
2372
2373
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2373
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2374
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2375
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2376
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2374
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2375
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2376
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2377
2377
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2378
2378
|
if (props.description) {
|
|
2379
2379
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2380
|
-
if (detectedPhrase
|
|
2380
|
+
if (detectedPhrase) {
|
|
2381
2381
|
originalEvent.properties.action_type = "Cancel";
|
|
2382
2382
|
originalEvent.properties.is_cancelled = true;
|
|
2383
|
-
return false;
|
|
2384
2383
|
}
|
|
2385
2384
|
}
|
|
2386
2385
|
if (originalEvent.vtec) {
|
|
@@ -2390,6 +2389,7 @@ var EventParser = class {
|
|
|
2390
2389
|
return false;
|
|
2391
2390
|
}
|
|
2392
2391
|
}
|
|
2392
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2393
2393
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2394
2394
|
return true;
|
|
2395
2395
|
});
|
|
@@ -2725,16 +2725,17 @@ var EventParser = class {
|
|
|
2725
2725
|
}
|
|
2726
2726
|
}
|
|
2727
2727
|
const filtered = events2.filter((alert) => {
|
|
2728
|
-
var _a2, _b2,
|
|
2728
|
+
var _a2, _b2, _d2, _e2;
|
|
2729
2729
|
const originalEvent = alert;
|
|
2730
2730
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2731
2731
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2732
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2732
2733
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2733
2734
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2734
2735
|
originalEvent.properties.event = eventName;
|
|
2735
2736
|
originalEvent.properties.tags = tags;
|
|
2736
2737
|
}
|
|
2737
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2738
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2738
2739
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2739
2740
|
for (const key in sets) {
|
|
2740
2741
|
const setting = sets[key];
|
|
@@ -2753,17 +2754,15 @@ var EventParser = class {
|
|
|
2753
2754
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2754
2755
|
}
|
|
2755
2756
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2756
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2757
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2758
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2759
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2757
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2758
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2759
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2760
2760
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2761
2761
|
if (props.description) {
|
|
2762
2762
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2763
|
-
if (detectedPhrase
|
|
2763
|
+
if (detectedPhrase) {
|
|
2764
2764
|
originalEvent.properties.action_type = "Cancel";
|
|
2765
2765
|
originalEvent.properties.is_cancelled = true;
|
|
2766
|
-
return false;
|
|
2767
2766
|
}
|
|
2768
2767
|
}
|
|
2769
2768
|
if (originalEvent.vtec) {
|
|
@@ -2773,6 +2772,7 @@ var EventParser = class {
|
|
|
2773
2772
|
return false;
|
|
2774
2773
|
}
|
|
2775
2774
|
}
|
|
2775
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2776
2776
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2777
2777
|
return true;
|
|
2778
2778
|
});
|
|
@@ -2648,16 +2648,17 @@ var EventParser = class {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
2650
|
const filtered = events2.filter((alert) => {
|
|
2651
|
-
var _a2, _b2,
|
|
2651
|
+
var _a2, _b2, _d2, _e2;
|
|
2652
2652
|
const originalEvent = alert;
|
|
2653
2653
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2654
2654
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2655
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2655
2656
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2656
2657
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2657
2658
|
originalEvent.properties.event = eventName;
|
|
2658
2659
|
originalEvent.properties.tags = tags;
|
|
2659
2660
|
}
|
|
2660
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2661
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2661
2662
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2662
2663
|
for (const key in sets) {
|
|
2663
2664
|
const setting = sets[key];
|
|
@@ -2676,17 +2677,15 @@ var EventParser = class {
|
|
|
2676
2677
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2677
2678
|
}
|
|
2678
2679
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2679
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2680
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2681
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2682
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2680
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2681
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2682
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2683
2683
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2684
2684
|
if (props.description) {
|
|
2685
2685
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2686
|
-
if (detectedPhrase
|
|
2686
|
+
if (detectedPhrase) {
|
|
2687
2687
|
originalEvent.properties.action_type = "Cancel";
|
|
2688
2688
|
originalEvent.properties.is_cancelled = true;
|
|
2689
|
-
return false;
|
|
2690
2689
|
}
|
|
2691
2690
|
}
|
|
2692
2691
|
if (originalEvent.vtec) {
|
|
@@ -2696,6 +2695,7 @@ var EventParser = class {
|
|
|
2696
2695
|
return false;
|
|
2697
2696
|
}
|
|
2698
2697
|
}
|
|
2698
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2699
2699
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2700
2700
|
return true;
|
|
2701
2701
|
});
|
|
@@ -2640,16 +2640,17 @@ var EventParser = class {
|
|
|
2640
2640
|
}
|
|
2641
2641
|
}
|
|
2642
2642
|
const filtered = events2.filter((alert) => {
|
|
2643
|
-
var _a2, _b2,
|
|
2643
|
+
var _a2, _b2, _d2, _e2;
|
|
2644
2644
|
const originalEvent = alert;
|
|
2645
2645
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2646
2646
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2647
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2647
2648
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2648
2649
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2649
2650
|
originalEvent.properties.event = eventName;
|
|
2650
2651
|
originalEvent.properties.tags = tags;
|
|
2651
2652
|
}
|
|
2652
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2653
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2653
2654
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2654
2655
|
for (const key in sets) {
|
|
2655
2656
|
const setting = sets[key];
|
|
@@ -2668,17 +2669,15 @@ var EventParser = class {
|
|
|
2668
2669
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2669
2670
|
}
|
|
2670
2671
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2671
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2672
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2673
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2674
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2672
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2673
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2674
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2675
2675
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2676
2676
|
if (props.description) {
|
|
2677
2677
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2678
|
-
if (detectedPhrase
|
|
2678
|
+
if (detectedPhrase) {
|
|
2679
2679
|
originalEvent.properties.action_type = "Cancel";
|
|
2680
2680
|
originalEvent.properties.is_cancelled = true;
|
|
2681
|
-
return false;
|
|
2682
2681
|
}
|
|
2683
2682
|
}
|
|
2684
2683
|
if (originalEvent.vtec) {
|
|
@@ -2688,6 +2687,7 @@ var EventParser = class {
|
|
|
2688
2687
|
return false;
|
|
2689
2688
|
}
|
|
2690
2689
|
}
|
|
2690
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2691
2691
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2692
2692
|
return true;
|
|
2693
2693
|
});
|
|
@@ -2688,16 +2688,17 @@ var EventParser = class {
|
|
|
2688
2688
|
}
|
|
2689
2689
|
}
|
|
2690
2690
|
const filtered = events2.filter((alert) => {
|
|
2691
|
-
var _a2, _b2,
|
|
2691
|
+
var _a2, _b2, _d2, _e2;
|
|
2692
2692
|
const originalEvent = alert;
|
|
2693
2693
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2694
2694
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2695
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2695
2696
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2696
2697
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2697
2698
|
originalEvent.properties.event = eventName;
|
|
2698
2699
|
originalEvent.properties.tags = tags;
|
|
2699
2700
|
}
|
|
2700
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2701
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2701
2702
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2702
2703
|
for (const key in sets) {
|
|
2703
2704
|
const setting = sets[key];
|
|
@@ -2716,17 +2717,15 @@ var EventParser = class {
|
|
|
2716
2717
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2717
2718
|
}
|
|
2718
2719
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2719
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2720
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2721
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2722
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2720
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2721
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2722
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2723
2723
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2724
2724
|
if (props.description) {
|
|
2725
2725
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2726
|
-
if (detectedPhrase
|
|
2726
|
+
if (detectedPhrase) {
|
|
2727
2727
|
originalEvent.properties.action_type = "Cancel";
|
|
2728
2728
|
originalEvent.properties.is_cancelled = true;
|
|
2729
|
-
return false;
|
|
2730
2729
|
}
|
|
2731
2730
|
}
|
|
2732
2731
|
if (originalEvent.vtec) {
|
|
@@ -2736,6 +2735,7 @@ var EventParser = class {
|
|
|
2736
2735
|
return false;
|
|
2737
2736
|
}
|
|
2738
2737
|
}
|
|
2738
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2739
2739
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2740
2740
|
return true;
|
|
2741
2741
|
});
|
|
@@ -2658,16 +2658,17 @@ var EventParser = class {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
}
|
|
2660
2660
|
const filtered = events2.filter((alert) => {
|
|
2661
|
-
var _a2, _b2,
|
|
2661
|
+
var _a2, _b2, _d2, _e2;
|
|
2662
2662
|
const originalEvent = alert;
|
|
2663
2663
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2664
2664
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2665
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2665
2666
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2666
2667
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2667
2668
|
originalEvent.properties.event = eventName;
|
|
2668
2669
|
originalEvent.properties.tags = tags;
|
|
2669
2670
|
}
|
|
2670
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2671
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2671
2672
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2672
2673
|
for (const key in sets) {
|
|
2673
2674
|
const setting = sets[key];
|
|
@@ -2686,17 +2687,15 @@ var EventParser = class {
|
|
|
2686
2687
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2687
2688
|
}
|
|
2688
2689
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2689
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2690
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2691
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2692
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2690
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2691
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2692
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2693
2693
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2694
2694
|
if (props.description) {
|
|
2695
2695
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2696
|
-
if (detectedPhrase
|
|
2696
|
+
if (detectedPhrase) {
|
|
2697
2697
|
originalEvent.properties.action_type = "Cancel";
|
|
2698
2698
|
originalEvent.properties.is_cancelled = true;
|
|
2699
|
-
return false;
|
|
2700
2699
|
}
|
|
2701
2700
|
}
|
|
2702
2701
|
if (originalEvent.vtec) {
|
|
@@ -2706,6 +2705,7 @@ var EventParser = class {
|
|
|
2706
2705
|
return false;
|
|
2707
2706
|
}
|
|
2708
2707
|
}
|
|
2708
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2709
2709
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2710
2710
|
return true;
|
|
2711
2711
|
});
|
|
@@ -2681,16 +2681,17 @@ var EventParser = class {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
}
|
|
2683
2683
|
const filtered = events2.filter((alert) => {
|
|
2684
|
-
var _a2, _b2,
|
|
2684
|
+
var _a2, _b2, _d2, _e2;
|
|
2685
2685
|
const originalEvent = alert;
|
|
2686
2686
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2687
2687
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2688
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2688
2689
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2689
2690
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2690
2691
|
originalEvent.properties.event = eventName;
|
|
2691
2692
|
originalEvent.properties.tags = tags;
|
|
2692
2693
|
}
|
|
2693
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2694
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2694
2695
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2695
2696
|
for (const key in sets) {
|
|
2696
2697
|
const setting = sets[key];
|
|
@@ -2709,17 +2710,15 @@ var EventParser = class {
|
|
|
2709
2710
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2710
2711
|
}
|
|
2711
2712
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2712
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2713
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2714
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2715
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2713
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2714
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2715
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2716
2716
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2717
2717
|
if (props.description) {
|
|
2718
2718
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2719
|
-
if (detectedPhrase
|
|
2719
|
+
if (detectedPhrase) {
|
|
2720
2720
|
originalEvent.properties.action_type = "Cancel";
|
|
2721
2721
|
originalEvent.properties.is_cancelled = true;
|
|
2722
|
-
return false;
|
|
2723
2722
|
}
|
|
2724
2723
|
}
|
|
2725
2724
|
if (originalEvent.vtec) {
|
|
@@ -2729,6 +2728,7 @@ var EventParser = class {
|
|
|
2729
2728
|
return false;
|
|
2730
2729
|
}
|
|
2731
2730
|
}
|
|
2731
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2732
2732
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2733
2733
|
return true;
|
|
2734
2734
|
});
|
package/dist/cjs/utils.cjs
CHANGED
|
@@ -2331,16 +2331,17 @@ var EventParser = class {
|
|
|
2331
2331
|
}
|
|
2332
2332
|
}
|
|
2333
2333
|
const filtered = events2.filter((alert) => {
|
|
2334
|
-
var _a2, _b2,
|
|
2334
|
+
var _a2, _b2, _d2, _e2;
|
|
2335
2335
|
const originalEvent = alert;
|
|
2336
2336
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2337
2337
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2338
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2338
2339
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2339
2340
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2340
2341
|
originalEvent.properties.event = eventName;
|
|
2341
2342
|
originalEvent.properties.tags = tags;
|
|
2342
2343
|
}
|
|
2343
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2344
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2344
2345
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2345
2346
|
for (const key in sets) {
|
|
2346
2347
|
const setting = sets[key];
|
|
@@ -2359,17 +2360,15 @@ var EventParser = class {
|
|
|
2359
2360
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2360
2361
|
}
|
|
2361
2362
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2362
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2363
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2364
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2365
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2363
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2364
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2365
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2366
2366
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2367
2367
|
if (props.description) {
|
|
2368
2368
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2369
|
-
if (detectedPhrase
|
|
2369
|
+
if (detectedPhrase) {
|
|
2370
2370
|
originalEvent.properties.action_type = "Cancel";
|
|
2371
2371
|
originalEvent.properties.is_cancelled = true;
|
|
2372
|
-
return false;
|
|
2373
2372
|
}
|
|
2374
2373
|
}
|
|
2375
2374
|
if (originalEvent.vtec) {
|
|
@@ -2379,6 +2378,7 @@ var EventParser = class {
|
|
|
2379
2378
|
return false;
|
|
2380
2379
|
}
|
|
2381
2380
|
}
|
|
2381
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2382
2382
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2383
2383
|
return true;
|
|
2384
2384
|
});
|
package/dist/cjs/xmpp.cjs
CHANGED
|
@@ -2331,16 +2331,17 @@ var EventParser = class {
|
|
|
2331
2331
|
}
|
|
2332
2332
|
}
|
|
2333
2333
|
const filtered = events2.filter((alert) => {
|
|
2334
|
-
var _a2, _b2,
|
|
2334
|
+
var _a2, _b2, _d2, _e2;
|
|
2335
2335
|
const originalEvent = alert;
|
|
2336
2336
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2337
2337
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2338
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2338
2339
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2339
2340
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2340
2341
|
originalEvent.properties.event = eventName;
|
|
2341
2342
|
originalEvent.properties.tags = tags;
|
|
2342
2343
|
}
|
|
2343
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2344
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2344
2345
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2345
2346
|
for (const key in sets) {
|
|
2346
2347
|
const setting = sets[key];
|
|
@@ -2359,17 +2360,15 @@ var EventParser = class {
|
|
|
2359
2360
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2360
2361
|
}
|
|
2361
2362
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2362
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2363
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2364
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2365
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2363
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2364
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2365
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2366
2366
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2367
2367
|
if (props.description) {
|
|
2368
2368
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2369
|
-
if (detectedPhrase
|
|
2369
|
+
if (detectedPhrase) {
|
|
2370
2370
|
originalEvent.properties.action_type = "Cancel";
|
|
2371
2371
|
originalEvent.properties.is_cancelled = true;
|
|
2372
|
-
return false;
|
|
2373
2372
|
}
|
|
2374
2373
|
}
|
|
2375
2374
|
if (originalEvent.vtec) {
|
|
@@ -2379,6 +2378,7 @@ var EventParser = class {
|
|
|
2379
2378
|
return false;
|
|
2380
2379
|
}
|
|
2381
2380
|
}
|
|
2381
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2382
2382
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2383
2383
|
return true;
|
|
2384
2384
|
});
|
package/dist/esm/eas.mjs
CHANGED
|
@@ -1885,16 +1885,17 @@ var EventParser = class {
|
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
const filtered = events2.filter((alert) => {
|
|
1888
|
-
var _a2, _b2,
|
|
1888
|
+
var _a2, _b2, _d2, _e2;
|
|
1889
1889
|
const originalEvent = alert;
|
|
1890
1890
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
1891
1891
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
1892
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
1892
1893
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
1893
1894
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
1894
1895
|
originalEvent.properties.event = eventName;
|
|
1895
1896
|
originalEvent.properties.tags = tags;
|
|
1896
1897
|
}
|
|
1897
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
1898
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
1898
1899
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
1899
1900
|
for (const key in sets) {
|
|
1900
1901
|
const setting = sets[key];
|
|
@@ -1913,17 +1914,15 @@ var EventParser = class {
|
|
|
1913
1914
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
1914
1915
|
}
|
|
1915
1916
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
1916
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
1917
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
1918
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
1919
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
1917
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
1918
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
1919
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
1920
1920
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
1921
1921
|
if (props.description) {
|
|
1922
1922
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
1923
|
-
if (detectedPhrase
|
|
1923
|
+
if (detectedPhrase) {
|
|
1924
1924
|
originalEvent.properties.action_type = "Cancel";
|
|
1925
1925
|
originalEvent.properties.is_cancelled = true;
|
|
1926
|
-
return false;
|
|
1927
1926
|
}
|
|
1928
1927
|
}
|
|
1929
1928
|
if (originalEvent.vtec) {
|
|
@@ -1933,6 +1932,7 @@ var EventParser = class {
|
|
|
1933
1932
|
return false;
|
|
1934
1933
|
}
|
|
1935
1934
|
}
|
|
1935
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
1936
1936
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
1937
1937
|
return true;
|
|
1938
1938
|
});
|
package/dist/esm/helper.mjs
CHANGED
|
@@ -2301,16 +2301,17 @@ var EventParser = class {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
2303
|
const filtered = events2.filter((alert) => {
|
|
2304
|
-
var _a2, _b2,
|
|
2304
|
+
var _a2, _b2, _d2, _e2;
|
|
2305
2305
|
const originalEvent = alert;
|
|
2306
2306
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2307
2307
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2308
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2308
2309
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2309
2310
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2310
2311
|
originalEvent.properties.event = eventName;
|
|
2311
2312
|
originalEvent.properties.tags = tags;
|
|
2312
2313
|
}
|
|
2313
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2314
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2314
2315
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2315
2316
|
for (const key in sets) {
|
|
2316
2317
|
const setting = sets[key];
|
|
@@ -2329,17 +2330,15 @@ var EventParser = class {
|
|
|
2329
2330
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2330
2331
|
}
|
|
2331
2332
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2332
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2333
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2334
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2335
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2333
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2334
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2335
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2336
2336
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2337
2337
|
if (props.description) {
|
|
2338
2338
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2339
|
-
if (detectedPhrase
|
|
2339
|
+
if (detectedPhrase) {
|
|
2340
2340
|
originalEvent.properties.action_type = "Cancel";
|
|
2341
2341
|
originalEvent.properties.is_cancelled = true;
|
|
2342
|
-
return false;
|
|
2343
2342
|
}
|
|
2344
2343
|
}
|
|
2345
2344
|
if (originalEvent.vtec) {
|
|
@@ -2349,6 +2348,7 @@ var EventParser = class {
|
|
|
2349
2348
|
return false;
|
|
2350
2349
|
}
|
|
2351
2350
|
}
|
|
2351
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2352
2352
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2353
2353
|
return true;
|
|
2354
2354
|
});
|
|
@@ -2692,16 +2692,17 @@ var EventParser = class {
|
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
2694
2694
|
const filtered = events2.filter((alert) => {
|
|
2695
|
-
var _a2, _b2,
|
|
2695
|
+
var _a2, _b2, _d2, _e2;
|
|
2696
2696
|
const originalEvent = alert;
|
|
2697
2697
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2698
2698
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2699
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2699
2700
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2700
2701
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2701
2702
|
originalEvent.properties.event = eventName;
|
|
2702
2703
|
originalEvent.properties.tags = tags;
|
|
2703
2704
|
}
|
|
2704
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2705
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2705
2706
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2706
2707
|
for (const key in sets) {
|
|
2707
2708
|
const setting = sets[key];
|
|
@@ -2720,17 +2721,15 @@ var EventParser = class {
|
|
|
2720
2721
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2721
2722
|
}
|
|
2722
2723
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2723
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2724
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2725
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2726
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2724
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2725
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2726
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2727
2727
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2728
2728
|
if (props.description) {
|
|
2729
2729
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2730
|
-
if (detectedPhrase
|
|
2730
|
+
if (detectedPhrase) {
|
|
2731
2731
|
originalEvent.properties.action_type = "Cancel";
|
|
2732
2732
|
originalEvent.properties.is_cancelled = true;
|
|
2733
|
-
return false;
|
|
2734
2733
|
}
|
|
2735
2734
|
}
|
|
2736
2735
|
if (originalEvent.vtec) {
|
|
@@ -2740,6 +2739,7 @@ var EventParser = class {
|
|
|
2740
2739
|
return false;
|
|
2741
2740
|
}
|
|
2742
2741
|
}
|
|
2742
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2743
2743
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2744
2744
|
return true;
|
|
2745
2745
|
});
|
|
@@ -2615,16 +2615,17 @@ var EventParser = class {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
}
|
|
2617
2617
|
const filtered = events2.filter((alert) => {
|
|
2618
|
-
var _a2, _b2,
|
|
2618
|
+
var _a2, _b2, _d2, _e2;
|
|
2619
2619
|
const originalEvent = alert;
|
|
2620
2620
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2621
2621
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2622
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2622
2623
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2623
2624
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2624
2625
|
originalEvent.properties.event = eventName;
|
|
2625
2626
|
originalEvent.properties.tags = tags;
|
|
2626
2627
|
}
|
|
2627
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2628
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2628
2629
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2629
2630
|
for (const key in sets) {
|
|
2630
2631
|
const setting = sets[key];
|
|
@@ -2643,17 +2644,15 @@ var EventParser = class {
|
|
|
2643
2644
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2644
2645
|
}
|
|
2645
2646
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2646
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2647
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2648
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2649
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2647
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2648
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2649
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2650
2650
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2651
2651
|
if (props.description) {
|
|
2652
2652
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2653
|
-
if (detectedPhrase
|
|
2653
|
+
if (detectedPhrase) {
|
|
2654
2654
|
originalEvent.properties.action_type = "Cancel";
|
|
2655
2655
|
originalEvent.properties.is_cancelled = true;
|
|
2656
|
-
return false;
|
|
2657
2656
|
}
|
|
2658
2657
|
}
|
|
2659
2658
|
if (originalEvent.vtec) {
|
|
@@ -2663,6 +2662,7 @@ var EventParser = class {
|
|
|
2663
2662
|
return false;
|
|
2664
2663
|
}
|
|
2665
2664
|
}
|
|
2665
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2666
2666
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2667
2667
|
return true;
|
|
2668
2668
|
});
|
|
@@ -2607,16 +2607,17 @@ var EventParser = class {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
}
|
|
2609
2609
|
const filtered = events2.filter((alert) => {
|
|
2610
|
-
var _a2, _b2,
|
|
2610
|
+
var _a2, _b2, _d2, _e2;
|
|
2611
2611
|
const originalEvent = alert;
|
|
2612
2612
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2613
2613
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2614
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2614
2615
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2615
2616
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2616
2617
|
originalEvent.properties.event = eventName;
|
|
2617
2618
|
originalEvent.properties.tags = tags;
|
|
2618
2619
|
}
|
|
2619
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2620
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2620
2621
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2621
2622
|
for (const key in sets) {
|
|
2622
2623
|
const setting = sets[key];
|
|
@@ -2635,17 +2636,15 @@ var EventParser = class {
|
|
|
2635
2636
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2636
2637
|
}
|
|
2637
2638
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2638
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2639
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2640
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2641
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2639
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2640
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2641
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2642
2642
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2643
2643
|
if (props.description) {
|
|
2644
2644
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2645
|
-
if (detectedPhrase
|
|
2645
|
+
if (detectedPhrase) {
|
|
2646
2646
|
originalEvent.properties.action_type = "Cancel";
|
|
2647
2647
|
originalEvent.properties.is_cancelled = true;
|
|
2648
|
-
return false;
|
|
2649
2648
|
}
|
|
2650
2649
|
}
|
|
2651
2650
|
if (originalEvent.vtec) {
|
|
@@ -2655,6 +2654,7 @@ var EventParser = class {
|
|
|
2655
2654
|
return false;
|
|
2656
2655
|
}
|
|
2657
2656
|
}
|
|
2657
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2658
2658
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2659
2659
|
return true;
|
|
2660
2660
|
});
|
|
@@ -2655,16 +2655,17 @@ var EventParser = class {
|
|
|
2655
2655
|
}
|
|
2656
2656
|
}
|
|
2657
2657
|
const filtered = events2.filter((alert) => {
|
|
2658
|
-
var _a2, _b2,
|
|
2658
|
+
var _a2, _b2, _d2, _e2;
|
|
2659
2659
|
const originalEvent = alert;
|
|
2660
2660
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2661
2661
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2662
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2662
2663
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2663
2664
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2664
2665
|
originalEvent.properties.event = eventName;
|
|
2665
2666
|
originalEvent.properties.tags = tags;
|
|
2666
2667
|
}
|
|
2667
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2668
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2668
2669
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2669
2670
|
for (const key in sets) {
|
|
2670
2671
|
const setting = sets[key];
|
|
@@ -2683,17 +2684,15 @@ var EventParser = class {
|
|
|
2683
2684
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2684
2685
|
}
|
|
2685
2686
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2686
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2687
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2688
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2689
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2687
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2688
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2689
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2690
2690
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2691
2691
|
if (props.description) {
|
|
2692
2692
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2693
|
-
if (detectedPhrase
|
|
2693
|
+
if (detectedPhrase) {
|
|
2694
2694
|
originalEvent.properties.action_type = "Cancel";
|
|
2695
2695
|
originalEvent.properties.is_cancelled = true;
|
|
2696
|
-
return false;
|
|
2697
2696
|
}
|
|
2698
2697
|
}
|
|
2699
2698
|
if (originalEvent.vtec) {
|
|
@@ -2703,6 +2702,7 @@ var EventParser = class {
|
|
|
2703
2702
|
return false;
|
|
2704
2703
|
}
|
|
2705
2704
|
}
|
|
2705
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2706
2706
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2707
2707
|
return true;
|
|
2708
2708
|
});
|
|
@@ -2625,16 +2625,17 @@ var EventParser = class {
|
|
|
2625
2625
|
}
|
|
2626
2626
|
}
|
|
2627
2627
|
const filtered = events2.filter((alert) => {
|
|
2628
|
-
var _a2, _b2,
|
|
2628
|
+
var _a2, _b2, _d2, _e2;
|
|
2629
2629
|
const originalEvent = alert;
|
|
2630
2630
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2631
2631
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2632
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2632
2633
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2633
2634
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2634
2635
|
originalEvent.properties.event = eventName;
|
|
2635
2636
|
originalEvent.properties.tags = tags;
|
|
2636
2637
|
}
|
|
2637
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2638
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2638
2639
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2639
2640
|
for (const key in sets) {
|
|
2640
2641
|
const setting = sets[key];
|
|
@@ -2653,17 +2654,15 @@ var EventParser = class {
|
|
|
2653
2654
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2654
2655
|
}
|
|
2655
2656
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2656
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2657
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2658
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2659
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2657
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2658
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2659
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2660
2660
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2661
2661
|
if (props.description) {
|
|
2662
2662
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2663
|
-
if (detectedPhrase
|
|
2663
|
+
if (detectedPhrase) {
|
|
2664
2664
|
originalEvent.properties.action_type = "Cancel";
|
|
2665
2665
|
originalEvent.properties.is_cancelled = true;
|
|
2666
|
-
return false;
|
|
2667
2666
|
}
|
|
2668
2667
|
}
|
|
2669
2668
|
if (originalEvent.vtec) {
|
|
@@ -2673,6 +2672,7 @@ var EventParser = class {
|
|
|
2673
2672
|
return false;
|
|
2674
2673
|
}
|
|
2675
2674
|
}
|
|
2675
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2676
2676
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2677
2677
|
return true;
|
|
2678
2678
|
});
|
|
@@ -2648,16 +2648,17 @@ var EventParser = class {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
2650
|
const filtered = events2.filter((alert) => {
|
|
2651
|
-
var _a2, _b2,
|
|
2651
|
+
var _a2, _b2, _d2, _e2;
|
|
2652
2652
|
const originalEvent = alert;
|
|
2653
2653
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2654
2654
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2655
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2655
2656
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2656
2657
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2657
2658
|
originalEvent.properties.event = eventName;
|
|
2658
2659
|
originalEvent.properties.tags = tags;
|
|
2659
2660
|
}
|
|
2660
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2661
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2661
2662
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2662
2663
|
for (const key in sets) {
|
|
2663
2664
|
const setting = sets[key];
|
|
@@ -2676,17 +2677,15 @@ var EventParser = class {
|
|
|
2676
2677
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2677
2678
|
}
|
|
2678
2679
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2679
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2680
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2681
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2682
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2680
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2681
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2682
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2683
2683
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2684
2684
|
if (props.description) {
|
|
2685
2685
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2686
|
-
if (detectedPhrase
|
|
2686
|
+
if (detectedPhrase) {
|
|
2687
2687
|
originalEvent.properties.action_type = "Cancel";
|
|
2688
2688
|
originalEvent.properties.is_cancelled = true;
|
|
2689
|
-
return false;
|
|
2690
2689
|
}
|
|
2691
2690
|
}
|
|
2692
2691
|
if (originalEvent.vtec) {
|
|
@@ -2696,6 +2695,7 @@ var EventParser = class {
|
|
|
2696
2695
|
return false;
|
|
2697
2696
|
}
|
|
2698
2697
|
}
|
|
2698
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2699
2699
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2700
2700
|
return true;
|
|
2701
2701
|
});
|
package/dist/esm/utils.mjs
CHANGED
|
@@ -2298,16 +2298,17 @@ var EventParser = class {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
2300
|
const filtered = events2.filter((alert) => {
|
|
2301
|
-
var _a2, _b2,
|
|
2301
|
+
var _a2, _b2, _d2, _e2;
|
|
2302
2302
|
const originalEvent = alert;
|
|
2303
2303
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2304
2304
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2305
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2305
2306
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2306
2307
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2307
2308
|
originalEvent.properties.event = eventName;
|
|
2308
2309
|
originalEvent.properties.tags = tags;
|
|
2309
2310
|
}
|
|
2310
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2311
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2311
2312
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2312
2313
|
for (const key in sets) {
|
|
2313
2314
|
const setting = sets[key];
|
|
@@ -2326,17 +2327,15 @@ var EventParser = class {
|
|
|
2326
2327
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2327
2328
|
}
|
|
2328
2329
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2329
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2330
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2331
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2332
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2330
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2331
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2332
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2333
2333
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2334
2334
|
if (props.description) {
|
|
2335
2335
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2336
|
-
if (detectedPhrase
|
|
2336
|
+
if (detectedPhrase) {
|
|
2337
2337
|
originalEvent.properties.action_type = "Cancel";
|
|
2338
2338
|
originalEvent.properties.is_cancelled = true;
|
|
2339
|
-
return false;
|
|
2340
2339
|
}
|
|
2341
2340
|
}
|
|
2342
2341
|
if (originalEvent.vtec) {
|
|
@@ -2346,6 +2345,7 @@ var EventParser = class {
|
|
|
2346
2345
|
return false;
|
|
2347
2346
|
}
|
|
2348
2347
|
}
|
|
2348
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2349
2349
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2350
2350
|
return true;
|
|
2351
2351
|
});
|
package/dist/esm/xmpp.mjs
CHANGED
|
@@ -2298,16 +2298,17 @@ var EventParser = class {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
2300
|
const filtered = events2.filter((alert) => {
|
|
2301
|
-
var _a2, _b2,
|
|
2301
|
+
var _a2, _b2, _d2, _e2;
|
|
2302
2302
|
const originalEvent = alert;
|
|
2303
2303
|
const props = originalEvent == null ? void 0 : originalEvent.properties;
|
|
2304
2304
|
const ugcs = (_b2 = (_a2 = props == null ? void 0 : props.geocode) == null ? void 0 : _a2.UGC) != null ? _b2 : [];
|
|
2305
|
+
const _c2 = originalEvent, { performance: performance2, header } = _c2, eventWithoutPerformance = __objRest(_c2, ["performance", "header"]);
|
|
2305
2306
|
if (bools == null ? void 0 : bools.betterEventParsing) {
|
|
2306
2307
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
2307
2308
|
originalEvent.properties.event = eventName;
|
|
2308
2309
|
originalEvent.properties.tags = tags;
|
|
2309
2310
|
}
|
|
2310
|
-
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (
|
|
2311
|
+
const eventCheck = (bools == null ? void 0 : bools.useParentEvents) ? (_d2 = props.parent) == null ? void 0 : _d2.toLowerCase() : (_e2 = props.event) == null ? void 0 : _e2.toLowerCase();
|
|
2311
2312
|
const statusCorrelation = definitions.correlations.find((c) => c.type === originalEvent.properties.action_type);
|
|
2312
2313
|
for (const key in sets) {
|
|
2313
2314
|
const setting = sets[key];
|
|
@@ -2326,17 +2327,15 @@ var EventParser = class {
|
|
|
2326
2327
|
if (key === "checkExpired" && setting && new Date(props == null ? void 0 : props.expires).getTime() < (/* @__PURE__ */ new Date()).getTime()) return false;
|
|
2327
2328
|
}
|
|
2328
2329
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
2329
|
-
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true
|
|
2330
|
-
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true
|
|
2331
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true
|
|
2332
|
-
const _e2 = originalEvent, { performance: performance2 } = _e2, eventWithoutPerformance = __objRest(_e2, ["performance"]);
|
|
2330
|
+
originalEvent.properties.is_updated = statusCorrelation ? statusCorrelation.update == true : false;
|
|
2331
|
+
originalEvent.properties.is_issued = statusCorrelation ? statusCorrelation.new == true : false;
|
|
2332
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? statusCorrelation.cancel == true : false;
|
|
2333
2333
|
originalEvent.hash = packages.crypto.createHash("md5").update(JSON.stringify(eventWithoutPerformance)).digest("hex");
|
|
2334
2334
|
if (props.description) {
|
|
2335
2335
|
const detectedPhrase = definitions.cancelSignatures.find((sig) => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
2336
|
-
if (detectedPhrase
|
|
2336
|
+
if (detectedPhrase) {
|
|
2337
2337
|
originalEvent.properties.action_type = "Cancel";
|
|
2338
2338
|
originalEvent.properties.is_cancelled = true;
|
|
2339
|
-
return false;
|
|
2340
2339
|
}
|
|
2341
2340
|
}
|
|
2342
2341
|
if (originalEvent.vtec) {
|
|
@@ -2346,6 +2345,7 @@ var EventParser = class {
|
|
|
2346
2345
|
return false;
|
|
2347
2346
|
}
|
|
2348
2347
|
}
|
|
2348
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
2349
2349
|
cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, "")}`);
|
|
2350
2350
|
return true;
|
|
2351
2351
|
});
|
package/package.json
CHANGED
package/src/parsers/events.ts
CHANGED
|
@@ -158,6 +158,7 @@ export class EventParser {
|
|
|
158
158
|
const originalEvent = alert
|
|
159
159
|
const props = originalEvent?.properties;
|
|
160
160
|
const ugcs = props?.geocode?.UGC ?? [];
|
|
161
|
+
const { performance, header, ...eventWithoutPerformance } = originalEvent;
|
|
161
162
|
if (bools?.betterEventParsing) {
|
|
162
163
|
const { eventName, tags } = this.enhanceEvent(originalEvent);
|
|
163
164
|
originalEvent.properties.event = eventName;
|
|
@@ -180,20 +181,20 @@ export class EventParser {
|
|
|
180
181
|
if (key === 'checkExpired' && setting && new Date(props?.expires).getTime() < new Date().getTime()) return false;
|
|
181
182
|
}
|
|
182
183
|
originalEvent.properties.action_type = statusCorrelation ? statusCorrelation.forward : originalEvent.properties.action_type;
|
|
183
|
-
originalEvent.properties.is_updated = statusCorrelation ? (statusCorrelation.update == true
|
|
184
|
-
originalEvent.properties.is_issued = statusCorrelation ? (statusCorrelation.new == true
|
|
185
|
-
originalEvent.properties.is_cancelled = statusCorrelation ? (statusCorrelation.cancel == true
|
|
186
|
-
const { performance, ...eventWithoutPerformance } = originalEvent;
|
|
184
|
+
originalEvent.properties.is_updated = statusCorrelation ? (statusCorrelation.update == true) : false;
|
|
185
|
+
originalEvent.properties.is_issued = statusCorrelation ? (statusCorrelation.new == true) : false;
|
|
186
|
+
originalEvent.properties.is_cancelled = statusCorrelation ? (statusCorrelation.cancel == true) : false;
|
|
187
187
|
originalEvent.hash = loader.packages.crypto.createHash('md5').update(JSON.stringify(eventWithoutPerformance)).digest('hex');
|
|
188
188
|
if (props.description) {
|
|
189
189
|
const detectedPhrase = loader.definitions.cancelSignatures.find(sig => props.description.toLowerCase().includes(sig.toLowerCase()));
|
|
190
|
-
if (detectedPhrase
|
|
190
|
+
if (detectedPhrase) { originalEvent.properties.action_type = 'Cancel'; originalEvent.properties.is_cancelled = true; }
|
|
191
191
|
}
|
|
192
192
|
if (originalEvent.vtec) {
|
|
193
193
|
const getType = originalEvent.vtec.split(`.`)[0];
|
|
194
194
|
const isTestProduct = loader.definitions.productTypes[getType] == `Test Product`
|
|
195
195
|
if (isTestProduct) { return false; }
|
|
196
196
|
}
|
|
197
|
+
if (bools.checkExpired && originalEvent.properties.is_cancelled == true) return false;
|
|
197
198
|
loader.cache.events.emit(`on${originalEvent.properties.parent.replace(/\s+/g, '')}`)
|
|
198
199
|
return true;
|
|
199
200
|
})
|