@adonis-agora/media
Version:
Media-library for AdonisJS — owner collections (MIME whitelist, single-file replace, ordering), image conversions (eager/lazy), pluggable content transformers (HLS video via mediabunny, metadata probe, image blur-up placeholder), and column attachments, a
29 lines • 1.56 kB
TypeScript
/**
* The AWS SDK deserializes S3's XML responses with `fast-xml-parser`. Some hosts pin
* `fast-xml-parser` v5 (CVE remediation), whose stricter mode rejects valid numeric character
* references (`
`, …) that S3 legitimately emits inside keys — surfacing as a deserialization
* error on `ListObjectsV2`. This module provides a fallback for {@link S3Disk.list}: re-issue the
* request as a signed raw GET (presigned with the hand-rolled SigV4 signer in `sigv4.ts`, no extra
* peer) and hand-parse the XML, bypassing `fast-xml-parser` entirely.
*
* NOTE: this fallback does NOT depend on `fast-xml-parser` — it exists precisely to work around it —
* and introduces NO new peer: the signing reuses the SigV4 presigner already bundled with the S3
* disk, so only regex XML parsing lives here.
*/
/** Is this the `fast-xml-parser` entity-rejection error the signed-GET fallback exists for? */
export declare function isXmlEntityDeserializationError(error: unknown): boolean;
export declare function decodeXmlEntities(value: string): string;
export interface ListObjectsV2Entry {
key: string;
size: number | null;
lastModified: string | null;
}
export interface ListObjectsV2FromXml {
folders: string[];
objects: ListObjectsV2Entry[];
nextContinuationToken: string | null;
isTruncated: boolean;
}
/** Hand-parse a `ListObjectsV2` XML body into the shape {@link S3Disk.list} needs. */
export declare function extractListObjectsV2FromXml(xml: string): ListObjectsV2FromXml;
//# sourceMappingURL=xml_fallback.d.ts.map