New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kenjiuno/msgreader

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kenjiuno/msgreader - npm Package Compare versions

Comparing version 1.6.3 to 1.6.4

51

lib/Burner.d.ts
import { TypeEnum } from "./Reader";
/**
* CFBF entry for CFBF burner.
*
* These entries are stored in same order in CFBF.
*
* The first entry must be {@link ROOT}.
*
* This {@link ROOT} stream represents:
*
* - The root folder as same as you see in real file system.
* Including direct children files/folder.
* - The body of minifat.
*
* The secondary entries are collection of items having type either {@link DIRECTORY} or {@link DOCUMENT}.
*
*/
export interface Entry {
/**
* Entry name (max 32 chars).
*/
name: string;
/**
* Entry type:
*
* - {@link DIRECTORY}
* - {@link DOCUMENT}
* - {@link ROOT}
*/
type: TypeEnum;
/**
* Callback to supply binary data.
*
* This is valid only for {@link DOCUMENT} entry type.
*/
binaryProvider?: () => ArrayLike<number>;
/**
* Binary data length in byte unit.
*
* Has to match with {@link binaryProvider}'s length.
*
* This is valid only for {@link DOCUMENT} entry type. Otherwise set zero.
*/
length: number;
/**
* The indices to sub entries including {@link DOCUMENT} and {@link DIRECTORY}.
*
* This is valid only for {@link DIRECTORY} entry type.
*/
children?: number[];
}
/**
* Burn CFBF file on the fly.
*
* CFBF = Compound File Binary Format
*
* @param entries The flattened (not tree) entries starting with `Root Entry`.
* @returns The binary.
*/
export declare function burn(entries: Entry[]): Uint8Array;

@@ -378,5 +378,14 @@ "use strict";

}();
/**
* Burn CFBF file on the fly.
*
* CFBF = Compound File Binary Format
*
* @param entries The flattened (not tree) entries starting with `Root Entry`.
* @returns The binary.
*/
function burn(entries) {
return new Uint8Array(new LiteBurner(entries).array);
}

2

lib/const.d.ts

@@ -48,2 +48,3 @@ declare const _default: {

'0c1a': string;
'0c1e': string;
'0c1f': string;

@@ -61,2 +62,3 @@ '5d0a': string;

'3001': string;
'3002': string;
'3003': string;

@@ -63,0 +65,0 @@ '39fe': string;

@@ -61,2 +61,3 @@ "use strict";

'0c1a': 'senderName',
'0c1e': 'senderAddressType',
'0c1f': 'senderEmail',

@@ -76,2 +77,3 @@ '5d0a': 'creatorSMTPAddress',

'3001': 'name',
'3002': 'addressType',
'3003': 'email',

@@ -78,0 +80,0 @@ '39fe': 'smtpAddress'

371

lib/DataStream.d.ts
/**
DataStream reads scalars, arrays and structs of data from an ArrayBuffer.
It's like a file-like DataView on steroids.
@param {ArrayBuffer} arrayBuffer ArrayBuffer to read from.
@param {?Number} byteOffset Offset from arrayBuffer beginning for the DataStream.
@param {?Boolean} endianness DataStream.BIG_ENDIAN or DataStream.LITTLE_ENDIAN (the default).
*/
* This DataStream is for internal use.
*/
export default class DataStream {
/**
* @internal
*/
_byteOffset: number;
/**
* @internal
*/
position: number;
/**
* @internal
*/
endianness: boolean;
/**
* @internal
*/
_buffer: ArrayBuffer;
/**
* @internal
*/
_dataView: DataView;
/**
DataStream reads scalars, arrays and structs of data from an ArrayBuffer.
It's like a file-like DataView on steroids.
@param arrayBuffer ArrayBuffer to read from.
@param byteOffset Offset from arrayBuffer beginning for the DataStream.
@param endianness {@link DataStream.BIG_ENDIAN} or {@link DataStream.LITTLE_ENDIAN} (the default).
*/
constructor(arrayBuffer: ArrayBuffer | DataView | Uint8Array | Int8Array, byteOffset: number | null, endianness: boolean | null);

@@ -20,4 +38,3 @@ /**

@param {string} filename Filename to save as.
@return {null}
@param filename Filename to save as.
*/

@@ -27,3 +44,2 @@ save(filename: any): void;

Big-endian const to use as default endianness.
@type {boolean}
*/

@@ -33,12 +49,13 @@ static BIG_ENDIAN: boolean;

Little-endian const to use as default endianness.
@type {boolean}
*/
static LITTLE_ENDIAN: boolean;
/**
Whether to extend DataStream buffer when trying to write beyond its size.
If set, the buffer is reallocated to twice its current size until the
requested write fits the buffer.
@type {boolean}
@internal
*/
_dynamicSize: boolean;
/**
* Whether to extend DataStream buffer when trying to write beyond its size.
* If set, the buffer is reallocated to twice its current size until the
* requested write fits the buffer.
*/
get dynamicSize(): boolean;

@@ -50,3 +67,4 @@ set dynamicSize(v: boolean);

If dynamicSize is false is set to buffer size.
@type {number}
@internal
*/

@@ -56,3 +74,2 @@ _byteLength: number;

Returns the byte length of the DataStream object.
@type {number}
*/

@@ -63,3 +80,2 @@ get byteLength(): number;

The setter updates the DataView to point to the new buffer.
@type {Object}
*/

@@ -71,3 +87,2 @@ get buffer(): ArrayBuffer;

The setter updates the DataView to point to the new byteOffset.
@type {number}
*/

@@ -79,3 +94,2 @@ get byteOffset(): number;

The setter updates the buffer and byteOffset to point to the DataView values.
@type {Object}
*/

@@ -86,4 +100,4 @@ get dataView(): DataView;

Internal function to resize the DataStream buffer when required.
@param {number} extra Number of bytes to add to the buffer allocation.
@return {null}
@internal
@param extra Number of bytes to add to the buffer allocation.
*/

@@ -97,3 +111,3 @@ _realloc(extra: number): void;

@return {null}
@internal
*/

@@ -105,4 +119,3 @@ _trimAlloc(): void;

@param {number} pos Position to seek to.
@return {null}
@param pos Position to seek to.
*/

@@ -114,3 +127,3 @@ seek(pos: number): void;

@return {boolean} True if the seek pointer is at the end of the buffer.
@return True if the seek pointer is at the end of the buffer.
*/

@@ -126,5 +139,5 @@ isEof(): boolean;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Int32Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Int32Array to the DataStream backing buffer.
*/

@@ -140,5 +153,5 @@ mapInt32Array(length: number, e?: boolean): Int32Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Int16Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Int16Array to the DataStream backing buffer.
*/

@@ -151,5 +164,5 @@ mapInt16Array(length: number, e?: boolean): Int16Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Int8Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Int8Array to the DataStream backing buffer.
*/

@@ -165,5 +178,5 @@ mapInt8Array(length: number): Int8Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Uint32Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Uint32Array to the DataStream backing buffer.
*/

@@ -179,5 +192,5 @@ mapUint32Array(length: number, e?: boolean): Uint32Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Uint16Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Uint16Array to the DataStream backing buffer.
*/

@@ -190,5 +203,5 @@ mapUint16Array(length: number, e?: boolean): Uint16Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Uint8Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Uint8Array to the DataStream backing buffer.
*/

@@ -204,5 +217,5 @@ mapUint8Array(length: number): Uint8Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Float64Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Float64Array to the DataStream backing buffer.
*/

@@ -218,5 +231,5 @@ mapFloat64Array(length: number, e?: boolean): Float64Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Float32Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Float32Array to the DataStream backing buffer.
*/

@@ -227,5 +240,5 @@ mapFloat32Array(length: number, e?: boolean): Float32Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Int32Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Int32Array.
*/

@@ -236,5 +249,5 @@ readInt32Array(length: number, e?: boolean): Int32Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Int16Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Int16Array.
*/

@@ -245,5 +258,5 @@ readInt16Array(length: number, e?: boolean): Int16Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Int8Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Int8Array.
*/

@@ -254,5 +267,5 @@ readInt8Array(length: number): Int8Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Uint32Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Uint32Array.
*/

@@ -263,5 +276,5 @@ readUint32Array(length: number, e?: boolean): Uint32Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Uint16Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Uint16Array.
*/

@@ -272,5 +285,5 @@ readUint16Array(length: number, e?: boolean): Uint16Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Uint8Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Uint8Array.
*/

@@ -281,5 +294,5 @@ readUint8Array(length: number): Uint8Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Float64Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Float64Array.
*/

@@ -290,5 +303,5 @@ readFloat64Array(length: number, e?: boolean): Float64Array;

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Float32Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Float32Array.
*/

@@ -299,4 +312,4 @@ readFloat32Array(length: number, e?: boolean): Float32Array;

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -307,4 +320,4 @@ writeInt32Array(arr: Int32Array | ArrayLike<number>, e?: boolean): void;

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -315,3 +328,3 @@ writeInt16Array(arr: Int16Array | ArrayLike<number>, e?: boolean): void;

@param {Object} arr The array to write.
@param arr The array to write.
*/

@@ -322,4 +335,4 @@ writeInt8Array(arr: Int8Array | ArrayLike<number>): void;

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -330,4 +343,4 @@ writeUint32Array(arr: Uint32Array | ArrayLike<number>, e?: boolean): void;

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -338,3 +351,3 @@ writeUint16Array(arr: Uint16Array | ArrayLike<number>, e?: boolean): void;

@param {Object} arr The array to write.
@param arr The array to write.
*/

@@ -345,4 +358,4 @@ writeUint8Array(arr: Uint8Array | ArrayLike<number>): void;

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -353,4 +366,4 @@ writeFloat64Array(arr: Float64Array | ArrayLike<number>, e?: boolean): void;

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -361,4 +374,4 @@ writeFloat32Array(arr: Float32Array | ArrayLike<number>, e?: boolean): void;

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -369,4 +382,4 @@ readInt32(e?: boolean): number;

@param {number} offset The offset.
@return {number} The read number.
@param offset The offset.
@return The read number.
*/

@@ -377,4 +390,4 @@ readInt(offset: number): number;

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -385,4 +398,4 @@ readInt16(e?: boolean): number;

@param {number} offset The offset.
@return {number} The read number.
@param offset The offset.
@return The read number.
*/

@@ -393,3 +406,3 @@ readShort(offset: number): number;

@return {number} The read number.
@return The read number.
*/

@@ -400,4 +413,4 @@ readInt8(): number;

@param {number} offset The offset.
@return {number} The read number.
@param offset The offset.
@return The read number.
*/

@@ -408,4 +421,4 @@ readByte(offset: number): number;

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -416,4 +429,4 @@ readUint32(e?: boolean): number;

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -424,3 +437,3 @@ readUint16(e?: boolean): number;

@return {number} The read number.
@return The read number.
*/

@@ -431,4 +444,4 @@ readUint8(): number;

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -439,4 +452,4 @@ readFloat32(e?: boolean): number;

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -447,4 +460,4 @@ readFloat64(e?: boolean): number;

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -455,4 +468,4 @@ writeInt32(v: number, e?: boolean): void;

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -463,3 +476,3 @@ writeInt16(v: number, e?: boolean): void;

@param {number} v Number to write.
@param v Number to write.
*/

@@ -470,4 +483,4 @@ writeInt8(v: number): void;

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -478,4 +491,4 @@ writeUint32(v: number, e?: boolean): void;

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -486,3 +499,3 @@ writeUint16(v: number, e?: boolean): void;

@param {number} v Number to write.
@param v Number to write.
*/

@@ -493,4 +506,4 @@ writeUint8(v: number): void;

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -501,4 +514,4 @@ writeFloat32(v: number, e?: boolean): void;

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -510,3 +523,2 @@ writeFloat64(v: number, e?: boolean): void;

@type {boolean}
*/

@@ -518,32 +530,35 @@ static endianness: boolean;

@param {Object} dst Destination ArrayBuffer to write to.
@param {number} dstOffset Offset to the destination ArrayBuffer.
@param {Object} src Source ArrayBuffer to read from.
@param {number} srcOffset Offset to the source ArrayBuffer.
@param {number} byteLength Number of bytes to copy.
@param dst Destination ArrayBuffer to write to.
@param dstOffset Offset to the destination ArrayBuffer.
@param src Source ArrayBuffer to read from.
@param srcOffset Offset to the source ArrayBuffer.
@param byteLength Number of bytes to copy.
*/
static memcpy(dst: any, dstOffset: any, src: any, srcOffset: any, byteLength: any): void;
static memcpy(dst: ArrayBufferLike, dstOffset: number, src: ArrayBufferLike, srcOffset: number, byteLength: number): void;
/**
Converts array to native endianness in-place.
@param {Object} array Typed array to convert.
@param {boolean} arrayIsLittleEndian True if the data in the array is
@param array Typed array to convert.
@param arrayIsLittleEndian True if the data in the array is
little-endian. Set false for big-endian.
@return {Object} The converted typed array.
@return The converted typed array.
@internal
*/
static arrayToNative(array: any, arrayIsLittleEndian: any): any;
static arrayToNative(array: any, arrayIsLittleEndian: boolean): any;
/**
Converts native endianness array to desired endianness in-place.
@param {Object} array Typed array to convert.
@param {boolean} littleEndian True if the converted array should be
@param array Typed array to convert.
@param littleEndian True if the converted array should be
little-endian. Set false for big-endian.
@return {Object} The converted typed array.
@return The converted typed array.
@internal
*/
static nativeToEndian(array: any, littleEndian: any): any;
static nativeToEndian(array: any, littleEndian: boolean): any;
/**
Flips typed array endianness in-place.
@param {Object} array Typed array to flip.
@return {Object} The converted typed array.
@param array Typed array to flip.
@return The converted typed array.
@internal
*/

@@ -555,6 +570,7 @@ static flipArrayEndianness(array: any): any;

@param {array} array Array of character codes.
@return {string} String created from the character codes.
@param array Array of character codes.
@return String created from the character codes.
@internal
**/
static createStringFromArray(array: any): string;
static createStringFromArray(array: ArrayLike<number>): string;
/**

@@ -564,3 +580,2 @@ Seek position where DataStream#readStruct ran into a problem.

@type {number}
*/

@@ -621,4 +636,4 @@ failurePosition: number;

@param {Object} structDefinition Struct definition object.
@return {Object} The read struct. Null if failed to read struct.
@param structDefinition Struct definition object.
@return The read struct. Null if failed to read struct.
*/

@@ -629,15 +644,15 @@ readStruct(structDefinition: any): {};

@param {number} length The length of the string to read.
@param {boolean} endianness The endianness of the string data in the DataStream.
@return {string} The read string.
@param length The length of the string to read.
@param endianness The endianness of the string data in the DataStream.
@return The read string.
*/
readUCS2String(length: any, endianness?: boolean): string;
readUCS2String(length: number, endianness?: boolean): string;
/**
Read UCS-2 string of desired length and offset from the DataStream.
@param {number} offset The offset.
@param {number} length The length of the string to read.
@return {string} The read string.
@param offset The offset.
@param length The length of the string to read.
@return The read string.
*/
readStringAt(offset: any, length: any): string;
readStringAt(offset: number, length: number): string;
/**

@@ -649,23 +664,23 @@ Write a UCS-2 string of desired endianness to the DataStream. The

@param {string} str The string to write.
@param {?boolean} endianness The endianness to use for the written string data.
@param {?number} lengthOverride The number of characters to write.
@param str The string to write.
@param endianness The endianness to use for the written string data.
@param lengthOverride The number of characters to write.
*/
writeUCS2String(str: any, endianness: any, lengthOverride: any): void;
writeUCS2String(str: string, endianness?: boolean, lengthOverride?: number): void;
/**
Read a string of desired length and encoding from the DataStream.
@param {number} length The length of the string to read in bytes.
@param {?string} encoding The encoding of the string data in the DataStream.
@param length The length of the string to read in bytes.
@param encoding The encoding of the string data in the DataStream.
Defaults to ASCII.
@return {string} The read string.
@return The read string.
*/
readString(length: any, encoding?: any): string;
readString(length?: number, encoding?: string): string;
/**
Writes a string of desired length and encoding to the DataStream.
@param {string} s The string to write.
@param {?string} encoding The encoding for the written string data.
@param s The string to write.
@param encoding The encoding for the written string data.
Defaults to ASCII.
@param {?number} length The number of characters to write.
@param length The number of characters to write.
*/

@@ -677,6 +692,6 @@ writeString(s: string, encoding?: string, length?: number): void;

@param {?number} length The length of the string to read.
@return {string} The read string.
@param length The length of the string to read.
@return The read string.
*/
readCString(length: any): string;
readCString(length?: number): string;
/**

@@ -688,6 +703,6 @@ Writes a null-terminated string to DataStream and zero-pads it to length

@param {string} s The string to write.
@param {?number} length The number of characters to write.
@param s The string to write.
@param length The number of characters to write.
*/
writeCString(s: any, length: any): void;
writeCString(s: string, length?: number): void;
/**

@@ -698,6 +713,6 @@ Reads an object of type t from the DataStream, passing struct as the thus-far

@param {Object} t Type of the object to read.
@param {?Object} struct Struct to refer to when resolving length references
@param t Type of the object to read.
@param struct Struct to refer to when resolving length references
and for calling callbacks.
@return {?Object} Returns the object on successful read, null on unsuccessful.
@return Returns the object on successful read, null on unsuccessful.
*/

@@ -710,4 +725,4 @@ readType(t: any, struct: any): any;

@param {Object} structDefinition Type definition of the struct.
@param {Object} struct The struct data object.
@param structDefinition Type definition of the struct.
@param struct The struct data object.
*/

@@ -718,7 +733,7 @@ writeStruct(structDefinition: any, struct: any): void;

@param {Object} t Type of data to write.
@param {Object} v Value of data to write.
@param {Object} struct Struct to pass to write callback functions.
@param t Type of data to write.
@param v Value of data to write.
@param struct Struct to pass to write callback functions.
*/
writeType(t: any, v: any, struct: any): any;
}

@@ -20,12 +20,35 @@ "use strict";

/**
DataStream reads scalars, arrays and structs of data from an ArrayBuffer.
It's like a file-like DataView on steroids.
* This DataStream is for internal use.
*/
@param {ArrayBuffer} arrayBuffer ArrayBuffer to read from.
@param {?Number} byteOffset Offset from arrayBuffer beginning for the DataStream.
@param {?Boolean} endianness DataStream.BIG_ENDIAN or DataStream.LITTLE_ENDIAN (the default).
*/
var DataStream = /*#__PURE__*/function () {
/**
* @internal
*/
var DataStream = /*#__PURE__*/function () {
/**
* @internal
*/
/**
* @internal
*/
/**
* @internal
*/
/**
* @internal
*/
/**
DataStream reads scalars, arrays and structs of data from an ArrayBuffer.
It's like a file-like DataView on steroids.
@param arrayBuffer ArrayBuffer to read from.
@param byteOffset Offset from arrayBuffer beginning for the DataStream.
@param endianness {@link DataStream.BIG_ENDIAN} or {@link DataStream.LITTLE_ENDIAN} (the default).
*/
function DataStream(arrayBuffer, byteOffset, endianness) {

@@ -73,4 +96,3 @@ _classCallCheck(this, DataStream);

@param {string} filename Filename to save as.
@return {null}
@param filename Filename to save as.
*/

@@ -94,3 +116,9 @@ function save(filename) {

key: "dynamicSize",
get: function get() {
get:
/**
* Whether to extend DataStream buffer when trying to write beyond its size.
* If set, the buffer is reallocated to twice its current size until the
* requested write fits the buffer.
*/
function get() {
return this._dynamicSize;

@@ -109,3 +137,3 @@ },

If dynamicSize is false is set to buffer size.
@type {number}
@internal
*/

@@ -118,3 +146,2 @@

Returns the byte length of the DataStream object.
@type {number}
*/

@@ -127,3 +154,2 @@ function get() {

The setter updates the DataView to point to the new buffer.
@type {Object}
*/

@@ -146,3 +172,2 @@

The setter updates the DataView to point to the new byteOffset.
@type {number}
*/

@@ -163,3 +188,2 @@

The setter updates the buffer and byteOffset to point to the DataView values.
@type {Object}
*/

@@ -180,4 +204,4 @@

Internal function to resize the DataStream buffer when required.
@param {number} extra Number of bytes to add to the buffer allocation.
@return {null}
@internal
@param extra Number of bytes to add to the buffer allocation.
*/

@@ -227,3 +251,3 @@

@return {null}
@internal
*/

@@ -248,4 +272,3 @@ function _trimAlloc() {

@param {number} pos Position to seek to.
@return {null}
@param pos Position to seek to.
*/

@@ -263,3 +286,3 @@ function seek(pos) {

@return {boolean} True if the seek pointer is at the end of the buffer.
@return True if the seek pointer is at the end of the buffer.
*/

@@ -280,5 +303,5 @@ function isEof() {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Int32Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Int32Array to the DataStream backing buffer.
*/

@@ -304,5 +327,5 @@ function mapInt32Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Int16Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Int16Array to the DataStream backing buffer.
*/

@@ -325,5 +348,5 @@ function mapInt16Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Int8Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Int8Array to the DataStream backing buffer.
*/

@@ -348,5 +371,5 @@ function mapInt8Array(length) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Uint32Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Uint32Array to the DataStream backing buffer.
*/

@@ -372,5 +395,5 @@ function mapUint32Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Uint16Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Uint16Array to the DataStream backing buffer.
*/

@@ -393,5 +416,5 @@ function mapUint16Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Uint8Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Uint8Array to the DataStream backing buffer.
*/

@@ -416,5 +439,5 @@ function mapUint8Array(length) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Float64Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Float64Array to the DataStream backing buffer.
*/

@@ -440,5 +463,5 @@ function mapFloat64Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} Float32Array to the DataStream backing buffer.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return Float32Array to the DataStream backing buffer.
*/

@@ -459,5 +482,5 @@ function mapFloat32Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Int32Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Int32Array.
*/

@@ -478,5 +501,5 @@ function readInt32Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Int16Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Int16Array.
*/

@@ -497,5 +520,5 @@ function readInt16Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Int8Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Int8Array.
*/

@@ -515,5 +538,5 @@ function readInt8Array(length) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Uint32Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Uint32Array.
*/

@@ -534,5 +557,5 @@ function readUint32Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Uint16Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Uint16Array.
*/

@@ -553,5 +576,5 @@ function readUint16Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Uint8Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Uint8Array.
*/

@@ -571,5 +594,5 @@ function readUint8Array(length) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Float64Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Float64Array.
*/

@@ -590,5 +613,5 @@ function readFloat64Array(length, e) {

@param {number} length Number of elements to map.
@param {?boolean} e Endianness of the data to read.
@return {Object} The read Float32Array.
@param length Number of elements to map.
@param e Endianness of the data to read.
@return The read Float32Array.
*/

@@ -609,4 +632,4 @@ function readFloat32Array(length, e) {

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -631,4 +654,4 @@ function writeInt32Array(arr, e) {

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -653,3 +676,3 @@ function writeInt16Array(arr, e) {

@param {Object} arr The array to write.
@param arr The array to write.
*/

@@ -674,4 +697,4 @@ function writeInt8Array(arr) {

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -696,4 +719,4 @@ function writeUint32Array(arr, e) {

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -718,3 +741,3 @@ function writeUint16Array(arr, e) {

@param {Object} arr The array to write.
@param arr The array to write.
*/

@@ -739,4 +762,4 @@ function writeUint8Array(arr) {

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -761,4 +784,4 @@ function writeFloat64Array(arr, e) {

@param {Object} arr The array to write.
@param {?boolean} e Endianness of the data to write.
@param arr The array to write.
@param e Endianness of the data to write.
*/

@@ -783,4 +806,4 @@ function writeFloat32Array(arr, e) {

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -799,4 +822,4 @@ function readInt32(e) {

@param {number} offset The offset.
@return {number} The read number.
@param offset The offset.
@return The read number.
*/

@@ -813,4 +836,4 @@ function readInt(offset) {

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -829,4 +852,4 @@ function readInt16(e) {

@param {number} offset The offset.
@return {number} The read number.
@param offset The offset.
@return The read number.
*/

@@ -843,3 +866,3 @@ function readShort(offset) {

@return {number} The read number.
@return The read number.
*/

@@ -858,4 +881,4 @@ function readInt8() {

@param {number} offset The offset.
@return {number} The read number.
@param offset The offset.
@return The read number.
*/

@@ -872,4 +895,4 @@ function readByte(offset) {

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -888,4 +911,4 @@ function readUint32(e) {

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -904,3 +927,3 @@ function readUint16(e) {

@return {number} The read number.
@return The read number.
*/

@@ -919,4 +942,4 @@ function readUint8() {

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -935,4 +958,4 @@ function readFloat32(e) {

@param {?boolean} e Endianness of the number.
@return {number} The read number.
@param e Endianness of the number.
@return The read number.
*/

@@ -951,4 +974,4 @@ function readFloat64(e) {

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -968,4 +991,4 @@ function writeInt32(v, e) {

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -985,3 +1008,3 @@ function writeInt16(v, e) {

@param {number} v Number to write.
@param v Number to write.
*/

@@ -1001,4 +1024,4 @@ function writeInt8(v) {

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -1018,4 +1041,4 @@ function writeUint32(v, e) {

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -1035,3 +1058,3 @@ function writeUint16(v, e) {

@param {number} v Number to write.
@param v Number to write.
*/

@@ -1051,4 +1074,4 @@ function writeUint8(v) {

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -1068,4 +1091,4 @@ function writeFloat32(v, e) {

@param {number} v Number to write.
@param {?boolean} e Endianness of the number.
@param v Number to write.
@param e Endianness of the number.
*/

@@ -1135,4 +1158,4 @@ function writeFloat64(v, e) {

@param {Object} structDefinition Struct definition object.
@return {Object} The read struct. Null if failed to read struct.
@param structDefinition Struct definition object.
@return The read struct. Null if failed to read struct.
*/

@@ -1170,5 +1193,5 @@ function readStruct(structDefinition) {

@param {number} length The length of the string to read.
@param {boolean} endianness The endianness of the string data in the DataStream.
@return {string} The read string.
@param length The length of the string to read.
@param endianness The endianness of the string data in the DataStream.
@return The read string.
*/

@@ -1184,5 +1207,5 @@ function readUCS2String(length, endianness) {

@param {number} offset The offset.
@param {number} length The length of the string to read.
@return {string} The read string.
@param offset The offset.
@param length The length of the string to read.
@return The read string.
*/

@@ -1202,5 +1225,5 @@ function readStringAt(offset, length) {

@param {string} str The string to write.
@param {?boolean} endianness The endianness to use for the written string data.
@param {?number} lengthOverride The number of characters to write.
@param str The string to write.
@param endianness The endianness to use for the written string data.
@param lengthOverride The number of characters to write.
*/

@@ -1226,6 +1249,6 @@ function writeUCS2String(str, endianness, lengthOverride) {

@param {number} length The length of the string to read in bytes.
@param {?string} encoding The encoding of the string data in the DataStream.
@param length The length of the string to read in bytes.
@param encoding The encoding of the string data in the DataStream.
Defaults to ASCII.
@return {string} The read string.
@return The read string.
*/

@@ -1245,6 +1268,6 @@ function readString(length, encoding) {

@param {string} s The string to write.
@param {?string} encoding The encoding for the written string data.
@param s The string to write.
@param encoding The encoding for the written string data.
Defaults to ASCII.
@param {?number} length The number of characters to write.
@param length The number of characters to write.
*/

@@ -1280,4 +1303,4 @@ function writeString(s, encoding, length) {

@param {?number} length The length of the string to read.
@return {string} The read string.
@param length The length of the string to read.
@return The read string.
*/

@@ -1317,4 +1340,4 @@ function readCString(length) {

@param {string} s The string to write.
@param {?number} length The number of characters to write.
@param s The string to write.
@param length The number of characters to write.
*/

@@ -1349,6 +1372,6 @@ function writeCString(s, length) {

@param {Object} t Type of the object to read.
@param {?Object} struct Struct to refer to when resolving length references
@param t Type of the object to read.
@param struct Struct to refer to when resolving length references
and for calling callbacks.
@return {?Object} Returns the object on successful read, null on unsuccessful.
@return Returns the object on successful read, null on unsuccessful.
*/

@@ -1626,4 +1649,4 @@ function readType(t, struct) {

@param {Object} structDefinition Type definition of the struct.
@param {Object} struct The struct data object.
@param structDefinition Type definition of the struct.
@param struct The struct data object.
*/

@@ -1642,5 +1665,5 @@ function writeStruct(structDefinition, struct) {

@param {Object} t Type of data to write.
@param {Object} v Value of data to write.
@param {Object} struct Struct to pass to write callback functions.
@param t Type of data to write.
@param v Value of data to write.
@param struct Struct to pass to write callback functions.
*/

@@ -1802,7 +1825,7 @@ function writeType(t, v, struct) {

@param {Object} dst Destination ArrayBuffer to write to.
@param {number} dstOffset Offset to the destination ArrayBuffer.
@param {Object} src Source ArrayBuffer to read from.
@param {number} srcOffset Offset to the source ArrayBuffer.
@param {number} byteLength Number of bytes to copy.
@param dst Destination ArrayBuffer to write to.
@param dstOffset Offset to the destination ArrayBuffer.
@param src Source ArrayBuffer to read from.
@param srcOffset Offset to the source ArrayBuffer.
@param byteLength Number of bytes to copy.
*/

@@ -1820,6 +1843,7 @@ function memcpy(dst, dstOffset, src, srcOffset, byteLength) {

@param {Object} array Typed array to convert.
@param {boolean} arrayIsLittleEndian True if the data in the array is
@param array Typed array to convert.
@param arrayIsLittleEndian True if the data in the array is
little-endian. Set false for big-endian.
@return {Object} The converted typed array.
@return The converted typed array.
@internal
*/

@@ -1839,6 +1863,7 @@ function arrayToNative(array, arrayIsLittleEndian) {

@param {Object} array Typed array to convert.
@param {boolean} littleEndian True if the converted array should be
@param array Typed array to convert.
@param littleEndian True if the converted array should be
little-endian. Set false for big-endian.
@return {Object} The converted typed array.
@return The converted typed array.
@internal
*/

@@ -1858,4 +1883,5 @@ function nativeToEndian(array, littleEndian) {

@param {Object} array Typed array to flip.
@return {Object} The converted typed array.
@param array Typed array to flip.
@return The converted typed array.
@internal
*/

@@ -1882,4 +1908,5 @@ function flipArrayEndianness(array) {

@param {array} array Array of character codes.
@return {string} String created from the character codes.
@param array Array of character codes.
@return String created from the character codes.
@internal
**/

@@ -1886,0 +1913,0 @@ function createStringFromArray(array) {

@@ -1,3 +0,2 @@

import { Reader } from './Reader';
declare class ParserConfig {
export interface ParserConfig {
propertyObserver?: (fields: FieldsData, tag: number, raw: Uint8Array | null) => void;

@@ -8,9 +7,11 @@ }

*
* Note that please sync with: CONST.MSG.FIELD.NAME_MAPPING
* Note that please sync with: `CONST.MSG.FIELD.NAME_MAPPING`
*
* @see [[MS-OXPROPS]: Exchange Server Protocols Master Property List | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxprops/f6ab1613-aefe-447d-a49c-18217230b148)
*/
interface SomeOxProps {
export interface SomeOxProps {
/**
* Contains the subject of the email message.
*
* Target dataType = 'msg'.
* Target {@link dataType} = 'msg'.
*

@@ -23,3 +24,3 @@ * @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/0037-PidTagSubject.md

*
* Target dataType = 'msg'.
* Target {@link dataType} = 'msg'.
*

@@ -32,4 +33,9 @@ * @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/0C1A-PidTagSenderName.md

*
* Target dataType = 'msg'.
* e.g.
*
* - `xmailuser@xmailserver.test` for {@link senderAddressType} = 'SMTP'
* - `/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (xxx)/CN=RECIPIENTS/CN=xxx` for {@link senderAddressType} = 'EX'
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/0C1F-PidTagSenderEmailAddress.md

@@ -41,3 +47,3 @@ */

*
* Target dataType = 'msg'.
* Target {@link dataType} = 'msg'.
*

@@ -50,4 +56,24 @@ * @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/1000-PidTagBody.md

*
* Target dataType = 'msg'.
* e.g.
*
* ```
* Return-Path: <xmailuser@xmailserver.test>
* Delivered-To: xmailuser@xmailserver.test
* X-AuthUser: xmailuser@xmailserver.test
* Received: from H270 ([127.0.0.1]:56695)
* by xmailserver.test with [XMail 1.27 ESMTP Server]
* id <S9> for <xmailuser@xmailserver.test> from <xmailuser@xmailserver.test>;
* Tue, 12 May 2020 14:45:17 +0900
* From: Microsoft Outlook <xmailuser@xmailserver.test>
* To: =?utf-8?B?eG1haWx1c2Vy?= <xmailuser@xmailserver.test>
* Subject: =?utf-8?B?TWljcm9zb2Z0IE91dGxvb2sg44OG44K544OIIOODoeODg+OCu+ODvOOCuA==?=
* MIME-Version: 1.0
* Content-Type: text/html;
* charset=\"utf-8\"
* Content-Transfer-Encoding: 8bit
*
* ```
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/007D-PidTagTransportMessageHeaders.md

@@ -59,3 +85,3 @@ */

*
* Target dataType = 'msg'.
* Target {@link dataType} = 'msg'.
*

@@ -68,4 +94,6 @@ * @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/1009-PidTagRtfCompressed.md

*
* Target dataType = 'attachment'.
* e.g. `.png`
*
* Target {@link dataType} = 'attachment'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3703-PidTagAttachExtension.md

@@ -77,4 +105,6 @@ */

*
* Target dataType = 'attachment'.
* e.g. `green.png`
*
* Target {@link dataType} = 'attachment'.
*
* @see https://docs.microsoft.com/en-US/office/client-developer/outlook/mapi/pidtagattachfilename-canonical-property

@@ -86,4 +116,6 @@ */

*
* Target dataType = 'attachment'.
* e.g. `green.png`
*
* Target {@link dataType} = 'attachment'.
*
* @see https://docs.microsoft.com/en-US/office/client-developer/outlook/mapi/pidtagattachlongfilename-canonical-property

@@ -95,5 +127,6 @@ * @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3707-PidTagAttachLongFilename.md

* Contains a content identifier unique to the Message object that matches a
* Target dataType = 'attachment'.
*
* corresponding "cid" URI schema reference in the HTML body of the Message object.
*
* Target {@link dataType} = 'attachment'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3712-PidTagAttachContentId.md

@@ -105,4 +138,10 @@ */

*
* Target dataType = 'recipient'.
* e.g.
*
* - `xmailuser` for recipient.
* - `green.png` for generic attachment.
* - `I have attachments!` for msg attachment.
*
* Target {@link dataType} = 'recipient' and 'attachment'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3001-PidTagDisplayName.md

@@ -114,4 +153,9 @@ */

*
* Target dataType = 'recipient'.
* e.g.
*
* - `xmailuser@xmailserver.test` for {@link addressType} = 'SMTP'
* - `/o=ExchangeLabs/ou=Exchange Administrative Group (xxx)/cn=Recipients/cn=xxx` for {@link addressType} = 'EX'
*
* Target {@link dataType} = 'recipient'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3003-PidTagEmailAddress.md

@@ -123,4 +167,6 @@ */

*
* Target dataType = 'msg'.
* e.g. `Mon, 15 Feb 2021 08:19:21 GMT`
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3007-PidTagCreationTime.md

@@ -132,4 +178,6 @@ */

*
* Target dataType = 'msg'.
* e.g. `Mon, 15 Feb 2021 08:19:21 GMT`
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3008-PidTagLastModificationTime.md

@@ -141,4 +189,6 @@ */

*
* Target dataType = 'msg'.
* e.g. `Mon, 15 Feb 2021 08:19:04 GMT`
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/0039-PidTagClientSubmitTime.md

@@ -150,4 +200,6 @@ */

*
* Target dataType = 'msg'.
* e.g. `Mon, 15 Feb 2021 08:19:00 GMT`
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/0E06-PidTagMessageDeliveryTime.md

@@ -160,5 +212,10 @@ */

*
* Target dataType = 'msg'.
* e.g.
*
* - `xxx@xxx.onmicrosoft.com` for {@link senderAddressType} = 'EX'
*
* Target {@link dataType} = 'msg'.
*
* @see https://social.microsoft.com/Forums/partner/en-US/8e15ac6d-0404-41c0-9af7-26a06ca797bf/meaning-of-mapi-identifiers-0x5d0a-and-0x5d0b?forum=os_exchangeprotocols
* @see https://github.com/HiraokaHyperTools/msgreader/issues/10
*/

@@ -170,5 +227,10 @@ creatorSMTPAddress?: string;

*
* Target dataType = 'msg'.
* e.g.
*
* - `xxx@xxx.onmicrosoft.com` for {@link senderAddressType} = 'EX'
*
* Target {@link dataType} = 'msg'.
*
* @see https://social.microsoft.com/Forums/partner/en-US/8e15ac6d-0404-41c0-9af7-26a06ca797bf/meaning-of-mapi-identifiers-0x5d0a-and-0x5d0b?forum=os_exchangeprotocols
* @see https://github.com/HiraokaHyperTools/msgreader/issues/10
*/

@@ -179,5 +241,10 @@ lastModifierSMTPAddress?: string;

*
* Target dataType = 'recipient'.
* e.g.
*
* - `xxx@xxx.onmicrosoft.com` for {@link addressType} = 'EX'
*
* Target {@link dataType} = 'recipient'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/39FE-PidTagSmtpAddress.md
* @see https://github.com/HiraokaHyperTools/msgreader/issues/10
*/

@@ -192,29 +259,132 @@ smtpAddress?: string;

*
* Target dataType = 'msg'.
* e.g.
*
* - `UnoKenji` for {@link senderAddressType} = 'EX'
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3FFA-PidTagLastModifierName.md
* @see https://github.com/HiraokaHyperTools/msgreader/issues/10
*/
lastModifierName?: string;
/**
* Contains the email address type of a Message object.
*
* e.g.
*
* - `EX`
* - `SMTP`
*
* Target {@link dataType} = 'recipient'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/3002-PidTagAddressType.md
* @see https://github.com/HiraokaHyperTools/msgreader/issues/10
*/
addressType?: string;
/**
* Contains the email address type of the sending mailbox owner.
*
* e.g.
*
* - `EX`
* - `SMTP`
*
* Target {@link dataType} = 'msg'.
*
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/0C1E-PidTagSenderAddressType.md
* @see https://github.com/HiraokaHyperTools/msgreader/issues/10
*/
senderAddressType?: string;
}
interface SomeParsedOxProps {
export interface SomeParsedOxProps {
recipType?: "to" | "cc" | "bcc";
}
interface FieldsData extends SomeOxProps, SomeParsedOxProps {
export interface FieldsData extends SomeOxProps, SomeParsedOxProps {
dataType: null | "msg" | "attachment" | "recipient";
/**
* The attachment file's contentLength.
*
* Target {@link dataType} = 'attachment'.
*/
contentLength?: number;
/**
* The attachment file's dataId (for internal use).
*
* This is entry index to CFBF stream.
*
* Target {@link dataType} = 'attachment'.
*/
dataId?: number;
/**
* folderId is internal and valid for embedded msg file.
*
* This is entry index to CFBF storage.
*
* Target {@link dataType} = 'attachment'.
*/
folderId?: number;
/**
* innerMsgContent is set to true, if this attachment is embedded msg.
*
* The embedded msg is represented as a CFBF storage (not single CFBF stream).
*
* Target {@link dataType} = 'attachment'.
*/
innerMsgContent?: true;
/**
* The properties defined in embedded msg.
*
* Target {@link dataType} = 'attachment'.
*/
innerMsgContentFields?: FieldsData;
/**
* The collection of attachment files:
*
* ```json
* {
* "dataType": "attachment",
* "name": "A.txt",
* "fileNameShort": "A.txt",
* "dataId": 40,
* "contentLength": 11,
* "extension": ".txt",
* "fileName": "A.txt"
* }
* ```
*
* Use with {@link MsgReader.getAttachment}.
*
* Target {@link dataType} = 'msg'.
*/
attachments?: FieldsData[];
/**
* The collection of recipients:
*
* ```json
* {
* "dataType": "recipient",
* "name": "to@example.com",
* "email": "to@example.com",
* "recipType": "to"
* },
* ```
*
* Target {@link dataType} = 'msg'.
*/
recipients?: FieldsData[];
/**
* error is set on parse error.
*
* Target {@link dataType} = 'msg'.
*/
error?: string;
}
/**
* The core implementation of MsgReader
*/
export default class MsgReader {
reader: Reader;
fieldsData: FieldsData;
private reader;
private fieldsData;
parserConfig: ParserConfig;
innerMsgBurners: {
[key: number]: () => Uint8Array;
};
private innerMsgBurners;
constructor(arrayBuffer: ArrayBuffer | DataView);

@@ -249,2 +419,1 @@ private getFieldValue;

}
export {};

@@ -24,2 +24,4 @@ "use strict";

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

@@ -29,18 +31,15 @@

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
// MSG Reader implementation
var ParserConfig = function ParserConfig() {
_classCallCheck(this, ParserConfig);
_defineProperty(this, "propertyObserver", void 0);
};
/**
* CONST.MSG.PROP.TYPE_ENUM
*/
var TypeEnum;
/**
* Some OXPROPS
*
* Note that please sync with: `CONST.MSG.FIELD.NAME_MAPPING`
*
* @see [[MS-OXPROPS]: Exchange Server Protocols Master Property List | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxprops/f6ab1613-aefe-447d-a49c-18217230b148)
*/

@@ -56,3 +55,7 @@ (function (TypeEnum) {

}
/**
* The core implementation of MsgReader
*/
var MsgReader = /*#__PURE__*/function () {

@@ -443,3 +446,3 @@ function MsgReader(arrayBuffer) {

if (attachData.innerMsgContent === true && typeof attachData.folderId === "number") {
// inner msg
// embedded msg
return {

@@ -446,0 +449,0 @@ fileName: attachData.name + ".msg",

@@ -1,8 +0,37 @@

import DataStream from "./DataStream";
/**
* CONST.MSG.PROP.TYPE_ENUM
* `Object Type` in `2.6.1 Compound File Directory Entry`
*
* See also: [[MS-CFB]: Compound File Directory Entry | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/60fe8611-66c3-496b-b70d-a504c94c9ace)
*/
export declare enum TypeEnum {
/**
* `Storage Object`
*
* storage object: An object in a compound file that is analogous to a file system directory. The parent object of a storage object must be another storage object or the root storage object.
*
* See also:
*
* - [[MS-CFB]: Other Directory Entries | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/b37413bb-f3ef-4adc-b18e-29bddd62c26e)
* - [[MS-CFB]: Glossary | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/59ccb2ef-1ce5-41e3-bc30-075dea759d0a#gt_c3ddf892-3f55-4561-8804-20325dbc8fba)
*/
DIRECTORY = 1,
/**
* `Stream Object`
*
* - stream object: An object in a compound file that is analogous to a file system file. The parent object of a stream object must be a storage object or the root storage object.
*
* See also:
* - [[MS-CFB]: Compound File User-Defined Data Sectors | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/b089deda-be20-4b4a-aad5-fbe68bb19672)
* - [[MS-CFB]: Glossary | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/59ccb2ef-1ce5-41e3-bc30-075dea759d0a#gt_9f598e1c-0d65-4845-8f06-8d50f7a32fd5)
*/
DOCUMENT = 2,
/**
* `Root Storage Object`
*
* - root storage object: A storage object in a compound file that must be accessed before any other storage objects and stream objects are referenced. It is the uppermost parent object in the storage object and stream object hierarchy.
*
* See also:
* - [[MS-CFB]: Root Directory Entry | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/026fde6e-143d-41bf-a7da-c08b2130d50e)
* - [[MS-CFB]: Glossary | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/59ccb2ef-1ce5-41e3-bc30-075dea759d0a#gt_d49237e3-04dd-4823-a0a5-5e23f750a5f4)
*/
ROOT = 5

@@ -20,33 +49,69 @@ }

}
/**
* The reader access to CFBF storage
*/
export interface CFolder {
/**
* CFBF entry index.
*/
dataId: number;
/**
* Storage name.
*/
name: string;
/**
* Sub folders.
*/
subFolders(): CFolder[];
/**
* Sub name set of streams.
*/
fileNames(): string[];
/**
* Sub read access set of stream.
*/
fileNameSets(): CFileSet[];
/**
* Read stream as binary to memory.
*/
readFile(fileName: string): Uint8Array | null;
}
/**
* The reader access to CFBF stream
*/
export interface CFileSet {
/**
* CFBF entry index.
*/
dataId: number;
/**
* Stream name.
*/
name: string;
/**
* The stream binary length in byte unit.
*/
length: number;
/**
* Read stream contents and get memory data.
*/
provider: () => Uint8Array;
}
/**
* Original CFBF reader implementation existed in MsgReader.
* Original msg file (CFBF) reader which was implemented in MsgReader.
*/
export declare class Reader {
ds: DataStream;
bigBlockSize: number;
bigBlockLength: number;
xBlockLength: number;
batCount: number;
propertyStart: number;
sbatStart: number;
sbatCount: number;
xbatStart: number;
xbatCount: number;
batData?: number[];
sbatData?: number[];
propertyData?: Property[];
private ds;
private bigBlockSize;
private bigBlockLength;
private xBlockLength;
private batCount;
private propertyStart;
private sbatStart;
private sbatCount;
private xbatStart;
private xbatCount;
private batData?;
private sbatData?;
private propertyData?;
constructor(arrayBuffer: ArrayBuffer | DataView);

@@ -60,2 +125,5 @@ isMSGFile(): boolean;

private propertyDataReader;
/**
* Parse msg file.
*/
parse(): void;

@@ -75,5 +143,17 @@ private batCountInHeader;

private readProperty;
/**
* Get binary from document in CFBF.
*
* @param index entry index
* @returns binary
* @internal
*/
readFileOf(index: number): Uint8Array;
private folderOf;
/**
* Get reader access to CFBF (valid after successful call of {@link parse}).
*
* @returns root folder
*/
rootFolder(): CFolder;
}

@@ -31,3 +31,5 @@ "use strict";

/**
* CONST.MSG.PROP.TYPE_ENUM
* `Object Type` in `2.6.1 Compound File Directory Entry`
*
* See also: [[MS-CFB]: Compound File Directory Entry | Microsoft Docs](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/60fe8611-66c3-496b-b70d-a504c94c9ace)
*/

@@ -44,3 +46,3 @@ var TypeEnum;

/**
* Original CFBF reader implementation existed in MsgReader.
* Original msg file (CFBF) reader which was implemented in MsgReader.
*/

@@ -198,2 +200,6 @@ var Reader = /*#__PURE__*/function () {

}
/**
* Parse msg file.
*/
}, {

@@ -376,2 +382,10 @@ key: "parse",

}
/**
* Get binary from document in CFBF.
*
* @param index entry index
* @returns binary
* @internal
*/
}, {

@@ -477,2 +491,8 @@ key: "readFileOf",

}
/**
* Get reader access to CFBF (valid after successful call of {@link parse}).
*
* @returns root folder
*/
}, {

@@ -479,0 +499,0 @@ key: "rootFolder",

@@ -0,2 +1,8 @@

/**
* @internal
*/
export declare function arraysEqual(a: ArrayLike<any>, b: ArrayLike<any>): boolean;
/**
* @internal
*/
export declare function uInt2int(data: number[]): number[];

@@ -9,2 +9,5 @@ "use strict";

/**
* @internal
*/
function arraysEqual(a, b) {

@@ -21,3 +24,7 @@ if (a === b) return true;

}
/**
* @internal
*/
function uInt2int(data) {

@@ -24,0 +31,0 @@ var result = new Array(data.length);

{
"name": "@kenjiuno/msgreader",
"version": "1.6.3",
"version": "1.6.4",
"description": "",

@@ -30,2 +30,4 @@ "main": "lib/index.js",

"mocha": "^9.0.2",
"typedoc": "^0.21.4",
"typedoc-plugin-rename-defaults": "^0.1.0",
"typescript": "^4.3.5"

@@ -32,0 +34,0 @@ },

@@ -16,2 +16,4 @@ # msgreader

Links: [_typedoc documentation_](https://hiraokahypertools.github.io/msgreader/typedoc/)
## How to use

@@ -18,0 +20,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc