@interfere/next 0.0.0-alpha.10 → 0.0.0

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 (154) hide show
  1. package/README.md +1 -0
  2. package/dist/__tests__/build/with-interfere-coverage.test.d.ts +2 -0
  3. package/dist/__tests__/build/with-interfere-coverage.test.d.ts.map +1 -0
  4. package/dist/__tests__/build/with-interfere-coverage.test.js +338 -0
  5. package/dist/__tests__/build/with-interfere-coverage.test.js.map +1 -0
  6. package/dist/__tests__/build/with-interfere.test.d.ts +2 -0
  7. package/dist/__tests__/build/with-interfere.test.d.ts.map +1 -0
  8. package/dist/__tests__/build/with-interfere.test.js +466 -0
  9. package/dist/__tests__/build/with-interfere.test.js.map +1 -0
  10. package/dist/__tests__/core/client.test.d.ts +2 -0
  11. package/dist/__tests__/core/client.test.d.ts.map +1 -0
  12. package/dist/__tests__/core/client.test.js +373 -0
  13. package/dist/__tests__/core/client.test.js.map +1 -0
  14. package/dist/__tests__/core/debug.test.d.ts +2 -0
  15. package/dist/__tests__/core/debug.test.d.ts.map +1 -0
  16. package/dist/__tests__/core/debug.test.js +277 -0
  17. package/dist/__tests__/core/debug.test.js.map +1 -0
  18. package/dist/__tests__/core/encoders.test.d.ts +2 -0
  19. package/dist/__tests__/core/encoders.test.d.ts.map +1 -0
  20. package/dist/__tests__/core/encoders.test.js +56 -0
  21. package/dist/__tests__/core/encoders.test.js.map +1 -0
  22. package/dist/__tests__/core/persistence.test.d.ts +2 -0
  23. package/dist/__tests__/core/persistence.test.d.ts.map +1 -0
  24. package/dist/__tests__/core/persistence.test.js +129 -0
  25. package/dist/__tests__/core/persistence.test.js.map +1 -0
  26. package/dist/__tests__/core/rage-click.test.d.ts +2 -0
  27. package/dist/__tests__/core/rage-click.test.d.ts.map +1 -0
  28. package/dist/__tests__/core/rage-click.test.js +121 -0
  29. package/dist/__tests__/core/rage-click.test.js.map +1 -0
  30. package/dist/__tests__/core/session-manager.test.d.ts +2 -0
  31. package/dist/__tests__/core/session-manager.test.d.ts.map +1 -0
  32. package/dist/__tests__/core/session-manager.test.js +1132 -0
  33. package/dist/__tests__/core/session-manager.test.js.map +1 -0
  34. package/dist/__tests__/integration/release-upload.test.d.ts +2 -0
  35. package/dist/__tests__/integration/release-upload.test.d.ts.map +1 -0
  36. package/dist/__tests__/integration/release-upload.test.js +173 -0
  37. package/dist/__tests__/integration/release-upload.test.js.map +1 -0
  38. package/dist/__tests__/react/provider.test.d.ts +2 -0
  39. package/dist/__tests__/react/provider.test.d.ts.map +1 -0
  40. package/dist/__tests__/react/provider.test.jsx +166 -0
  41. package/dist/__tests__/react/provider.test.jsx.map +1 -0
  42. package/dist/__tests__/session/persistence.test.d.ts +2 -0
  43. package/dist/__tests__/session/persistence.test.d.ts.map +1 -0
  44. package/dist/__tests__/session/persistence.test.js +129 -0
  45. package/dist/__tests__/session/persistence.test.js.map +1 -0
  46. package/dist/__tests__/session/replay.test.d.ts +2 -0
  47. package/dist/__tests__/session/replay.test.d.ts.map +1 -0
  48. package/dist/__tests__/session/replay.test.js +296 -0
  49. package/dist/__tests__/session/replay.test.js.map +1 -0
  50. package/dist/__tests__/session/session-summary.test.d.ts +2 -0
  51. package/dist/__tests__/session/session-summary.test.d.ts.map +1 -0
  52. package/dist/__tests__/session/session-summary.test.js +763 -0
  53. package/dist/__tests__/session/session-summary.test.js.map +1 -0
  54. package/dist/build/index.d.ts +3 -0
  55. package/dist/build/index.d.ts.map +1 -0
  56. package/dist/build/index.js +2 -0
  57. package/dist/build/index.js.map +1 -0
  58. package/dist/build/with-interfere.d.ts +54 -0
  59. package/dist/build/with-interfere.d.ts.map +1 -0
  60. package/dist/build/with-interfere.js +267 -0
  61. package/dist/build/with-interfere.js.map +1 -0
  62. package/dist/core/client-core.d.ts +27 -0
  63. package/dist/core/client-core.d.ts.map +1 -0
  64. package/dist/core/client-core.js +164 -0
  65. package/dist/core/client-core.js.map +1 -0
  66. package/dist/core/client.d.ts +70 -18
  67. package/dist/core/client.d.ts.map +1 -1
  68. package/dist/core/client.js +112 -104
  69. package/dist/core/client.js.map +1 -1
  70. package/dist/core/client.test.js +227 -92
  71. package/dist/core/client.test.js.map +1 -1
  72. package/dist/core/constants.d.ts +12 -0
  73. package/dist/core/constants.d.ts.map +1 -0
  74. package/dist/core/constants.js +17 -0
  75. package/dist/core/constants.js.map +1 -0
  76. package/dist/core/debug.d.ts +47 -0
  77. package/dist/core/debug.d.ts.map +1 -0
  78. package/dist/core/debug.js +79 -0
  79. package/dist/core/debug.js.map +1 -0
  80. package/dist/core/encoders.test.js +20 -19
  81. package/dist/core/encoders.test.js.map +1 -1
  82. package/dist/core/error-handlers.d.ts.map +1 -1
  83. package/dist/core/error-handlers.js +42 -41
  84. package/dist/core/error-handlers.js.map +1 -1
  85. package/dist/core/runtime.d.ts +7 -0
  86. package/dist/core/runtime.d.ts.map +1 -0
  87. package/dist/core/runtime.js +16 -0
  88. package/dist/core/runtime.js.map +1 -0
  89. package/dist/index.d.ts +10 -7
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +6 -7
  92. package/dist/index.js.map +1 -1
  93. package/dist/next/error-boundary.d.ts +5 -5
  94. package/dist/next/error-boundary.d.ts.map +1 -1
  95. package/dist/next/error-boundary.jsx +5 -5
  96. package/dist/next/middleware.d.ts +1 -1
  97. package/dist/next/middleware.js +13 -13
  98. package/dist/persistence/index.d.ts +5 -0
  99. package/dist/persistence/index.d.ts.map +1 -0
  100. package/dist/persistence/index.js +67 -0
  101. package/dist/persistence/index.js.map +1 -0
  102. package/dist/persistence/storage.d.ts +5 -0
  103. package/dist/persistence/storage.d.ts.map +1 -0
  104. package/dist/persistence/storage.js +67 -0
  105. package/dist/persistence/storage.js.map +1 -0
  106. package/dist/react/provider.d.ts +9 -5
  107. package/dist/react/provider.d.ts.map +1 -1
  108. package/dist/react/provider.jsx +33 -10
  109. package/dist/react/provider.jsx.map +1 -1
  110. package/dist/session/constants.d.ts +19 -0
  111. package/dist/session/constants.d.ts.map +1 -0
  112. package/dist/session/constants.js +34 -0
  113. package/dist/session/constants.js.map +1 -0
  114. package/dist/session/persistence.d.ts +58 -0
  115. package/dist/session/persistence.d.ts.map +1 -0
  116. package/dist/session/persistence.js +180 -0
  117. package/dist/session/persistence.js.map +1 -0
  118. package/dist/session/persistence.test.d.ts +2 -0
  119. package/dist/session/persistence.test.d.ts.map +1 -0
  120. package/dist/session/persistence.test.js +129 -0
  121. package/dist/session/persistence.test.js.map +1 -0
  122. package/dist/session/rage-click.d.ts +17 -0
  123. package/dist/session/rage-click.d.ts.map +1 -0
  124. package/dist/session/rage-click.js +104 -0
  125. package/dist/session/rage-click.js.map +1 -0
  126. package/dist/session/rage-click.test.d.ts +2 -0
  127. package/dist/session/rage-click.test.d.ts.map +1 -0
  128. package/dist/session/rage-click.test.js +124 -0
  129. package/dist/session/rage-click.test.js.map +1 -0
  130. package/dist/session/replay.d.ts +2 -2
  131. package/dist/session/replay.d.ts.map +1 -1
  132. package/dist/session/replay.js +57 -24
  133. package/dist/session/replay.js.map +1 -1
  134. package/dist/session/session-manager.d.ts +126 -0
  135. package/dist/session/session-manager.d.ts.map +1 -0
  136. package/dist/session/session-manager.js +635 -0
  137. package/dist/session/session-manager.js.map +1 -0
  138. package/dist/session/session-manager.test.d.ts +2 -0
  139. package/dist/session/session-manager.test.d.ts.map +1 -0
  140. package/dist/session/session-manager.test.js +1134 -0
  141. package/dist/session/session-manager.test.js.map +1 -0
  142. package/dist/session/session-summary.d.ts +2 -2
  143. package/dist/session/session-summary.d.ts.map +1 -1
  144. package/dist/session/session-summary.js +94 -47
  145. package/dist/session/session-summary.js.map +1 -1
  146. package/dist/storage/index.d.ts +5 -0
  147. package/dist/storage/index.d.ts.map +1 -0
  148. package/dist/storage/index.js +67 -0
  149. package/dist/storage/index.js.map +1 -0
  150. package/dist/types/storage.d.ts +7 -0
  151. package/dist/types/storage.d.ts.map +1 -0
  152. package/dist/types/storage.js +2 -0
  153. package/dist/types/storage.js.map +1 -0
  154. package/package.json +24 -7
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Debug utilities for development
3
+ */
4
+ export class DebugUtils {
5
+ config;
6
+ sessionManager;
7
+ persistence;
8
+ surface;
9
+ runtime;
10
+ constructor(params) {
11
+ this.config = params.config;
12
+ this.sessionManager = params.sessionManager;
13
+ this.persistence = params.persistence;
14
+ this.surface = params.surface;
15
+ this.runtime = params.runtime;
16
+ }
17
+ getDebugInfo(queueLength) {
18
+ const { sessionId, windowId, sessionStartTimestamp, lastActivityTimestamp, } = this.sessionManager.checkAndGetSessionAndWindowId(true);
19
+ const now = Date.now();
20
+ const sessionAge = sessionStartTimestamp ? now - sessionStartTimestamp : 0;
21
+ const timeSinceLastActivity = lastActivityTimestamp
22
+ ? now - lastActivityTimestamp
23
+ : 0;
24
+ return {
25
+ sessionId,
26
+ windowId,
27
+ sessionStartTimestamp,
28
+ lastActivityTimestamp,
29
+ sessionTimeoutMs: this.sessionManager.sessionTimeoutMs,
30
+ sessionAge,
31
+ timeSinceLastActivity,
32
+ isSessionActive: timeSinceLastActivity < this.sessionManager.sessionTimeoutMs,
33
+ config: this.config,
34
+ storageInfo: this.getStorageInfo(),
35
+ queueLength,
36
+ surface: this.surface,
37
+ runtime: this.runtime,
38
+ buildId: this.config.buildId,
39
+ releaseId: this.config.releaseId,
40
+ };
41
+ }
42
+ getStorageInfo() {
43
+ const persistenceType = this.config.persistence || "localStorage";
44
+ const isDisabled = this.persistence.isDisabled();
45
+ const canUseLocalStorage = !isDisabled && persistenceType === "localStorage";
46
+ const canUseSessionStorage = !isDisabled && persistenceType === "sessionStorage";
47
+ let storageKeys = [];
48
+ if (!isDisabled && typeof window !== "undefined") {
49
+ if (persistenceType === "localStorage" && window.localStorage) {
50
+ storageKeys = this.getStorageKeys(window.localStorage, "localStorage");
51
+ }
52
+ else if (persistenceType === "sessionStorage" &&
53
+ window.sessionStorage) {
54
+ storageKeys = this.getStorageKeys(window.sessionStorage, "sessionStorage");
55
+ }
56
+ }
57
+ return {
58
+ canUseLocalStorage,
59
+ canUseSessionStorage,
60
+ storageKeys,
61
+ };
62
+ }
63
+ getStorageKeys(storage, prefix) {
64
+ const keys = [];
65
+ try {
66
+ for (let i = 0; i < storage.length; i++) {
67
+ const key = storage.key(i);
68
+ if (key?.startsWith("interfere_")) {
69
+ keys.push(`${prefix}: ${key}`);
70
+ }
71
+ }
72
+ }
73
+ catch {
74
+ // Storage access might be blocked
75
+ }
76
+ return keys;
77
+ }
78
+ }
79
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/core/debug.ts"],"names":[],"mappings":"AAAA;;GAEG;AA+BH,MAAM,OAAO,UAAU;IACJ,MAAM,CAAS;IACf,cAAc,CAAmB;IACjC,WAAW,CAAuB;IAClC,OAAO,CAAS;IAChB,OAAO,CAAU;IAElC,YAAY,MAMX;QACC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,YAAY,CAAC,WAAmB;QAC9B,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,GACtB,GAAG,IAAI,CAAC,cAAc,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;QAE5D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,UAAU,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,MAAM,qBAAqB,GAAG,qBAAqB;YACjD,CAAC,CAAC,GAAG,GA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AAgB,CACjB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,kBAAkB;YAClB,oBAAoB;YACpB,WAAW;SACZ,CAAC;IACJ,CAAC;IAEO,cAAc,CAAC,OAAgB,EAAE,MAAc;QACrD,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACxC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC3B,IAAI,GAAG,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;oBAClC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,kCAAkC;QACpC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -1,39 +1,40 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { decode, encode } from './encoders.js';
3
- describe('encoders', () => {
4
- describe('encode', () => {
5
- it('encodes strings to Uint8Array', () => {
6
- const result = encode('hello');
1
+ /** biome-ignore-all lint/style/noMagicNumbers: Self-explanatory */
2
+ import { describe, expect, it } from "vitest";
3
+ import { decode, encode } from "./encoders.js";
4
+ describe("encoders", () => {
5
+ describe("encode", () => {
6
+ it("encodes strings to Uint8Array", () => {
7
+ const result = encode("hello");
7
8
  expect(result).toBeInstanceOf(Uint8Array);
8
9
  expect(new TextDecoder().decode(result)).toBe('"hello"');
9
10
  });
10
- it('encodes objects to Uint8Array', () => {
11
- const obj = { foo: 'bar', num: 123 };
11
+ it("encodes objects to Uint8Array", () => {
12
+ const obj = { foo: "bar", num: 123 };
12
13
  const result = encode(obj);
13
14
  expect(result).toBeInstanceOf(Uint8Array);
14
15
  expect(new TextDecoder().decode(result)).toBe('{"foo":"bar","num":123}');
15
16
  });
16
- it('encodes arrays to Uint8Array', () => {
17
+ it("encodes arrays to Uint8Array", () => {
17
18
  const arr = [1, 2, 3];
18
19
  const result = encode(arr);
19
20
  expect(result).toBeInstanceOf(Uint8Array);
20
- expect(new TextDecoder().decode(result)).toBe('[1,2,3]');
21
+ expect(new TextDecoder().decode(result)).toBe("[1,2,3]");
21
22
  });
22
- it('encodes null', () => {
23
- expect(new TextDecoder().decode(encode(null))).toBe('null');
23
+ it("encodes null", () => {
24
+ expect(new TextDecoder().decode(encode(null))).toBe("null");
24
25
  });
25
- it('handles undefined by encoding as null', () => {
26
+ it("handles undefined by encoding as null", () => {
26
27
  // JSON.stringify(undefined) returns undefined, which becomes empty string
27
28
  // This is expected behavior for JSON
28
29
  const result = encode(undefined);
29
30
  expect(result).toBeInstanceOf(Uint8Array);
30
31
  });
31
32
  });
32
- describe('decode', () => {
33
- it('decodes Uint8Array back to original values', () => {
33
+ describe("decode", () => {
34
+ it("decodes Uint8Array back to original values", () => {
34
35
  const testCases = [
35
- 'hello',
36
- { foo: 'bar', num: 123 },
36
+ "hello",
37
+ { foo: "bar", num: 123 },
37
38
  [1, 2, 3],
38
39
  null,
39
40
  true,
@@ -46,8 +47,8 @@ describe('encoders', () => {
46
47
  expect(decoded).toEqual(original);
47
48
  }
48
49
  });
49
- it('throws on invalid JSON', () => {
50
- const invalidJson = new TextEncoder().encode('not valid json');
50
+ it("throws on invalid JSON", () => {
51
+ const invalidJson = new TextEncoder().encode("not valid json");
51
52
  expect(() => decode(invalidJson)).toThrow();
52
53
  });
53
54
  });
@@ -1 +1 @@
1
- {"version":3,"file":"encoders.test.js","sourceRoot":"","sources":["../../src/core/encoders.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/C,QAAQ,CAAC,UAAU,EA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C,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"error-handlers.d.ts","sourceRoot":"","sources":["../../src/core/error-handlers.ts"],"names":[],"mappings":"AA4DA,wBAAgB,wBAAwB,IAAI,IAAI,CAiE/C;AAGD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,GACA,IAAI,CAoBN;AAGD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,GACpC,IAAI,CAQN;AAGD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,GACf,IAAI,CAcN;AA+BD,KAAK,aAAa,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE9D,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,EACtD,EAAE,EAAE,CAAC,EACL,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,CAAC,CAkBH"}
1
+ {"version":3,"file":"error-handlers.d.ts","sourceRoot":"","sources":["../../src/core/error-handlers.ts"],"names":[],"mappings":"AA4DA,wBAAgB,wBAAwB,IAAI,IAAI,CAiE/C;AAGD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,GACA,IAAI,CAoBN;AAGD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,GACpC,IAAI,CAQN;AAGD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,GACf,IAAI,CAcN;AAgCD,KAAK,aAAa,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE9D,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,EACtD,EAAE,EAAE,CAAC,EACL,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,CAAC,CAkBH"}
@@ -1,4 +1,4 @@
1
- import { capture } from './client.js';
1
+ import { capture } from "./client.js";
2
2
  // Flag to prevent infinite loops when capturing errors
3
3
  let isCapturing = false;
4
4
  function serializeError(error) {
@@ -10,15 +10,15 @@ function serializeError(error) {
10
10
  cause: error.cause,
11
11
  };
12
12
  }
13
- if (typeof error === 'string') {
13
+ if (typeof error === "string") {
14
14
  return {
15
15
  message: error,
16
- name: 'Error',
16
+ name: "Error",
17
17
  };
18
18
  }
19
19
  return {
20
20
  message: String(error),
21
- name: 'UnknownError',
21
+ name: "UnknownError",
22
22
  };
23
23
  }
24
24
  // Safe capture that doesn't throw if SDK isn't initialized
@@ -41,21 +41,21 @@ function safeCapture(eventType, payload) {
41
41
  }
42
42
  // Client-side error handling
43
43
  export function setupClientErrorHandlers() {
44
- if (typeof window === 'undefined') {
44
+ if (typeof window === "undefined") {
45
45
  return;
46
46
  }
47
47
  // Handle unhandled errors
48
- window.addEventListener('error', (event) => {
48
+ window.addEventListener("error", (event) => {
49
49
  const errorInfo = {
50
50
  message: event.message,
51
- name: 'WindowError',
51
+ name: "WindowError",
52
52
  fileName: event.filename,
53
53
  lineNumber: event.lineno,
54
54
  columnNumber: event.colno,
55
55
  stack: event.error?.stack,
56
56
  };
57
- safeCapture('error', {
58
- type: 'unhandled_error',
57
+ safeCapture("error", {
58
+ type: "unhandled_error",
59
59
  error: errorInfo,
60
60
  url: window.location.href,
61
61
  userAgent: navigator.userAgent,
@@ -63,10 +63,10 @@ export function setupClientErrorHandlers() {
63
63
  });
64
64
  });
65
65
  // Handle unhandled promise rejections
66
- window.addEventListener('unhandledrejection', (event) => {
66
+ window.addEventListener("unhandledrejection", (event) => {
67
67
  const errorInfo = serializeError(event.reason);
68
- safeCapture('error', {
69
- type: 'unhandled_rejection',
68
+ safeCapture("error", {
69
+ type: "unhandled_rejection",
70
70
  error: errorInfo,
71
71
  url: window.location.href,
72
72
  userAgent: navigator.userAgent,
@@ -81,7 +81,7 @@ export function setupClientErrorHandlers() {
81
81
  // Convert arguments to a readable format
82
82
  const message = args
83
83
  .map((arg) => {
84
- if (typeof arg === 'object') {
84
+ if (typeof arg === "object") {
85
85
  try {
86
86
  return JSON.stringify(arg);
87
87
  }
@@ -91,11 +91,11 @@ export function setupClientErrorHandlers() {
91
91
  }
92
92
  return String(arg);
93
93
  })
94
- .join(' ');
95
- safeCapture('error', {
96
- type: 'console_error',
94
+ .join(" ");
95
+ safeCapture("error", {
96
+ type: "console_error",
97
97
  message,
98
- url: typeof window !== 'undefined' ? window.location.href : undefined,
98
+ url: typeof window !== "undefined" ? window.location.href : undefined,
99
99
  timestamp: Date.now(),
100
100
  });
101
101
  };
@@ -103,11 +103,11 @@ export function setupClientErrorHandlers() {
103
103
  // Server/Edge error handling for Next.js
104
104
  export function captureServerError(error, request, context) {
105
105
  const errorInfo = serializeError(error);
106
- const runtime = typeof globalThis !== 'undefined' && 'EdgeRuntime' in globalThis
107
- ? 'edge'
108
- : 'server';
109
- safeCapture(runtime === 'edge' ? 'edge_error' : 'server_error', {
110
- type: 'server_error',
106
+ const runtime = typeof globalThis !== "undefined" && "EdgeRuntime" in globalThis
107
+ ? "edge"
108
+ : "server";
109
+ safeCapture(runtime === "edge" ? "edge_error" : "server_error", {
110
+ type: "server_error",
111
111
  error: errorInfo,
112
112
  request: request
113
113
  ? {
@@ -122,19 +122,19 @@ export function captureServerError(error, request, context) {
122
122
  }
123
123
  // Next.js specific error boundary helper
124
124
  export function captureErrorBoundaryError(error, errorInfo) {
125
- safeCapture('error', {
126
- type: 'error_boundary',
125
+ safeCapture("error", {
126
+ type: "error_boundary",
127
127
  error: serializeError(error),
128
128
  componentStack: errorInfo.componentStack,
129
- url: typeof window !== 'undefined' ? window.location.href : undefined,
129
+ url: typeof window !== "undefined" ? window.location.href : undefined,
130
130
  timestamp: Date.now(),
131
131
  });
132
132
  }
133
133
  // Capture Next.js API route errors
134
134
  export function captureApiRouteError(error, req, pathname) {
135
135
  const errorInfo = serializeError(error);
136
- safeCapture('server_error', {
137
- type: 'api_route_error',
136
+ safeCapture("server_error", {
137
+ type: "api_route_error",
138
138
  error: errorInfo,
139
139
  request: {
140
140
  url: req.url,
@@ -147,26 +147,27 @@ export function captureApiRouteError(error, req, pathname) {
147
147
  }
148
148
  // Determine runtime environment
149
149
  function getRuntime() {
150
- if (typeof window !== 'undefined') {
151
- return 'client';
150
+ if (typeof window !== "undefined") {
151
+ return "client";
152
152
  }
153
- if (typeof globalThis !== 'undefined' && 'EdgeRuntime' in globalThis) {
154
- return 'edge';
153
+ if (typeof globalThis !== "undefined" && "EdgeRuntime" in globalThis) {
154
+ return "edge";
155
155
  }
156
- return 'server';
156
+ return "server";
157
157
  }
158
158
  // Get event type based on runtime
159
159
  function getErrorEventType(runtime) {
160
+ // biome-ignore lint/nursery/noUnnecessaryConditions: runtime is guaranteed to be one of the values in the switch statement
160
161
  switch (runtime) {
161
- case 'client':
162
- return 'error';
163
- case 'edge':
164
- return 'edge_error';
165
- case 'server':
166
- return 'server_error';
162
+ case "client":
163
+ return "error";
164
+ case "edge":
165
+ return "edge_error";
166
+ case "server":
167
+ return "server_error";
167
168
  default:
168
169
  // This should never happen due to the type constraint, but satisfies the linter
169
- return 'error';
170
+ return "error";
170
171
  }
171
172
  }
172
173
  export function withErrorCapture(fn, context) {
@@ -178,9 +179,9 @@ export function withErrorCapture(fn, context) {
178
179
  const runtime = getRuntime();
179
180
  const eventType = getErrorEventType(runtime);
180
181
  safeCapture(eventType, {
181
- type: 'wrapped_function_error',
182
+ type: "wrapped_function_error",
182
183
  error: serializeError(error),
183
- functionName: fn.name || 'anonymous',
184
+ functionName: fn.name || "anonymous",
184
185
  context,
185
186
  timestamp: Date.now(),
186
187
  });
@@ -1 +1 @@
1
- {"version":3,"file":"error-handlers.js","sourceRoot":"","sources":["../../src/core/error-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,uDAAuD;AACvD,IAAI,WAAW,GAAG,KAAK,CAAC;AAYxB,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,OAAO;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC;QACtB,IAAI,EAAE,cAAc;KACrB,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,SAAS,WAAW,CAClB,SAAwC,EACxC,OAAsC;IAEtC,6BAA6B;IAC7B,IAAI,WAAW,EAAE,CAAC;QAChB,OAA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ACV,CAAC"}
1
+ {"version":3,"file":"error-handlers.js","sourceRoot":"","sources":["../../src/core/error-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,uDAAuD;AACvD,IAAI,WAAW,GAAG,KAAgB,CAAC;AAYnC,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,OAAO;SACd,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC;QACtB,IAAI,EAAE,cAAc;KACrB,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,SAAS,WAAW,CAClB,SAAwC,EACxC,OAAsC;IAEtC,6BAA6B;IAC7B,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,WAAW,GAAG,IAAI,CAAC;QACnB,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,wCAAwC;QACxC,gEAAgE;IAClE,CAAC;YAAS,CAAC;QACT,WAAW,GAAG,KAAK,CAAC;IACtB,CAAC;AACH,CAAC;AAED,6BAA6B;AAC7B,MAAM,UAAU,wBAAwB;IACtC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO;IACT,CAAC;IAED,0BAA0B;IAC1B,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACzC,MA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AAC;QAChB,KAAK,QAAQ;YACX,OAAO,OAAO,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,YAAY,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,cAAc,CAAC;QACxB;YACE,gFAAgF;YAChF,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC;AAKD,MAAM,UAAU,gBAAgB,CAC9B,EAAK,EACL,OAAiC;IAEjC,OAAO,CAAC,KAAK,EAAE,GAAG,IAAmB,EAAE,EAAE;QACvC,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;YAC7B,MAAM,SAAS,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAE7C,WAAW,CAAC,SAAS,EAAE;gBACrB,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC;gBAC5B,YAAY,EAAE,EAAE,CAAC,IAAI,IAAI,WAAW;gBACpC,OAAO;gBACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC,CAAC;YACH,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAM,CAAC;AACV,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Runtime detection utilities
3
+ */
4
+ export type Runtime = "client" | "server" | "edge";
5
+ export declare function detectRuntime(): Runtime;
6
+ export declare function isClient(): boolean;
7
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/core/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnD,wBAAgB,aAAa,IAAI,OAAO,CAUvC;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Runtime detection utilities
3
+ */
4
+ export function detectRuntime() {
5
+ if (typeof window !== "undefined") {
6
+ return "client";
7
+ }
8
+ if (typeof globalThis !== "undefined" && "EdgeRuntime" in globalThis) {
9
+ return "edge";
10
+ }
11
+ return "server";
12
+ }
13
+ export function isClient() {
14
+ return typeof window !== "undefined";
15
+ }
16
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/core/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,UAAU,aAAa;IAC3B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,aAAa,IAAI,UAAU,EAAE,CAAC;QACrE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC;AACvC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
- export type { Config, Env, Envelope, EventType, InitConfig, SessionId, SurfaceId, } from '@interfere/schemas';
2
- export { capture, flush, getSessionId, init } from './core/client.js';
3
- export { decode, encode } from './core/encoders.js';
4
- export { captureApiRouteError, captureErrorBoundaryError, captureServerError, setupClientErrorHandlers, withErrorCapture, } from './core/error-handlers.js';
5
- export { InterfereErrorBoundary } from './next/error-boundary.jsx';
6
- export { createInterfereErrorHandler, withInterfereApiRoute, withInterfereMiddleware, withInterfereServerComponent, } from './next/middleware.js';
7
- export { InterfereProvider, useInterfere } from './react/provider.jsx';
1
+ /** biome-ignore-all lint/performance/noBarrelFile: Could be improved in the future */
2
+ export type { Config, Env, InitConfig, } from "@interfere/schemas/config";
3
+ export type { Envelope, EventType, } from "@interfere/schemas/envelope";
4
+ export type { SessionId } from "@interfere/schemas/session";
5
+ export type { SurfaceId } from "@interfere/schemas/surface";
6
+ export { capture, flush, getSessionId, init } from "./core/client.js";
7
+ export { decode, encode } from "./core/encoders.js";
8
+ export { captureApiRouteError, captureErrorBoundaryError, captureServerError, setupClientErrorHandlers, withErrorCapture, } from "./core/error-handlers.js";
9
+ export { createInterfereErrorHandler, withInterfereApiRoute, withInterfereMiddleware, withInterfereServerComponent, } from "./next/middleware.js";
10
+ export { InterfereProvider, useInterfere } from "./react/provider.jsx";
8
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACV,MAAM,EACN,GAAG,EACH,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,sFAAsF;AAGtF,YAAY,EACV,MAAM,EACN,GAAG,EACH,UAAU,GACX,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,QAAQ,EACR,SAAS,GACV,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,11 +1,10 @@
1
1
  // Core client functionality
2
- export { capture, flush, getSessionId, init } from './core/client.js';
3
- export { decode, encode } from './core/encoders.js';
2
+ /** biome-ignore-all lint/performance/noBarrelFile: Could be improved in the future */
3
+ export { capture, flush, getSessionId, init } from "./core/client.js";
4
+ export { decode, encode } from "./core/encoders.js";
4
5
  // Error handling utilities
5
- export { captureApiRouteError, captureErrorBoundaryError, captureServerError, setupClientErrorHandlers, withErrorCapture, } from './core/error-handlers.js';
6
- // Next.js specific components and utilities
7
- export { InterfereErrorBoundary } from './next/error-boundary.jsx';
8
- export { createInterfereErrorHandler, withInterfereApiRoute, withInterfereMiddleware, withInterfereServerComponent, } from './next/middleware.js';
6
+ export { captureApiRouteError, captureErrorBoundaryError, captureServerError, setupClientErrorHandlers, withErrorCapture, } from "./core/error-handlers.js";
7
+ export { createInterfereErrorHandler, withInterfereApiRoute, withInterfereMiddleware, withInterfereServerComponent, } from "./next/middleware.js";
9
8
  // React components and hooks
10
- export { InterfereProvider, useInterfere } from './react/provider.jsx';
9
+ export { InterfereProvider, useInterfere } from "./react/provider.jsx";
11
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAY5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,2BAA2B;AAC3B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,4CAA4C;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,6BAA6B;AAC7B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,sFAAsF;AAiBtF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,2BAA2B;AAC3B,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,6BAA6B;AAC7B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,12 +1,12 @@
1
- import React, { type ReactNode } from 'react';
2
- interface Props {
1
+ import React, { type ReactNode } from "react";
2
+ type Props = {
3
3
  children: ReactNode;
4
4
  fallback?: ReactNode;
5
- }
6
- interface State {
5
+ };
6
+ type State = {
7
7
  hasError: boolean;
8
8
  error?: Error;
9
- }
9
+ };
10
10
  export declare class InterfereErrorBoundary extends React.Component<Props, State> {
11
11
  constructor(props: Props);
12
12
  static getDerivedStateFromError(error: Error): State;
@@ -1 +1 @@
1
- {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/next/error-boundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAMD,qBAAa,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC3D,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAI3C,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAQjE,MAAM;CAgBhB"}
1
+ {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/next/error-boundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAMF,qBAAa,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC3D,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAI3C,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAQjE,MAAM;CAgBhB"}
@@ -1,6 +1,6 @@
1
- 'use client';
2
- import React, {} from 'react';
3
- import { captureErrorBoundaryError } from '../core/error-handlers.js';
1
+ "use client";
2
+ import React, {} from "react";
3
+ import { captureErrorBoundaryError } from "../core/error-handlers.js";
4
4
  export class InterfereErrorBoundary extends React.Component {
5
5
  constructor(props) {
6
6
  super(props);
@@ -12,7 +12,7 @@ export class InterfereErrorBoundary extends React.Component {
12
12
  componentDidCatch(error, errorInfo) {
13
13
  // React's ErrorInfo might have undefined componentStack, but our handler expects a string
14
14
  const errorBoundaryInfo = {
15
- componentStack: errorInfo.componentStack || '',
15
+ componentStack: errorInfo.componentStack || "",
16
16
  };
17
17
  captureErrorBoundaryError(error, errorBoundaryInfo);
18
18
  }
@@ -21,7 +21,7 @@ export class InterfereErrorBoundary extends React.Component {
21
21
  if (this.props.fallback) {
22
22
  return this.props.fallback;
23
23
  }
24
- return (<div style={{ padding: '20px', textAlign: 'center' }}>
24
+ return (<div style={{ padding: "20px", textAlign: "center" }}>
25
25
  <h1>Something went wrong.</h1>
26
26
  <p>We've been notified about this error.</p>
27
27
  </div>);
@@ -1,4 +1,4 @@
1
- import type { NextRequest, NextResponse } from 'next/server';
1
+ import type { NextRequest, NextResponse } from "next/server";
2
2
  export declare function withInterfereMiddleware(middleware: (request: NextRequest) => Promise<NextResponse> | NextResponse): (request: NextRequest) => Promise<NextResponse<unknown>>;
3
3
  export declare function withInterfereApiRoute(handler: (req: NextRequest) => Promise<Response>): (req: NextRequest) => Promise<Response>;
4
4
  export declare function withInterfereServerComponent<T extends (...args: unknown[]) => Promise<unknown>>(component: T, componentName?: string): T;
@@ -1,5 +1,5 @@
1
- import { capture } from '../core/client.js';
2
- import { captureServerError } from '../core/error-handlers.js';
1
+ import { capture } from "../core/client.js";
2
+ import { captureServerError } from "../core/error-handlers.js";
3
3
  // Middleware wrapper to capture errors
4
4
  export function withInterfereMiddleware(middleware) {
5
5
  return async (request) => {
@@ -7,8 +7,8 @@ export function withInterfereMiddleware(middleware) {
7
7
  try {
8
8
  // Try to capture the request, but don't fail if SDK isn't initialized
9
9
  try {
10
- capture('edge_req', {
11
- type: 'middleware_request',
10
+ capture("edge_req", {
11
+ type: "middleware_request",
12
12
  url: request.url,
13
13
  method: request.method,
14
14
  headers: Object.fromEntries(request.headers.entries()),
@@ -22,8 +22,8 @@ export function withInterfereMiddleware(middleware) {
22
22
  const response = await middleware(request);
23
23
  // Try to capture successful response timing
24
24
  try {
25
- capture('edge_req', {
26
- type: 'middleware_response',
25
+ capture("edge_req", {
26
+ type: "middleware_response",
27
27
  url: request.url,
28
28
  statusCode: response.status,
29
29
  duration: Date.now() - startTime,
@@ -58,8 +58,8 @@ export function withInterfereApiRoute(handler) {
58
58
  try {
59
59
  // Try to capture API route request
60
60
  try {
61
- capture('server_req', {
62
- type: 'api_route_request',
61
+ capture("server_req", {
62
+ type: "api_route_request",
63
63
  url: req.url,
64
64
  method: req.method,
65
65
  headers: Object.fromEntries(req.headers.entries()),
@@ -73,8 +73,8 @@ export function withInterfereApiRoute(handler) {
73
73
  const response = await handler(req);
74
74
  // Try to capture response info
75
75
  try {
76
- capture('server_req', {
77
- type: 'api_route_response',
76
+ capture("server_req", {
77
+ type: "api_route_response",
78
78
  url: req.url,
79
79
  statusCode: response.status,
80
80
  duration: Date.now() - startTime,
@@ -91,7 +91,7 @@ export function withInterfereApiRoute(handler) {
91
91
  try {
92
92
  captureServerError(error, req, {
93
93
  pathname: req.nextUrl.pathname,
94
- type: 'api_route',
94
+ type: "api_route",
95
95
  duration: Date.now() - startTime,
96
96
  });
97
97
  }
@@ -111,7 +111,7 @@ export function withInterfereServerComponent(component, componentName) {
111
111
  catch (error) {
112
112
  try {
113
113
  captureServerError(error, undefined, {
114
- type: 'server_component',
114
+ type: "server_component",
115
115
  componentName: componentName || component.name,
116
116
  });
117
117
  }
@@ -128,7 +128,7 @@ export function createInterfereErrorHandler() {
128
128
  try {
129
129
  captureServerError(error, undefined, {
130
130
  digest: errorInfo.digest,
131
- type: 'app_directory_error',
131
+ type: "app_directory_error",
132
132
  });
133
133
  }
134
134
  catch {
@@ -0,0 +1,5 @@
1
+ import type { PersistentStore } from "../types/storage";
2
+ export declare const localStore: PersistentStore;
3
+ export declare const sessionStore: PersistentStore;
4
+ export declare const memoryStore: PersistentStore;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/persistence/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAoExD,eAAO,MAAM,UAAU,iBAAgC,CAAC;AACxD,eAAO,MAAM,YAAY,iBAAkC,CAAC;AAC5D,eAAO,MAAM,WAAW,iBAA0B,CAAC"}