@ubercode/dcmtk 0.6.5 → 0.7.1

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.cts CHANGED
@@ -3,7 +3,7 @@ export { L as LineSource, P as ProcessLine, a as ResultValue, b as assertUnreach
3
3
  import { A as AETitle, D as DicomTag, a as DicomTagPath, P as Port, S as SOPClassUID, T as TransferSyntaxUID, b as DicomDataset } from './DicomInstance-zsmyd7fs.cjs';
4
4
  export { B as Brand, C as ChangeSet, c as DicomFilePath, d as DicomInstance, W as WalkTagEntry, e as WalkTagsOptions, f as createAETitle, g as createDicomFilePath, h as createDicomTag, i as createDicomTagPath, j as createPort, k as createSOPClassUID, l as createTransferSyntaxUID, t as tag, w as walkTags } from './DicomInstance-zsmyd7fs.cjs';
5
5
  import { z } from 'zod';
6
- export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-D_ew9kha.cjs';
6
+ export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-AYvUunlI.cjs';
7
7
  export { b as DcmodifyOptions, c as DcmodifyResult, D as DicomJsonElement, a as DicomJsonModel, T as TagModification, d as ToolBaseOptions, e as dcmodify, x as xmlToJson } from './dcmodify-Cf-RPHF3.cjs';
8
8
  export { DictionaryEntry, SOPClassName, SOP_CLASSES, TagSegment, VR, VRCategoryName, VRMetadata, VRValue, VR_CATEGORY, VR_CATEGORY_NAME, VR_META, getVRCategory, isBinaryVR, isNumericVR, isStringVR, lookupTag, lookupTagByKeyword, lookupTagByName, segmentsToModifyPath, segmentsToString, sopClassNameFromUID, tagPathToSegments } from './dicom.cjs';
9
9
  import { ProposedTransferSyntaxValue } from './tools.cjs';
@@ -277,6 +277,20 @@ interface DicomSenderOptions {
277
277
  readonly bucketFlushMs?: number | undefined;
278
278
  /** Maximum files per bucket before auto-flush (bucket mode only). Defaults to 50. */
279
279
  readonly maxBucketSize?: number | undefined;
280
+ /** Maximum PDU receive size (passed through to storescu `--max-pdu`). */
281
+ readonly maxPduReceive?: number | undefined;
282
+ /** Maximum PDU send size (passed through to storescu `--max-send-pdu`). */
283
+ readonly maxPduSend?: number | undefined;
284
+ /** Association timeout in seconds (passed through to storescu `-to`). */
285
+ readonly associationTimeout?: number | undefined;
286
+ /** ACSE timeout in seconds (passed through to storescu `-ta`). */
287
+ readonly acseTimeout?: number | undefined;
288
+ /** DIMSE timeout in seconds (passed through to storescu `-td`). */
289
+ readonly dimseTimeout?: number | undefined;
290
+ /** Disable DNS hostname lookup (passed through to storescu `-nh`). Useful in containerized environments. */
291
+ readonly noHostnameLookup?: boolean | undefined;
292
+ /** Verbosity level for diagnostic output. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
293
+ readonly verbosity?: 'verbose' | 'debug' | undefined;
280
294
  /** AbortSignal for external cancellation. */
281
295
  readonly signal?: AbortSignal | undefined;
282
296
  }
@@ -286,6 +300,10 @@ interface SendOptions {
286
300
  readonly timeoutMs?: number | undefined;
287
301
  /** Override max retries for this send. */
288
302
  readonly maxRetries?: number | undefined;
303
+ /** Override called AE Title for this send. */
304
+ readonly calledAETitle?: string | undefined;
305
+ /** Override calling AE Title for this send. */
306
+ readonly callingAETitle?: string | undefined;
289
307
  }
290
308
  /** Result of a successful send operation. */
291
309
  interface SendResult {
@@ -295,6 +313,10 @@ interface SendResult {
295
313
  readonly fileCount: number;
296
314
  /** Total send duration in milliseconds. */
297
315
  readonly durationMs: number;
316
+ /** Raw stdout from storescu (available when verbosity is set). */
317
+ readonly stdout: string;
318
+ /** Raw stderr from storescu. */
319
+ readonly stderr: string;
298
320
  }
299
321
  /** Snapshot of the sender's current state. */
300
322
  interface SenderStatus {
@@ -321,6 +343,10 @@ interface SenderSendCompleteData {
321
343
  readonly fileCount: number;
322
344
  /** Total send duration in milliseconds. */
323
345
  readonly durationMs: number;
346
+ /** Raw stdout from storescu. */
347
+ readonly stdout: string;
348
+ /** Raw stderr from storescu. */
349
+ readonly stderr: string;
324
350
  }
325
351
  /** Data emitted with SEND_FAILED events. */
326
352
  interface SenderSendFailedData {
@@ -330,6 +356,10 @@ interface SenderSendFailedData {
330
356
  readonly error: Error;
331
357
  /** Number of attempts made. */
332
358
  readonly attempts: number;
359
+ /** Raw stdout from the last storescu attempt. */
360
+ readonly stdout: string;
361
+ /** Raw stderr from the last storescu attempt. */
362
+ readonly stderr: string;
333
363
  }
334
364
  /** Data emitted with HEALTH_CHANGED events. */
335
365
  interface SenderHealthChangedData {
@@ -446,6 +476,8 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
446
476
  * @returns A Result containing the send result or an error
447
477
  */
448
478
  send(files: readonly string[], options?: SendOptions): Promise<Result<SendResult>>;
479
+ /** Dispatches a send to the appropriate mode handler. */
480
+ private dispatchSend;
449
481
  /**
450
482
  * Flushes the current bucket immediately (bucket mode only).
451
483
  * In single/multiple mode this is a no-op.
@@ -510,7 +542,7 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
510
542
  private clearBucketTimer;
511
543
  /** Executes a single queue entry: calls storescu with retry. */
512
544
  private executeEntry;
513
- /** Attempts storescu up to maxAttempts times. Returns undefined on success, or the last error. */
545
+ /** Attempts storescu up to maxAttempts times. Returns undefined on success, or failure info. */
514
546
  private attemptSend;
515
547
  /** Calls storescu with the configured options. */
516
548
  private callStorescu;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { L as LineSource, P as ProcessLine, a as ResultValue, b as assertUnreach
3
3
  import { A as AETitle, D as DicomTag, a as DicomTagPath, P as Port, S as SOPClassUID, T as TransferSyntaxUID, b as DicomDataset } from './DicomInstance-BjrSIEGN.js';
4
4
  export { B as Brand, C as ChangeSet, c as DicomFilePath, d as DicomInstance, W as WalkTagEntry, e as WalkTagsOptions, f as createAETitle, g as createDicomFilePath, h as createDicomTag, i as createDicomTagPath, j as createPort, k as createSOPClassUID, l as createTransferSyntaxUID, t as tag, w as walkTags } from './DicomInstance-BjrSIEGN.js';
5
5
  import { z } from 'zod';
6
- export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-DHsEm87K.js';
6
+ export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-C20fLU5U.js';
7
7
  export { b as DcmodifyOptions, c as DcmodifyResult, D as DicomJsonElement, a as DicomJsonModel, T as TagModification, d as ToolBaseOptions, e as dcmodify, x as xmlToJson } from './dcmodify-CHvwChFu.js';
8
8
  export { DictionaryEntry, SOPClassName, SOP_CLASSES, TagSegment, VR, VRCategoryName, VRMetadata, VRValue, VR_CATEGORY, VR_CATEGORY_NAME, VR_META, getVRCategory, isBinaryVR, isNumericVR, isStringVR, lookupTag, lookupTagByKeyword, lookupTagByName, segmentsToModifyPath, segmentsToString, sopClassNameFromUID, tagPathToSegments } from './dicom.js';
9
9
  import { ProposedTransferSyntaxValue } from './tools.js';
@@ -277,6 +277,20 @@ interface DicomSenderOptions {
277
277
  readonly bucketFlushMs?: number | undefined;
278
278
  /** Maximum files per bucket before auto-flush (bucket mode only). Defaults to 50. */
279
279
  readonly maxBucketSize?: number | undefined;
280
+ /** Maximum PDU receive size (passed through to storescu `--max-pdu`). */
281
+ readonly maxPduReceive?: number | undefined;
282
+ /** Maximum PDU send size (passed through to storescu `--max-send-pdu`). */
283
+ readonly maxPduSend?: number | undefined;
284
+ /** Association timeout in seconds (passed through to storescu `-to`). */
285
+ readonly associationTimeout?: number | undefined;
286
+ /** ACSE timeout in seconds (passed through to storescu `-ta`). */
287
+ readonly acseTimeout?: number | undefined;
288
+ /** DIMSE timeout in seconds (passed through to storescu `-td`). */
289
+ readonly dimseTimeout?: number | undefined;
290
+ /** Disable DNS hostname lookup (passed through to storescu `-nh`). Useful in containerized environments. */
291
+ readonly noHostnameLookup?: boolean | undefined;
292
+ /** Verbosity level for diagnostic output. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
293
+ readonly verbosity?: 'verbose' | 'debug' | undefined;
280
294
  /** AbortSignal for external cancellation. */
281
295
  readonly signal?: AbortSignal | undefined;
282
296
  }
@@ -286,6 +300,10 @@ interface SendOptions {
286
300
  readonly timeoutMs?: number | undefined;
287
301
  /** Override max retries for this send. */
288
302
  readonly maxRetries?: number | undefined;
303
+ /** Override called AE Title for this send. */
304
+ readonly calledAETitle?: string | undefined;
305
+ /** Override calling AE Title for this send. */
306
+ readonly callingAETitle?: string | undefined;
289
307
  }
290
308
  /** Result of a successful send operation. */
291
309
  interface SendResult {
@@ -295,6 +313,10 @@ interface SendResult {
295
313
  readonly fileCount: number;
296
314
  /** Total send duration in milliseconds. */
297
315
  readonly durationMs: number;
316
+ /** Raw stdout from storescu (available when verbosity is set). */
317
+ readonly stdout: string;
318
+ /** Raw stderr from storescu. */
319
+ readonly stderr: string;
298
320
  }
299
321
  /** Snapshot of the sender's current state. */
300
322
  interface SenderStatus {
@@ -321,6 +343,10 @@ interface SenderSendCompleteData {
321
343
  readonly fileCount: number;
322
344
  /** Total send duration in milliseconds. */
323
345
  readonly durationMs: number;
346
+ /** Raw stdout from storescu. */
347
+ readonly stdout: string;
348
+ /** Raw stderr from storescu. */
349
+ readonly stderr: string;
324
350
  }
325
351
  /** Data emitted with SEND_FAILED events. */
326
352
  interface SenderSendFailedData {
@@ -330,6 +356,10 @@ interface SenderSendFailedData {
330
356
  readonly error: Error;
331
357
  /** Number of attempts made. */
332
358
  readonly attempts: number;
359
+ /** Raw stdout from the last storescu attempt. */
360
+ readonly stdout: string;
361
+ /** Raw stderr from the last storescu attempt. */
362
+ readonly stderr: string;
333
363
  }
334
364
  /** Data emitted with HEALTH_CHANGED events. */
335
365
  interface SenderHealthChangedData {
@@ -446,6 +476,8 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
446
476
  * @returns A Result containing the send result or an error
447
477
  */
448
478
  send(files: readonly string[], options?: SendOptions): Promise<Result<SendResult>>;
479
+ /** Dispatches a send to the appropriate mode handler. */
480
+ private dispatchSend;
449
481
  /**
450
482
  * Flushes the current bucket immediately (bucket mode only).
451
483
  * In single/multiple mode this is a no-op.
@@ -510,7 +542,7 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
510
542
  private clearBucketTimer;
511
543
  /** Executes a single queue entry: calls storescu with retry. */
512
544
  private executeEntry;
513
- /** Attempts storescu up to maxAttempts times. Returns undefined on success, or the last error. */
545
+ /** Attempts storescu up to maxAttempts times. Returns undefined on success, or failure info. */
514
546
  private attemptSend;
515
547
  /** Calls storescu with the configured options. */
516
548
  private callStorescu;
package/dist/index.js CHANGED
@@ -33232,7 +33232,6 @@ var StorescuOptionsSchema = z.object({
33232
33232
  acseTimeout: z.number().int().positive().optional(),
33233
33233
  dimseTimeout: z.number().int().positive().optional(),
33234
33234
  noHostnameLookup: z.boolean().optional(),
33235
- noUidChecks: z.boolean().optional(),
33236
33235
  proposedTransferSyntax: z.enum([
33237
33236
  "uncompressed",
33238
33237
  "littleEndian",
@@ -33274,9 +33273,6 @@ function pushNetworkArgs3(args, options) {
33274
33273
  function buildArgs34(options) {
33275
33274
  const args = [];
33276
33275
  pushNetworkArgs3(args, options);
33277
- if (options.noUidChecks === true) {
33278
- args.push("--no-uid-checks");
33279
- }
33280
33276
  if (options.callingAETitle !== void 0) {
33281
33277
  args.push("-aet", options.callingAETitle);
33282
33278
  }
@@ -33317,7 +33313,7 @@ async function storescu(options) {
33317
33313
  if (result.value.exitCode !== 0) {
33318
33314
  return err(createToolError("storescu", args, result.value.exitCode, result.value.stderr));
33319
33315
  }
33320
- return ok({ success: true, stderr: result.value.stderr });
33316
+ return ok({ success: true, stdout: result.value.stdout, stderr: result.value.stderr });
33321
33317
  }
33322
33318
  var QueryModel = {
33323
33319
  WORKLIST: "worklist",
@@ -36172,6 +36168,9 @@ var DicomReceiverOptionsSchema = z.object({
36172
36168
  acseTimeout: z.number().int().positive().optional(),
36173
36169
  dimseTimeout: z.number().int().positive().optional(),
36174
36170
  maxPdu: z.number().int().min(4096).max(131072).optional(),
36171
+ filenameMode: z.enum(["default", "unique", "short-unique", "system-time"]).optional(),
36172
+ filenameExtension: z.string().min(1).optional(),
36173
+ storageMode: z.enum(["normal", "bit-preserving", "ignore"]).optional(),
36175
36174
  signal: z.instanceof(AbortSignal).optional()
36176
36175
  }).strict().refine((data) => (data.minPoolSize ?? DEFAULT_MIN_POOL_SIZE) <= (data.maxPoolSize ?? DEFAULT_MAX_POOL_SIZE), {
36177
36176
  message: "minPoolSize must be <= maxPoolSize"
@@ -36493,7 +36492,10 @@ var DicomReceiver = class _DicomReceiver extends EventEmitter {
36493
36492
  configProfile: this.options.configProfile,
36494
36493
  acseTimeout: this.options.acseTimeout,
36495
36494
  dimseTimeout: this.options.dimseTimeout,
36496
- maxPdu: this.options.maxPdu
36495
+ maxPdu: this.options.maxPdu,
36496
+ filenameMode: this.options.filenameMode,
36497
+ filenameExtension: this.options.filenameExtension,
36498
+ storageMode: this.options.storageMode
36497
36499
  });
36498
36500
  }
36499
36501
  /** Spawns a single Dcmrecv worker with an ephemeral port. */
@@ -36855,6 +36857,13 @@ var DicomSenderOptionsSchema = z.object({
36855
36857
  retryDelayMs: z.number().int().min(0).optional(),
36856
36858
  bucketFlushMs: z.number().int().positive().optional(),
36857
36859
  maxBucketSize: z.number().int().min(1).optional(),
36860
+ maxPduReceive: z.number().int().min(4096).max(131072).optional(),
36861
+ maxPduSend: z.number().int().min(4096).max(131072).optional(),
36862
+ associationTimeout: z.number().int().positive().optional(),
36863
+ acseTimeout: z.number().int().positive().optional(),
36864
+ dimseTimeout: z.number().int().positive().optional(),
36865
+ noHostnameLookup: z.boolean().optional(),
36866
+ verbosity: z.enum(["verbose", "debug"]).optional(),
36858
36867
  signal: z.instanceof(AbortSignal).optional()
36859
36868
  }).strict();
36860
36869
  function resolveConfig(options) {
@@ -36953,14 +36962,22 @@ var DicomSender = class _DicomSender extends EventEmitter {
36953
36962
  if (files.length === 0) {
36954
36963
  return Promise.resolve(err(new Error("DicomSender: no files provided")));
36955
36964
  }
36956
- const timeoutMs = options?.timeoutMs ?? this.defaultTimeoutMs;
36957
- const maxRetries = options?.maxRetries ?? this.defaultMaxRetries;
36965
+ const params = {
36966
+ timeoutMs: options?.timeoutMs ?? this.defaultTimeoutMs,
36967
+ maxRetries: options?.maxRetries ?? this.defaultMaxRetries,
36968
+ calledAETitle: options?.calledAETitle,
36969
+ callingAETitle: options?.callingAETitle
36970
+ };
36971
+ return this.dispatchSend(files, params);
36972
+ }
36973
+ /** Dispatches a send to the appropriate mode handler. */
36974
+ dispatchSend(files, params) {
36958
36975
  switch (this.mode) {
36959
36976
  case "single":
36960
36977
  case "multiple":
36961
- return this.enqueueSend(files, timeoutMs, maxRetries);
36978
+ return this.enqueueSend(files, params);
36962
36979
  case "bucket":
36963
- return this.enqueueBucket(files, timeoutMs, maxRetries);
36980
+ return this.enqueueBucket(files, params);
36964
36981
  default:
36965
36982
  assertUnreachable(this.mode);
36966
36983
  }
@@ -37055,14 +37072,21 @@ var DicomSender = class _DicomSender extends EventEmitter {
37055
37072
  // Single/Multiple mode: queue-based dispatch
37056
37073
  // -----------------------------------------------------------------------
37057
37074
  /** Enqueues a send and dispatches immediately if capacity allows. */
37058
- enqueueSend(files, timeoutMs, maxRetries) {
37075
+ enqueueSend(files, params) {
37059
37076
  return new Promise((resolve) => {
37060
37077
  const totalQueued = this.queue.length + this.currentBucket.length;
37061
37078
  if (totalQueued >= this.maxQueueLength) {
37062
37079
  resolve(err(new Error("DicomSender: queue full")));
37063
37080
  return;
37064
37081
  }
37065
- const entry = { files, timeoutMs, maxRetries, resolve };
37082
+ const entry = {
37083
+ files,
37084
+ timeoutMs: params.timeoutMs,
37085
+ maxRetries: params.maxRetries,
37086
+ calledAETitle: params.calledAETitle,
37087
+ callingAETitle: params.callingAETitle,
37088
+ resolve
37089
+ };
37066
37090
  if (this.activeAssociations < this.effectiveMaxAssociations) {
37067
37091
  void this.executeEntry(entry);
37068
37092
  } else {
@@ -37082,14 +37106,15 @@ var DicomSender = class _DicomSender extends EventEmitter {
37082
37106
  // Bucket mode: accumulate-then-flush
37083
37107
  // -----------------------------------------------------------------------
37084
37108
  /** Adds files to the current bucket and triggers flush if full. */
37085
- enqueueBucket(files, timeoutMs, maxRetries) {
37109
+ enqueueBucket(files, params) {
37086
37110
  return new Promise((resolve) => {
37087
37111
  const totalQueued = this.queue.length + this.currentBucket.length;
37088
37112
  if (totalQueued >= this.maxQueueLength) {
37089
37113
  resolve(err(new Error("DicomSender: queue full")));
37090
37114
  return;
37091
37115
  }
37092
- this.currentBucket.push({ files, resolve, timeoutMs, maxRetries });
37116
+ const { timeoutMs, maxRetries, calledAETitle, callingAETitle } = params;
37117
+ this.currentBucket.push({ files, resolve, timeoutMs, maxRetries, calledAETitle, callingAETitle });
37093
37118
  const totalFiles = this.countBucketFiles();
37094
37119
  if (totalFiles >= this.maxBucketSize) {
37095
37120
  this.clearBucketTimer();
@@ -37129,6 +37154,8 @@ var DicomSender = class _DicomSender extends EventEmitter {
37129
37154
  files: allFiles,
37130
37155
  timeoutMs,
37131
37156
  maxRetries,
37157
+ calledAETitle: entries[0]?.calledAETitle,
37158
+ callingAETitle: entries[0]?.callingAETitle,
37132
37159
  resolve: (result) => {
37133
37160
  for (let i = 0; i < entries.length; i++) {
37134
37161
  entries[i].resolve(result);
@@ -37164,17 +37191,24 @@ var DicomSender = class _DicomSender extends EventEmitter {
37164
37191
  this.activeAssociations++;
37165
37192
  const startMs = Date.now();
37166
37193
  const maxAttempts = entry.maxRetries + 1;
37167
- const lastError = await this.attemptSend(entry, maxAttempts, startMs);
37168
- if (lastError === void 0) return;
37194
+ const failure = await this.attemptSend(entry, maxAttempts, startMs);
37195
+ if (failure === void 0) return;
37169
37196
  this.activeAssociations--;
37170
37197
  this.recordFailure();
37171
- this.emit("SEND_FAILED", { files: entry.files, error: lastError, attempts: maxAttempts });
37172
- entry.resolve(err(lastError));
37198
+ this.emit("SEND_FAILED", {
37199
+ files: entry.files,
37200
+ error: failure.error,
37201
+ attempts: maxAttempts,
37202
+ stdout: failure.output.stdout,
37203
+ stderr: failure.output.stderr
37204
+ });
37205
+ entry.resolve(err(failure.error));
37173
37206
  this.drainQueue();
37174
37207
  }
37175
- /** Attempts storescu up to maxAttempts times. Returns undefined on success, or the last error. */
37208
+ /** Attempts storescu up to maxAttempts times. Returns undefined on success, or failure info. */
37176
37209
  async attemptSend(entry, maxAttempts, startMs) {
37177
37210
  let lastError;
37211
+ const lastOutput = { stdout: "", stderr: "" };
37178
37212
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
37179
37213
  if (this.isStopped) {
37180
37214
  this.activeAssociations--;
@@ -37183,7 +37217,7 @@ var DicomSender = class _DicomSender extends EventEmitter {
37183
37217
  }
37184
37218
  const result = await this.callStorescu(entry);
37185
37219
  if (result.ok) {
37186
- this.handleSendSuccess(entry, startMs);
37220
+ this.handleSendSuccess(entry, startMs, result.value);
37187
37221
  return void 0;
37188
37222
  }
37189
37223
  lastError = result.error;
@@ -37191,7 +37225,7 @@ var DicomSender = class _DicomSender extends EventEmitter {
37191
37225
  await delay2(this.retryDelayMs * (attempt + 1));
37192
37226
  }
37193
37227
  }
37194
- return lastError ?? new Error("DicomSender: send failed");
37228
+ return { error: lastError ?? new Error("DicomSender: send failed"), output: lastOutput };
37195
37229
  }
37196
37230
  /** Calls storescu with the configured options. */
37197
37231
  callStorescu(entry) {
@@ -37199,20 +37233,28 @@ var DicomSender = class _DicomSender extends EventEmitter {
37199
37233
  host: this.options.host,
37200
37234
  port: this.options.port,
37201
37235
  files: [...entry.files],
37202
- calledAETitle: this.options.calledAETitle,
37203
- callingAETitle: this.options.callingAETitle,
37236
+ calledAETitle: entry.calledAETitle ?? this.options.calledAETitle,
37237
+ callingAETitle: entry.callingAETitle ?? this.options.callingAETitle,
37204
37238
  proposedTransferSyntax: this.options.proposedTransferSyntax,
37239
+ maxPduReceive: this.options.maxPduReceive,
37240
+ maxPduSend: this.options.maxPduSend,
37241
+ associationTimeout: this.options.associationTimeout,
37242
+ acseTimeout: this.options.acseTimeout,
37243
+ dimseTimeout: this.options.dimseTimeout,
37244
+ noHostnameLookup: this.options.noHostnameLookup,
37245
+ verbosity: this.options.verbosity,
37205
37246
  timeoutMs: entry.timeoutMs,
37206
37247
  signal: this.options.signal
37207
37248
  });
37208
37249
  }
37209
37250
  /** Handles a successful send: updates state, emits event, resolves promise. */
37210
- handleSendSuccess(entry, startMs) {
37251
+ handleSendSuccess(entry, startMs, output) {
37211
37252
  this.activeAssociations--;
37212
37253
  const durationMs = Date.now() - startMs;
37213
37254
  this.recordSuccess();
37214
- this.emit("SEND_COMPLETE", { files: entry.files, fileCount: entry.files.length, durationMs });
37215
- entry.resolve(ok({ files: entry.files, fileCount: entry.files.length, durationMs }));
37255
+ const data = { files: entry.files, fileCount: entry.files.length, durationMs, stdout: output.stdout, stderr: output.stderr };
37256
+ this.emit("SEND_COMPLETE", data);
37257
+ entry.resolve(ok(data));
37216
37258
  this.drainQueue();
37217
37259
  }
37218
37260
  // -----------------------------------------------------------------------