@snyxex/pipex 1.0.3 → 1.0.4

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{compression-CtrHxa9G.d.mts → compression-B0xKUa-N.d.mts} +2 -5
  3. package/dist/{compression-DnVFu8TM.d.cts → compression-C1nLQVur.d.cts} +2 -5
  4. package/dist/compression-ChJlMVwP.mjs +1 -0
  5. package/dist/compression-ZHOsKTJC.cjs +1 -0
  6. package/dist/compression.cjs +1 -1
  7. package/dist/compression.d.cts +1 -1
  8. package/dist/compression.d.mts +1 -1
  9. package/dist/compression.mjs +1 -1
  10. package/dist/core-DNchiRD5.mjs +2 -0
  11. package/dist/core-DSIwvTqu.cjs +2 -0
  12. package/dist/dataEngine-6R3J-WtS.cjs +1 -0
  13. package/dist/{dataEngine-D-fIXgE7.d.cts → dataEngine-C-xYat2f.d.cts} +2 -11
  14. package/dist/{dataEngine-DUEmWp7a.d.mts → dataEngine-Zap1RwAJ.d.mts} +2 -11
  15. package/dist/dataEngine-raQdutX5.mjs +1 -0
  16. package/dist/{encryption-BmmNECIc.d.cts → encryption-CCPoyX4q.d.cts} +2 -7
  17. package/dist/{encryption-CqxtoqAD.mjs → encryption-CHvy--rb.mjs} +1 -1
  18. package/dist/{encryption-CnSL1BEY.d.mts → encryption-D4eC9ubl.d.mts} +2 -7
  19. package/dist/encryption-DwdO7Y4J.cjs +1 -0
  20. package/dist/encryption.cjs +1 -1
  21. package/dist/encryption.d.cts +1 -1
  22. package/dist/encryption.d.mts +1 -1
  23. package/dist/encryption.mjs +1 -1
  24. package/dist/{hashing-B6xGcbQR.d.mts → hashing-C6TkcsUE.d.cts} +2 -5
  25. package/dist/{hashing-LY-8x66g.d.cts → hashing-CEwtXh2V.d.mts} +2 -5
  26. package/dist/hashing-DF_guuZf.cjs +1 -0
  27. package/dist/hashing-DU3rmGMP.mjs +1 -0
  28. package/dist/hashing.cjs +1 -1
  29. package/dist/hashing.d.cts +1 -1
  30. package/dist/hashing.d.mts +1 -1
  31. package/dist/hashing.mjs +1 -1
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.d.cts +77 -94
  34. package/dist/index.d.mts +77 -94
  35. package/dist/index.mjs +1 -1
  36. package/dist/kms.cjs +1 -1
  37. package/dist/kms.d.cts +2 -2
  38. package/dist/kms.d.mts +2 -2
  39. package/dist/kms.mjs +1 -1
  40. package/dist/kms_encryption-1G54Lcuo.mjs +1 -0
  41. package/dist/kms_encryption-B07lunjB.cjs +1 -0
  42. package/dist/{kms_encryption-Da-KqjKI.d.mts → kms_encryption-BBIHGi_O.d.cts} +2 -5
  43. package/dist/{kms_encryption-Dh1LEHhk.d.cts → kms_encryption-BbtS7rXa.d.mts} +2 -5
  44. package/dist/native.cjs +1 -1
  45. package/dist/native.d.cts +1 -1
  46. package/dist/native.d.mts +1 -1
  47. package/dist/native.mjs +1 -1
  48. package/dist/parallel.cjs +1 -1
  49. package/dist/parallel.d.cts +1 -1
  50. package/dist/parallel.d.mts +1 -1
  51. package/dist/parallel.mjs +1 -1
  52. package/dist/{plugin-C9Kd9coY.d.cts → plugin-D85NMNiy.d.mts} +1 -4
  53. package/dist/{plugin-CE94-p8P.d.mts → plugin-c_iSNY86.d.cts} +1 -4
  54. package/dist/resourceLimits-CpDWwraK.mjs +1 -0
  55. package/dist/resourceLimits-lJrEhDE5.cjs +1 -0
  56. package/dist/{types-ia4x-Dvp.d.cts → types-B50Urzn2.d.cts} +0 -3
  57. package/dist/{types-Bytga6zd.d.mts → types-B50Urzn2.d.mts} +0 -3
  58. package/dist/validation-BgdV4KdW.cjs +1 -0
  59. package/dist/validation-BkJxOs7q.mjs +1 -0
  60. package/dist/{validation-CqmhNHdW.d.cts → validation-hcvcixaS.d.cts} +3 -6
  61. package/dist/{validation-D17IkoHy.d.mts → validation-xIBvnsSH.d.mts} +3 -6
  62. package/dist/validation.cjs +1 -1
  63. package/dist/validation.d.cts +1 -1
  64. package/dist/validation.d.mts +1 -1
  65. package/dist/validation.mjs +1 -1
  66. package/dist/worker-1Q2hRcRB.cjs +1 -0
  67. package/dist/{worker-CbuCpSNc.d.cts → worker-DT7RYWwo.d.cts} +2 -5
  68. package/dist/{worker-CgCC-BWG.d.mts → worker-iSO3KhfN.d.mts} +2 -5
  69. package/dist/worker-ul8lQ0SH.mjs +1 -0
  70. package/package.json +9 -9
  71. package/dist/compression-2mm0MhWY.mjs +0 -1
  72. package/dist/compression-DrgzribA.cjs +0 -1
  73. package/dist/core-BOdvxKBq.mjs +0 -2
  74. package/dist/core-B_z1gN5W.cjs +0 -2
  75. package/dist/dataEngine-4m6GTOLe.mjs +0 -1
  76. package/dist/dataEngine-Bvl6amzP.cjs +0 -1
  77. package/dist/encryption-DdP1zFYl.cjs +0 -1
  78. package/dist/hashing-ChrADfcH.mjs +0 -1
  79. package/dist/hashing-JtOHPybU.cjs +0 -1
  80. package/dist/kms_encryption-R9auKGW4.mjs +0 -1
  81. package/dist/kms_encryption-xyWi65rZ.cjs +0 -1
  82. package/dist/resourceLimits-C1HHDwXQ.mjs +0 -1
  83. package/dist/resourceLimits-CI0Qrqdf.cjs +0 -1
  84. package/dist/validation-P5WRSAUK.mjs +0 -1
  85. package/dist/validation-pEeJmCad.cjs +0 -1
  86. package/dist/worker-I_kqxWeK.cjs +0 -1
  87. package/dist/worker-c0_VZ9c7.mjs +0 -1
package/dist/index.d.mts CHANGED
@@ -1,116 +1,108 @@
1
- import { C as StreamPluginContext, S as Span, T as isManifest, _ as ProcessorContext, a as EngineEvents, b as RetryOptions, c as KmsOperation, d as KmsRequestOptions, f as Logger, g as PluginOperation, h as PluginCapabilities, i as EngineConfig, l as KmsProvider, m as PipeXManifest, n as AuditRecord, o as EngineLimits, p as OperationOptions, r as BinaryUndoOptions, s as EngineResult, t as AuditLogger, u as KmsProviderCapabilities, v as ProcessorPlugin, w as Tracer, x as SchemaRegistry, y as RegisteredPluginCapabilities } from "./types-Bytga6zd.mjs";
2
- import { t as BasePlugin } from "./plugin-CE94-p8P.mjs";
3
- import { i as CompressionType, n as CompressionOptions, r as CompressionPlugin } from "./compression-CtrHxa9G.mjs";
4
- import { a as EncryptionPlugin, i as EncryptionOptions, o as EncryptionAlgorithm } from "./encryption-CnSL1BEY.mjs";
5
- import { n as HashingOptions, r as HashingPlugin, t as HashAlgorithm } from "./hashing-B6xGcbQR.mjs";
6
- import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-Da-KqjKI.mjs";
7
- import { n as PluginConstructor, t as DataEngine } from "./dataEngine-DUEmWp7a.mjs";
8
- import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-CgCC-BWG.mjs";
9
- import { n as ValidationPlugin, t as ValidationOptions } from "./validation-D17IkoHy.mjs";
10
1
  import { Duplex, Readable, Transform, TransformCallback, Writable } from "node:stream";
11
2
  import { Packr, PackrStream, Unpackr, UnpackrStream } from "msgpackr";
12
-
13
- //#region src/core/frameLimits.d.ts
14
- declare function assertMessagePackFrameLimits(input: Buffer | Uint8Array, maxFrameBytes: number, maxFrames?: number): number;
15
- declare function buildFrameLimitTransform(maxFrameBytes: number, maxFrames: number): Transform;
16
- //#endregion
17
- //#region src/core/resourceLimits.d.ts
18
- declare const DEFAULT_LIMITS: Readonly<EngineLimits>;
19
- //#endregion
20
- //#region src/core/core.d.ts
3
+ import { C as StreamPluginContext, S as Span, T as isManifest, _ as ProcessorContext, a as EngineEvents, b as RetryOptions, c as KmsOperation, d as KmsRequestOptions, f as Logger, g as PluginOperation, h as PluginCapabilities, i as EngineConfig, l as KmsProvider, m as PipeXManifest, n as AuditRecord, o as EngineLimits, p as OperationOptions, r as BinaryUndoOptions, s as EngineResult, t as AuditLogger, u as KmsProviderCapabilities, v as ProcessorPlugin, w as Tracer, x as SchemaRegistry, y as RegisteredPluginCapabilities } from "./types-B50Urzn2.mjs";
4
+ import { n as PluginConstructor, t as DataEngine } from "./dataEngine-Zap1RwAJ.mjs";
5
+ import { t as BasePlugin } from "./plugin-D85NMNiy.mjs";
6
+ import { n as HashingOptions, r as HashingPlugin, t as HashAlgorithm } from "./hashing-CEwtXh2V.mjs";
7
+ import { a as EncryptionPlugin, i as EncryptionOptions, o as EncryptionAlgorithm } from "./encryption-D4eC9ubl.mjs";
8
+ import { i as CompressionType, n as CompressionOptions, r as CompressionPlugin } from "./compression-B0xKUa-N.mjs";
9
+ import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-iSO3KhfN.mjs";
10
+ import { n as ValidationPlugin, t as ValidationOptions } from "./validation-xIBvnsSH.mjs";
11
+ import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-BbtS7rXa.mjs";
12
+ export declare function assertMessagePackFrameLimits(input: Buffer | Uint8Array, maxFrameBytes: number, maxFrames?: number): number;
13
+ export declare function buildFrameLimitTransform(maxFrameBytes: number, maxFrames: number): Transform;
14
+ export declare const DEFAULT_LIMITS: Readonly<EngineLimits>;
21
15
  /**
22
16
  * Executes a function with automatic retries and backoff.
23
17
  */
24
- declare function withRetry<T>(fn: () => Promise<T> | T, options?: RetryOptions, logger?: Logger, control?: {
18
+ export declare function withRetry<T>(fn: () => Promise<T> | T, options?: RetryOptions, logger?: Logger, control?: {
25
19
  signal?: AbortSignal;
26
20
  limits?: Pick<EngineLimits, 'maxRetryAttempts' | 'maxRetryDelayMs'>;
27
21
  track?: (pending: Promise<unknown>) => void;
28
22
  }): Promise<T>;
29
- declare const PIPEX_MANIFEST_KEY: "__pipex_v";
30
- declare const PACKR: Packr;
31
- declare const UNPACKR: Unpackr;
23
+ export declare const PIPEX_MANIFEST_KEY: '__pipex_v';
24
+ export declare const PACKR: Packr;
25
+ export declare const UNPACKR: Unpackr;
32
26
  /** @deprecated Use `DEFAULT_LIMITS.maxFrameBytes` or an engine-specific limit. */
33
- declare const MAX_FRAME_BYTES: number;
34
- declare const DEFAULT_HIGH_WATER: number;
27
+ export declare const MAX_FRAME_BYTES: number;
28
+ export declare const DEFAULT_HIGH_WATER: number;
35
29
  type PluginWithStream = ProcessorPlugin & {
36
30
  createStream(mode: 'compress' | 'decompress', context?: StreamPluginContext): Duplex;
37
31
  };
38
- declare function hasStreamSupport(p: ProcessorPlugin): p is PluginWithStream;
32
+ export declare function hasStreamSupport(p: ProcessorPlugin): p is PluginWithStream;
39
33
  /**
40
34
  * Returns the effective capabilities of a plugin after validating declarations.
41
35
  * Explicit `false` declarations are authoritative, which supports plugins whose
42
36
  * implementation is present but disabled by configuration (for example workers).
43
37
  */
44
- declare function getPluginCapabilities(plugin: ProcessorPlugin): Readonly<PluginCapabilities>;
38
+ export declare function getPluginCapabilities(plugin: ProcessorPlugin): Readonly<PluginCapabilities>;
45
39
  /** Query an operation without attempting to execute it. Invalid declarations fail closed. */
46
- declare function supportsOperation(plugin: ProcessorPlugin, operation: PluginOperation): boolean;
47
- declare function supportsReverse(plugin: ProcessorPlugin): plugin is ProcessorPlugin & Required<Pick<ProcessorPlugin, 'reverse'>>;
48
- declare function assertReversiblePipeline(plugins: readonly ProcessorPlugin[]): void;
49
- declare function assertStreamingPipeline(plugins: readonly ProcessorPlugin[]): void;
50
- declare function detectType(input: unknown): string;
51
- declare function toBuffer(input: unknown): Buffer;
52
- declare const ORIGINAL_TYPES: readonly ["buffer", "object", "array", "string", "number", "boolean", "null", "undefined", "bigint", "json"];
53
- declare function assertOriginalType(value: unknown): asserts value is string;
54
- declare function fromBuffer(buffer: Buffer, targetType: string, maxFrameBytes?: number): unknown;
55
- declare function makeContext(requestId: string, extra?: Record<string, unknown>, logger?: Logger, span?: Span, signal?: AbortSignal, limits?: Readonly<EngineLimits>): ProcessorContext;
56
- declare function buildManifest(plugins: readonly ProcessorPlugin[]): PipeXManifest;
40
+ export declare function supportsOperation(plugin: ProcessorPlugin, operation: PluginOperation): boolean;
41
+ export declare function supportsReverse(plugin: ProcessorPlugin): plugin is ProcessorPlugin & Required<Pick<ProcessorPlugin, 'reverse'>>;
42
+ export declare function assertReversiblePipeline(plugins: readonly ProcessorPlugin[]): void;
43
+ export declare function assertStreamingPipeline(plugins: readonly ProcessorPlugin[]): void;
44
+ export declare function detectType(input: unknown): string;
45
+ export declare function toBuffer(input: unknown): Buffer;
46
+ export declare const ORIGINAL_TYPES: readonly ["buffer", "object", "array", "string", "number", "boolean", "null", "undefined", "bigint", "json"];
47
+ export declare function assertOriginalType(value: unknown): asserts value is string;
48
+ export declare function fromBuffer(buffer: Buffer, targetType: string, maxFrameBytes?: number): unknown;
49
+ export declare function makeContext(requestId: string, extra?: Record<string, unknown>, logger?: Logger, span?: Span, signal?: AbortSignal, limits?: Readonly<EngineLimits>): ProcessorContext;
50
+ export declare function buildManifest(plugins: readonly ProcessorPlugin[]): PipeXManifest;
57
51
  /**
58
52
  * A passthrough Transform that prepends a single msgpack-encoded manifest frame
59
53
  * to the byte stream before forwarding any data chunks.
60
54
  * Inserted between PackrStream output and the file destination.
61
55
  */
62
- declare function buildManifestHeaderTransform(manifest: PipeXManifest): Transform;
56
+ export declare function buildManifestHeaderTransform(manifest: PipeXManifest): Transform;
63
57
  /**
64
58
  * Object-mode Transform that sits after UnpackrStream.
65
59
  * Intercepts the first decoded frame: if it is a PipeXManifest, captures it
66
60
  * via onManifest() and drops it from the output; all other frames pass through.
67
61
  */
68
- declare function buildManifestExtractTransform(onManifest: (m: PipeXManifest) => void): Transform;
62
+ export declare function buildManifestExtractTransform(onManifest: (m: PipeXManifest) => void): Transform;
69
63
  /** DoS-safe UnpackrStream subclass — rejects oversized raw chunks before decode. */
70
- declare class GuardedUnpackrStream extends UnpackrStream {
64
+ export declare class GuardedUnpackrStream extends UnpackrStream {
71
65
  #private;
72
66
  constructor(options?: Record<string, unknown>, maxInputBytes?: number);
73
67
  _transform(chunk: Buffer, enc: BufferEncoding, cb: TransformCallback): void;
74
68
  }
75
69
  /** PackrStream with useRecords disabled (safe default). */
76
- declare function createPackrStream(): PackrStream;
70
+ export declare function createPackrStream(): PackrStream;
77
71
  /** GuardedUnpackrStream with useRecords disabled. */
78
- declare function createUnpackrStream(maxInputBytes?: number): GuardedUnpackrStream;
79
- declare function buildByteLimitTransform(maxBytes: number, label: string): Transform;
80
- declare function buildObjectLimitTransform(maxFrames: number): Transform;
72
+ export declare function createUnpackrStream(maxInputBytes?: number): GuardedUnpackrStream;
73
+ export declare function buildByteLimitTransform(maxBytes: number, label: string): Transform;
74
+ export declare function buildObjectLimitTransform(maxFrames: number): Transform;
81
75
  /** Rejects known byte-backed values before MessagePack copies their payload. */
82
- declare function assertKnownValueByteLimit(value: unknown, maxBytes: number, label: string): void;
83
- declare function buildKnownValueByteLimitTransform(maxBytes: number, label: string): Transform;
76
+ export declare function assertKnownValueByteLimit(value: unknown, maxBytes: number, label: string): void;
77
+ export declare function buildKnownValueByteLimitTransform(maxBytes: number, label: string): Transform;
84
78
  /**
85
79
  * Wraps a plugin's process/reverse call in a Transform.
86
80
  * requestId is fixed per stream instance — not per chunk — to avoid
87
81
  * 60× randomUUID() overhead on high-throughput paths.
88
82
  */
89
- declare function buildFallbackTransform(plugin: ProcessorPlugin, reverse: boolean, emitProgress?: (bytes: number) => void, logger?: Logger, tracer?: Tracer, dlq?: Writable, streamContext?: StreamPluginContext): Transform;
83
+ export declare function buildFallbackTransform(plugin: ProcessorPlugin, reverse: boolean, emitProgress?: (bytes: number) => void, logger?: Logger, tracer?: Tracer, dlq?: Writable, streamContext?: StreamPluginContext): Transform;
90
84
  /** Serialises JS objects to NDJSON lines. */
91
- declare function buildNdjsonTransform(): Transform;
85
+ export declare function buildNdjsonTransform(): Transform;
92
86
  /**
93
87
  * Builds the ordered Transform chain from a plugin list.
94
88
  * Uses native createStream() when available; falls back to buildFallbackTransform.
95
89
  */
96
- declare function buildTransformChain(plugins: readonly ProcessorPlugin[], mode: 'compress' | 'decompress', reverse?: boolean, onProgress?: (bytes: number) => void, logger?: Logger, tracer?: Tracer, dlq?: Writable, streamContext?: StreamPluginContext): (Duplex | Transform | PackrStream | GuardedUnpackrStream)[];
90
+ export declare function buildTransformChain(plugins: readonly ProcessorPlugin[], mode: 'compress' | 'decompress', reverse?: boolean, onProgress?: (bytes: number) => void, logger?: Logger, tracer?: Tracer, dlq?: Writable, streamContext?: StreamPluginContext): (Duplex | Transform | PackrStream | GuardedUnpackrStream)[];
97
91
  /**
98
92
  * Runs an arbitrary pipeline: Source → [...Transforms] → Destination.
99
93
  * The `any` cast is scoped to this single call site — nowhere else.
100
94
  */
101
- declare function runPipeline(source: Readable, transforms: (Duplex | Transform | PackrStream | GuardedUnpackrStream)[], destination: Writable, options?: {
95
+ export declare function runPipeline(source: Readable, transforms: (Duplex | Transform | PackrStream | GuardedUnpackrStream)[], destination: Writable, options?: {
102
96
  signal?: AbortSignal;
103
97
  }): Promise<void>;
104
- declare function assertExists(inputPath: string, allowedRoot?: string): string;
105
- declare function resolveOutputPath(outputPath: string, allowedRoot?: string): string;
106
- //#endregion
107
- //#region src/core/typedPipeline.d.ts
98
+ export declare function assertExists(inputPath: string, allowedRoot?: string): string;
99
+ export declare function resolveOutputPath(outputPath: string, allowedRoot?: string): string;
108
100
  /** A synchronous or asynchronous transformation from Input to Output. */
109
101
  type TypedTransform<Input, Output> = (input: Input, options: Readonly<OperationOptions>) => Output | Promise<Output>;
110
102
  /** Cancellation options for typed application pipelines. */
111
103
  type TypedPipelineOptions = Readonly<OperationOptions>;
112
104
  /** An immutable pipeline whose input and output types are preserved across steps. */
113
- declare class TypedPipeline<Input, Output> {
105
+ export declare class TypedPipeline<Input, Output> {
114
106
  private readonly transforms;
115
107
  private constructor();
116
108
  /**
@@ -127,11 +119,9 @@ declare class TypedPipeline<Input, Output> {
127
119
  run(input: Input, options?: TypedPipelineOptions): Promise<Output>;
128
120
  }
129
121
  /** Create a typed pipeline with automatic end-to-end transform inference. */
130
- declare function typedPipeline<Input, Output>(first: TypedTransform<Input, Output>): TypedPipeline<Input, Awaited<Output>>;
131
- //#endregion
132
- //#region src/core/errors.d.ts
122
+ export declare function typedPipeline<Input, Output>(first: TypedTransform<Input, Output>): TypedPipeline<Input, Awaited<Output>>;
133
123
  type PipeXErrorCode = 'VALIDATION_FAILED' | 'COMPRESSION_FAILED' | 'HASHING_FAILED' | 'UNSUPPORTED_ALGORITHM' | 'UNSUPPORTED_REVERSE' | 'UNSUPPORTED_STREAMING' | 'INVALID_PLUGIN_CAPABILITY' | 'ENCRYPTION_ERROR' | 'INVALID_ENCRYPTION_KEY' | 'ENCRYPTION_AUTHENTICATION_FAILED' | 'OPERATION_ABORTED' | 'OPERATION_TIMEOUT' | 'KMS_PROVIDER_FAILURE' | 'KMS_AUTHENTICATION_FAILED' | 'KMS_PROVIDER_AUTHENTICATION_FAILED' | 'KMS_PROVIDER_UNAVAILABLE' | 'UNSUPPORTED_KMS_OPERATION' | 'INVALID_KMS_PROVIDER_CAPABILITY' | 'WORKER_POOL_CLOSED' | 'WORKER_QUEUE_FULL' | 'WORKER_POOL_CLOSE_FAILURE' | 'WORKER_TASK_FAILURE';
134
- declare class PipeXError extends Error {
124
+ export declare class PipeXError extends Error {
135
125
  readonly code: PipeXErrorCode;
136
126
  readonly name: string;
137
127
  readonly transformName?: string;
@@ -142,28 +132,28 @@ declare class PipeXError extends Error {
142
132
  });
143
133
  }
144
134
  /** Domain failures use fixed, non-sensitive messages. Never include input, keys or arbitrary provider errors. */
145
- declare class ValidationError extends PipeXError {
135
+ export declare class ValidationError extends PipeXError {
146
136
  readonly name = "ValidationError";
147
137
  constructor(options?: ErrorOptions & {
148
138
  transformName?: string;
149
139
  stage?: string;
150
140
  });
151
141
  }
152
- declare class CompressionError extends PipeXError {
142
+ export declare class CompressionError extends PipeXError {
153
143
  readonly name = "CompressionError";
154
144
  constructor(options?: ErrorOptions & {
155
145
  transformName?: string;
156
146
  stage?: string;
157
147
  });
158
148
  }
159
- declare class HashingError extends PipeXError {
149
+ export declare class HashingError extends PipeXError {
160
150
  readonly name = "HashingError";
161
151
  constructor(options?: ErrorOptions & {
162
152
  transformName?: string;
163
153
  stage?: string;
164
154
  });
165
155
  }
166
- declare class UnsupportedAlgorithmError extends PipeXError {
156
+ export declare class UnsupportedAlgorithmError extends PipeXError {
167
157
  readonly name = "UnsupportedAlgorithmError";
168
158
  constructor(options?: ErrorOptions & {
169
159
  transformName?: string;
@@ -171,125 +161,119 @@ declare class UnsupportedAlgorithmError extends PipeXError {
171
161
  });
172
162
  }
173
163
  /** Alias hierarchy: existing OperationAbortedError retains its code and instanceof contract. */
174
- declare class PipelineAbortedError extends PipeXError {
164
+ export declare class PipelineAbortedError extends PipeXError {
175
165
  readonly name: string;
176
166
  constructor(options?: ErrorOptions & {
177
167
  transformName?: string;
178
168
  stage?: string;
179
169
  });
180
170
  }
181
- declare class UnsupportedReverseError extends PipeXError {
171
+ export declare class UnsupportedReverseError extends PipeXError {
182
172
  readonly plugin: string;
183
173
  readonly name: string;
184
174
  constructor(plugin: string);
185
175
  }
186
- declare class UnsupportedStreamingError extends PipeXError {
176
+ export declare class UnsupportedStreamingError extends PipeXError {
187
177
  readonly plugin: string;
188
178
  readonly name: string;
189
179
  constructor(plugin: string);
190
180
  }
191
181
  type InvalidPluginCapabilityIssue = 'MUST_BE_BOOLEAN' | 'MISSING_IMPLEMENTATION' | 'CONFLICTING_IMPLEMENTATION';
192
- declare class InvalidPluginCapabilityError extends PipeXError {
182
+ export declare class InvalidPluginCapabilityError extends PipeXError {
193
183
  readonly plugin: string;
194
184
  readonly capability: 'reversible' | 'streaming';
195
185
  readonly issue: InvalidPluginCapabilityIssue;
196
186
  readonly name: string;
197
187
  constructor(plugin: string, capability: 'reversible' | 'streaming', issue: InvalidPluginCapabilityIssue);
198
188
  }
199
- declare class OperationAbortedError extends PipelineAbortedError {
189
+ export declare class OperationAbortedError extends PipelineAbortedError {
200
190
  readonly name: string;
201
191
  constructor(options?: ErrorOptions);
202
192
  }
203
- declare class OperationTimeoutError extends PipeXError {
193
+ export declare class OperationTimeoutError extends PipeXError {
204
194
  readonly name: string;
205
195
  constructor(options?: ErrorOptions);
206
196
  }
207
- declare class KmsProviderError extends PipeXError {
197
+ export declare class KmsProviderError extends PipeXError {
208
198
  readonly operation: 'generateDataKey' | 'decrypt' | 'encrypt';
209
199
  readonly name: string;
210
200
  constructor(operation: 'generateDataKey' | 'decrypt' | 'encrypt', options?: ErrorOptions);
211
201
  }
212
- declare class KmsAuthenticationError extends PipeXError {
202
+ export declare class KmsAuthenticationError extends PipeXError {
213
203
  readonly name: string;
214
204
  constructor();
215
205
  }
216
- declare class KmsProviderAuthenticationError extends PipeXError {
206
+ export declare class KmsProviderAuthenticationError extends PipeXError {
217
207
  readonly operation: 'generateDataKey' | 'decrypt' | 'encrypt';
218
208
  readonly name: string;
219
209
  constructor(operation: 'generateDataKey' | 'decrypt' | 'encrypt');
220
210
  }
221
- declare class KmsProviderUnavailableError extends PipeXError {
211
+ export declare class KmsProviderUnavailableError extends PipeXError {
222
212
  readonly operation: 'generateDataKey' | 'decrypt' | 'encrypt';
223
213
  readonly name: string;
224
214
  constructor(operation: 'generateDataKey' | 'decrypt' | 'encrypt');
225
215
  }
226
- declare class UnsupportedKmsOperationError extends PipeXError {
216
+ export declare class UnsupportedKmsOperationError extends PipeXError {
227
217
  readonly operation: 'generateDataKey' | 'decrypt' | 'encrypt';
228
218
  readonly name: string;
229
219
  constructor(operation: 'generateDataKey' | 'decrypt' | 'encrypt');
230
220
  }
231
221
  type InvalidKmsProviderCapabilityIssue = 'MUST_BE_BOOLEAN' | 'MISSING_IMPLEMENTATION';
232
- declare class InvalidKmsProviderCapabilityError extends PipeXError {
222
+ export declare class InvalidKmsProviderCapabilityError extends PipeXError {
233
223
  readonly operation: 'generateDataKey' | 'decrypt' | 'encrypt';
234
224
  readonly issue: InvalidKmsProviderCapabilityIssue;
235
225
  readonly name: string;
236
226
  constructor(operation: 'generateDataKey' | 'decrypt' | 'encrypt', issue: InvalidKmsProviderCapabilityIssue);
237
227
  }
238
- declare class WorkerPoolClosedError extends PipeXError {
228
+ export declare class WorkerPoolClosedError extends PipeXError {
239
229
  readonly name: string;
240
230
  constructor();
241
231
  }
242
- declare class WorkerQueueFullError extends PipeXError {
232
+ export declare class WorkerQueueFullError extends PipeXError {
243
233
  readonly maxQueue: number;
244
234
  readonly name: string;
245
235
  constructor(maxQueue: number);
246
236
  }
247
- declare class WorkerPoolCloseError extends PipeXError {
237
+ export declare class WorkerPoolCloseError extends PipeXError {
248
238
  readonly name: string;
249
239
  constructor(options?: ErrorOptions);
250
240
  }
251
- declare class WorkerTaskError extends PipeXError {
241
+ export declare class WorkerTaskError extends PipeXError {
252
242
  readonly taskName: string;
253
243
  readonly name: string;
254
244
  constructor(taskName: string, options?: ErrorOptions);
255
245
  }
256
246
  /** Public cryptographic failure categories; never include keys or ciphertext in messages. */
257
- declare class EncryptionError extends PipeXError {
247
+ export declare class EncryptionError extends PipeXError {
258
248
  readonly name: string;
259
249
  constructor(message?: string);
260
250
  }
261
- declare class InvalidKeyError extends PipeXError {
251
+ export declare class InvalidKeyError extends PipeXError {
262
252
  readonly name: string;
263
253
  constructor();
264
254
  }
265
- declare class AuthenticationError extends PipeXError {
255
+ export declare class AuthenticationError extends PipeXError {
266
256
  readonly name: string;
267
257
  constructor();
268
258
  }
269
- //#endregion
270
- //#region src/core/kmsCapabilities.d.ts
271
259
  /**
272
260
  * Returns an immutable, runtime-validated view of a generic KMS provider.
273
261
  * Explicit false declarations support legacy provider stubs that exist only
274
262
  * to throw; such methods are never invoked through PipeX.
275
263
  */
276
- declare function getKmsProviderCapabilities(provider: KmsProvider): Readonly<KmsProviderCapabilities>;
277
- declare function supportsKmsOperation(provider: KmsProvider, operation: KmsOperation): boolean;
278
- //#endregion
279
- //#region src/plugin/performance.d.ts
264
+ export declare function getKmsProviderCapabilities(provider: KmsProvider): Readonly<KmsProviderCapabilities>;
265
+ export declare function supportsKmsOperation(provider: KmsProvider, operation: KmsOperation): boolean;
280
266
  /**
281
267
  * BenchmarkPlugin — Standard library plugin for monitoring data throughput.
282
268
  * Records input/output byte counts in context metadata.
283
269
  */
284
- declare class BenchmarkPlugin extends BasePlugin {
270
+ export declare class BenchmarkPlugin extends BasePlugin {
285
271
  readonly name = "benchmark";
286
272
  readonly version = "2.0.0";
287
273
  process(data: Buffer, ctx: ProcessorContext): Promise<Buffer>;
288
274
  reverse(data: Buffer, ctx: ProcessorContext): Promise<Buffer>;
289
275
  }
290
- //#endregion
291
- //#region src/index.d.ts
292
- declare const Plugins: {
276
+ export declare const Plugins: {
293
277
  readonly Hashing: typeof HashingPlugin;
294
278
  readonly Encryption: typeof EncryptionPlugin;
295
279
  readonly Compression: typeof CompressionPlugin;
@@ -298,5 +282,4 @@ declare const Plugins: {
298
282
  readonly Validation: typeof ValidationPlugin;
299
283
  readonly KmsEncryption: typeof KmsEncryptionPlugin;
300
284
  };
301
- //#endregion
302
- export { type AuditLogger, type AuditRecord, AuthenticationError, BasePlugin, BenchmarkPlugin, type BinaryUndoOptions, CompressionError, type CompressionOptions, CompressionPlugin, type CompressionType, DEFAULT_HIGH_WATER, DEFAULT_LIMITS, DataEngine, type EncryptionAlgorithm, EncryptionError, type EncryptionOptions, EncryptionPlugin, type EngineConfig, type EngineEvents, type EngineLimits, type EngineResult, GuardedUnpackrStream, type HashAlgorithm, HashingError, type HashingOptions, HashingPlugin, InvalidKeyError, InvalidKmsProviderCapabilityError, type InvalidKmsProviderCapabilityIssue, InvalidPluginCapabilityError, type InvalidPluginCapabilityIssue, KmsAuthenticationError, type KmsEncryptionOptions, KmsEncryptionPlugin, type KmsOperation, type KmsProvider, KmsProviderAuthenticationError, type KmsProviderCapabilities, KmsProviderError, KmsProviderUnavailableError, type KmsRequestOptions, type Logger, MAX_FRAME_BYTES, ORIGINAL_TYPES, OperationAbortedError, type OperationOptions, OperationTimeoutError, PACKR, PIPEX_MANIFEST_KEY, PipeXError, type PipeXErrorCode, type PipeXManifest, PipelineAbortedError, type PluginCapabilities, type PluginConstructor, type PluginOperation, Plugins, type ProcessorContext, type ProcessorPlugin, type RegisteredPluginCapabilities, type RetryOptions, type SchemaRegistry, type Span, type StreamPluginContext, type Tracer, TypedPipeline, type TypedPipelineOptions, type TypedTransform, UNPACKR, UnsupportedAlgorithmError, UnsupportedKmsOperationError, UnsupportedReverseError, UnsupportedStreamingError, ValidationError, type ValidationOptions, ValidationPlugin, WorkerPoolCloseError, WorkerPoolClosedError, type WorkerPoolOptions, WorkerPoolPlugin, WorkerQueueFullError, WorkerTaskError, assertExists, assertKnownValueByteLimit, assertMessagePackFrameLimits, assertOriginalType, assertReversiblePipeline, assertStreamingPipeline, buildByteLimitTransform, buildFallbackTransform, buildFrameLimitTransform, buildKnownValueByteLimitTransform, buildManifest, buildManifestExtractTransform, buildManifestHeaderTransform, buildNdjsonTransform, buildObjectLimitTransform, buildTransformChain, createPackrStream, createUnpackrStream, detectType, fromBuffer, getKmsProviderCapabilities, getPluginCapabilities, hasStreamSupport, isManifest, makeContext, resolveOutputPath, runPipeline, supportsKmsOperation, supportsOperation, supportsReverse, toBuffer, typedPipeline, withRetry };
285
+ export { type AuditLogger, type AuditRecord, BasePlugin, type BinaryUndoOptions, type CompressionOptions, CompressionPlugin, type CompressionType, DataEngine, type EncryptionAlgorithm, type EncryptionOptions, EncryptionPlugin, type EngineConfig, type EngineEvents, type EngineLimits, type EngineResult, type HashAlgorithm, type HashingOptions, HashingPlugin, type InvalidKmsProviderCapabilityIssue, type InvalidPluginCapabilityIssue, type KmsEncryptionOptions, KmsEncryptionPlugin, type KmsOperation, type KmsProvider, type KmsProviderCapabilities, type KmsRequestOptions, type Logger, type OperationOptions, type PipeXErrorCode, type PipeXManifest, type PluginCapabilities, type PluginConstructor, type PluginOperation, type ProcessorContext, type ProcessorPlugin, type RegisteredPluginCapabilities, type RetryOptions, type SchemaRegistry, type Span, type StreamPluginContext, type Tracer, type TypedPipelineOptions, type TypedTransform, type ValidationOptions, ValidationPlugin, type WorkerPoolOptions, WorkerPoolPlugin, isManifest };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{A as e,C as t,D as n,E as r,H as i,M as a,N as ee,O as o,P as s,S as c,T as l,U as te,V as ne,_ as re,a as ie,b as ae,c as oe,d as se,f as ce,g as u,h as d,i as f,j as p,k as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,v as w,w as T,x as E,y as D}from"./core-BOdvxKBq.mjs";import{C as O,D as k,E as A,O as j,S as M,T as N,_ as P,a as F,b as I,c as le,d as L,f as R,g as z,h as B,i as V,l as H,m as U,o as W,p as ue,s as de,t as fe,u as pe,v as me,w as he,x as ge,y as _e}from"./resourceLimits-C1HHDwXQ.mjs";import{t as G}from"./dataEngine-4m6GTOLe.mjs";import{n as ve,r as ye,t as K}from"./kms_encryption-R9auKGW4.mjs";import{t as q}from"./hashing-ChrADfcH.mjs";import{t as J}from"./encryption-CqxtoqAD.mjs";import{t as Y}from"./compression-2mm0MhWY.mjs";import{t as X}from"./worker-c0_VZ9c7.mjs";import{t as Z}from"./validation-P5WRSAUK.mjs";var Q=class e{constructor(e){this.transforms=e}static from(t){return new e([t])}pipe(t){return new e([...this.transforms,t])}async run(e,t={}){let n=e,r=t.signal,i=()=>{if(r?.aborted)throw new z};i();for(let e of this.transforms){i();let a=Promise.resolve(e(n,t));n=r?await new Promise((e,t)=>{let n=()=>t(new z);r.addEventListener(`abort`,n,{once:!0}),a.then(e,t).finally(()=>r.removeEventListener(`abort`,n)).catch(()=>{}),r.aborted&&n()}):await a}return i(),n}};function be(e){return Q.from(e)}var $=class extends V{name=`benchmark`;version=`2.0.0`;async process(e,t){t.metadata??={};let n=t.metadata[`benchmark:start`]||Date.now();return t.metadata[`benchmark:in_bytes`]=e.length,t.metadata[`benchmark:start`]=n,e}async reverse(e,t){t.metadata??={},t.metadata[`benchmark:out_bytes`]=e.length;let n=t.metadata[`benchmark:start`];return n&&(t.metadata[`benchmark:duration_ms`]=Date.now()-n),e}};const xe={Hashing:q,Encryption:J,Compression:Y,Benchmark:$,WorkerPool:X,Validation:Z,KmsEncryption:K};G.registerPlugin(`hashing`,q),G.registerPlugin(`encryption`,J),G.registerPlugin(`compression`,Y),G.registerPlugin(`benchmark`,$),G.registerPlugin(`worker-pool`,X),G.registerPlugin(`validation`,Z),G.registerPlugin(`kms-encryption`,K);export{F as AuthenticationError,V as BasePlugin,$ as BenchmarkPlugin,W as CompressionError,Y as CompressionPlugin,S as DEFAULT_HIGH_WATER,fe as DEFAULT_LIMITS,G as DataEngine,de as EncryptionError,J as EncryptionPlugin,_ as GuardedUnpackrStream,le as HashingError,q as HashingPlugin,H as InvalidKeyError,pe as InvalidKmsProviderCapabilityError,L as InvalidPluginCapabilityError,R as KmsAuthenticationError,K as KmsEncryptionPlugin,ue as KmsProviderAuthenticationError,U as KmsProviderError,B as KmsProviderUnavailableError,b as MAX_FRAME_BYTES,f as ORIGINAL_TYPES,z as OperationAbortedError,P as OperationTimeoutError,ie as PACKR,v as PIPEX_MANIFEST_KEY,me as PipeXError,_e as PipelineAbortedError,xe as Plugins,Q as TypedPipeline,x as UNPACKR,I as UnsupportedAlgorithmError,ge as UnsupportedKmsOperationError,M as UnsupportedReverseError,O as UnsupportedStreamingError,he as ValidationError,Z as ValidationPlugin,N as WorkerPoolCloseError,A as WorkerPoolClosedError,X as WorkerPoolPlugin,k as WorkerQueueFullError,j as WorkerTaskError,oe as assertExists,h as assertKnownValueByteLimit,ne as assertMessagePackFrameLimits,C as assertOriginalType,se as assertReversiblePipeline,ce as assertStreamingPipeline,y as buildByteLimitTransform,g as buildFallbackTransform,i as buildFrameLimitTransform,d as buildKnownValueByteLimitTransform,u as buildManifest,re as buildManifestExtractTransform,w as buildManifestHeaderTransform,D as buildNdjsonTransform,ae as buildObjectLimitTransform,E as buildTransformChain,c as createPackrStream,t as createUnpackrStream,T as detectType,l as fromBuffer,ve as getKmsProviderCapabilities,r as getPluginCapabilities,n as hasStreamSupport,te as isManifest,o as makeContext,m as resolveOutputPath,e as runPipeline,ye as supportsKmsOperation,p as supportsOperation,a as supportsReverse,ee as toBuffer,be as typedPipeline,s as withRetry};
1
+ import{A as e,C as t,D as n,E as r,H as i,M as a,N as ee,O as o,P as s,S as c,T as l,U as u,V as te,_ as ne,a as re,b as ie,c as ae,d as oe,f as se,g as d,h as f,i as p,j as m,k as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,v as T,w as E,x as D,y as O}from"./core-DNchiRD5.mjs";import{t as k}from"./dataEngine-raQdutX5.mjs";import{C as A,D as j,E as M,O as N,S as P,T as F,_ as I,a as L,b as ce,c as R,d as z,f as B,g as V,h as H,i as U,l as W,m as G,o as le,p as ue,s as de,t as fe,u as pe,v as me,w as he,x as ge,y as _e}from"./resourceLimits-CpDWwraK.mjs";import{n as ve,r as ye,t as K}from"./kms_encryption-1G54Lcuo.mjs";import{t as q}from"./hashing-DU3rmGMP.mjs";import{t as J}from"./encryption-CHvy--rb.mjs";import{t as Y}from"./compression-ChJlMVwP.mjs";import{t as X}from"./worker-ul8lQ0SH.mjs";import{t as Z}from"./validation-BkJxOs7q.mjs";var Q=class e{transforms;constructor(e){this.transforms=e}static from(t){return new e([t])}pipe(t){return new e([...this.transforms,t])}async run(e,t={}){let n=e,r=t.signal,i=()=>{if(r?.aborted)throw new V};i();for(let e of this.transforms){i();let a=Promise.resolve(e(n,t));n=r?await new Promise((e,t)=>{let n=()=>t(new V);r.addEventListener(`abort`,n,{once:!0}),a.then(e,t).finally(()=>r.removeEventListener(`abort`,n)).catch(()=>{}),r.aborted&&n()}):await a}return i(),n}};function be(e){return Q.from(e)}var $=class extends U{name=`benchmark`;version=`2.0.0`;async process(e,t){t.metadata??={};let n=t.metadata[`benchmark:start`]||Date.now();return t.metadata[`benchmark:in_bytes`]=e.length,t.metadata[`benchmark:start`]=n,e}async reverse(e,t){t.metadata??={},t.metadata[`benchmark:out_bytes`]=e.length;let n=t.metadata[`benchmark:start`];return n&&(t.metadata[`benchmark:duration_ms`]=Date.now()-n),e}};const xe={Hashing:q,Encryption:J,Compression:Y,Benchmark:$,WorkerPool:X,Validation:Z,KmsEncryption:K};k.registerPlugin(`hashing`,q),k.registerPlugin(`encryption`,J),k.registerPlugin(`compression`,Y),k.registerPlugin(`benchmark`,$),k.registerPlugin(`worker-pool`,X),k.registerPlugin(`validation`,Z),k.registerPlugin(`kms-encryption`,K);export{L as AuthenticationError,U as BasePlugin,$ as BenchmarkPlugin,le as CompressionError,Y as CompressionPlugin,C as DEFAULT_HIGH_WATER,fe as DEFAULT_LIMITS,k as DataEngine,de as EncryptionError,J as EncryptionPlugin,v as GuardedUnpackrStream,R as HashingError,q as HashingPlugin,W as InvalidKeyError,pe as InvalidKmsProviderCapabilityError,z as InvalidPluginCapabilityError,B as KmsAuthenticationError,K as KmsEncryptionPlugin,ue as KmsProviderAuthenticationError,G as KmsProviderError,H as KmsProviderUnavailableError,x as MAX_FRAME_BYTES,p as ORIGINAL_TYPES,V as OperationAbortedError,I as OperationTimeoutError,re as PACKR,y as PIPEX_MANIFEST_KEY,me as PipeXError,_e as PipelineAbortedError,xe as Plugins,Q as TypedPipeline,S as UNPACKR,ce as UnsupportedAlgorithmError,ge as UnsupportedKmsOperationError,P as UnsupportedReverseError,A as UnsupportedStreamingError,he as ValidationError,Z as ValidationPlugin,F as WorkerPoolCloseError,M as WorkerPoolClosedError,X as WorkerPoolPlugin,j as WorkerQueueFullError,N as WorkerTaskError,ae as assertExists,g as assertKnownValueByteLimit,te as assertMessagePackFrameLimits,w as assertOriginalType,oe as assertReversiblePipeline,se as assertStreamingPipeline,b as buildByteLimitTransform,_ as buildFallbackTransform,i as buildFrameLimitTransform,f as buildKnownValueByteLimitTransform,d as buildManifest,ne as buildManifestExtractTransform,T as buildManifestHeaderTransform,O as buildNdjsonTransform,ie as buildObjectLimitTransform,D as buildTransformChain,c as createPackrStream,t as createUnpackrStream,E as detectType,l as fromBuffer,ve as getKmsProviderCapabilities,r as getPluginCapabilities,n as hasStreamSupport,u as isManifest,o as makeContext,h as resolveOutputPath,e as runPipeline,ye as supportsKmsOperation,m as supportsOperation,a as supportsReverse,ee as toBuffer,be as typedPipeline,s as withRetry};
package/dist/kms.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./kms_encryption-xyWi65rZ.cjs`);exports.KmsEncryptionPlugin=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./kms_encryption-B07lunjB.cjs");exports.KmsEncryptionPlugin=e.t;
package/dist/kms.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { c as KmsOperation, d as KmsRequestOptions, l as KmsProvider, u as KmsProviderCapabilities } from "./types-ia4x-Dvp.cjs";
2
- import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-Dh1LEHhk.cjs";
1
+ import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-BBIHGi_O.cjs";
2
+ import { c as KmsOperation, d as KmsRequestOptions, l as KmsProvider, u as KmsProviderCapabilities } from "./types-B50Urzn2.cjs";
3
3
  export { type KmsEncryptionOptions, KmsEncryptionPlugin, type KmsOperation, type KmsProvider, type KmsProviderCapabilities, type KmsRequestOptions };
package/dist/kms.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { c as KmsOperation, d as KmsRequestOptions, l as KmsProvider, u as KmsProviderCapabilities } from "./types-Bytga6zd.mjs";
2
- import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-Da-KqjKI.mjs";
1
+ import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-BbtS7rXa.mjs";
2
+ import { c as KmsOperation, d as KmsRequestOptions, l as KmsProvider, u as KmsProviderCapabilities } from "./types-B50Urzn2.mjs";
3
3
  export { type KmsEncryptionOptions, KmsEncryptionPlugin, type KmsOperation, type KmsProvider, type KmsProviderCapabilities, type KmsRequestOptions };
package/dist/kms.mjs CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./kms_encryption-R9auKGW4.mjs";export{e as KmsEncryptionPlugin};
1
+ export{t as KmsEncryptionPlugin}from"./kms_encryption-1G54Lcuo.mjs";
@@ -0,0 +1 @@
1
+ import{createCipheriv as e,createDecipheriv as t,randomBytes as n}from"node:crypto";import{_ as r,f as i,g as a,h as o,i as s,m as c,n as l,p as u,r as d,t as f,u as p,x as m}from"./resourceLimits-CpDWwraK.mjs";const h=[`encrypt`,`decrypt`,`generateDataKey`];function g(e){if(!e||typeof e!=`object`)throw TypeError(`[PipeX] Invalid KMS provider`);if(e.capabilities!==void 0&&(!e.capabilities||typeof e.capabilities!=`object`))throw TypeError(`[PipeX] Invalid KMS provider capabilities`);let t={};for(let n of h){let r=e.capabilities?.[n],i=typeof e[n]==`function`;if(r!==void 0&&typeof r!=`boolean`)throw new p(n,`MUST_BE_BOOLEAN`);if(r===!0&&!i)throw new p(n,`MISSING_IMPLEMENTATION`);t[n]=r??i}return Object.freeze(t)}function _(e,t){if(!h.includes(t))throw TypeError(`[PipeX] Unknown KMS operation`);return g(e)[t]}function v(e,t){if(!_(e,t))throw new m(t)}const y=Buffer.from(`PXKM`);function b(e){let t={cause:e.reason};return e.reason instanceof Error&&e.reason.name===`TimeoutError`?new r(t):new a(t)}async function x(e,t,n){if(!t)return e;if(t.aborted)throw e.then(e=>{try{n?.(e)}catch{}},()=>void 0),b(t);return new Promise((r,i)=>{let a=!1,o=()=>{a=!0,i(b(t))};t.addEventListener(`abort`,o,{once:!0}),e.then(e=>{if(t.removeEventListener(`abort`,o),a)try{n?.(e)}catch{}else r(e)},e=>{t.removeEventListener(`abort`,o),a||i(e)})})}function S(e){let t=e.limits?.operationTimeoutMs??f.operationTimeoutMs;if(!Number.isSafeInteger(t)||t<0||t>0x7fffffff)throw Error(`[PipeX] Invalid KMS provider timeout`);if(t===0)return{signal:e.signal,cleanup(){}};let n=new AbortController,r=setTimeout(()=>{n.abort(new DOMException(`KMS provider operation timed out`,`TimeoutError`))},t);return{signal:e.signal?AbortSignal.any([e.signal,n.signal]):n.signal,cleanup(){clearTimeout(r)}}}function C(e,t){return t instanceof a||t instanceof r?t:t instanceof u?new u(e):t instanceof o?new o(e):new c(e)}async function w(e,t,n,r,i){v(e,t);let a=S(n);try{if(a.signal?.aborted)throw b(a.signal);return await x(r(a.signal),a.signal,i)}catch(e){throw a.signal?.aborted?b(a.signal):C(t,e)}finally{a.cleanup()}}var T=class extends s{options;name=`kms-encryption`;version=`2.1.0`;streaming=!1;get providerCapabilities(){return g(this.options.kms)}get reversible(){return this.providerCapabilities.decrypt}constructor(e){if(super(e),this.options=e,!e||!e.kms||typeof e.keyId!=`string`||e.keyId.length===0)throw Error(`[PipeX] KMS Encryption: invalid provider or keyId`);if(e.allowLegacyDecrypt!==void 0&&typeof e.allowLegacyDecrypt!=`boolean`)throw Error(`[PipeX] KMS Encryption allowLegacyDecrypt must be a boolean`);g(e.kms),v(e.kms,`generateDataKey`)}async process(t,r){let i=l(r),a=d(r),o=r.limits?.maxKmsEncryptedKeyBytes??f.maxKmsEncryptedKeyBytes,s=r.limits?.maxKmsKeyIdBytes??f.maxKmsKeyIdBytes;if(Buffer.byteLength(this.options.keyId)>s)throw Error(`[PipeX] KMS key identifier exceeds the configured limit`);if(t.length>i)throw Error(`[PipeX] KMS encryption input exceeds ${i} bytes`);if(t.length>0xffffffff)throw Error(`[PipeX] KMS encryption input exceeds the format limit`);if(t.length>a-45)throw Error(`[PipeX] KMS encryption output exceeds ${a} bytes`);let{kms:c,keyId:u}=this.options,p=await w(c,`generateDataKey`,r,e=>c.generateDataKey(u,{signal:e}),e=>{Buffer.isBuffer(e?.plaintext)&&e.plaintext.fill(0)}),m=p?.plaintext;try{let r=p?.ciphertext;if(!Buffer.isBuffer(m)||m.length!==32)throw Error(`[PipeX] KMS generated an invalid data key`);if(!Buffer.isBuffer(r)||r.length<1||r.length>o)throw Error(`[PipeX] KMS generated an invalid encrypted key`);let i=28+r.length+16;if(t.length>a-i)throw Error(`[PipeX] KMS encryption output exceeds ${a} bytes`);let s=i+t.length,c=n(12),l=e(`aes-256-gcm`,m,c,{authTagLength:16}),u=Buffer.alloc(28);y.copy(u,0),u.writeUInt8(1,4),u.writeUInt8(1,5),u.writeUInt16BE(0,6),u.writeUInt32BE(r.length,8),u.writeUInt32BE(t.length,12),c.copy(u,16),l.setAAD(Buffer.concat([u,r]));let d=Buffer.concat([l.update(t),l.final()]),f=l.getAuthTag();return Buffer.concat([u,r,d,f],s)}finally{Buffer.isBuffer(m)&&m.fill(0)}}async reverse(e,n){let{kms:r,keyId:a}=this.options;v(r,`decrypt`);let o=l(n),s=d(n),c=n.limits?.maxKmsEncryptedKeyBytes??f.maxKmsEncryptedKeyBytes,u=n.limits?.maxKmsKeyIdBytes??f.maxKmsKeyIdBytes;if(Buffer.byteLength(a)>u)throw Error(`[PipeX] KMS key identifier exceeds the configured limit`);if(e.length>o)throw Error(`[PipeX] KMS decryption input exceeds ${o} bytes`);if(e.length===0)throw Error(`[PipeX] KMS Decryption: Packet too short`);let p=e.length>=y.length&&e.subarray(0,y.length).equals(y);if(!p&&e.readUInt8(0)===y.readUInt8(0))throw Error(`[PipeX] KMS Decryption: incomplete framed header`);if(!p&&this.options.allowLegacyDecrypt!==!0)throw Error(`[PipeX] KMS Decryption: legacy format disabled`);let m,h,g,_,b;if(p){if(e.length<45)throw Error(`[PipeX] KMS Decryption: incomplete framed envelope`);if(e.readUInt8(4)!==1)throw Error(`[PipeX] KMS Decryption: unsupported format version`);if(e.readUInt8(5)!==1||e.readUInt16BE(6)!==0)throw Error(`[PipeX] KMS Decryption: invalid framed envelope`);let t=e.readUInt32BE(8),n=e.readUInt32BE(12);if(t<1||t>c)throw Error(`[PipeX] KMS Decryption: invalid key envelope`);if(28+t+n+16!==e.length)throw Error(`[PipeX] KMS Decryption: invalid envelope length`);if(n>s)throw Error(`[PipeX] KMS decryption output exceeds ${s} bytes`);h=e.subarray(16,28),m=e.subarray(28,28+t),_=e.subarray(28+t,e.length-16),g=e.subarray(e.length-16),b=e.subarray(0,28+t)}else{if(e.length<4)throw Error(`[PipeX] KMS Decryption: Packet too short`);let t=e.readUInt32BE(0);if(t<1||t>c||e.length<4+t+12+16)throw Error(`[PipeX] KMS Decryption: invalid key envelope`);m=e.subarray(4,4+t),h=e.subarray(4+t,4+t+12),g=e.subarray(4+t+12,4+t+12+16),_=e.subarray(4+t+12+16)}if(_.length>s)throw Error(`[PipeX] KMS decryption output exceeds ${s} bytes`);let x=await w(r,`decrypt`,n,e=>r.decrypt(m,a,{signal:e}),e=>{Buffer.isBuffer(e)&&e.fill(0)});try{if(!Buffer.isBuffer(x)||x.length!==32)throw Error(`[PipeX] KMS Decryption: invalid data key length`);let e=t(`aes-256-gcm`,x,h,{authTagLength:16});b&&e.setAAD(b),e.setAuthTag(g);let n=e.update(_);try{let t=e.final();return t.length===0?n:Buffer.concat([n,t])}catch{throw n.fill(0),new i}}finally{Buffer.isBuffer(x)&&x.fill(0)}}};export{g as n,_ as r,T as t};
@@ -0,0 +1 @@
1
+ let e=require("node:crypto");const t=require("./resourceLimits-lJrEhDE5.cjs"),n=[`encrypt`,`decrypt`,`generateDataKey`];function r(e){if(!e||typeof e!=`object`)throw TypeError(`[PipeX] Invalid KMS provider`);if(e.capabilities!==void 0&&(!e.capabilities||typeof e.capabilities!=`object`))throw TypeError(`[PipeX] Invalid KMS provider capabilities`);let r={};for(let i of n){let n=e.capabilities?.[i],a=typeof e[i]==`function`;if(n!==void 0&&typeof n!=`boolean`)throw new t.u(i,`MUST_BE_BOOLEAN`);if(n===!0&&!a)throw new t.u(i,`MISSING_IMPLEMENTATION`);r[i]=n??a}return Object.freeze(r)}function i(e,t){if(!n.includes(t))throw TypeError(`[PipeX] Unknown KMS operation`);return r(e)[t]}function a(e,n){if(!i(e,n))throw new t.x(n)}const o=Buffer.from(`PXKM`);function s(e){let n={cause:e.reason};return e.reason instanceof Error&&e.reason.name===`TimeoutError`?new t._(n):new t.g(n)}async function c(e,t,n){if(!t)return e;if(t.aborted)throw e.then(e=>{try{n?.(e)}catch{}},()=>void 0),s(t);return new Promise((r,i)=>{let a=!1,o=()=>{a=!0,i(s(t))};t.addEventListener(`abort`,o,{once:!0}),e.then(e=>{if(t.removeEventListener(`abort`,o),a)try{n?.(e)}catch{}else r(e)},e=>{t.removeEventListener(`abort`,o),a||i(e)})})}function l(e){let n=e.limits?.operationTimeoutMs??t.t.operationTimeoutMs;if(!Number.isSafeInteger(n)||n<0||n>0x7fffffff)throw Error(`[PipeX] Invalid KMS provider timeout`);if(n===0)return{signal:e.signal,cleanup(){}};let r=new AbortController,i=setTimeout(()=>{r.abort(new DOMException(`KMS provider operation timed out`,`TimeoutError`))},n);return{signal:e.signal?AbortSignal.any([e.signal,r.signal]):r.signal,cleanup(){clearTimeout(i)}}}function u(e,n){return n instanceof t.g||n instanceof t._?n:n instanceof t.p?new t.p(e):n instanceof t.h?new t.h(e):new t.m(e)}async function d(e,t,n,r,i){a(e,t);let o=l(n);try{if(o.signal?.aborted)throw s(o.signal);return await c(r(o.signal),o.signal,i)}catch(e){throw o.signal?.aborted?s(o.signal):u(t,e)}finally{o.cleanup()}}var f=class extends t.i{options;name=`kms-encryption`;version=`2.1.0`;streaming=!1;get providerCapabilities(){return r(this.options.kms)}get reversible(){return this.providerCapabilities.decrypt}constructor(e){if(super(e),this.options=e,!e||!e.kms||typeof e.keyId!=`string`||e.keyId.length===0)throw Error(`[PipeX] KMS Encryption: invalid provider or keyId`);if(e.allowLegacyDecrypt!==void 0&&typeof e.allowLegacyDecrypt!=`boolean`)throw Error(`[PipeX] KMS Encryption allowLegacyDecrypt must be a boolean`);r(e.kms),a(e.kms,`generateDataKey`)}async process(n,r){let i=t.n(r),a=t.r(r),s=r.limits?.maxKmsEncryptedKeyBytes??t.t.maxKmsEncryptedKeyBytes,c=r.limits?.maxKmsKeyIdBytes??t.t.maxKmsKeyIdBytes;if(Buffer.byteLength(this.options.keyId)>c)throw Error(`[PipeX] KMS key identifier exceeds the configured limit`);if(n.length>i)throw Error(`[PipeX] KMS encryption input exceeds ${i} bytes`);if(n.length>0xffffffff)throw Error(`[PipeX] KMS encryption input exceeds the format limit`);if(n.length>a-45)throw Error(`[PipeX] KMS encryption output exceeds ${a} bytes`);let{kms:l,keyId:u}=this.options,f=await d(l,`generateDataKey`,r,e=>l.generateDataKey(u,{signal:e}),e=>{Buffer.isBuffer(e?.plaintext)&&e.plaintext.fill(0)}),p=f?.plaintext;try{let t=f?.ciphertext;if(!Buffer.isBuffer(p)||p.length!==32)throw Error(`[PipeX] KMS generated an invalid data key`);if(!Buffer.isBuffer(t)||t.length<1||t.length>s)throw Error(`[PipeX] KMS generated an invalid encrypted key`);let r=28+t.length+16;if(n.length>a-r)throw Error(`[PipeX] KMS encryption output exceeds ${a} bytes`);let i=r+n.length,c=(0,e.randomBytes)(12),l=(0,e.createCipheriv)(`aes-256-gcm`,p,c,{authTagLength:16}),u=Buffer.alloc(28);o.copy(u,0),u.writeUInt8(1,4),u.writeUInt8(1,5),u.writeUInt16BE(0,6),u.writeUInt32BE(t.length,8),u.writeUInt32BE(n.length,12),c.copy(u,16),l.setAAD(Buffer.concat([u,t]));let d=Buffer.concat([l.update(n),l.final()]),m=l.getAuthTag();return Buffer.concat([u,t,d,m],i)}finally{Buffer.isBuffer(p)&&p.fill(0)}}async reverse(n,r){let{kms:i,keyId:s}=this.options;a(i,`decrypt`);let c=t.n(r),l=t.r(r),u=r.limits?.maxKmsEncryptedKeyBytes??t.t.maxKmsEncryptedKeyBytes,f=r.limits?.maxKmsKeyIdBytes??t.t.maxKmsKeyIdBytes;if(Buffer.byteLength(s)>f)throw Error(`[PipeX] KMS key identifier exceeds the configured limit`);if(n.length>c)throw Error(`[PipeX] KMS decryption input exceeds ${c} bytes`);if(n.length===0)throw Error(`[PipeX] KMS Decryption: Packet too short`);let p=n.length>=o.length&&n.subarray(0,o.length).equals(o);if(!p&&n.readUInt8(0)===o.readUInt8(0))throw Error(`[PipeX] KMS Decryption: incomplete framed header`);if(!p&&this.options.allowLegacyDecrypt!==!0)throw Error(`[PipeX] KMS Decryption: legacy format disabled`);let m,h,g,_,v;if(p){if(n.length<45)throw Error(`[PipeX] KMS Decryption: incomplete framed envelope`);if(n.readUInt8(4)!==1)throw Error(`[PipeX] KMS Decryption: unsupported format version`);if(n.readUInt8(5)!==1||n.readUInt16BE(6)!==0)throw Error(`[PipeX] KMS Decryption: invalid framed envelope`);let e=n.readUInt32BE(8),t=n.readUInt32BE(12);if(e<1||e>u)throw Error(`[PipeX] KMS Decryption: invalid key envelope`);if(28+e+t+16!==n.length)throw Error(`[PipeX] KMS Decryption: invalid envelope length`);if(t>l)throw Error(`[PipeX] KMS decryption output exceeds ${l} bytes`);h=n.subarray(16,28),m=n.subarray(28,28+e),_=n.subarray(28+e,n.length-16),g=n.subarray(n.length-16),v=n.subarray(0,28+e)}else{if(n.length<4)throw Error(`[PipeX] KMS Decryption: Packet too short`);let e=n.readUInt32BE(0);if(e<1||e>u||n.length<4+e+12+16)throw Error(`[PipeX] KMS Decryption: invalid key envelope`);m=n.subarray(4,4+e),h=n.subarray(4+e,4+e+12),g=n.subarray(4+e+12,4+e+12+16),_=n.subarray(4+e+12+16)}if(_.length>l)throw Error(`[PipeX] KMS decryption output exceeds ${l} bytes`);let y=await d(i,`decrypt`,r,e=>i.decrypt(m,s,{signal:e}),e=>{Buffer.isBuffer(e)&&e.fill(0)});try{if(!Buffer.isBuffer(y)||y.length!==32)throw Error(`[PipeX] KMS Decryption: invalid data key length`);let n=(0,e.createDecipheriv)(`aes-256-gcm`,y,h,{authTagLength:16});v&&n.setAAD(v),n.setAuthTag(g);let r=n.update(_);try{let e=n.final();return e.length===0?r:Buffer.concat([r,e])}catch{throw r.fill(0),new t.f}}finally{Buffer.isBuffer(y)&&y.fill(0)}}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -1,7 +1,5 @@
1
- import { _ as ProcessorContext, l as KmsProvider, u as KmsProviderCapabilities } from "./types-Bytga6zd.mjs";
2
- import { t as BasePlugin } from "./plugin-CE94-p8P.mjs";
3
-
4
- //#region src/plugin/kms_encryption.d.ts
1
+ import { t as BasePlugin } from "./plugin-c_iSNY86.cjs";
2
+ import { _ as ProcessorContext, l as KmsProvider, u as KmsProviderCapabilities } from "./types-B50Urzn2.cjs";
5
3
  interface KmsEncryptionOptions {
6
4
  kms: KmsProvider;
7
5
  keyId: string;
@@ -29,5 +27,4 @@ declare class KmsEncryptionPlugin extends BasePlugin {
29
27
  process(data: Buffer, ctx: ProcessorContext): Promise<Buffer>;
30
28
  reverse(data: Buffer, ctx: ProcessorContext): Promise<Buffer>;
31
29
  }
32
- //#endregion
33
30
  export { KmsEncryptionPlugin as n, KmsEncryptionOptions as t };
@@ -1,7 +1,5 @@
1
- import { _ as ProcessorContext, l as KmsProvider, u as KmsProviderCapabilities } from "./types-ia4x-Dvp.cjs";
2
- import { t as BasePlugin } from "./plugin-C9Kd9coY.cjs";
3
-
4
- //#region src/plugin/kms_encryption.d.ts
1
+ import { t as BasePlugin } from "./plugin-D85NMNiy.mjs";
2
+ import { _ as ProcessorContext, l as KmsProvider, u as KmsProviderCapabilities } from "./types-B50Urzn2.mjs";
5
3
  interface KmsEncryptionOptions {
6
4
  kms: KmsProvider;
7
5
  keyId: string;
@@ -29,5 +27,4 @@ declare class KmsEncryptionPlugin extends BasePlugin {
29
27
  process(data: Buffer, ctx: ProcessorContext): Promise<Buffer>;
30
28
  reverse(data: Buffer, ctx: ProcessorContext): Promise<Buffer>;
31
29
  }
32
- //#endregion
33
30
  export { KmsEncryptionPlugin as n, KmsEncryptionOptions as t };
package/dist/native.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./dataEngine-Bvl6amzP.cjs`);exports.DataEngine=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./dataEngine-6R3J-WtS.cjs");exports.DataEngine=e.t;
package/dist/native.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as DataEngine } from "./dataEngine-D-fIXgE7.cjs";
1
+ import { t as DataEngine } from "./dataEngine-C-xYat2f.cjs";
2
2
  export { DataEngine };
package/dist/native.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as DataEngine } from "./dataEngine-DUEmWp7a.mjs";
1
+ import { t as DataEngine } from "./dataEngine-Zap1RwAJ.mjs";
2
2
  export { DataEngine };
package/dist/native.mjs CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./dataEngine-4m6GTOLe.mjs";export{e as DataEngine};
1
+ export{t as DataEngine}from"./dataEngine-raQdutX5.mjs";
package/dist/parallel.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./worker-I_kqxWeK.cjs`);exports.WorkerPoolPlugin=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./worker-1Q2hRcRB.cjs");exports.WorkerPoolPlugin=e.t;
@@ -1,2 +1,2 @@
1
- import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-CbuCpSNc.cjs";
1
+ import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-DT7RYWwo.cjs";
2
2
  export { type WorkerPoolOptions, WorkerPoolPlugin };
@@ -1,2 +1,2 @@
1
- import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-CgCC-BWG.mjs";
1
+ import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-iSO3KhfN.mjs";
2
2
  export { type WorkerPoolOptions, WorkerPoolPlugin };
package/dist/parallel.mjs CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./worker-c0_VZ9c7.mjs";export{e as WorkerPoolPlugin};
1
+ export{t as WorkerPoolPlugin}from"./worker-ul8lQ0SH.mjs";
@@ -1,6 +1,4 @@
1
- import { _ as ProcessorContext, b as RetryOptions, v as ProcessorPlugin } from "./types-ia4x-Dvp.cjs";
2
-
3
- //#region src/core/plugin.d.ts
1
+ import { _ as ProcessorContext, b as RetryOptions, v as ProcessorPlugin } from "./types-B50Urzn2.mjs";
4
2
  declare abstract class BasePlugin implements ProcessorPlugin {
5
3
  protected options: object;
6
4
  abstract readonly name: string;
@@ -12,5 +10,4 @@ declare abstract class BasePlugin implements ProcessorPlugin {
12
10
  /** Unsupported by default. Subclasses must implement reverse explicitly. */
13
11
  reverse(_data: Buffer, _context: ProcessorContext): Promise<Buffer> | Buffer;
14
12
  }
15
- //#endregion
16
13
  export { BasePlugin as t };
@@ -1,6 +1,4 @@
1
- import { _ as ProcessorContext, b as RetryOptions, v as ProcessorPlugin } from "./types-Bytga6zd.mjs";
2
-
3
- //#region src/core/plugin.d.ts
1
+ import { _ as ProcessorContext, b as RetryOptions, v as ProcessorPlugin } from "./types-B50Urzn2.cjs";
4
2
  declare abstract class BasePlugin implements ProcessorPlugin {
5
3
  protected options: object;
6
4
  abstract readonly name: string;
@@ -12,5 +10,4 @@ declare abstract class BasePlugin implements ProcessorPlugin {
12
10
  /** Unsupported by default. Subclasses must implement reverse explicitly. */
13
11
  reverse(_data: Buffer, _context: ProcessorContext): Promise<Buffer> | Buffer;
14
12
  }
15
- //#endregion
16
13
  export { BasePlugin as t };
@@ -0,0 +1 @@
1
+ var e=class extends Error{code;name=`PipeXError`;transformName;stage;constructor(e,t,n){super(t,n),this.code=e,this.transformName=n?.transformName,this.stage=n?.stage}},t=class extends e{name=`ValidationError`;constructor(e){super(`VALIDATION_FAILED`,`[PipeX] Validation failed`,e)}},n=class extends e{name=`CompressionError`;constructor(e){super(`COMPRESSION_FAILED`,`[PipeX] Compression failed`,e)}},r=class extends e{name=`HashingError`;constructor(e){super(`HASHING_FAILED`,`[PipeX] Hashing failed`,e)}},i=class extends e{name=`UnsupportedAlgorithmError`;constructor(e){super(`UNSUPPORTED_ALGORITHM`,`[PipeX] Unsupported algorithm`,e)}},a=class extends e{name=`PipelineAbortedError`;constructor(e){super(`OPERATION_ABORTED`,`[PipeX] Operation aborted`,e)}},o=class extends e{plugin;name=`UnsupportedReverseError`;constructor(e){super(`UNSUPPORTED_REVERSE`,`[PipeX] Plugin ${e} does not support reverse operations`),this.plugin=e}},s=class extends e{plugin;name=`UnsupportedStreamingError`;constructor(e){super(`UNSUPPORTED_STREAMING`,`[PipeX] Plugin ${e} does not support stream operations`),this.plugin=e}},c=class extends e{plugin;capability;issue;name=`InvalidPluginCapabilityError`;constructor(e,t,n){super(`INVALID_PLUGIN_CAPABILITY`,`[PipeX] Plugin ${e} has an invalid ${t} capability: ${n===`MUST_BE_BOOLEAN`?`must be a boolean when declared`:n===`MISSING_IMPLEMENTATION`?`is declared but its implementation is missing`:`is disabled but its implementation is present`}`),this.plugin=e,this.capability=t,this.issue=n}},l=class extends a{name=`OperationAbortedError`;constructor(e){super(e)}},u=class extends e{name=`OperationTimeoutError`;constructor(e){super(`OPERATION_TIMEOUT`,`[PipeX] Operation timed out`,e)}},d=class extends e{operation;name=`KmsProviderError`;constructor(e,t){super(`KMS_PROVIDER_FAILURE`,`[PipeX] KMS ${e} failed`,t),this.operation=e}},f=class extends e{name=`KmsAuthenticationError`;constructor(){super(`KMS_AUTHENTICATION_FAILED`,`[PipeX] KMS envelope authentication failed`)}},p=class extends e{operation;name=`KmsProviderAuthenticationError`;constructor(e){super(`KMS_PROVIDER_AUTHENTICATION_FAILED`,`[PipeX] KMS ${e} authentication failed`),this.operation=e}},m=class extends e{operation;name=`KmsProviderUnavailableError`;constructor(e){super(`KMS_PROVIDER_UNAVAILABLE`,`[PipeX] KMS ${e} provider unavailable`),this.operation=e}},h=class extends e{operation;name=`UnsupportedKmsOperationError`;constructor(e){super(`UNSUPPORTED_KMS_OPERATION`,`[PipeX] KMS provider does not support ${e}`),this.operation=e}},g=class extends e{operation;issue;name=`InvalidKmsProviderCapabilityError`;constructor(e,t){super(`INVALID_KMS_PROVIDER_CAPABILITY`,`[PipeX] Invalid KMS ${e} capability: ${t===`MUST_BE_BOOLEAN`?`must be a boolean when declared`:`is declared but its implementation is missing`}`),this.operation=e,this.issue=t}},_=class extends e{name=`WorkerPoolClosedError`;constructor(){super(`WORKER_POOL_CLOSED`,`[PipeX] Worker pool is closed`)}},v=class extends e{maxQueue;name=`WorkerQueueFullError`;constructor(e){super(`WORKER_QUEUE_FULL`,`[PipeX] Worker queue is full (maximum ${e} waiting tasks)`),this.maxQueue=e}},y=class extends e{name=`WorkerPoolCloseError`;constructor(e){super(`WORKER_POOL_CLOSE_FAILURE`,`[PipeX] Worker pool failed to close cleanly`,e)}},b=class extends e{taskName;name=`WorkerTaskError`;constructor(e,t){super(`WORKER_TASK_FAILURE`,`[PipeX] Worker task ${e} failed`,t),this.taskName=e}},x=class extends e{name=`EncryptionError`;constructor(e=`[PipeX] Encryption operation failed`){super(`ENCRYPTION_ERROR`,e)}},S=class extends e{name=`InvalidKeyError`;constructor(){super(`INVALID_ENCRYPTION_KEY`,`[PipeX] Encryption key must be a 32-byte Buffer`)}},C=class extends e{name=`AuthenticationError`;constructor(){super(`ENCRYPTION_AUTHENTICATION_FAILED`,`[PipeX] Encrypted data authentication failed`)}},w=class e{options;retryOptions;get reversible(){return this.reverse!==e.prototype.reverse}constructor(e={}){this.options=e}reverse(e,t){throw new o(`${this.name}@${this.version}`)}};const T=Object.freeze({maxInputBytes:67108864,maxOutputBytes:268435456,maxFrameBytes:8388608,maxFrames:1e5,maxConcurrentOperations:32,operationTimeoutMs:3e5,maxRetryAttempts:5,maxRetryDelayMs:3e4,maxKmsEncryptedKeyBytes:65536,maxKmsKeyIdBytes:512});function E(e){let t=e?.limits??T;return Math.max(t.maxInputBytes,t.maxOutputBytes)}function D(e){return e?.limits?.maxOutputBytes??T.maxOutputBytes}export{s as C,v as D,_ as E,b as O,o as S,y as T,u as _,C as a,i as b,r as c,c as d,f,l as g,m as h,w as i,S as l,d as m,E as n,n as o,p,D as r,x as s,T as t,g as u,e as v,t as w,h as x,a as y};
@@ -0,0 +1 @@
1
+ var e=class extends Error{code;name=`PipeXError`;transformName;stage;constructor(e,t,n){super(t,n),this.code=e,this.transformName=n?.transformName,this.stage=n?.stage}},t=class extends e{name=`ValidationError`;constructor(e){super(`VALIDATION_FAILED`,`[PipeX] Validation failed`,e)}},n=class extends e{name=`CompressionError`;constructor(e){super(`COMPRESSION_FAILED`,`[PipeX] Compression failed`,e)}},r=class extends e{name=`HashingError`;constructor(e){super(`HASHING_FAILED`,`[PipeX] Hashing failed`,e)}},i=class extends e{name=`UnsupportedAlgorithmError`;constructor(e){super(`UNSUPPORTED_ALGORITHM`,`[PipeX] Unsupported algorithm`,e)}},a=class extends e{name=`PipelineAbortedError`;constructor(e){super(`OPERATION_ABORTED`,`[PipeX] Operation aborted`,e)}},o=class extends e{plugin;name=`UnsupportedReverseError`;constructor(e){super(`UNSUPPORTED_REVERSE`,`[PipeX] Plugin ${e} does not support reverse operations`),this.plugin=e}},s=class extends e{plugin;name=`UnsupportedStreamingError`;constructor(e){super(`UNSUPPORTED_STREAMING`,`[PipeX] Plugin ${e} does not support stream operations`),this.plugin=e}},c=class extends e{plugin;capability;issue;name=`InvalidPluginCapabilityError`;constructor(e,t,n){super(`INVALID_PLUGIN_CAPABILITY`,`[PipeX] Plugin ${e} has an invalid ${t} capability: ${n===`MUST_BE_BOOLEAN`?`must be a boolean when declared`:n===`MISSING_IMPLEMENTATION`?`is declared but its implementation is missing`:`is disabled but its implementation is present`}`),this.plugin=e,this.capability=t,this.issue=n}},l=class extends a{name=`OperationAbortedError`;constructor(e){super(e)}},u=class extends e{name=`OperationTimeoutError`;constructor(e){super(`OPERATION_TIMEOUT`,`[PipeX] Operation timed out`,e)}},d=class extends e{operation;name=`KmsProviderError`;constructor(e,t){super(`KMS_PROVIDER_FAILURE`,`[PipeX] KMS ${e} failed`,t),this.operation=e}},f=class extends e{name=`KmsAuthenticationError`;constructor(){super(`KMS_AUTHENTICATION_FAILED`,`[PipeX] KMS envelope authentication failed`)}},p=class extends e{operation;name=`KmsProviderAuthenticationError`;constructor(e){super(`KMS_PROVIDER_AUTHENTICATION_FAILED`,`[PipeX] KMS ${e} authentication failed`),this.operation=e}},m=class extends e{operation;name=`KmsProviderUnavailableError`;constructor(e){super(`KMS_PROVIDER_UNAVAILABLE`,`[PipeX] KMS ${e} provider unavailable`),this.operation=e}},h=class extends e{operation;name=`UnsupportedKmsOperationError`;constructor(e){super(`UNSUPPORTED_KMS_OPERATION`,`[PipeX] KMS provider does not support ${e}`),this.operation=e}},g=class extends e{operation;issue;name=`InvalidKmsProviderCapabilityError`;constructor(e,t){super(`INVALID_KMS_PROVIDER_CAPABILITY`,`[PipeX] Invalid KMS ${e} capability: ${t===`MUST_BE_BOOLEAN`?`must be a boolean when declared`:`is declared but its implementation is missing`}`),this.operation=e,this.issue=t}},_=class extends e{name=`WorkerPoolClosedError`;constructor(){super(`WORKER_POOL_CLOSED`,`[PipeX] Worker pool is closed`)}},v=class extends e{maxQueue;name=`WorkerQueueFullError`;constructor(e){super(`WORKER_QUEUE_FULL`,`[PipeX] Worker queue is full (maximum ${e} waiting tasks)`),this.maxQueue=e}},y=class extends e{name=`WorkerPoolCloseError`;constructor(e){super(`WORKER_POOL_CLOSE_FAILURE`,`[PipeX] Worker pool failed to close cleanly`,e)}},b=class extends e{taskName;name=`WorkerTaskError`;constructor(e,t){super(`WORKER_TASK_FAILURE`,`[PipeX] Worker task ${e} failed`,t),this.taskName=e}},x=class extends e{name=`EncryptionError`;constructor(e=`[PipeX] Encryption operation failed`){super(`ENCRYPTION_ERROR`,e)}},S=class extends e{name=`InvalidKeyError`;constructor(){super(`INVALID_ENCRYPTION_KEY`,`[PipeX] Encryption key must be a 32-byte Buffer`)}},C=class extends e{name=`AuthenticationError`;constructor(){super(`ENCRYPTION_AUTHENTICATION_FAILED`,`[PipeX] Encrypted data authentication failed`)}},w=class e{options;retryOptions;get reversible(){return this.reverse!==e.prototype.reverse}constructor(e={}){this.options=e}reverse(e,t){throw new o(`${this.name}@${this.version}`)}};const T=Object.freeze({maxInputBytes:67108864,maxOutputBytes:268435456,maxFrameBytes:8388608,maxFrames:1e5,maxConcurrentOperations:32,operationTimeoutMs:3e5,maxRetryAttempts:5,maxRetryDelayMs:3e4,maxKmsEncryptedKeyBytes:65536,maxKmsKeyIdBytes:512});function E(e){let t=e?.limits??T;return Math.max(t.maxInputBytes,t.maxOutputBytes)}function D(e){return e?.limits?.maxOutputBytes??T.maxOutputBytes}Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return a}});
@@ -1,7 +1,5 @@
1
1
  import { Duplex, Writable } from "node:stream";
2
2
  import { z } from "zod";
3
-
4
- //#region src/core/types.d.ts
5
3
  interface Logger {
6
4
  info(message: string, context?: Record<string, unknown>): void;
7
5
  warn(message: string, context?: Record<string, unknown>): void;
@@ -151,5 +149,4 @@ interface EngineEvents {
151
149
  error: [err: Error, requestId: string];
152
150
  end: [requestId: string, durationMs: number];
153
151
  }
154
- //#endregion
155
152
  export { StreamPluginContext as C, Span as S, isManifest as T, ProcessorContext as _, EngineEvents as a, RetryOptions as b, KmsOperation as c, KmsRequestOptions as d, Logger as f, PluginOperation as g, PluginCapabilities as h, EngineConfig as i, KmsProvider as l, PipeXManifest as m, AuditRecord as n, EngineLimits as o, OperationOptions as p, BinaryUndoOptions as r, EngineResult as s, AuditLogger as t, KmsProviderCapabilities as u, ProcessorPlugin as v, Tracer as w, SchemaRegistry as x, RegisteredPluginCapabilities as y };