@kenjiuno/msgreader
Advanced tools
Comparing version 1.6.5 to 1.6.6
@@ -114,3 +114,3 @@ const program = require('commander'); | ||
} | ||
if (fields.dataType === "msg") { | ||
{ | ||
const key = tag.toString(16).padStart(8, "0").toUpperCase(); | ||
@@ -121,2 +121,3 @@ const prop = props.filter(it => it.key === key).shift(); | ||
"msgIdx:", fields.msgIndex, | ||
"dataType:", `'${fields.dataType}'`, | ||
"tag:", `0x${key}`, | ||
@@ -123,0 +124,0 @@ "name:", prop && prop.name || null, |
@@ -60,2 +60,3 @@ declare const _default: { | ||
'3712': string; | ||
'7ffe': string; | ||
'3001': string; | ||
@@ -62,0 +63,0 @@ '3002': string; |
@@ -74,2 +74,3 @@ "use strict"; | ||
'3712': 'pidContentId', | ||
'7ffe': 'attachmentHidden', | ||
// recipient specific | ||
@@ -76,0 +77,0 @@ '3001': 'name', |
@@ -361,2 +361,11 @@ export interface ParserConfig { | ||
error?: string; | ||
/** | ||
* Indicates whether an attachment is hidden from the end user. | ||
* | ||
* Target {@link dataType} = 'attachment'. | ||
* | ||
* @see https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagattachmenthidden-canonical-property | ||
* @see https://github.com/HiraokaHyperTools/OXPROPS/blob/master/JSON/7FFE-PidTagAttachmentHidden.md | ||
*/ | ||
attachmentHidden?: boolean; | ||
} | ||
@@ -378,3 +387,3 @@ /** | ||
private registerFolder; | ||
private fieldsRecipProperties; | ||
private fieldsRecipAndAttachmentProperties; | ||
private fieldsRootProperties; | ||
@@ -381,0 +390,0 @@ private fieldsDataDir; |
@@ -16,2 +16,4 @@ "use strict"; | ||
var _utils = require("./utils"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
@@ -264,4 +266,4 @@ | ||
}, { | ||
key: "fieldsRecipProperties", | ||
value: function fieldsRecipProperties(parserConfig, documentProperty, fields) { | ||
key: "fieldsRecipAndAttachmentProperties", | ||
value: function fieldsRecipAndAttachmentProperties(parserConfig, documentProperty, fields) { | ||
var propertiesBinary = documentProperty.provider(); | ||
@@ -272,2 +274,3 @@ var propertiesDs = new _DataStream["default"](propertiesBinary, 8, _DataStream["default"].LITTLE_ENDIAN); // See: [MS-OXMSG]: Outlook Item (.msg) File Format, 2.4 Property Stream | ||
var PtypInteger32 = 0x0003; | ||
var PtypBoolean = 0x000B; | ||
var PidTagRecipientType = 0x0C150003; | ||
@@ -278,15 +281,20 @@ | ||
var flags = propertiesDs.readUint32(); | ||
var fieldClass = (0, _utils.toHexStr)(propertyTag >> 16 & 65535, 4); | ||
var fieldType = (0, _utils.toHexStr)(propertyTag & 65535, 4); | ||
var ptyp = propertyTag & 0xFFFF; | ||
var value = undefined; | ||
var rawDataPos = propertiesDs.position; | ||
if (ptyp === PtypInteger32) { | ||
value = propertiesDs.readUint32(); | ||
propertiesDs.readUint32(); | ||
} else { | ||
propertiesDs.readUint32(); | ||
propertiesDs.readUint32(); | ||
} else if (ptyp === PtypBoolean) { | ||
value = propertiesDs.readUint16() ? true : false; | ||
} | ||
parserConfig.propertyObserver(fields, propertyTag, new Uint8Array(8)); | ||
propertiesDs.seek(rawDataPos); | ||
var _raw = propertiesDs.readUint8Array(8); | ||
parserConfig.propertyObserver(fields, propertyTag, _raw); | ||
if (propertyTag === PidTagRecipientType) { | ||
@@ -304,2 +312,8 @@ var MAPI_TO = 1; | ||
} | ||
} else { | ||
var fieldName = _const["default"].MSG.FIELD.NAME_MAPPING[fieldClass]; //console.info("@", fieldClass, propertyTag, fieldName, value); | ||
if (fieldName && value !== undefined) { | ||
fields[fieldName] = value; | ||
} | ||
} | ||
@@ -377,4 +391,4 @@ } | ||
} else if (fileSet.name === "__properties_version1.0") { | ||
if (subClass === "recip") { | ||
this.fieldsRecipProperties(parserConfig, fileSet, fields); | ||
if (subClass === "recip" || subClass === "attachment") { | ||
this.fieldsRecipAndAttachmentProperties(parserConfig, fileSet, fields); | ||
} else if (subClass === "root") { | ||
@@ -381,0 +395,0 @@ this.fieldsRootProperties(parserConfig, fileSet, fields); |
@@ -9,1 +9,5 @@ /** | ||
export declare function uInt2int(data: number[]): number[]; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function toHexStr(value: number, padding: number): string; |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.uInt2int = uInt2int; | ||
exports.toHexStr = toHexStr; | ||
@@ -37,2 +38,23 @@ /** | ||
return result; | ||
} | ||
/** | ||
* @internal | ||
*/ | ||
function toHexStr(value, padding) { | ||
var text = ""; | ||
while (value != 0) { | ||
text = "0123456789abcdef"[value & 15] + text; | ||
value >>= 4; | ||
text = "0123456789abcdef"[value & 15] + text; | ||
value >>= 4; | ||
} | ||
while (text.length < padding) { | ||
text = "0" + text; | ||
} | ||
return text; | ||
} |
{ | ||
"name": "@kenjiuno/msgreader", | ||
"version": "1.6.5", | ||
"version": "1.6.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
224672
6739