@nivaro/react 0.1.67 → 0.1.68

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 (3) hide show
  1. package/dist/index.d.ts +33 -11
  2. package/dist/index.js +5304 -5235
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -235,6 +235,14 @@ export declare function canOpenDm(): boolean;
235
235
 
236
236
  export declare function canPreviewFile(type: string | null | undefined): boolean;
237
237
 
238
+ /**
239
+ * Grab the replay link for an error being reported right now. Resolves null
240
+ * when no recorder is active (both settings off, recording failed, or the
241
+ * clip upload took longer than 4s) — error reporting must never wait on or
242
+ * break because of replay capture.
243
+ */
244
+ export declare function captureErrorClip(): Promise<ErrorReplayLink | null>;
245
+
238
246
  export { CascadeFilterRule }
239
247
 
240
248
  declare type CascadeRule = {
@@ -796,6 +804,13 @@ export declare function ErpFailureBanner({ collection, itemId }: {
796
804
  itemId: string;
797
805
  }): JSX.Element | null;
798
806
 
807
+ export declare interface ErrorReplayLink {
808
+ recording_id: string;
809
+ /** Milliseconds into the recording where the error happened. Null for
810
+ * clips — the whole clip IS the error context. */
811
+ offset_ms: number | null;
812
+ }
813
+
799
814
  /** Boolean convenience — for guards and conditions. */
800
815
  export declare function evaluateBoolean(src: string, row: TokenResolver | Record<string, unknown>, opts?: EvaluateOptions): boolean;
801
816
 
@@ -2834,20 +2849,27 @@ export declare type SectionState = {
2834
2849
  export declare function SelectField({ field, value, onChange, error, disabled, readOnly, inputId, errorId }: FieldComponentProps): JSX.Element;
2835
2850
 
2836
2851
  /**
2837
- * rrweb session recorder for headless frontends.
2852
+ * rrweb session recorder for headless frontends — two modes, one hook
2853
+ * (the exact model the admin app runs; see admin/src/lib/use-session-recorder.ts).
2854
+ *
2855
+ * FULL mode (`session_recording_enabled` on the instance): events stream to
2856
+ * the server continuously.
2857
+ *
2858
+ * ERROR-CLIP mode (`error_replay_enabled`, when full recording is off):
2859
+ * rrweb records into a rolling IN-MEMORY buffer — two 30s checkout windows,
2860
+ * so 30–60s of history — and uploads NOTHING. When the host reports an error,
2861
+ * `captureErrorClip()` flushes the buffer as a short recording labelled
2862
+ * app='error-clip'; attach the returned `recording_id`/`offset_ms` to your
2863
+ * `POST /issues/client` body and the issue links straight to the replay.
2838
2864
  *
2839
2865
  * Drop `useSessionRecorder({ app: 'customer-portal' })` anywhere inside a
2840
- * NivaroProvider (or pass a client explicitly) and the app records itself —
2841
- * ONLY when the Nivaro instance has session recording enabled in Settings,
2842
- * and ONLY if the host app has `rrweb` installed (optional peer dependency;
2843
- * without it the hook warns once and no-ops).
2866
+ * NivaroProvider (or pass a client explicitly). Needs `rrweb` installed in
2867
+ * the host (optional peer dependency; without it the hook warns once and
2868
+ * no-ops). Privacy in both modes: every input masked, `nvr-no-record`
2869
+ * class blocked; in clip mode events never leave the browser except on error.
2844
2870
  *
2845
- * Privacy defaults match the admin recorder: every input masked before
2846
- * events leave the browser, elements with the `nvr-no-record` class blocked.
2847
- * Events flush every 10s (or 150 events); the server enforces size caps and
2848
- * a 7-day retention. Recordings attribute to the authenticated SDK identity
2849
- * (usually your service token's user) with the `app` label telling replays
2850
- * apart per frontend.
2871
+ * `captureErrorClip` is a module singleton so an error boundary — a class
2872
+ * component far from this hook can call it without plumbing.
2851
2873
  */
2852
2874
  export declare interface SessionRecorderOptions {
2853
2875
  /** Label shown in the admin replay list — which frontend this is. */