@kush_hemant/react-api-monitor 1.0.17 → 1.0.18

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 +0 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -37,7 +37,6 @@ var isPatched = false;
37
37
  function monitorFetch() {
38
38
  if (isPatched) return;
39
39
  isPatched = true;
40
- if (!window.fetch) return;
41
40
  const originalFetch = window.fetch;
42
41
  window.fetch = async function(...args) {
43
42
  const input = args[0];
@@ -64,9 +63,6 @@ function monitorFetch() {
64
63
  try {
65
64
  if (init.body) {
66
65
  requestBody = typeof init.body === "string" ? init.body : JSON.stringify(init.body);
67
- } else if (input instanceof Request) {
68
- const clone = input.clone();
69
- requestBody = await clone.text();
70
66
  }
71
67
  } catch {
72
68
  }
@@ -87,15 +83,6 @@ function monitorFetch() {
87
83
  { once: true }
88
84
  );
89
85
  }
90
- sendLog({
91
- type: "api_start",
92
- transport: "fetch",
93
- url,
94
- method,
95
- requestHeaders,
96
- requestBody,
97
- ...getMetadata()
98
- });
99
86
  try {
100
87
  const response = await originalFetch.apply(
101
88
  this,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kush_hemant/react-api-monitor",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Automatic API monitoring SDK for React apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",