pst-extractor 1.9.0 → 1.11.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.
Files changed (59) hide show
  1. package/dist/ColumnDescriptor.class.d.ts +26 -26
  2. package/dist/ColumnDescriptor.class.js +51 -51
  3. package/dist/DescriptorIndexNode.class.d.ts +25 -26
  4. package/dist/DescriptorIndexNode.class.js +53 -53
  5. package/dist/LZFu.class.d.ts +11 -12
  6. package/dist/LZFu.class.js +95 -95
  7. package/dist/NodeInfo.class.d.ts +33 -33
  8. package/dist/NodeInfo.class.js +52 -52
  9. package/dist/NodeMap.class.d.ts +35 -35
  10. package/dist/NodeMap.class.js +86 -86
  11. package/dist/OffsetIndexItem.class.d.ts +23 -24
  12. package/dist/OffsetIndexItem.class.js +45 -45
  13. package/dist/OutlookProperties.d.ts +275 -275
  14. package/dist/OutlookProperties.js +281 -281
  15. package/dist/PSTActivity.class.d.ts +103 -103
  16. package/dist/PSTActivity.class.js +144 -144
  17. package/dist/PSTAppointment.class.d.ts +270 -271
  18. package/dist/PSTAppointment.class.js +376 -376
  19. package/dist/PSTAttachment.class.d.ts +172 -172
  20. package/dist/PSTAttachment.class.js +317 -317
  21. package/dist/PSTContact.class.d.ts +884 -884
  22. package/dist/PSTContact.class.js +1227 -1227
  23. package/dist/PSTDescriptorItem.class.d.ts +45 -46
  24. package/dist/PSTDescriptorItem.class.js +99 -99
  25. package/dist/PSTFile.class.d.ts +215 -216
  26. package/dist/PSTFile.class.js +830 -818
  27. package/dist/PSTFolder.class.d.ts +129 -129
  28. package/dist/PSTFolder.class.js +318 -310
  29. package/dist/PSTMessage.class.d.ts +788 -789
  30. package/dist/PSTMessage.class.js +1321 -1321
  31. package/dist/PSTMessageStore.class.d.ts +13 -13
  32. package/dist/PSTMessageStore.class.js +17 -17
  33. package/dist/PSTNodeInputStream.class.d.ts +122 -123
  34. package/dist/PSTNodeInputStream.class.js +524 -514
  35. package/dist/PSTObject.class.d.ts +133 -134
  36. package/dist/PSTObject.class.js +326 -326
  37. package/dist/PSTRecipient.class.d.ts +65 -65
  38. package/dist/PSTRecipient.class.js +103 -103
  39. package/dist/PSTTable.class.d.ts +52 -52
  40. package/dist/PSTTable.class.js +175 -175
  41. package/dist/PSTTable7C.class.d.ts +45 -45
  42. package/dist/PSTTable7C.class.js +282 -281
  43. package/dist/PSTTableBC.class.d.ts +31 -31
  44. package/dist/PSTTableBC.class.js +111 -111
  45. package/dist/PSTTableItem.class.d.ts +47 -48
  46. package/dist/PSTTableItem.class.js +124 -124
  47. package/dist/PSTTask.class.d.ts +146 -146
  48. package/dist/PSTTask.class.js +205 -205
  49. package/dist/PSTUtil.class.d.ts +134 -135
  50. package/dist/PSTUtil.class.js +795 -795
  51. package/dist/RecurrencePattern.class.d.ts +49 -50
  52. package/dist/RecurrencePattern.class.js +120 -120
  53. package/dist/index.d.ts +6 -6
  54. package/dist/index.js +15 -15
  55. package/example/package.json +6 -6
  56. package/example/yarn.lock +120 -67
  57. package/junit.xml +68 -68
  58. package/package.json +26 -26
  59. package/readme.md +3 -3
@@ -1,52 +1,52 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodeInfo = void 0;
4
- class NodeInfo {
5
- /**
6
- * Creates an instance of NodeInfo, part of the node table.
7
- * @param {number} start
8
- * @param {number} end
9
- * @param {PSTNodeInputStream} pstNodeInputStream
10
- * @memberof NodeInfo
11
- */
12
- constructor(start, end, pstNodeInputStream) {
13
- if (start > end) {
14
- throw new Error(`NodeInfo:: constructor Invalid NodeInfo parameters: start ${start} is greater than end ${end}`);
15
- }
16
- this._startOffset = start;
17
- this._endOffset = end;
18
- this._pstNodeInputStream = pstNodeInputStream;
19
- }
20
- get startOffset() {
21
- return this._startOffset;
22
- }
23
- get endOffset() {
24
- return this._endOffset;
25
- }
26
- length() {
27
- return this.endOffset - this.startOffset;
28
- }
29
- get pstNodeInputStream() {
30
- return this._pstNodeInputStream;
31
- }
32
- /**
33
- * Seek to position in node input stream and read a long
34
- * @param {long} offset
35
- * @param {number} length
36
- * @returns {long}
37
- * @memberof NodeInfo
38
- */
39
- seekAndReadLong(offset, length) {
40
- return this.pstNodeInputStream.seekAndReadLong(offset.add(this.startOffset), length);
41
- }
42
- /**
43
- * JSON stringify the object properties.
44
- * @returns {string}
45
- * @memberof NodeInfo
46
- */
47
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
- toJSON() {
49
- return this;
50
- }
51
- }
52
- exports.NodeInfo = NodeInfo;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeInfo = void 0;
4
+ class NodeInfo {
5
+ get startOffset() {
6
+ return this._startOffset;
7
+ }
8
+ get endOffset() {
9
+ return this._endOffset;
10
+ }
11
+ length() {
12
+ return this.endOffset - this.startOffset;
13
+ }
14
+ get pstNodeInputStream() {
15
+ return this._pstNodeInputStream;
16
+ }
17
+ /**
18
+ * Creates an instance of NodeInfo, part of the node table.
19
+ * @param {number} start
20
+ * @param {number} end
21
+ * @param {PSTNodeInputStream} pstNodeInputStream
22
+ * @memberof NodeInfo
23
+ */
24
+ constructor(start, end, pstNodeInputStream) {
25
+ if (start > end) {
26
+ throw new Error(`NodeInfo:: constructor Invalid NodeInfo parameters: start ${start} is greater than end ${end}`);
27
+ }
28
+ this._startOffset = start;
29
+ this._endOffset = end;
30
+ this._pstNodeInputStream = pstNodeInputStream;
31
+ }
32
+ /**
33
+ * Seek to position in node input stream and read a long
34
+ * @param {long} offset
35
+ * @param {number} length
36
+ * @returns {long}
37
+ * @memberof NodeInfo
38
+ */
39
+ seekAndReadLong(offset, length) {
40
+ return this.pstNodeInputStream.seekAndReadLong(offset.add(this.startOffset), length);
41
+ }
42
+ /**
43
+ * JSON stringify the object properties.
44
+ * @returns {string}
45
+ * @memberof NodeInfo
46
+ */
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ toJSON() {
49
+ return this;
50
+ }
51
+ }
52
+ exports.NodeInfo = NodeInfo;
@@ -1,35 +1,35 @@
1
- import Long from 'long';
2
- /**
3
- * Stores node names (both alpha and numeric) in node maps for quick lookup.
4
- * @export
5
- * @class NodeMap
6
- */
7
- export declare class NodeMap {
8
- private nameToId;
9
- private idToNumericName;
10
- private idToStringName;
11
- /**
12
- * Set a node into the map.
13
- * @param {*} key
14
- * @param {number} propId
15
- * @param {number} [idx]
16
- * @memberof NodeMap
17
- */
18
- setId(key: any, propId: number, idx?: number): void;
19
- /**
20
- * Get a node from the map.
21
- * @param {*} key
22
- * @param {number} [idx]
23
- * @returns {number}
24
- * @memberof NodeMap
25
- */
26
- getId(key: any, idx?: number): number;
27
- /**
28
- * Get a node from the map.
29
- * @param {number} propId
30
- * @returns {long}
31
- * @memberof NodeMap
32
- */
33
- getNumericName(propId: number): Long | undefined;
34
- private transformKey;
35
- }
1
+ import Long from 'long';
2
+ /**
3
+ * Stores node names (both alpha and numeric) in node maps for quick lookup.
4
+ * @export
5
+ * @class NodeMap
6
+ */
7
+ export declare class NodeMap {
8
+ private nameToId;
9
+ private idToNumericName;
10
+ private idToStringName;
11
+ /**
12
+ * Set a node into the map.
13
+ * @param {*} key
14
+ * @param {number} propId
15
+ * @param {number} [idx]
16
+ * @memberof NodeMap
17
+ */
18
+ setId(key: any, propId: number, idx?: number): void;
19
+ /**
20
+ * Get a node from the map.
21
+ * @param {*} key
22
+ * @param {number} [idx]
23
+ * @returns {number}
24
+ * @memberof NodeMap
25
+ */
26
+ getId(key: any, idx?: number): number;
27
+ /**
28
+ * Get a node from the map.
29
+ * @param {number} propId
30
+ * @returns {long}
31
+ * @memberof NodeMap
32
+ */
33
+ getNumericName(propId: number): Long | undefined;
34
+ private transformKey;
35
+ }
@@ -1,86 +1,86 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NodeMap = void 0;
7
- /* eslint-disable @typescript-eslint/no-explicit-any */
8
- const long_1 = __importDefault(require("long"));
9
- /**
10
- * Stores node names (both alpha and numeric) in node maps for quick lookup.
11
- * @export
12
- * @class NodeMap
13
- */
14
- class NodeMap {
15
- constructor() {
16
- this.nameToId = new Map();
17
- this.idToNumericName = new Map();
18
- this.idToStringName = new Map();
19
- }
20
- /**
21
- * Set a node into the map.
22
- * @param {*} key
23
- * @param {number} propId
24
- * @param {number} [idx]
25
- * @memberof NodeMap
26
- */
27
- setId(key, propId, idx) {
28
- if (typeof key === 'number' && idx !== undefined) {
29
- const lkey = this.transformKey(key, idx);
30
- this.nameToId.set(lkey.toString(), propId);
31
- this.idToNumericName.set(propId, lkey);
32
- // console.log('NodeMap::setId: propId = ' + propId + ', lkey = ' + lkey.toString());
33
- }
34
- else if (typeof key === 'string') {
35
- this.nameToId.set(key, propId);
36
- this.idToStringName.set(propId, key);
37
- // console.log('NodeMap::setId: propId = ' + propId + ', key = ' + key);
38
- }
39
- else {
40
- throw new Error('NodeMap::setId bad param type ' + typeof key);
41
- }
42
- }
43
- /**
44
- * Get a node from the map.
45
- * @param {*} key
46
- * @param {number} [idx]
47
- * @returns {number}
48
- * @memberof NodeMap
49
- */
50
- getId(key, idx) {
51
- let id = undefined;
52
- if (typeof key === 'number' && idx) {
53
- id = this.nameToId.get(this.transformKey(key, idx).toString());
54
- }
55
- else if (typeof key === 'string') {
56
- id = this.nameToId.get(key);
57
- }
58
- else {
59
- throw new Error('NodeMap::getId bad param type ' + typeof key);
60
- }
61
- if (!id) {
62
- return -1;
63
- }
64
- return id;
65
- }
66
- /**
67
- * Get a node from the map.
68
- * @param {number} propId
69
- * @returns {long}
70
- * @memberof NodeMap
71
- */
72
- getNumericName(propId) {
73
- const lkey = this.idToNumericName.get(propId);
74
- if (!lkey) {
75
- // console.log("NodeMap::getNumericName Name to Id mapping not found, propId = " + propId);
76
- }
77
- return lkey;
78
- }
79
- transformKey(key, idx) {
80
- let lidx = long_1.default.fromNumber(idx);
81
- lidx = lidx.shiftLeft(32);
82
- lidx = lidx.or(key);
83
- return lidx;
84
- }
85
- }
86
- exports.NodeMap = NodeMap;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NodeMap = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const long_1 = __importDefault(require("long"));
9
+ /**
10
+ * Stores node names (both alpha and numeric) in node maps for quick lookup.
11
+ * @export
12
+ * @class NodeMap
13
+ */
14
+ class NodeMap {
15
+ constructor() {
16
+ this.nameToId = new Map();
17
+ this.idToNumericName = new Map();
18
+ this.idToStringName = new Map();
19
+ }
20
+ /**
21
+ * Set a node into the map.
22
+ * @param {*} key
23
+ * @param {number} propId
24
+ * @param {number} [idx]
25
+ * @memberof NodeMap
26
+ */
27
+ setId(key, propId, idx) {
28
+ if (typeof key === 'number' && idx !== undefined) {
29
+ const lkey = this.transformKey(key, idx);
30
+ this.nameToId.set(lkey.toString(), propId);
31
+ this.idToNumericName.set(propId, lkey);
32
+ // console.log('NodeMap::setId: propId = ' + propId + ', lkey = ' + lkey.toString());
33
+ }
34
+ else if (typeof key === 'string') {
35
+ this.nameToId.set(key, propId);
36
+ this.idToStringName.set(propId, key);
37
+ // console.log('NodeMap::setId: propId = ' + propId + ', key = ' + key);
38
+ }
39
+ else {
40
+ throw new Error('NodeMap::setId bad param type ' + typeof key);
41
+ }
42
+ }
43
+ /**
44
+ * Get a node from the map.
45
+ * @param {*} key
46
+ * @param {number} [idx]
47
+ * @returns {number}
48
+ * @memberof NodeMap
49
+ */
50
+ getId(key, idx) {
51
+ let id = undefined;
52
+ if (typeof key === 'number' && idx) {
53
+ id = this.nameToId.get(this.transformKey(key, idx).toString());
54
+ }
55
+ else if (typeof key === 'string') {
56
+ id = this.nameToId.get(key);
57
+ }
58
+ else {
59
+ throw new Error('NodeMap::getId bad param type ' + typeof key);
60
+ }
61
+ if (!id) {
62
+ return -1;
63
+ }
64
+ return id;
65
+ }
66
+ /**
67
+ * Get a node from the map.
68
+ * @param {number} propId
69
+ * @returns {long}
70
+ * @memberof NodeMap
71
+ */
72
+ getNumericName(propId) {
73
+ const lkey = this.idToNumericName.get(propId);
74
+ if (!lkey) {
75
+ // console.log("NodeMap::getNumericName Name to Id mapping not found, propId = " + propId);
76
+ }
77
+ return lkey;
78
+ }
79
+ transformKey(key, idx) {
80
+ let lidx = long_1.default.fromNumber(idx);
81
+ lidx = lidx.shiftLeft(32);
82
+ lidx = lidx.or(key);
83
+ return lidx;
84
+ }
85
+ }
86
+ exports.NodeMap = NodeMap;
@@ -1,24 +1,23 @@
1
- /// <reference types="node" />
2
- import Long from 'long';
3
- export declare class OffsetIndexItem {
4
- private _indexIdentifier;
5
- get indexIdentifier(): Long;
6
- private _fileOffset;
7
- get fileOffset(): Long;
8
- private _size;
9
- get size(): number;
10
- private cRef;
11
- /**
12
- * Creates an instance of OffsetIndexItem, part of the node table.
13
- * @param {Buffer} data
14
- * @param {number} pstFileType
15
- * @memberof OffsetIndexItem
16
- */
17
- constructor(data: Buffer, pstFileType: number);
18
- /**
19
- * JSON stringify the object properties.
20
- * @returns {string}
21
- * @memberof OffsetIndexItem
22
- */
23
- toJSON(): any;
24
- }
1
+ import Long from 'long';
2
+ export declare class OffsetIndexItem {
3
+ private _indexIdentifier;
4
+ get indexIdentifier(): Long;
5
+ private _fileOffset;
6
+ get fileOffset(): Long;
7
+ private _size;
8
+ get size(): number;
9
+ private cRef;
10
+ /**
11
+ * Creates an instance of OffsetIndexItem, part of the node table.
12
+ * @param {Buffer} data
13
+ * @param {number} pstFileType
14
+ * @memberof OffsetIndexItem
15
+ */
16
+ constructor(data: Buffer, pstFileType: number);
17
+ /**
18
+ * JSON stringify the object properties.
19
+ * @returns {string}
20
+ * @memberof OffsetIndexItem
21
+ */
22
+ toJSON(): any;
23
+ }
@@ -1,45 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OffsetIndexItem = void 0;
4
- const PSTFile_class_1 = require("./PSTFile.class");
5
- const PSTUtil_class_1 = require("./PSTUtil.class");
6
- class OffsetIndexItem {
7
- /**
8
- * Creates an instance of OffsetIndexItem, part of the node table.
9
- * @param {Buffer} data
10
- * @param {number} pstFileType
11
- * @memberof OffsetIndexItem
12
- */
13
- constructor(data, pstFileType) {
14
- if (pstFileType == PSTFile_class_1.PSTFile.PST_TYPE_ANSI) {
15
- this._indexIdentifier = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 0, 4);
16
- this._fileOffset = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 4, 8);
17
- this._size = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 8, 10).toNumber();
18
- this.cRef = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 10, 12);
19
- }
20
- else {
21
- this._indexIdentifier = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 0, 8);
22
- this._fileOffset = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 8, 16);
23
- this._size = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 16, 18).toNumber();
24
- this.cRef = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 16, 18);
25
- }
26
- }
27
- get indexIdentifier() {
28
- return this._indexIdentifier;
29
- }
30
- get fileOffset() {
31
- return this._fileOffset;
32
- }
33
- get size() {
34
- return this._size;
35
- }
36
- /**
37
- * JSON stringify the object properties.
38
- * @returns {string}
39
- * @memberof OffsetIndexItem
40
- */
41
- toJSON() {
42
- return this;
43
- }
44
- }
45
- exports.OffsetIndexItem = OffsetIndexItem;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OffsetIndexItem = void 0;
4
+ const PSTFile_class_1 = require("./PSTFile.class");
5
+ const PSTUtil_class_1 = require("./PSTUtil.class");
6
+ class OffsetIndexItem {
7
+ get indexIdentifier() {
8
+ return this._indexIdentifier;
9
+ }
10
+ get fileOffset() {
11
+ return this._fileOffset;
12
+ }
13
+ get size() {
14
+ return this._size;
15
+ }
16
+ /**
17
+ * Creates an instance of OffsetIndexItem, part of the node table.
18
+ * @param {Buffer} data
19
+ * @param {number} pstFileType
20
+ * @memberof OffsetIndexItem
21
+ */
22
+ constructor(data, pstFileType) {
23
+ if (pstFileType == PSTFile_class_1.PSTFile.PST_TYPE_ANSI) {
24
+ this._indexIdentifier = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 0, 4);
25
+ this._fileOffset = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 4, 8);
26
+ this._size = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 8, 10).toNumber();
27
+ this.cRef = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 10, 12);
28
+ }
29
+ else {
30
+ this._indexIdentifier = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 0, 8);
31
+ this._fileOffset = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 8, 16);
32
+ this._size = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 16, 18).toNumber();
33
+ this.cRef = PSTUtil_class_1.PSTUtil.convertLittleEndianBytesToLong(data, 16, 18);
34
+ }
35
+ }
36
+ /**
37
+ * JSON stringify the object properties.
38
+ * @returns {string}
39
+ * @memberof OffsetIndexItem
40
+ */
41
+ toJSON() {
42
+ return this;
43
+ }
44
+ }
45
+ exports.OffsetIndexItem = OffsetIndexItem;