med-scribe-alliance-ts-sdk 2.0.26 → 2.0.28
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 +73 -21
- package/dist/index.mjs +245 -189
- package/dist/worker.bundle.js +1 -1
- package/package.json +1 -1
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,
|
|
@@ -157,6 +203,7 @@ export interface TransportRequest {
|
|
|
157
203
|
uploadBlob?: Blob;
|
|
158
204
|
/** Additional HTTP status codes to treat as success (not throw). */
|
|
159
205
|
acceptStatuses?: number[];
|
|
206
|
+
maxRetries?: number;
|
|
160
207
|
}
|
|
161
208
|
export interface TransportResponse<T = any> {
|
|
162
209
|
status: number;
|
|
@@ -477,29 +524,27 @@ export interface RetryUploadResult {
|
|
|
477
524
|
/** File names that still failed after retry */
|
|
478
525
|
stillFailed: string[];
|
|
479
526
|
}
|
|
480
|
-
type RecordingState$1 = "started" | "paused" | "resumed" | "ended";
|
|
481
527
|
export interface RecordingStateChangeEvent {
|
|
482
528
|
type: RecordingState$1;
|
|
483
529
|
timestamp: string;
|
|
484
530
|
data?: any;
|
|
485
531
|
}
|
|
486
|
-
export type AudioEventType = "user_speech" | "silence_warning" | "chunk_ready" | "frame_processed";
|
|
487
532
|
export interface AudioEventUserSpeech {
|
|
488
|
-
type:
|
|
533
|
+
type: AudioEventType.USER_SPEECH;
|
|
489
534
|
timestamp: string;
|
|
490
535
|
data: {
|
|
491
536
|
isSpeaking: boolean;
|
|
492
537
|
};
|
|
493
538
|
}
|
|
494
539
|
export interface AudioEventSilenceWarning {
|
|
495
|
-
type:
|
|
540
|
+
type: AudioEventType.SILENCE_WARNING;
|
|
496
541
|
timestamp: string;
|
|
497
542
|
data: {
|
|
498
543
|
durationMs: number;
|
|
499
544
|
};
|
|
500
545
|
}
|
|
501
546
|
export interface AudioEventChunkReady {
|
|
502
|
-
type:
|
|
547
|
+
type: AudioEventType.CHUNK_READY;
|
|
503
548
|
timestamp: string;
|
|
504
549
|
data: {
|
|
505
550
|
chunkIndex: number;
|
|
@@ -508,7 +553,7 @@ export interface AudioEventChunkReady {
|
|
|
508
553
|
};
|
|
509
554
|
}
|
|
510
555
|
export interface AudioEventFrameProcessed {
|
|
511
|
-
type:
|
|
556
|
+
type: AudioEventType.FRAME_PROCESSED;
|
|
512
557
|
timestamp: string;
|
|
513
558
|
data: {
|
|
514
559
|
isSpeech: number;
|
|
@@ -518,9 +563,8 @@ export interface AudioEventFrameProcessed {
|
|
|
518
563
|
};
|
|
519
564
|
}
|
|
520
565
|
export type AudioEvent = AudioEventUserSpeech | AudioEventSilenceWarning | AudioEventChunkReady | AudioEventFrameProcessed;
|
|
521
|
-
export type UploadEventType = "progress" | "failed" | "retry";
|
|
522
566
|
export interface UploadEventProgress {
|
|
523
|
-
type:
|
|
567
|
+
type: UploadEventType.PROGRESS;
|
|
524
568
|
timestamp: string;
|
|
525
569
|
data: {
|
|
526
570
|
successCount: number;
|
|
@@ -528,7 +572,7 @@ export interface UploadEventProgress {
|
|
|
528
572
|
};
|
|
529
573
|
}
|
|
530
574
|
export interface UploadEventFailed {
|
|
531
|
-
type:
|
|
575
|
+
type: UploadEventType.FAILED;
|
|
532
576
|
timestamp: string;
|
|
533
577
|
data: {
|
|
534
578
|
fileName: string;
|
|
@@ -536,7 +580,7 @@ export interface UploadEventFailed {
|
|
|
536
580
|
};
|
|
537
581
|
}
|
|
538
582
|
export interface UploadEventRetry {
|
|
539
|
-
type:
|
|
583
|
+
type: UploadEventType.RETRY;
|
|
540
584
|
timestamp: string;
|
|
541
585
|
data: {
|
|
542
586
|
fileName: string;
|
|
@@ -544,42 +588,40 @@ export interface UploadEventRetry {
|
|
|
544
588
|
};
|
|
545
589
|
}
|
|
546
590
|
export type UploadEvent = UploadEventProgress | UploadEventFailed | UploadEventRetry;
|
|
547
|
-
export type SessionEventType = "created" | "ended" | "discarded" | "status_update" | "partial_result";
|
|
548
591
|
export interface SessionEventCreated {
|
|
549
|
-
type:
|
|
592
|
+
type: SessionEventType.CREATED;
|
|
550
593
|
timestamp: string;
|
|
551
594
|
data: CreateSessionResponse;
|
|
552
595
|
}
|
|
553
596
|
export interface SessionEventEnded {
|
|
554
|
-
type:
|
|
597
|
+
type: SessionEventType.ENDED;
|
|
555
598
|
timestamp: string;
|
|
556
599
|
data: EndSessionResponse;
|
|
557
600
|
}
|
|
558
601
|
export interface SessionEventDiscarded {
|
|
559
|
-
type:
|
|
602
|
+
type: SessionEventType.DISCARDED;
|
|
560
603
|
timestamp: string;
|
|
561
604
|
data: {
|
|
562
605
|
sessionId: string | null;
|
|
563
|
-
reason:
|
|
606
|
+
reason: DiscardReason;
|
|
564
607
|
};
|
|
565
608
|
}
|
|
566
609
|
export interface SessionEventStatusUpdate {
|
|
567
|
-
type:
|
|
610
|
+
type: SessionEventType.STATUS_UPDATE;
|
|
568
611
|
timestamp: string;
|
|
569
612
|
data: GetSessionStatusResponse;
|
|
570
613
|
}
|
|
571
614
|
export interface SessionEventPartialResult {
|
|
572
|
-
type:
|
|
615
|
+
type: SessionEventType.PARTIAL_RESULT;
|
|
573
616
|
timestamp: string;
|
|
574
617
|
data: any;
|
|
575
618
|
}
|
|
576
619
|
export type SessionEvent = SessionEventCreated | SessionEventEnded | SessionEventDiscarded | SessionEventStatusUpdate | SessionEventPartialResult;
|
|
577
|
-
export type ErrorEventType = "vad_error" | "worker_error" | "transport_error" | "validation_error";
|
|
578
620
|
interface ErrorEvent$1 {
|
|
579
621
|
type: ErrorEventType;
|
|
580
622
|
timestamp: string;
|
|
581
623
|
error: {
|
|
582
|
-
code:
|
|
624
|
+
code: ErrorCode;
|
|
583
625
|
message: string;
|
|
584
626
|
details?: any;
|
|
585
627
|
};
|
|
@@ -630,7 +672,7 @@ export interface WorkerUploadFailedMessage {
|
|
|
630
672
|
type: "upload_failed";
|
|
631
673
|
fileName: string;
|
|
632
674
|
error: string;
|
|
633
|
-
|
|
675
|
+
chunkData?: Uint8Array[];
|
|
634
676
|
}
|
|
635
677
|
export interface WorkerAllUploadsCompleteMessage {
|
|
636
678
|
type: "all_uploads_complete";
|
|
@@ -708,6 +750,11 @@ export declare class ScribeClient {
|
|
|
708
750
|
* Check if the active recording is paused.
|
|
709
751
|
*/
|
|
710
752
|
isRecordingPaused(): boolean;
|
|
753
|
+
/**
|
|
754
|
+
* Override the 500-chunk session limit, allowing unlimited chunks.
|
|
755
|
+
* Call this after receiving a 'chunk_limit_reached' error to resume chunk uploads.
|
|
756
|
+
*/
|
|
757
|
+
forceAllowMoreChunks(): void;
|
|
711
758
|
/**
|
|
712
759
|
* Create a session directly (without starting a recording).
|
|
713
760
|
*/
|
|
@@ -1045,6 +1092,11 @@ export declare class RecordingManager {
|
|
|
1045
1092
|
* and don't want to block on pending uploads.
|
|
1046
1093
|
*/
|
|
1047
1094
|
forceStop(): void;
|
|
1095
|
+
/**
|
|
1096
|
+
* Override the session chunk limit, allowing unlimited chunks.
|
|
1097
|
+
* Only applies to ChunkedRecorder.
|
|
1098
|
+
*/
|
|
1099
|
+
forceAllowMoreChunks(): void;
|
|
1048
1100
|
/**
|
|
1049
1101
|
* Update the auth token for the active recording.
|
|
1050
1102
|
* Forwards to the active recorder (which updates WorkerManager/transport).
|