med-scribe-alliance-ts-sdk 2.0.20 → 2.0.23

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
@@ -209,6 +209,12 @@ export interface ScribeSDKConfig {
209
209
  debug?: boolean;
210
210
  /** Auto-fetch discovery document on init. Default: true */
211
211
  autoDiscovery?: boolean;
212
+ /**
213
+ * Optional `flavour` identifier. When set, the SDK sends it as the
214
+ * `flavour` header on every API request (including chunk uploads).
215
+ * Server uses this to route or tag requests per deployment variant.
216
+ */
217
+ flavour?: string;
212
218
  }
213
219
  /**
214
220
  * Discovery document types (MedScribe Alliance Protocol)
@@ -956,6 +962,8 @@ export interface WorkerManagerConfig {
956
962
  export interface RecordingManagerConfig {
957
963
  workerConfig?: WorkerManagerConfig;
958
964
  debug?: boolean;
965
+ /** Optional `flavour` identifier — sent as a header on chunk upload requests. */
966
+ flavour?: string;
959
967
  }
960
968
  export declare class RecordingManager {
961
969
  private callbackRegistry;
@@ -1090,11 +1098,13 @@ export declare class RecordingManager {
1090
1098
  }
1091
1099
  export declare class HttpTransport implements ITransport {
1092
1100
  private accessToken?;
1101
+ private flavour?;
1093
1102
  private debug;
1094
1103
  private onUnauthorized?;
1095
1104
  private tokenRefreshPromise;
1096
1105
  constructor(options: {
1097
1106
  accessToken?: string;
1107
+ flavour?: string;
1098
1108
  debug?: boolean;
1099
1109
  onUnauthorized?: () => Promise<string | undefined>;
1100
1110
  });
@@ -1132,6 +1142,7 @@ export declare class IpcTransport implements ITransport {
1132
1142
  private bridge;
1133
1143
  private pendingRequests;
1134
1144
  private accessToken?;
1145
+ private flavour?;
1135
1146
  private debug;
1136
1147
  private correlationCounter;
1137
1148
  private onUnauthorized?;
@@ -1139,6 +1150,7 @@ export declare class IpcTransport implements ITransport {
1139
1150
  constructor(options: {
1140
1151
  bridge: IpcBridge;
1141
1152
  accessToken?: string;
1153
+ flavour?: string;
1142
1154
  debug?: boolean;
1143
1155
  onUnauthorized?: () => Promise<string | undefined>;
1144
1156
  });
package/dist/index.mjs CHANGED
@@ -165,7 +165,7 @@ var r = "/.well-known/medscribealliance", i = 3600 * 1e3, a = /* @__PURE__ */ fu
165
165
  session_mode: e.string().optional(),
166
166
  patient_details: e.object({
167
167
  name: e.string().optional(),
168
- age: e.string().optional(),
168
+ age: e.union([e.string(), e.number()]).optional(),
169
169
  gender: e.string().optional(),
170
170
  mobile: e.number().optional()
171
171
  }).optional(),
@@ -178,7 +178,7 @@ var r = "/.well-known/medscribealliance", i = 3600 * 1e3, a = /* @__PURE__ */ fu
178
178
  processing_status: e.string().optional(),
179
179
  patient_details: e.object({
180
180
  name: e.string().optional(),
181
- age: e.string().optional(),
181
+ age: e.union([e.string(), e.number()]).optional(),
182
182
  gender: e.string().optional(),
183
183
  mobile: e.number().optional()
184
184
  }).optional(),
@@ -194,7 +194,7 @@ var r = "/.well-known/medscribealliance", i = 3600 * 1e3, a = /* @__PURE__ */ fu
194
194
  upload_url: e.string().min(1, "upload_url is required"),
195
195
  patient_details: e.object({
196
196
  name: e.string().optional(),
197
- age: e.string().optional(),
197
+ age: e.union([e.string(), e.number()]).optional(),
198
198
  gender: e.string().optional(),
199
199
  mobile: e.number().optional()
200
200
  }).nullable().optional()
@@ -209,14 +209,13 @@ var r = "/.well-known/medscribealliance", i = 3600 * 1e3, a = /* @__PURE__ */ fu
209
209
  status: e.string(),
210
210
  created_at: e.string(),
211
211
  expires_at: e.string().nullish(),
212
- expired_at: e.string().nullish(),
213
212
  completed_at: e.string().nullish(),
214
213
  model_used: e.string().nullish(),
215
214
  language_detected: e.string().nullish(),
216
215
  audio_files_received: e.number().int(),
217
216
  audio_files: e.array(e.string()),
218
217
  audio_files_processed: e.number().int().optional(),
219
- additional_data: e.record(e.string(), e.any()),
218
+ additional_data: e.record(e.string(), e.any()).optional(),
220
219
  templates: e.array(e.record(e.string(), e.any())).optional(),
221
220
  transcript: e.string().nullable().optional(),
222
221
  processing_errors: e.array(e.object({
@@ -231,7 +230,7 @@ var r = "/.well-known/medscribealliance", i = 3600 * 1e3, a = /* @__PURE__ */ fu
231
230
  }).optional(),
232
231
  patient_details: e.object({
233
232
  name: e.string().optional(),
234
- age: e.string().optional(),
233
+ age: e.union([e.string(), e.number()]).optional(),
235
234
  gender: e.string().optional(),
236
235
  mobile: e.number().optional()
237
236
  }).nullable().optional(),
@@ -358,7 +357,7 @@ function L(e) {
358
357
  //#region src/transport/http-transport.ts
359
358
  var R = class {
360
359
  constructor(e) {
361
- this.tokenRefreshPromise = null, this.accessToken = e.accessToken, this.debug = e.debug ?? !1, this.onUnauthorized = e.onUnauthorized;
360
+ this.tokenRefreshPromise = null, this.accessToken = e.accessToken, this.flavour = e.flavour, this.debug = e.debug ?? !1, this.onUnauthorized = e.onUnauthorized;
362
361
  }
363
362
  setAuthToken(e) {
364
363
  this.accessToken = e;
@@ -415,7 +414,7 @@ var R = class {
415
414
  }
416
415
  buildHeaders(e) {
417
416
  let t = {};
418
- return e.isUpload ? t["Content-Type"] = "audio/mp3" : (t["Content-Type"] = "application/json", t.Accept = "application/json"), this.accessToken && (t.Authorization = `Bearer ${this.accessToken}`), e.headers && Object.assign(t, e.headers), t;
417
+ return e.isUpload ? t["Content-Type"] = "audio/mp3" : (t["Content-Type"] = "application/json", t.Accept = "application/json"), this.accessToken && (t.Authorization = `Bearer ${this.accessToken}`), this.flavour && (t.flavour = this.flavour), e.headers && Object.assign(t, e.headers), t;
419
418
  }
420
419
  buildRequestInit(e, t) {
421
420
  let n = {
@@ -472,7 +471,7 @@ var R = class {
472
471
  }
473
472
  }, z = class {
474
473
  constructor(e) {
475
- this.pendingRequests = /* @__PURE__ */ new Map(), this.correlationCounter = 0, this.tokenRefreshPromise = null, this.bridge = e.bridge, this.accessToken = e.accessToken, this.debug = e.debug ?? !1, this.onUnauthorized = e.onUnauthorized, this.bridge.onResponse((e) => {
474
+ this.pendingRequests = /* @__PURE__ */ new Map(), this.correlationCounter = 0, this.tokenRefreshPromise = null, this.bridge = e.bridge, this.accessToken = e.accessToken, this.flavour = e.flavour, this.debug = e.debug ?? !1, this.onUnauthorized = e.onUnauthorized, this.bridge.onResponse((e) => {
476
475
  this.handleResponse(e);
477
476
  });
478
477
  }
@@ -537,7 +536,7 @@ var R = class {
537
536
  }
538
537
  buildHeaders(e) {
539
538
  let t = {};
540
- return e.isUpload ? t["Content-Type"] = "audio/mp3" : (t["Content-Type"] = "application/json", t.Accept = "application/json"), this.accessToken && (t.Authorization = `Bearer ${this.accessToken}`), e.headers && Object.assign(t, e.headers), t;
539
+ return e.isUpload ? t["Content-Type"] = "audio/mp3" : (t["Content-Type"] = "application/json", t.Accept = "application/json"), this.accessToken && (t.Authorization = `Bearer ${this.accessToken}`), this.flavour && (t.flavour = this.flavour), e.headers && Object.assign(t, e.headers), t;
541
540
  }
542
541
  async buildIpcRequest(e, t, n) {
543
542
  let r = {
@@ -1838,7 +1837,7 @@ var ie = class {
1838
1837
  }
1839
1838
  buildUploadHeaders(e) {
1840
1839
  let t = {};
1841
- return e && (t.Authorization = `Bearer ${e}`), t;
1840
+ return e && (t.Authorization = `Bearer ${e}`), this.config.flavour && (t.flavour = this.config.flavour), t;
1842
1841
  }
1843
1842
  applyDiscoveryOverrides(e) {
1844
1843
  try {
@@ -1889,6 +1888,7 @@ var ie = class {
1889
1888
  ...e
1890
1889
  }, this.callbackRegistry = new w(), this.validator = new P(), this.transport = this.createTransport(), this.discoveryManager = new V(this.transport, this.validator, this.config.debug), this.sessionManager = new H(this.transport, this.validator, this.config.debug), this.recordingManager = new Q(this.callbackRegistry, this.sessionManager, this.discoveryManager, this.transport, {
1891
1890
  debug: this.config.debug,
1891
+ flavour: this.config.flavour,
1892
1892
  workerConfig: this.resolveWorkerConfig()
1893
1893
  });
1894
1894
  }
@@ -2052,12 +2052,14 @@ var ie = class {
2052
2052
  return new z({
2053
2053
  bridge: this.config.ipcTransport,
2054
2054
  accessToken: this.config.accessToken,
2055
+ flavour: this.config.flavour,
2055
2056
  debug: this.config.debug,
2056
2057
  onUnauthorized: e
2057
2058
  });
2058
2059
  }
2059
2060
  return new R({
2060
2061
  accessToken: this.config.accessToken,
2062
+ flavour: this.config.flavour,
2061
2063
  debug: this.config.debug,
2062
2064
  onUnauthorized: e
2063
2065
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "med-scribe-alliance-ts-sdk",
3
- "version": "2.0.20",
3
+ "version": "2.0.23",
4
4
  "description": "TypeScript SDK for the MedScribe Alliance Protocol",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",