@keploy/capture-sdk 3.0.1 → 3.1.0-rc.2

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 (55) hide show
  1. package/README.md +1617 -130
  2. package/body-redact/package.json +6 -0
  3. package/body-worker-start/package.json +6 -0
  4. package/dist/body-jobs.d.ts +134 -0
  5. package/dist/body-redact.d.ts +23 -0
  6. package/dist/body-redact.js +1 -0
  7. package/dist/body-redact.js.map +1 -0
  8. package/dist/body-redact.mjs +1 -0
  9. package/dist/body-redact.mjs.map +1 -0
  10. package/dist/body-worker-none.d.ts +3 -0
  11. package/dist/body-worker-none.js +1 -0
  12. package/dist/body-worker-none.js.map +1 -0
  13. package/dist/body-worker-none.mjs +1 -0
  14. package/dist/body-worker-none.mjs.map +1 -0
  15. package/dist/body-worker-start.d.ts +3 -0
  16. package/dist/body-worker-start.js +1 -0
  17. package/dist/body-worker-start.js.map +1 -0
  18. package/dist/body-worker-start.mjs +1 -0
  19. package/dist/body-worker-start.mjs.map +1 -0
  20. package/dist/body-worker-unbundled.d.ts +1 -0
  21. package/dist/body-worker-unbundled.mjs +1 -0
  22. package/dist/body-worker-unbundled.mjs.map +1 -0
  23. package/dist/body-worker.d.ts +1 -0
  24. package/dist/body-worker.js +1 -0
  25. package/dist/body-worker.js.map +1 -0
  26. package/dist/errors.d.ts +224 -28
  27. package/dist/index.bundler.mjs +1 -0
  28. package/dist/index.bundler.mjs.map +1 -0
  29. package/dist/index.d.ts +23 -28
  30. package/dist/index.js +1 -2354
  31. package/dist/index.js.map +1 -0
  32. package/dist/index.mjs +1 -2297
  33. package/dist/index.mjs.map +1 -0
  34. package/dist/leave.d.ts +67 -0
  35. package/dist/module-of.d.ts +58 -0
  36. package/dist/network.d.ts +163 -4
  37. package/dist/privacy.d.ts +387 -12
  38. package/dist/recorder.d.ts +304 -64
  39. package/dist/redact.d.ts +48 -6
  40. package/dist/request-term.d.ts +23 -0
  41. package/dist/request-term.js +1 -0
  42. package/dist/request-term.js.map +1 -0
  43. package/dist/request-term.mjs +1 -0
  44. package/dist/request-term.mjs.map +1 -0
  45. package/dist/strict-attributes.d.ts +9 -0
  46. package/dist/strict-attributes.js +1 -0
  47. package/dist/strict-attributes.js.map +1 -0
  48. package/dist/strict-attributes.mjs +1 -0
  49. package/dist/strict-attributes.mjs.map +1 -0
  50. package/dist/term-candidate.d.ts +16 -0
  51. package/dist/transport.d.ts +269 -130
  52. package/dist/types.d.ts +152 -9
  53. package/package.json +37 -4
  54. package/request-term/package.json +6 -0
  55. package/strict-attributes/package.json +6 -0
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export type { CaptureConfig, SessionEvent, SessionEventType, NetworkEvent, Netwo
2
2
  export { PrivacyEngine, defaultPrivacyConfig } from "./privacy";
3
3
  export { NetworkInterceptor } from "./network";
4
4
  export { Transport } from "./transport";
5
- export { CaptureError, IngestRejection, SessionIdRefusal, SDK_ERRORS, SDK_WARNINGS, codeForStatus, describeValue, parseServerError, } from "./errors";
6
- export type { AnyCaptureError, CaptureErrorCode, CaptureWarningCode, CaptureWarningEvidence, CaptureEvidence, CaptureRemedy, IngestEvidence, ServerAnsweredCode, ServerError, ServerIssue, SessionIdEvidence, } from "./errors";
5
+ export { CaptureDeclined, CaptureError, DomRecorderRefusal, IngestRejection, PrivacyConflict, PrivacyRouteRefusal, SessionIdRefusal, StrictAttributesRefusal, SDK_ERRORS, SDK_WARNINGS, codeForStatus, describeValue, parseServerError, } from "./errors";
6
+ export type { AnyCaptureError, CaptureDeclinedEvidence, CaptureErrorCode, CaptureWarningCode, CaptureWarningEvidence, CaptureEvidence, CaptureRemedy, DomRecorderEvidence, PrivacyRouteEvidence, IngestEvidence, ServerAnsweredCode, ServerError, PrivacyConflictEvidence, PrivacySignal, ServerIssue, SessionIdEvidence, } from "./errors";
7
7
  export { SESSION_ID_MAX_LENGTH, SESSION_ID_PATTERN, SESSION_ID_RULE, isValidSessionId, } from "./session-id";
8
8
  export type { TransportConfig } from "./transport";
9
9
  export { KeployCaptureRecorder } from "./recorder";
@@ -30,6 +30,7 @@ export declare class KeployCapture {
30
30
  * ```
31
31
  */
32
32
  static init(config: CaptureConfig): Promise<KeployCapture>;
33
+ private static begin;
33
34
  /**
34
35
  * Stop all recording and flush remaining events.
35
36
  *
@@ -37,9 +38,12 @@ export declare class KeployCapture {
37
38
  */
38
39
  static stop(): Promise<void>;
39
40
  /**
40
- * Pause recording: no event of any kind — DOM or network — is
41
- * emitted until {@link resume}. The tab going hidden and visible in
42
- * between does not end the pause.
41
+ * Pause recording: nothing more is recorded until {@link resume}. No
42
+ * DOM event, and no network exchange that starts or is answered while
43
+ * paused; an exchange still reading its body is recorded at once with
44
+ * what had arrived, cut and marked, and nothing of it after, resume()
45
+ * included. The tab going hidden and visible in between does not end
46
+ * the pause.
43
47
  */
44
48
  static pause(): void;
45
49
  /** Resume recording after {@link pause}. A hidden tab stays paused until it is visible. */
@@ -73,32 +77,23 @@ export declare class KeployCapture {
73
77
  private start;
74
78
  private stop;
75
79
  /**
76
- * The recorder refused to start: the configured sessionIdGenerator
77
- * did not produce a session id -- a string outside the server's
78
- * rule, a non-string, or a throw (KUI_E_SESSION_ID_INVALID). Nothing
79
- * has been sent and nothing is patched, but the singleton is set, so
80
- * this takes the path a server rejection takes and in the same order
81
- * -- the console line, the capture ended and the singleton released,
82
- * THEN onError -- so a handler that fixes the generator and calls
83
- * init() again gets a fresh capture, not this dead one.
80
+ * The capture was declined by a privacy signal: the capture ended,
81
+ * then onError -- on EVERY declined init(), so each handler learns its
82
+ * capture did not start (a silent init() looks like success) -- and
83
+ * the console line ONCE PER PAGE, since the signal does not change and
84
+ * a page that re-inits (React StrictMode's double effect, a re-init per
85
+ * route) would otherwise repeat it. Logged as information: nothing
86
+ * failed.
84
87
  */
88
+ private decline;
85
89
  private refuse;
86
- /**
87
- * A subsystem ended this capture on its own. ONE path, two callers:
88
- *
89
- * - the recorder, when `maxSessionDuration` elapses;
90
- * - the transport, when the server answers a batch with a terminal
91
- * 4xx — a revoked key, a key for another app, or a second run
92
- * claiming a live session id. That one used to stop the transport
93
- * alone, so rrweb kept recording, fetch and XHR stayed patched and
94
- * the session timer stayed armed for a capture that could never
95
- * post another byte.
96
- *
97
- * The singleton is released either way, so a later init() starts a
98
- * NEW session rather than handing back a finished or dead one — which
99
- * is the whole recovery path after a key is rotated.
100
- */
101
90
  private endCapture;
91
+ /** Cancels a continuous capture's wait for the visitor's next interaction. */
92
+ private static cancelNextSession;
93
+ private static nextSessionPaused;
94
+ private static ending;
95
+ private static restartPending;
96
+ private endSession;
102
97
  private pause;
103
98
  private resume;
104
99
  }