med-scribe-alliance-ts-sdk 2.0.26 → 2.0.27

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.
package/dist/index.d.ts CHANGED
@@ -28,6 +28,41 @@ export declare enum TransportMode {
28
28
  DIRECT = "direct",
29
29
  IPC = "ipc"
30
30
  }
31
+ declare enum RecordingState$1 {
32
+ STARTED = "started",
33
+ PAUSED = "paused",
34
+ RESUMED = "resumed",
35
+ ENDED = "ended"
36
+ }
37
+ export declare enum AudioEventType {
38
+ USER_SPEECH = "user_speech",
39
+ SILENCE_WARNING = "silence_warning",
40
+ CHUNK_READY = "chunk_ready",
41
+ FRAME_PROCESSED = "frame_processed"
42
+ }
43
+ export declare enum UploadEventType {
44
+ PROGRESS = "progress",
45
+ FAILED = "failed",
46
+ RETRY = "retry"
47
+ }
48
+ export declare enum SessionEventType {
49
+ CREATED = "created",
50
+ ENDED = "ended",
51
+ DISCARDED = "discarded",
52
+ STATUS_UPDATE = "status_update",
53
+ PARTIAL_RESULT = "partial_result"
54
+ }
55
+ export declare enum ErrorEventType {
56
+ VAD_ERROR = "vad_error",
57
+ WORKER_ERROR = "worker_error",
58
+ TRANSPORT_ERROR = "transport_error",
59
+ VALIDATION_ERROR = "validation_error"
60
+ }
61
+ export declare enum DiscardReason {
62
+ CLEARED = "cleared",
63
+ CANCELLED = "cancelled",
64
+ RESET = "reset"
65
+ }
31
66
  export declare enum ErrorCode {
32
67
  AUTHENTICATION_FAILED = "authentication_failed",
33
68
  TOKEN_EXPIRED = "token_expired",
@@ -52,7 +87,18 @@ export declare enum ErrorCode {
52
87
  TRANSPORT_ERROR = "transport_error",
53
88
  WORKER_ERROR = "worker_error",
54
89
  UPLOAD_FAILED = "upload_failed",
55
- VAD_ERROR = "vad_error"
90
+ VAD_ERROR = "vad_error",
91
+ CHUNK_LENGTH_EXCEEDED = "chunk_length_exceeded",
92
+ CHUNK_LIMIT_REACHED = "chunk_limit_reached",
93
+ CHUNK_CREATION_FAILED = "chunk_creation_failed",
94
+ WORKER_POST_FAILED = "worker_post_failed",
95
+ SESSION_CREATION_FAILED = "session_creation_failed",
96
+ RECORDER_INIT_FAILED = "recorder_init_failed",
97
+ RECORDER_START_FAILED = "recorder_start_failed",
98
+ VAD_START_FAILED = "vad_start_failed",
99
+ STOP_FAILED = "stop_failed",
100
+ INTERNAL_RETRY_FAILED = "internal_retry_failed",
101
+ SESSION_END_FAILED = "session_end_failed"
56
102
  }
57
103
  export declare enum HttpStatus {
58
104
  OK = 200,
@@ -477,29 +523,27 @@ export interface RetryUploadResult {
477
523
  /** File names that still failed after retry */
478
524
  stillFailed: string[];
479
525
  }
480
- type RecordingState$1 = "started" | "paused" | "resumed" | "ended";
481
526
  export interface RecordingStateChangeEvent {
482
527
  type: RecordingState$1;
483
528
  timestamp: string;
484
529
  data?: any;
485
530
  }
486
- export type AudioEventType = "user_speech" | "silence_warning" | "chunk_ready" | "frame_processed";
487
531
  export interface AudioEventUserSpeech {
488
- type: "user_speech";
532
+ type: AudioEventType.USER_SPEECH;
489
533
  timestamp: string;
490
534
  data: {
491
535
  isSpeaking: boolean;
492
536
  };
493
537
  }
494
538
  export interface AudioEventSilenceWarning {
495
- type: "silence_warning";
539
+ type: AudioEventType.SILENCE_WARNING;
496
540
  timestamp: string;
497
541
  data: {
498
542
  durationMs: number;
499
543
  };
500
544
  }
501
545
  export interface AudioEventChunkReady {
502
- type: "chunk_ready";
546
+ type: AudioEventType.CHUNK_READY;
503
547
  timestamp: string;
504
548
  data: {
505
549
  chunkIndex: number;
@@ -508,7 +552,7 @@ export interface AudioEventChunkReady {
508
552
  };
509
553
  }
510
554
  export interface AudioEventFrameProcessed {
511
- type: "frame_processed";
555
+ type: AudioEventType.FRAME_PROCESSED;
512
556
  timestamp: string;
513
557
  data: {
514
558
  isSpeech: number;
@@ -518,9 +562,8 @@ export interface AudioEventFrameProcessed {
518
562
  };
519
563
  }
520
564
  export type AudioEvent = AudioEventUserSpeech | AudioEventSilenceWarning | AudioEventChunkReady | AudioEventFrameProcessed;
521
- export type UploadEventType = "progress" | "failed" | "retry";
522
565
  export interface UploadEventProgress {
523
- type: "progress";
566
+ type: UploadEventType.PROGRESS;
524
567
  timestamp: string;
525
568
  data: {
526
569
  successCount: number;
@@ -528,7 +571,7 @@ export interface UploadEventProgress {
528
571
  };
529
572
  }
530
573
  export interface UploadEventFailed {
531
- type: "failed";
574
+ type: UploadEventType.FAILED;
532
575
  timestamp: string;
533
576
  data: {
534
577
  fileName: string;
@@ -536,7 +579,7 @@ export interface UploadEventFailed {
536
579
  };
537
580
  }
538
581
  export interface UploadEventRetry {
539
- type: "retry";
582
+ type: UploadEventType.RETRY;
540
583
  timestamp: string;
541
584
  data: {
542
585
  fileName: string;
@@ -544,42 +587,40 @@ export interface UploadEventRetry {
544
587
  };
545
588
  }
546
589
  export type UploadEvent = UploadEventProgress | UploadEventFailed | UploadEventRetry;
547
- export type SessionEventType = "created" | "ended" | "discarded" | "status_update" | "partial_result";
548
590
  export interface SessionEventCreated {
549
- type: "created";
591
+ type: SessionEventType.CREATED;
550
592
  timestamp: string;
551
593
  data: CreateSessionResponse;
552
594
  }
553
595
  export interface SessionEventEnded {
554
- type: "ended";
596
+ type: SessionEventType.ENDED;
555
597
  timestamp: string;
556
598
  data: EndSessionResponse;
557
599
  }
558
600
  export interface SessionEventDiscarded {
559
- type: "discarded";
601
+ type: SessionEventType.DISCARDED;
560
602
  timestamp: string;
561
603
  data: {
562
604
  sessionId: string | null;
563
- reason: "cleared" | "cancelled" | "reset";
605
+ reason: DiscardReason;
564
606
  };
565
607
  }
566
608
  export interface SessionEventStatusUpdate {
567
- type: "status_update";
609
+ type: SessionEventType.STATUS_UPDATE;
568
610
  timestamp: string;
569
611
  data: GetSessionStatusResponse;
570
612
  }
571
613
  export interface SessionEventPartialResult {
572
- type: "partial_result";
614
+ type: SessionEventType.PARTIAL_RESULT;
573
615
  timestamp: string;
574
616
  data: any;
575
617
  }
576
618
  export type SessionEvent = SessionEventCreated | SessionEventEnded | SessionEventDiscarded | SessionEventStatusUpdate | SessionEventPartialResult;
577
- export type ErrorEventType = "vad_error" | "worker_error" | "transport_error" | "validation_error";
578
619
  interface ErrorEvent$1 {
579
620
  type: ErrorEventType;
580
621
  timestamp: string;
581
622
  error: {
582
- code: string;
623
+ code: ErrorCode;
583
624
  message: string;
584
625
  details?: any;
585
626
  };
@@ -708,6 +749,11 @@ export declare class ScribeClient {
708
749
  * Check if the active recording is paused.
709
750
  */
710
751
  isRecordingPaused(): boolean;
752
+ /**
753
+ * Override the 500-chunk session limit, allowing unlimited chunks.
754
+ * Call this after receiving a 'chunk_limit_reached' error to resume chunk uploads.
755
+ */
756
+ forceAllowMoreChunks(): void;
711
757
  /**
712
758
  * Create a session directly (without starting a recording).
713
759
  */
@@ -1045,6 +1091,11 @@ export declare class RecordingManager {
1045
1091
  * and don't want to block on pending uploads.
1046
1092
  */
1047
1093
  forceStop(): void;
1094
+ /**
1095
+ * Override the session chunk limit, allowing unlimited chunks.
1096
+ * Only applies to ChunkedRecorder.
1097
+ */
1098
+ forceAllowMoreChunks(): void;
1048
1099
  /**
1049
1100
  * Update the auth token for the active recording.
1050
1101
  * Forwards to the active recorder (which updates WorkerManager/transport).