pst-extractor 1.6.0 → 1.9.0
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/dist/ColumnDescriptor.class.js +9 -4
- package/dist/DescriptorIndexNode.class.d.ts +3 -3
- package/dist/DescriptorIndexNode.class.js +1 -0
- package/dist/LZFu.class.js +2 -0
- package/dist/NodeInfo.class.d.ts +2 -2
- package/dist/NodeInfo.class.js +2 -0
- package/dist/NodeMap.class.d.ts +2 -2
- package/dist/NodeMap.class.js +7 -2
- package/dist/OffsetIndexItem.class.d.ts +3 -3
- package/dist/OffsetIndexItem.class.js +1 -0
- package/dist/OutlookProperties.d.ts +2 -0
- package/dist/OutlookProperties.js +3 -0
- package/dist/PSTActivity.class.js +1 -0
- package/dist/PSTAppointment.class.js +1 -0
- package/dist/PSTAttachment.class.js +7 -2
- package/dist/PSTContact.class.js +1 -0
- package/dist/PSTDescriptorItem.class.js +9 -4
- package/dist/PSTFile.class.d.ts +8 -8
- package/dist/PSTFile.class.js +43 -20
- package/dist/PSTFolder.class.js +10 -5
- package/dist/PSTMessage.class.d.ts +2 -2
- package/dist/PSTMessage.class.js +9 -4
- package/dist/PSTMessageStore.class.js +1 -0
- package/dist/PSTNodeInputStream.class.d.ts +5 -5
- package/dist/PSTNodeInputStream.class.js +52 -25
- package/dist/PSTObject.class.d.ts +3 -3
- package/dist/PSTObject.class.js +11 -6
- package/dist/PSTRecipient.class.js +2 -0
- package/dist/PSTTable.class.d.ts +2 -2
- package/dist/PSTTable.class.js +16 -11
- package/dist/PSTTable7C.class.js +24 -19
- package/dist/PSTTableBC.class.js +9 -4
- package/dist/PSTTableItem.class.d.ts +4 -4
- package/dist/PSTTableItem.class.js +7 -2
- package/dist/PSTTask.class.d.ts +13 -0
- package/dist/PSTTask.class.js +19 -0
- package/dist/PSTUtil.class.d.ts +5 -5
- package/dist/PSTUtil.class.js +16 -7
- package/dist/RecurrencePattern.class.d.ts +50 -0
- package/dist/RecurrencePattern.class.js +120 -0
- package/dist/index.js +7 -6
- package/example/package.json +8 -8
- package/example/test-min.ts +32 -7
- package/example/{test-mem.ts → test.ts} +43 -32
- package/example/testdata/attachments/Clinometer Usage.pdf +0 -0
- package/example/testdata/attachments/primoz-roglic-of-slovenia-and-team-jumbo-visma-red-leader-news-photo-1628610563.jpg +0 -0
- package/example/testdata/attachments/text.txt +1 -0
- package/example/testdata/output.txt +278 -0
- package/example/testdata/outputBody.txt +3404 -0
- package/example/testdata/pstextractortest@outlook.com.ost +0 -0
- package/example/testdata/pstextractortestpdf@outlook.com.ost +0 -0
- package/example/yarn.lock +85 -45
- package/junit.xml +37 -31
- package/package.json +28 -27
- package/readme.md +13 -6
- package/example/test-max.ts +0 -247
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.ColumnDescriptor = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
4
9
|
class ColumnDescriptor {
|
|
5
10
|
/**
|
|
6
11
|
* Creates an instance of ColumnDescriptor.
|
|
@@ -9,12 +14,12 @@ class ColumnDescriptor {
|
|
|
9
14
|
* @memberof ColumnDescriptor
|
|
10
15
|
*/
|
|
11
16
|
constructor(nodeInfo, offset) {
|
|
12
|
-
this._type = nodeInfo.seekAndReadLong(
|
|
17
|
+
this._type = nodeInfo.seekAndReadLong(long_1.default.fromValue(offset), 2).toNumber(); // & 0xFFFF;
|
|
13
18
|
this._id = nodeInfo
|
|
14
|
-
.seekAndReadLong(
|
|
19
|
+
.seekAndReadLong(long_1.default.fromValue(offset + 2), 2)
|
|
15
20
|
.toNumber(); // & 0xFFFF;
|
|
16
21
|
this._ibData = nodeInfo
|
|
17
|
-
.seekAndReadLong(
|
|
22
|
+
.seekAndReadLong(long_1.default.fromValue(offset + 4), 2)
|
|
18
23
|
.toNumber(); // & 0xFFFF;
|
|
19
24
|
this._cbData = nodeInfo.pstNodeInputStream.read(); // & 0xFFFF;
|
|
20
25
|
this._iBit = nodeInfo.pstNodeInputStream.read(); // & 0xFFFF;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
2
|
+
import Long from 'long';
|
|
3
3
|
export declare class DescriptorIndexNode {
|
|
4
4
|
private _descriptorIdentifier;
|
|
5
5
|
itemType: number;
|
|
@@ -7,9 +7,9 @@ export declare class DescriptorIndexNode {
|
|
|
7
7
|
private _parentDescriptorIndexIdentifier;
|
|
8
8
|
get parentDescriptorIndexIdentifier(): number;
|
|
9
9
|
private _localDescriptorsOffsetIndexIdentifier;
|
|
10
|
-
get localDescriptorsOffsetIndexIdentifier():
|
|
10
|
+
get localDescriptorsOffsetIndexIdentifier(): Long;
|
|
11
11
|
private _dataOffsetIndexIdentifier;
|
|
12
|
-
get dataOffsetIndexIdentifier():
|
|
12
|
+
get dataOffsetIndexIdentifier(): Long;
|
|
13
13
|
/**
|
|
14
14
|
* Creates an instance of DescriptorIndexNode, a component of the internal descriptor b-tree.
|
|
15
15
|
* @param {Buffer} buffer
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DescriptorIndexNode = void 0;
|
|
3
4
|
const PSTFile_class_1 = require("./PSTFile.class");
|
|
4
5
|
const PSTUtil_class_1 = require("./PSTUtil.class");
|
|
5
6
|
// DescriptorIndexNode is a leaf item from the Descriptor index b-tree
|
package/dist/LZFu.class.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LZFu = void 0;
|
|
3
4
|
const PSTUtil_class_1 = require("./PSTUtil.class");
|
|
4
5
|
// An implementation of the LZFu algorithm to decompress RTF content
|
|
5
6
|
class LZFu {
|
|
@@ -18,6 +19,7 @@ class LZFu {
|
|
|
18
19
|
// ).toNumber()
|
|
19
20
|
const uncompressedSize = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 4, 8).toNumber();
|
|
20
21
|
const compressionSig = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 8, 12).toNumber();
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
23
|
const compressedCRC = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 12, 16).toNumber();
|
|
22
24
|
if (compressionSig == 0x75465a4c) {
|
|
23
25
|
// we are compressed...
|
package/dist/NodeInfo.class.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Long from 'long';
|
|
2
2
|
import { PSTNodeInputStream } from './PSTNodeInputStream.class';
|
|
3
3
|
export declare class NodeInfo {
|
|
4
4
|
private _startOffset;
|
|
@@ -23,7 +23,7 @@ export declare class NodeInfo {
|
|
|
23
23
|
* @returns {long}
|
|
24
24
|
* @memberof NodeInfo
|
|
25
25
|
*/
|
|
26
|
-
seekAndReadLong(offset:
|
|
26
|
+
seekAndReadLong(offset: Long, length: number): Long;
|
|
27
27
|
/**
|
|
28
28
|
* JSON stringify the object properties.
|
|
29
29
|
* @returns {string}
|
package/dist/NodeInfo.class.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NodeInfo = void 0;
|
|
3
4
|
class NodeInfo {
|
|
4
5
|
/**
|
|
5
6
|
* Creates an instance of NodeInfo, part of the node table.
|
|
@@ -43,6 +44,7 @@ class NodeInfo {
|
|
|
43
44
|
* @returns {string}
|
|
44
45
|
* @memberof NodeInfo
|
|
45
46
|
*/
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
48
|
toJSON() {
|
|
47
49
|
return this;
|
|
48
50
|
}
|
package/dist/NodeMap.class.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Long from 'long';
|
|
2
2
|
/**
|
|
3
3
|
* Stores node names (both alpha and numeric) in node maps for quick lookup.
|
|
4
4
|
* @export
|
|
@@ -30,6 +30,6 @@ export declare class NodeMap {
|
|
|
30
30
|
* @returns {long}
|
|
31
31
|
* @memberof NodeMap
|
|
32
32
|
*/
|
|
33
|
-
getNumericName(propId: number):
|
|
33
|
+
getNumericName(propId: number): Long | undefined;
|
|
34
34
|
private transformKey;
|
|
35
35
|
}
|
package/dist/NodeMap.class.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.NodeMap = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
4
9
|
/**
|
|
5
10
|
* Stores node names (both alpha and numeric) in node maps for quick lookup.
|
|
6
11
|
* @export
|
|
@@ -72,7 +77,7 @@ class NodeMap {
|
|
|
72
77
|
return lkey;
|
|
73
78
|
}
|
|
74
79
|
transformKey(key, idx) {
|
|
75
|
-
let lidx =
|
|
80
|
+
let lidx = long_1.default.fromNumber(idx);
|
|
76
81
|
lidx = lidx.shiftLeft(32);
|
|
77
82
|
lidx = lidx.or(key);
|
|
78
83
|
return lidx;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
2
|
+
import Long from 'long';
|
|
3
3
|
export declare class OffsetIndexItem {
|
|
4
4
|
private _indexIdentifier;
|
|
5
|
-
get indexIdentifier():
|
|
5
|
+
get indexIdentifier(): Long;
|
|
6
6
|
private _fileOffset;
|
|
7
|
-
get fileOffset():
|
|
7
|
+
get fileOffset(): Long;
|
|
8
8
|
private _size;
|
|
9
9
|
get size(): number;
|
|
10
10
|
private cRef;
|
|
@@ -258,10 +258,12 @@ export declare enum OutlookProperties {
|
|
|
258
258
|
PidTagWeddingAnniversary = 14913,
|
|
259
259
|
PidLidPercentComplete = 33026,
|
|
260
260
|
PidLidTaskStatus = 33025,
|
|
261
|
+
PidLidTaskDeadOccurrence = 33033,
|
|
261
262
|
PidLidTaskDateCompleted = 33039,
|
|
262
263
|
PidLidTaskActualEffort = 33040,
|
|
263
264
|
PidLidTaskEstimatedEffort = 33041,
|
|
264
265
|
PidLidTaskVersion = 33042,
|
|
266
|
+
PidLidTaskRecurrence = 33046,
|
|
265
267
|
PidLidTaskComplete = 33052,
|
|
266
268
|
PidLidTaskOwner = 33055,
|
|
267
269
|
PidLidTaskAssigner = 33057,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutlookProperties = void 0;
|
|
3
4
|
/* eslint-disable @typescript-eslint/camelcase */
|
|
4
5
|
// See PSTMessage.class for details on these properties
|
|
5
6
|
var OutlookProperties;
|
|
@@ -263,10 +264,12 @@ var OutlookProperties;
|
|
|
263
264
|
OutlookProperties[OutlookProperties["PidTagWeddingAnniversary"] = 14913] = "PidTagWeddingAnniversary";
|
|
264
265
|
OutlookProperties[OutlookProperties["PidLidPercentComplete"] = 33026] = "PidLidPercentComplete";
|
|
265
266
|
OutlookProperties[OutlookProperties["PidLidTaskStatus"] = 33025] = "PidLidTaskStatus";
|
|
267
|
+
OutlookProperties[OutlookProperties["PidLidTaskDeadOccurrence"] = 33033] = "PidLidTaskDeadOccurrence";
|
|
266
268
|
OutlookProperties[OutlookProperties["PidLidTaskDateCompleted"] = 33039] = "PidLidTaskDateCompleted";
|
|
267
269
|
OutlookProperties[OutlookProperties["PidLidTaskActualEffort"] = 33040] = "PidLidTaskActualEffort";
|
|
268
270
|
OutlookProperties[OutlookProperties["PidLidTaskEstimatedEffort"] = 33041] = "PidLidTaskEstimatedEffort";
|
|
269
271
|
OutlookProperties[OutlookProperties["PidLidTaskVersion"] = 33042] = "PidLidTaskVersion";
|
|
272
|
+
OutlookProperties[OutlookProperties["PidLidTaskRecurrence"] = 33046] = "PidLidTaskRecurrence";
|
|
270
273
|
OutlookProperties[OutlookProperties["PidLidTaskComplete"] = 33052] = "PidLidTaskComplete";
|
|
271
274
|
OutlookProperties[OutlookProperties["PidLidTaskOwner"] = 33055] = "PidLidTaskOwner";
|
|
272
275
|
OutlookProperties[OutlookProperties["PidLidTaskAssigner"] = 33057] = "PidLidTaskAssigner";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PSTActivity = void 0;
|
|
3
4
|
const PSTMessage_class_1 = require("./PSTMessage.class");
|
|
4
5
|
const OutlookProperties_1 = require("./OutlookProperties");
|
|
5
6
|
class PSTActivity extends PSTMessage_class_1.PSTMessage {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PSTAppointment = void 0;
|
|
3
4
|
const OutlookProperties_1 = require("./OutlookProperties");
|
|
4
5
|
const PSTMessage_class_1 = require("./PSTMessage.class");
|
|
5
6
|
// PSTAppointment is for Calendar items
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.PSTAttachment = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
4
9
|
const OutlookProperties_1 = require("./OutlookProperties");
|
|
5
10
|
const PSTNodeInputStream_class_1 = require("./PSTNodeInputStream.class");
|
|
6
11
|
const PSTObject_class_1 = require("./PSTObject.class");
|
|
@@ -78,7 +83,7 @@ class PSTAttachment extends PSTObject_class_1.PSTObject {
|
|
|
78
83
|
pstNodeInputStream = new PSTNodeInputStream_class_1.PSTNodeInputStream(this.pstFile, descriptorItemNested);
|
|
79
84
|
if (descriptorItemNested &&
|
|
80
85
|
descriptorItemNested.subNodeOffsetIndexIdentifier > 0) {
|
|
81
|
-
this.localDescriptorItems = this.pstFile.getPSTDescriptorItems(
|
|
86
|
+
this.localDescriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromNumber(descriptorItemNested.subNodeOffsetIndexIdentifier));
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
89
|
}
|
package/dist/PSTContact.class.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PSTContact = void 0;
|
|
3
4
|
const OutlookProperties_1 = require("./OutlookProperties");
|
|
4
5
|
const PSTMessage_class_1 = require("./PSTMessage.class");
|
|
5
6
|
class PSTContact extends PSTMessage_class_1.PSTMessage {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.PSTDescriptorItem = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
4
9
|
const PSTUtil_class_1 = require("./PSTUtil.class");
|
|
5
10
|
const PSTFile_class_1 = require("./PSTFile.class");
|
|
6
11
|
class PSTDescriptorItem {
|
|
@@ -48,7 +53,7 @@ class PSTDescriptorItem {
|
|
|
48
53
|
if (this.dataBlockData != null) {
|
|
49
54
|
return this.dataBlockData;
|
|
50
55
|
}
|
|
51
|
-
const pstNodeInputStream = this._pstFile.readLeaf(
|
|
56
|
+
const pstNodeInputStream = this._pstFile.readLeaf(long_1.default.fromValue(this.offsetIndexIdentifier));
|
|
52
57
|
const out = Buffer.alloc(pstNodeInputStream.length.toNumber());
|
|
53
58
|
pstNodeInputStream.readCompletely(out);
|
|
54
59
|
this.dataBlockData = out;
|
|
@@ -65,7 +70,7 @@ class PSTDescriptorItem {
|
|
|
65
70
|
return this.dataBlockOffsets;
|
|
66
71
|
}
|
|
67
72
|
const offsets = this._pstFile
|
|
68
|
-
.readLeaf(
|
|
73
|
+
.readLeaf(long_1.default.fromNumber(this.offsetIndexIdentifier))
|
|
69
74
|
.getBlockOffsets();
|
|
70
75
|
const offsetsOut = [];
|
|
71
76
|
for (let x = 0; x < offsets.length; x++) {
|
|
@@ -80,7 +85,7 @@ class PSTDescriptorItem {
|
|
|
80
85
|
* @memberof PSTDescriptorItem
|
|
81
86
|
*/
|
|
82
87
|
get dataSize() {
|
|
83
|
-
return this._pstFile.getLeafSize(
|
|
88
|
+
return this._pstFile.getLeafSize(long_1.default.fromNumber(this.offsetIndexIdentifier));
|
|
84
89
|
}
|
|
85
90
|
/**
|
|
86
91
|
* JSON stringify the object properties.
|
package/dist/PSTFile.class.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
2
|
+
import Long from 'long';
|
|
3
3
|
import { DescriptorIndexNode } from './DescriptorIndexNode.class';
|
|
4
4
|
import { OffsetIndexItem } from './OffsetIndexItem.class';
|
|
5
5
|
import { PSTDescriptorItem } from './PSTDescriptorItem.class';
|
|
@@ -96,7 +96,7 @@ export declare class PSTFile {
|
|
|
96
96
|
* @returns {long}
|
|
97
97
|
* @memberof PSTFile
|
|
98
98
|
*/
|
|
99
|
-
static getNameToIdMapKey(propId: number):
|
|
99
|
+
static getNameToIdMapKey(propId: number): Long | undefined;
|
|
100
100
|
/**
|
|
101
101
|
* Get the message store of the PST file. Note that this doesn't really
|
|
102
102
|
* have much information, better to look under the root folder.
|
|
@@ -116,14 +116,14 @@ export declare class PSTFile {
|
|
|
116
116
|
* @returns {PSTNodeInputStream}
|
|
117
117
|
* @memberof PSTFile
|
|
118
118
|
*/
|
|
119
|
-
readLeaf(bid:
|
|
119
|
+
readLeaf(bid: Long): PSTNodeInputStream;
|
|
120
120
|
/**
|
|
121
121
|
* Read the size of the specified leaf.
|
|
122
122
|
* @param {long} bid
|
|
123
123
|
* @returns {number}
|
|
124
124
|
* @memberof PSTFile
|
|
125
125
|
*/
|
|
126
|
-
getLeafSize(bid:
|
|
126
|
+
getLeafSize(bid: Long): number;
|
|
127
127
|
/**
|
|
128
128
|
* Get file offset, which is sorted in 8 little endian bytes
|
|
129
129
|
* @private
|
|
@@ -147,21 +147,21 @@ export declare class PSTFile {
|
|
|
147
147
|
* @returns {DescriptorIndexNode}
|
|
148
148
|
* @memberof PSTFile
|
|
149
149
|
*/
|
|
150
|
-
getDescriptorIndexNode(id:
|
|
150
|
+
getDescriptorIndexNode(id: Long): DescriptorIndexNode;
|
|
151
151
|
/**
|
|
152
152
|
* Get an offset index node in the b-tree
|
|
153
153
|
* @param {long} id
|
|
154
154
|
* @returns {OffsetIndexItem}
|
|
155
155
|
* @memberof PSTFile
|
|
156
156
|
*/
|
|
157
|
-
getOffsetIndexNode(id:
|
|
157
|
+
getOffsetIndexNode(id: Long): OffsetIndexItem;
|
|
158
158
|
/**
|
|
159
159
|
* Parse a PSTDescriptor and get all of its items
|
|
160
160
|
* @param {long} localDescriptorsOffsetIndexIdentifier
|
|
161
161
|
* @returns {Map<number, PSTDescriptorItem>}
|
|
162
162
|
* @memberof PSTFile
|
|
163
163
|
*/
|
|
164
|
-
getPSTDescriptorItems(localDescriptorsOffsetIndexIdentifier:
|
|
164
|
+
getPSTDescriptorItems(localDescriptorsOffsetIndexIdentifier: Long): Map<number, PSTDescriptorItem>;
|
|
165
165
|
getPSTDescriptorItems(inputStream: PSTNodeInputStream): Map<number, PSTDescriptorItem>;
|
|
166
166
|
/**
|
|
167
167
|
* Build the children descriptor tree, used as a fallback when the nodes
|
|
@@ -206,7 +206,7 @@ export declare class PSTFile {
|
|
|
206
206
|
* @param {long} index
|
|
207
207
|
* @memberof PSTFile
|
|
208
208
|
*/
|
|
209
|
-
seek(index:
|
|
209
|
+
seek(index: Long): void;
|
|
210
210
|
/**
|
|
211
211
|
* JSON stringify the object properties.
|
|
212
212
|
* @returns {string}
|
package/dist/PSTFile.class.js
CHANGED
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
29
|
+
exports.PSTFile = void 0;
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
31
|
+
const long_1 = __importDefault(require("long"));
|
|
5
32
|
const DescriptorIndexNode_class_1 = require("./DescriptorIndexNode.class");
|
|
6
33
|
const OffsetIndexItem_class_1 = require("./OffsetIndexItem.class");
|
|
7
34
|
const PSTDescriptorItem_class_1 = require("./PSTDescriptorItem.class");
|
|
@@ -110,7 +137,7 @@ class PSTFile {
|
|
|
110
137
|
* @memberof PSTFile
|
|
111
138
|
*/
|
|
112
139
|
processNameToIDMap() {
|
|
113
|
-
const nameToIdMapDescriptorNode = this.getDescriptorIndexNode(
|
|
140
|
+
const nameToIdMapDescriptorNode = this.getDescriptorIndexNode(long_1.default.fromNumber(97));
|
|
114
141
|
// get the descriptors if we have them
|
|
115
142
|
let localDescriptorItems = null;
|
|
116
143
|
if (nameToIdMapDescriptorNode.localDescriptorsOffsetIndexIdentifier.toNumber() !=
|
|
@@ -270,7 +297,7 @@ class PSTFile {
|
|
|
270
297
|
* @memberof PSTFile
|
|
271
298
|
*/
|
|
272
299
|
getMessageStore() {
|
|
273
|
-
const messageStoreDescriptor = this.getDescriptorIndexNode(
|
|
300
|
+
const messageStoreDescriptor = this.getDescriptorIndexNode(long_1.default.fromNumber(PSTFile.MESSAGE_STORE_DESCRIPTOR_IDENTIFIER));
|
|
274
301
|
return new PSTMessageStore_class_1.PSTMessageStore(this, messageStoreDescriptor);
|
|
275
302
|
}
|
|
276
303
|
/**
|
|
@@ -279,7 +306,7 @@ class PSTFile {
|
|
|
279
306
|
* @memberof PSTFile
|
|
280
307
|
*/
|
|
281
308
|
getRootFolder() {
|
|
282
|
-
const rootFolderDescriptor = this.getDescriptorIndexNode(
|
|
309
|
+
const rootFolderDescriptor = this.getDescriptorIndexNode(long_1.default.fromValue(PSTFile.ROOT_FOLDER_DESCRIPTOR_IDENTIFIER));
|
|
283
310
|
const output = new PSTFolder_class_1.PSTFolder(this, rootFolderDescriptor);
|
|
284
311
|
return output;
|
|
285
312
|
}
|
|
@@ -322,7 +349,7 @@ class PSTFile {
|
|
|
322
349
|
* @memberof PSTFile
|
|
323
350
|
*/
|
|
324
351
|
extractLEFileOffset(startOffset) {
|
|
325
|
-
let offset =
|
|
352
|
+
let offset = long_1.default.ZERO;
|
|
326
353
|
if (this._pstFileType == PSTFile.PST_TYPE_ANSI) {
|
|
327
354
|
this.seek(startOffset);
|
|
328
355
|
const buffer = Buffer.alloc(4);
|
|
@@ -362,15 +389,15 @@ class PSTFile {
|
|
|
362
389
|
let fileTypeAdjustment;
|
|
363
390
|
// first find the starting point for the offset index
|
|
364
391
|
if (this._pstFileType === PSTFile.PST_TYPE_ANSI) {
|
|
365
|
-
btreeStartOffset = this.extractLEFileOffset(
|
|
392
|
+
btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(196));
|
|
366
393
|
if (descTree) {
|
|
367
|
-
btreeStartOffset = this.extractLEFileOffset(
|
|
394
|
+
btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(188));
|
|
368
395
|
}
|
|
369
396
|
}
|
|
370
397
|
else {
|
|
371
|
-
btreeStartOffset = this.extractLEFileOffset(
|
|
398
|
+
btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(240));
|
|
372
399
|
if (descTree) {
|
|
373
|
-
btreeStartOffset = this.extractLEFileOffset(
|
|
400
|
+
btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(224));
|
|
374
401
|
}
|
|
375
402
|
}
|
|
376
403
|
// okay, what we want to do is navigate the tree until you reach the bottom....
|
|
@@ -553,22 +580,18 @@ class PSTFile {
|
|
|
553
580
|
}
|
|
554
581
|
getPSTDescriptorItems(arg) {
|
|
555
582
|
let inputStream = arg;
|
|
556
|
-
// todo: if (arg instanceof long) {
|
|
557
583
|
if (typeof arg === 'object' && arg.hasOwnProperty('low')) {
|
|
558
584
|
inputStream = this.readLeaf(arg);
|
|
559
585
|
}
|
|
560
|
-
else {
|
|
561
|
-
console.log('getPSTDescriptorItems: not object');
|
|
562
|
-
}
|
|
563
586
|
// make sure the signature is correct
|
|
564
|
-
inputStream.seek(
|
|
587
|
+
inputStream.seek(long_1.default.ZERO);
|
|
565
588
|
const sig = inputStream.read();
|
|
566
589
|
if (sig != 0x2) {
|
|
567
590
|
throw new Error('PSTFile::getPSTDescriptorItems Unable to process descriptor node, bad signature: ' +
|
|
568
591
|
sig);
|
|
569
592
|
}
|
|
570
593
|
const output = new Map();
|
|
571
|
-
const numberOfItems = inputStream.seekAndReadLong(
|
|
594
|
+
const numberOfItems = inputStream.seekAndReadLong(long_1.default.fromValue(2), 2);
|
|
572
595
|
let offset;
|
|
573
596
|
if (this._pstFileType === PSTFile.PST_TYPE_ANSI) {
|
|
574
597
|
offset = 4;
|
|
@@ -577,7 +600,7 @@ class PSTFile {
|
|
|
577
600
|
offset = 8;
|
|
578
601
|
}
|
|
579
602
|
const data = Buffer.alloc(inputStream.length.toNumber());
|
|
580
|
-
inputStream.seek(
|
|
603
|
+
inputStream.seek(long_1.default.ZERO);
|
|
581
604
|
inputStream.readCompletely(data);
|
|
582
605
|
for (let x = 0; x < numberOfItems.toNumber(); x++) {
|
|
583
606
|
const item = new PSTDescriptorItem_class_1.PSTDescriptorItem(data, offset, this);
|
|
@@ -599,12 +622,12 @@ class PSTFile {
|
|
|
599
622
|
*/
|
|
600
623
|
getChildDescriptorTree() {
|
|
601
624
|
if (!this.childrenDescriptorTree) {
|
|
602
|
-
let btreeStartOffset =
|
|
625
|
+
let btreeStartOffset = long_1.default.ZERO;
|
|
603
626
|
if (this._pstFileType === PSTFile.PST_TYPE_ANSI) {
|
|
604
|
-
btreeStartOffset = this.extractLEFileOffset(
|
|
627
|
+
btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(188));
|
|
605
628
|
}
|
|
606
629
|
else {
|
|
607
|
-
btreeStartOffset = this.extractLEFileOffset(
|
|
630
|
+
btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(224));
|
|
608
631
|
}
|
|
609
632
|
this.childrenDescriptorTree = new Map();
|
|
610
633
|
this.processDescriptorBTree(btreeStartOffset);
|
package/dist/PSTFolder.class.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.PSTFolder = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
4
9
|
const OutlookProperties_1 = require("./OutlookProperties");
|
|
5
10
|
const PSTNodeInputStream_class_1 = require("./PSTNodeInputStream.class");
|
|
6
11
|
const PSTTable7C_class_1 = require("./PSTTable7C.class");
|
|
@@ -51,7 +56,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
|
|
|
51
56
|
for (const itemMap of itemMapSet) {
|
|
52
57
|
const item = itemMap.get(26610);
|
|
53
58
|
if (item) {
|
|
54
|
-
output.push(PSTUtil_class_1.PSTUtil.detectAndLoadPSTObject(this.pstFile,
|
|
59
|
+
output.push(PSTUtil_class_1.PSTUtil.detectAndLoadPSTObject(this.pstFile, long_1.default.fromNumber(item.entryValueReference)));
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
62
|
}
|
|
@@ -78,7 +83,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
|
|
|
78
83
|
if (!this.descriptorIndexNode) {
|
|
79
84
|
throw new Error('PSTFolder::initSubfoldersTable descriptorIndexNode is null');
|
|
80
85
|
}
|
|
81
|
-
const folderDescriptorIndex =
|
|
86
|
+
const folderDescriptorIndex = long_1.default.fromValue(this.descriptorIndexNode.descriptorIdentifier + 11);
|
|
82
87
|
try {
|
|
83
88
|
const folderDescriptor = this.pstFile.getDescriptorIndexNode(folderDescriptorIndex);
|
|
84
89
|
let tmp = undefined;
|
|
@@ -111,7 +116,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
|
|
|
111
116
|
}
|
|
112
117
|
try {
|
|
113
118
|
const folderDescriptorIndex = this.descriptorIndexNode.descriptorIdentifier + 12;
|
|
114
|
-
const folderDescriptor = this.pstFile.getDescriptorIndexNode(
|
|
119
|
+
const folderDescriptor = this.pstFile.getDescriptorIndexNode(long_1.default.fromNumber(folderDescriptorIndex));
|
|
115
120
|
let tmp = undefined;
|
|
116
121
|
if (folderDescriptor.localDescriptorsOffsetIndexIdentifier.greaterThan(0)) {
|
|
117
122
|
tmp = this.pstFile.getPSTDescriptorItems(folderDescriptor.localDescriptorsOffsetIndexIdentifier);
|
|
@@ -158,7 +163,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
|
|
|
158
163
|
// no more!
|
|
159
164
|
return null;
|
|
160
165
|
}
|
|
161
|
-
const childDescriptor = this.pstFile.getDescriptorIndexNode(
|
|
166
|
+
const childDescriptor = this.pstFile.getDescriptorIndexNode(long_1.default.fromNumber(emailRow.entryValueReference));
|
|
162
167
|
const child = PSTUtil_class_1.PSTUtil.detectAndLoadPSTObject(this.pstFile, childDescriptor);
|
|
163
168
|
this.currentEmailIndex++;
|
|
164
169
|
return child;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
2
|
+
import Long from 'long';
|
|
3
3
|
import { DescriptorIndexNode } from './DescriptorIndexNode.class';
|
|
4
4
|
import { PSTDescriptorItem } from './PSTDescriptorItem.class';
|
|
5
5
|
import { PSTFile } from './PSTFile.class';
|
|
@@ -531,7 +531,7 @@ export declare class PSTMessage extends PSTObject {
|
|
|
531
531
|
* @type {long}
|
|
532
532
|
* @memberof PSTMessage
|
|
533
533
|
*/
|
|
534
|
-
get messageSize():
|
|
534
|
+
get messageSize(): Long;
|
|
535
535
|
/**
|
|
536
536
|
* A number associated with an item in a message store.
|
|
537
537
|
* https://msdn.microsoft.com/en-us/library/office/cc815718.aspx
|
package/dist/PSTMessage.class.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
exports.PSTMessage = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
4
9
|
const OutlookProperties_1 = require("./OutlookProperties");
|
|
5
10
|
const PSTFile_class_1 = require("./PSTFile.class");
|
|
6
11
|
const PSTNodeInputStream_class_1 = require("./PSTNodeInputStream.class");
|
|
@@ -162,7 +167,7 @@ class PSTMessage extends PSTObject_class_1.PSTObject {
|
|
|
162
167
|
const item = this.localDescriptorItems.get(recipientTableKey);
|
|
163
168
|
let descriptorItems = new Map();
|
|
164
169
|
if (item && item.subNodeOffsetIndexIdentifier > 0) {
|
|
165
|
-
descriptorItems = this.pstFile.getPSTDescriptorItems(
|
|
170
|
+
descriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromNumber(item.subNodeOffsetIndexIdentifier));
|
|
166
171
|
}
|
|
167
172
|
this.recipientTable = new PSTTable7C_class_1.PSTTable7C(new PSTNodeInputStream_class_1.PSTNodeInputStream(this.pstFile, item), descriptorItems);
|
|
168
173
|
}
|
|
@@ -394,7 +399,7 @@ class PSTMessage extends PSTObject_class_1.PSTObject {
|
|
|
394
399
|
const item = this.localDescriptorItems.get(attachmentTableKey);
|
|
395
400
|
let descriptorItems = new Map();
|
|
396
401
|
if (item && item.subNodeOffsetIndexIdentifier > 0) {
|
|
397
|
-
descriptorItems = this.pstFile.getPSTDescriptorItems(
|
|
402
|
+
descriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromValue(item.subNodeOffsetIndexIdentifier));
|
|
398
403
|
}
|
|
399
404
|
this.attachmentTable = new PSTTable7C_class_1.PSTTable7C(new PSTNodeInputStream_class_1.PSTNodeInputStream(this.pstFile, item), descriptorItems);
|
|
400
405
|
}
|
|
@@ -462,7 +467,7 @@ class PSTMessage extends PSTObject_class_1.PSTObject {
|
|
|
462
467
|
// so no need to pass it...
|
|
463
468
|
let attachmentDescriptorItems = new Map();
|
|
464
469
|
if (descriptorItem.subNodeOffsetIndexIdentifier > 0) {
|
|
465
|
-
attachmentDescriptorItems = this.pstFile.getPSTDescriptorItems(
|
|
470
|
+
attachmentDescriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromNumber(descriptorItem.subNodeOffsetIndexIdentifier));
|
|
466
471
|
}
|
|
467
472
|
return new PSTAttachment_class_1.PSTAttachment(this.pstFile, attachmentDetailsTable, attachmentDescriptorItems);
|
|
468
473
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
2
|
+
import Long from 'long';
|
|
3
3
|
import { PSTDescriptorItem } from './PSTDescriptorItem.class';
|
|
4
4
|
import { OffsetIndexItem } from './OffsetIndexItem.class';
|
|
5
5
|
import { PSTFile } from './PSTFile.class';
|
|
@@ -15,7 +15,7 @@ export declare class PSTNodeInputStream {
|
|
|
15
15
|
private _pstFile;
|
|
16
16
|
get pstFile(): PSTFile;
|
|
17
17
|
private _length;
|
|
18
|
-
get length():
|
|
18
|
+
get length(): Long;
|
|
19
19
|
private _encrypted;
|
|
20
20
|
get encrypted(): boolean;
|
|
21
21
|
/**
|
|
@@ -98,14 +98,14 @@ export declare class PSTNodeInputStream {
|
|
|
98
98
|
* @returns {long[]}
|
|
99
99
|
* @memberof PSTNodeInputStream
|
|
100
100
|
*/
|
|
101
|
-
getBlockOffsets():
|
|
101
|
+
getBlockOffsets(): Long[];
|
|
102
102
|
/**
|
|
103
103
|
* Seek within item.
|
|
104
104
|
* @param {long} location
|
|
105
105
|
* @returns
|
|
106
106
|
* @memberof PSTNodeInputStream
|
|
107
107
|
*/
|
|
108
|
-
seek(location:
|
|
108
|
+
seek(location: Long): void;
|
|
109
109
|
/**
|
|
110
110
|
* Seek within stream and read a long.
|
|
111
111
|
* @param {long} location
|
|
@@ -113,7 +113,7 @@ export declare class PSTNodeInputStream {
|
|
|
113
113
|
* @returns {long}
|
|
114
114
|
* @memberof PSTNodeInputStream
|
|
115
115
|
*/
|
|
116
|
-
seekAndReadLong(location:
|
|
116
|
+
seekAndReadLong(location: Long, bytes: number): Long;
|
|
117
117
|
/**
|
|
118
118
|
* JSON the object, large buffers excluded.
|
|
119
119
|
* @returns {*}
|