med-scribe-alliance-ts-sdk 2.0.11 → 2.0.13

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
@@ -287,7 +287,7 @@ export interface CreateSessionRequest {
287
287
  additional_data?: Record<string, any>;
288
288
  session_mode?: string;
289
289
  patient_details?: PatientDetails;
290
- txn_id?: string;
290
+ session_id?: string;
291
291
  }
292
292
  export interface CreateSessionResponse {
293
293
  session_id: string;
@@ -395,7 +395,7 @@ export interface RecordingOptions {
395
395
  deviceId?: string;
396
396
  sessionMode?: string;
397
397
  patientDetails?: PatientDetails;
398
- txnId?: string;
398
+ sessionId?: string;
399
399
  }
400
400
  export interface RecorderConfig {
401
401
  accessToken?: string;
@@ -483,6 +483,8 @@ export interface AudioEventFrameProcessed {
483
483
  data: {
484
484
  isSpeech: number;
485
485
  notSpeech: number;
486
+ frame: Float32Array;
487
+ duration: number;
486
488
  };
487
489
  }
488
490
  export type AudioEvent = AudioEventUserSpeech | AudioEventSilenceWarning | AudioEventChunkReady | AudioEventFrameProcessed;
@@ -660,6 +662,11 @@ export declare class ScribeClient {
660
662
  * Create a session directly (without starting a recording).
661
663
  */
662
664
  createSession(sessionRequest: CreateSessionRequest): Promise<SDKResult<CreateSessionResponse>>;
665
+ /**
666
+ * End a session directly (without stopping a recording).
667
+ * Uses the current active session if no sessionId is provided.
668
+ */
669
+ endSession(request: EndSessionRequest, sessionId?: string): Promise<SDKResult<EndSessionResponse>>;
663
670
  /**
664
671
  * Get the status of a session.
665
672
  * Uses the current active session if no sessionId is provided.
package/dist/index.mjs CHANGED
@@ -169,7 +169,7 @@ var r = "/.well-known/medscribealliance", i = 3600 * 1e3, a = /* @__PURE__ */ fu
169
169
  gender: e.string().optional(),
170
170
  mobile: e.number().optional()
171
171
  }).optional(),
172
- txn_id: e.string().optional()
172
+ session_id: e.string().optional()
173
173
  }), k = e.object({
174
174
  audio_files_sent: e.number().int().min(0, "audio_files_sent must be a non-negative integer"),
175
175
  audio_files_uploaded: e.number().int().min(0, "audio_files_uploaded must be a non-negative integer")
@@ -261,7 +261,7 @@ var r = "/.well-known/medscribealliance", i = 3600 * 1e3, a = /* @__PURE__ */ fu
261
261
  gender: e.string().optional(),
262
262
  mobile: e.number().optional()
263
263
  }).optional(),
264
- txnId: e.string().optional()
264
+ sessionId: e.string().optional()
265
265
  }), P = class {
266
266
  validateDiscoveryResponse(e) {
267
267
  this.parseWithValidationError(D, e, "Invalid discovery response");
@@ -940,7 +940,9 @@ var G = {
940
940
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
941
941
  data: {
942
942
  isSpeech: e.isSpeech,
943
- notSpeech: e.notSpeech
943
+ notSpeech: e.notSpeech,
944
+ frame: t,
945
+ duration: t.length / this.samplingRate
944
946
  }
945
947
  }), !this.isRecording) return;
946
948
  this.onRawFrame?.(t);
@@ -1530,7 +1532,7 @@ var ie = class {
1530
1532
  additional_data: t.additionalData,
1531
1533
  session_mode: t.sessionMode,
1532
1534
  patient_details: t.patientDetails,
1533
- txn_id: t.txnId
1535
+ session_id: t.sessionId
1534
1536
  };
1535
1537
  try {
1536
1538
  let i;
@@ -1851,6 +1853,10 @@ var ie = class {
1851
1853
  let t = this.getEffectiveBaseUrl();
1852
1854
  return this.wrapResult(() => this.sessionManager.createSession(t, e));
1853
1855
  }
1856
+ async endSession(e, t) {
1857
+ let n = this.getEffectiveBaseUrl();
1858
+ return this.wrapResult(() => this.sessionManager.endSession(n, e, t));
1859
+ }
1854
1860
  async getSessionStatus(e, t) {
1855
1861
  let n = this.getEffectiveBaseUrl();
1856
1862
  return t?.poll ? this.wrapResult(() => this.sessionManager.pollForCompletion(n, e, t.poll)) : this.wrapResult(() => this.sessionManager.getSessionStatus(n, e, t?.templateId));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "med-scribe-alliance-ts-sdk",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "TypeScript SDK for the MedScribe Alliance Protocol",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",