analytica.click 0.0.256 → 0.0.259

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 (2) hide show
  1. package/dist/index.js +30 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -672,6 +672,31 @@ var require_api = __commonJS({
672
672
  }
673
673
  });
674
674
 
675
+ // ../common/dist/helpers/logsend.js
676
+ var require_logsend = __commonJS({
677
+ "../common/dist/helpers/logsend.js"(exports) {
678
+ Object.defineProperty(exports, "__esModule", { value: true });
679
+ exports.isValidLogMessage = void 0;
680
+ var log_1 = require("ag-common/dist/common/helpers/log");
681
+ function isValidLogMessage2(m) {
682
+ if (!m) {
683
+ (0, log_1.info)("no message?");
684
+ return false;
685
+ }
686
+ if (m.match(/^"?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"?$/)) {
687
+ (0, log_1.info)("ignoring react devtools message");
688
+ return false;
689
+ }
690
+ if (m === JSON.stringify([{}])) {
691
+ (0, log_1.info)("empty message payload?");
692
+ return false;
693
+ }
694
+ return true;
695
+ }
696
+ exports.isValidLogMessage = isValidLogMessage2;
697
+ }
698
+ });
699
+
675
700
  // ../common-ui/dist/components/ErrorBoundary/index.js
676
701
  var require_ErrorBoundary = __commonJS({
677
702
  "../common-ui/dist/components/ErrorBoundary/index.js"(exports) {
@@ -813,6 +838,7 @@ var import_array = require("ag-common/dist/common/helpers/array");
813
838
  var import_log = require("ag-common/dist/common/helpers/log");
814
839
  var import_callOpenApi = require("ag-common/dist/ui/helpers/callOpenApi");
815
840
  var import_api = __toESM(require_api());
841
+ var import_logsend = __toESM(require_logsend());
816
842
  function callOpenApi(p) {
817
843
  return (0, import_callOpenApi.callOpenApi)(__spreadProps(__spreadValues({}, p), {
818
844
  func: (d) => p.func(d),
@@ -875,10 +901,14 @@ var errorTrack = (_0) => __async(void 0, [_0], function* ({
875
901
  data,
876
902
  overrideBaseUrl = "https://api.analytica.click"
877
903
  }) {
904
+ var _a2;
878
905
  if (isLocal) {
879
906
  (0, import_log.debug)(`local error tracking ignored:${data.data.message} ${JSON.stringify(data)}, to ${overrideBaseUrl}`);
880
907
  return {};
881
908
  }
909
+ if (!(0, import_logsend.isValidLogMessage)((_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.message)) {
910
+ return {};
911
+ }
882
912
  (0, import_log.debug)("error track", data.data.message, JSON.stringify(data));
883
913
  errorBuffer.push(data);
884
914
  overrideBaseUrlSet = overrideBaseUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analytica.click",
3
- "version": "0.0.256",
3
+ "version": "0.0.259",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",