@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.
- package/CHANGELOG.md +6 -0
- package/dist/{compression-CtrHxa9G.d.mts → compression-B0xKUa-N.d.mts} +2 -5
- package/dist/{compression-DnVFu8TM.d.cts → compression-C1nLQVur.d.cts} +2 -5
- package/dist/compression-ChJlMVwP.mjs +1 -0
- package/dist/compression-ZHOsKTJC.cjs +1 -0
- package/dist/compression.cjs +1 -1
- package/dist/compression.d.cts +1 -1
- package/dist/compression.d.mts +1 -1
- package/dist/compression.mjs +1 -1
- package/dist/core-DNchiRD5.mjs +2 -0
- package/dist/core-DSIwvTqu.cjs +2 -0
- package/dist/dataEngine-6R3J-WtS.cjs +1 -0
- package/dist/{dataEngine-D-fIXgE7.d.cts → dataEngine-C-xYat2f.d.cts} +2 -11
- package/dist/{dataEngine-DUEmWp7a.d.mts → dataEngine-Zap1RwAJ.d.mts} +2 -11
- package/dist/dataEngine-raQdutX5.mjs +1 -0
- package/dist/{encryption-BmmNECIc.d.cts → encryption-CCPoyX4q.d.cts} +2 -7
- package/dist/{encryption-CqxtoqAD.mjs → encryption-CHvy--rb.mjs} +1 -1
- package/dist/{encryption-CnSL1BEY.d.mts → encryption-D4eC9ubl.d.mts} +2 -7
- package/dist/encryption-DwdO7Y4J.cjs +1 -0
- package/dist/encryption.cjs +1 -1
- package/dist/encryption.d.cts +1 -1
- package/dist/encryption.d.mts +1 -1
- package/dist/encryption.mjs +1 -1
- package/dist/{hashing-B6xGcbQR.d.mts → hashing-C6TkcsUE.d.cts} +2 -5
- package/dist/{hashing-LY-8x66g.d.cts → hashing-CEwtXh2V.d.mts} +2 -5
- package/dist/hashing-DF_guuZf.cjs +1 -0
- package/dist/hashing-DU3rmGMP.mjs +1 -0
- package/dist/hashing.cjs +1 -1
- package/dist/hashing.d.cts +1 -1
- package/dist/hashing.d.mts +1 -1
- package/dist/hashing.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +77 -94
- package/dist/index.d.mts +77 -94
- package/dist/index.mjs +1 -1
- package/dist/kms.cjs +1 -1
- package/dist/kms.d.cts +2 -2
- package/dist/kms.d.mts +2 -2
- package/dist/kms.mjs +1 -1
- package/dist/kms_encryption-1G54Lcuo.mjs +1 -0
- package/dist/kms_encryption-B07lunjB.cjs +1 -0
- package/dist/{kms_encryption-Da-KqjKI.d.mts → kms_encryption-BBIHGi_O.d.cts} +2 -5
- package/dist/{kms_encryption-Dh1LEHhk.d.cts → kms_encryption-BbtS7rXa.d.mts} +2 -5
- package/dist/native.cjs +1 -1
- package/dist/native.d.cts +1 -1
- package/dist/native.d.mts +1 -1
- package/dist/native.mjs +1 -1
- package/dist/parallel.cjs +1 -1
- package/dist/parallel.d.cts +1 -1
- package/dist/parallel.d.mts +1 -1
- package/dist/parallel.mjs +1 -1
- package/dist/{plugin-C9Kd9coY.d.cts → plugin-D85NMNiy.d.mts} +1 -4
- package/dist/{plugin-CE94-p8P.d.mts → plugin-c_iSNY86.d.cts} +1 -4
- package/dist/resourceLimits-CpDWwraK.mjs +1 -0
- package/dist/resourceLimits-lJrEhDE5.cjs +1 -0
- package/dist/{types-ia4x-Dvp.d.cts → types-B50Urzn2.d.cts} +0 -3
- package/dist/{types-Bytga6zd.d.mts → types-B50Urzn2.d.mts} +0 -3
- package/dist/validation-BgdV4KdW.cjs +1 -0
- package/dist/validation-BkJxOs7q.mjs +1 -0
- package/dist/{validation-CqmhNHdW.d.cts → validation-hcvcixaS.d.cts} +3 -6
- package/dist/{validation-D17IkoHy.d.mts → validation-xIBvnsSH.d.mts} +3 -6
- package/dist/validation.cjs +1 -1
- package/dist/validation.d.cts +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/dist/worker-1Q2hRcRB.cjs +1 -0
- package/dist/{worker-CbuCpSNc.d.cts → worker-DT7RYWwo.d.cts} +2 -5
- package/dist/{worker-CgCC-BWG.d.mts → worker-iSO3KhfN.d.mts} +2 -5
- package/dist/worker-ul8lQ0SH.mjs +1 -0
- package/package.json +9 -9
- package/dist/compression-2mm0MhWY.mjs +0 -1
- package/dist/compression-DrgzribA.cjs +0 -1
- package/dist/core-BOdvxKBq.mjs +0 -2
- package/dist/core-B_z1gN5W.cjs +0 -2
- package/dist/dataEngine-4m6GTOLe.mjs +0 -1
- package/dist/dataEngine-Bvl6amzP.cjs +0 -1
- package/dist/encryption-DdP1zFYl.cjs +0 -1
- package/dist/hashing-ChrADfcH.mjs +0 -1
- package/dist/hashing-JtOHPybU.cjs +0 -1
- package/dist/kms_encryption-R9auKGW4.mjs +0 -1
- package/dist/kms_encryption-xyWi65rZ.cjs +0 -1
- package/dist/resourceLimits-C1HHDwXQ.mjs +0 -1
- package/dist/resourceLimits-CI0Qrqdf.cjs +0 -1
- package/dist/validation-P5WRSAUK.mjs +0 -1
- package/dist/validation-pEeJmCad.cjs +0 -1
- package/dist/worker-I_kqxWeK.cjs +0 -1
- package/dist/worker-c0_VZ9c7.mjs +0 -1
package/dist/hashing.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Sha512HashingOptions, i as Sha256HashingOptions, n as HashingOptions, r as HashingPlugin, t as HashAlgorithm } from "./hashing-
|
|
1
|
+
import { a as Sha512HashingOptions, i as Sha256HashingOptions, n as HashingOptions, r as HashingPlugin, t as HashAlgorithm } from "./hashing-CEwtXh2V.mjs";
|
|
2
2
|
export { type HashAlgorithm, type HashingOptions, HashingPlugin, type Sha256HashingOptions, type Sha512HashingOptions };
|
package/dist/hashing.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{t as HashingPlugin}from"./hashing-DU3rmGMP.mjs";
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./core-DSIwvTqu.cjs"),t=require("./dataEngine-6R3J-WtS.cjs"),n=require("./resourceLimits-lJrEhDE5.cjs"),r=require("./kms_encryption-B07lunjB.cjs"),i=require("./hashing-DF_guuZf.cjs"),a=require("./encryption-DwdO7Y4J.cjs"),o=require("./compression-ZHOsKTJC.cjs"),s=require("./worker-1Q2hRcRB.cjs"),c=require("./validation-BgdV4KdW.cjs");var l=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 r=e,i=t.signal,a=()=>{if(i?.aborted)throw new n.g};a();for(let e of this.transforms){a();let o=Promise.resolve(e(r,t));r=i?await new Promise((e,t)=>{let r=()=>t(new n.g);i.addEventListener(`abort`,r,{once:!0}),o.then(e,t).finally(()=>i.removeEventListener(`abort`,r)).catch(()=>{}),i.aborted&&r()}):await o}return a(),r}},u=class extends n.i{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 d={Hashing:i.t,Encryption:a.t,Compression:o.t,Benchmark:u,WorkerPool:s.t,Validation:c.t,KmsEncryption:r.t};t.t.registerPlugin(`hashing`,i.t),t.t.registerPlugin(`encryption`,a.t),t.t.registerPlugin(`compression`,o.t),t.t.registerPlugin(`benchmark`,u),t.t.registerPlugin(`worker-pool`,s.t),t.t.registerPlugin(`validation`,c.t),t.t.registerPlugin(`kms-encryption`,r.t),exports.AuthenticationError=n.a,exports.BasePlugin=n.i,exports.BenchmarkPlugin=u,exports.CompressionError=n.o,exports.CompressionPlugin=o.t,exports.DEFAULT_HIGH_WATER=e.t,exports.DEFAULT_LIMITS=n.t,exports.DataEngine=t.t,exports.EncryptionError=n.s,exports.EncryptionPlugin=a.t,exports.GuardedUnpackrStream=e.n,exports.HashingError=n.c,exports.HashingPlugin=i.t,exports.InvalidKeyError=n.l,exports.InvalidKmsProviderCapabilityError=n.u,exports.InvalidPluginCapabilityError=n.d,exports.KmsAuthenticationError=n.f,exports.KmsEncryptionPlugin=r.t,exports.KmsProviderAuthenticationError=n.p,exports.KmsProviderError=n.m,exports.KmsProviderUnavailableError=n.h,exports.MAX_FRAME_BYTES=e.r,exports.ORIGINAL_TYPES=e.i,exports.OperationAbortedError=n.g,exports.OperationTimeoutError=n._,exports.PACKR=e.a,exports.PIPEX_MANIFEST_KEY=e.o,exports.PipeXError=n.v,exports.PipelineAbortedError=n.y,exports.Plugins=d,exports.TypedPipeline=l,exports.UNPACKR=e.s,exports.UnsupportedAlgorithmError=n.b,exports.UnsupportedKmsOperationError=n.x,exports.UnsupportedReverseError=n.S,exports.UnsupportedStreamingError=n.C,exports.ValidationError=n.w,exports.ValidationPlugin=c.t,exports.WorkerPoolCloseError=n.T,exports.WorkerPoolClosedError=n.E,exports.WorkerPoolPlugin=s.t,exports.WorkerQueueFullError=n.D,exports.WorkerTaskError=n.O,exports.assertExists=e.c,exports.assertKnownValueByteLimit=e.l,exports.assertMessagePackFrameLimits=e.V,exports.assertOriginalType=e.u,exports.assertReversiblePipeline=e.d,exports.assertStreamingPipeline=e.f,exports.buildByteLimitTransform=e.p,exports.buildFallbackTransform=e.m,exports.buildFrameLimitTransform=e.H,exports.buildKnownValueByteLimitTransform=e.h,exports.buildManifest=e.g,exports.buildManifestExtractTransform=e._,exports.buildManifestHeaderTransform=e.v,exports.buildNdjsonTransform=e.y,exports.buildObjectLimitTransform=e.b,exports.buildTransformChain=e.x,exports.createPackrStream=e.S,exports.createUnpackrStream=e.C,exports.detectType=e.w,exports.fromBuffer=e.T,exports.getKmsProviderCapabilities=r.n,exports.getPluginCapabilities=e.E,exports.hasStreamSupport=e.D,exports.isManifest=e.U,exports.makeContext=e.O,exports.resolveOutputPath=e.k,exports.runPipeline=e.A,exports.supportsKmsOperation=r.r,exports.supportsOperation=e.j,exports.supportsReverse=e.M,exports.toBuffer=e.N,exports.typedPipeline=function(e){return l.from(e)},exports.withRetry=e.P;
|
package/dist/index.d.cts
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-ia4x-Dvp.cjs";
|
|
2
|
-
import { t as BasePlugin } from "./plugin-C9Kd9coY.cjs";
|
|
3
|
-
import { i as CompressionType, n as CompressionOptions, r as CompressionPlugin } from "./compression-DnVFu8TM.cjs";
|
|
4
|
-
import { a as EncryptionPlugin, i as EncryptionOptions, o as EncryptionAlgorithm } from "./encryption-BmmNECIc.cjs";
|
|
5
|
-
import { n as HashingOptions, r as HashingPlugin, t as HashAlgorithm } from "./hashing-LY-8x66g.cjs";
|
|
6
|
-
import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-Dh1LEHhk.cjs";
|
|
7
|
-
import { n as PluginConstructor, t as DataEngine } from "./dataEngine-D-fIXgE7.cjs";
|
|
8
|
-
import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-CbuCpSNc.cjs";
|
|
9
|
-
import { n as ValidationPlugin, t as ValidationOptions } from "./validation-CqmhNHdW.cjs";
|
|
10
1
|
import { Duplex, Readable, Transform, TransformCallback, Writable } from "node:stream";
|
|
11
2
|
import { Packr, PackrStream, Unpackr, UnpackrStream } from "msgpackr";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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.cjs";
|
|
4
|
+
import { n as PluginConstructor, t as DataEngine } from "./dataEngine-C-xYat2f.cjs";
|
|
5
|
+
import { t as BasePlugin } from "./plugin-c_iSNY86.cjs";
|
|
6
|
+
import { n as HashingOptions, r as HashingPlugin, t as HashAlgorithm } from "./hashing-C6TkcsUE.cjs";
|
|
7
|
+
import { a as EncryptionPlugin, i as EncryptionOptions, o as EncryptionAlgorithm } from "./encryption-CCPoyX4q.cjs";
|
|
8
|
+
import { i as CompressionType, n as CompressionOptions, r as CompressionPlugin } from "./compression-C1nLQVur.cjs";
|
|
9
|
+
import { n as WorkerPoolPlugin, t as WorkerPoolOptions } from "./worker-DT7RYWwo.cjs";
|
|
10
|
+
import { n as ValidationPlugin, t as ValidationOptions } from "./validation-hcvcixaS.cjs";
|
|
11
|
+
import { n as KmsEncryptionPlugin, t as KmsEncryptionOptions } from "./kms_encryption-BBIHGi_O.cjs";
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|