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.
Files changed (56) hide show
  1. package/dist/ColumnDescriptor.class.js +9 -4
  2. package/dist/DescriptorIndexNode.class.d.ts +3 -3
  3. package/dist/DescriptorIndexNode.class.js +1 -0
  4. package/dist/LZFu.class.js +2 -0
  5. package/dist/NodeInfo.class.d.ts +2 -2
  6. package/dist/NodeInfo.class.js +2 -0
  7. package/dist/NodeMap.class.d.ts +2 -2
  8. package/dist/NodeMap.class.js +7 -2
  9. package/dist/OffsetIndexItem.class.d.ts +3 -3
  10. package/dist/OffsetIndexItem.class.js +1 -0
  11. package/dist/OutlookProperties.d.ts +2 -0
  12. package/dist/OutlookProperties.js +3 -0
  13. package/dist/PSTActivity.class.js +1 -0
  14. package/dist/PSTAppointment.class.js +1 -0
  15. package/dist/PSTAttachment.class.js +7 -2
  16. package/dist/PSTContact.class.js +1 -0
  17. package/dist/PSTDescriptorItem.class.js +9 -4
  18. package/dist/PSTFile.class.d.ts +8 -8
  19. package/dist/PSTFile.class.js +43 -20
  20. package/dist/PSTFolder.class.js +10 -5
  21. package/dist/PSTMessage.class.d.ts +2 -2
  22. package/dist/PSTMessage.class.js +9 -4
  23. package/dist/PSTMessageStore.class.js +1 -0
  24. package/dist/PSTNodeInputStream.class.d.ts +5 -5
  25. package/dist/PSTNodeInputStream.class.js +52 -25
  26. package/dist/PSTObject.class.d.ts +3 -3
  27. package/dist/PSTObject.class.js +11 -6
  28. package/dist/PSTRecipient.class.js +2 -0
  29. package/dist/PSTTable.class.d.ts +2 -2
  30. package/dist/PSTTable.class.js +16 -11
  31. package/dist/PSTTable7C.class.js +24 -19
  32. package/dist/PSTTableBC.class.js +9 -4
  33. package/dist/PSTTableItem.class.d.ts +4 -4
  34. package/dist/PSTTableItem.class.js +7 -2
  35. package/dist/PSTTask.class.d.ts +13 -0
  36. package/dist/PSTTask.class.js +19 -0
  37. package/dist/PSTUtil.class.d.ts +5 -5
  38. package/dist/PSTUtil.class.js +16 -7
  39. package/dist/RecurrencePattern.class.d.ts +50 -0
  40. package/dist/RecurrencePattern.class.js +120 -0
  41. package/dist/index.js +7 -6
  42. package/example/package.json +8 -8
  43. package/example/test-min.ts +32 -7
  44. package/example/{test-mem.ts → test.ts} +43 -32
  45. package/example/testdata/attachments/Clinometer Usage.pdf +0 -0
  46. package/example/testdata/attachments/primoz-roglic-of-slovenia-and-team-jumbo-visma-red-leader-news-photo-1628610563.jpg +0 -0
  47. package/example/testdata/attachments/text.txt +1 -0
  48. package/example/testdata/output.txt +278 -0
  49. package/example/testdata/outputBody.txt +3404 -0
  50. package/example/testdata/pstextractortest@outlook.com.ost +0 -0
  51. package/example/testdata/pstextractortestpdf@outlook.com.ost +0 -0
  52. package/example/yarn.lock +85 -45
  53. package/junit.xml +37 -31
  54. package/package.json +28 -27
  55. package/readme.md +13 -6
  56. package/example/test-max.ts +0 -247
@@ -1,7 +1,35 @@
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
- const long = require("long");
4
- const zlib = require("zlib");
29
+ exports.PSTNodeInputStream = void 0;
30
+ /* eslint-disable @typescript-eslint/no-explicit-any */
31
+ const long_1 = __importDefault(require("long"));
32
+ const zlib = __importStar(require("zlib"));
5
33
  const PSTDescriptorItem_class_1 = require("./PSTDescriptorItem.class");
6
34
  const PSTUtil_class_1 = require("./PSTUtil.class");
7
35
  const OffsetIndexItem_class_1 = require("./OffsetIndexItem.class");
@@ -13,8 +41,8 @@ class PSTNodeInputStream {
13
41
  this.currentBlock = 0;
14
42
  this.allData = null;
15
43
  this.isZlib = false;
16
- this._currentLocation = long.ZERO;
17
- this._length = long.ZERO;
44
+ this._currentLocation = long_1.default.ZERO;
45
+ this._length = long_1.default.ZERO;
18
46
  this._encrypted = false;
19
47
  this.totalLoopCount = 0;
20
48
  this._pstFile = pstFile;
@@ -27,11 +55,11 @@ class PSTNodeInputStream {
27
55
  this._encrypted =
28
56
  pstFile.encryptionType == PSTFile_class_1.PSTFile.ENCRYPTION_TYPE_COMPRESSIBLE;
29
57
  // we want to get the first block of data and see what we are dealing with
30
- this.loadFromOffsetItem(pstFile.getOffsetIndexNode(long.fromNumber(arg.offsetIndexIdentifier)));
58
+ this.loadFromOffsetItem(pstFile.getOffsetIndexNode(long_1.default.fromNumber(arg.offsetIndexIdentifier)));
31
59
  }
32
60
  else if (arg instanceof Buffer) {
33
61
  this.allData = arg;
34
- this._length = long.fromNumber(this.allData.length);
62
+ this._length = long_1.default.fromNumber(this.allData.length);
35
63
  if (encrypted != undefined) {
36
64
  this._encrypted = encrypted;
37
65
  }
@@ -41,7 +69,7 @@ class PSTNodeInputStream {
41
69
  }
42
70
  }
43
71
  this.currentBlock = 0;
44
- this.currentLocation = long.ZERO;
72
+ this.currentLocation = long_1.default.ZERO;
45
73
  this.detectZlib();
46
74
  }
47
75
  get currentLocation() {
@@ -83,19 +111,18 @@ class PSTNodeInputStream {
83
111
  // and replace our contents with that. firstly, if we have blocks, use that as the length
84
112
  let outputStream = null;
85
113
  if (multiStreams) {
86
- debugger;
87
- // Log.debug1('list of all index items')
114
+ // debugger
115
+ // console.log('list of all index items')
88
116
  // for (let i of this.indexItems) {
89
- // Log.debug1(i.toJSON());
117
+ // console.log(i.toJSON());
90
118
  // }
91
- // Log.debug1('----------------------')
92
- // TODO - try this with different types of attachments, includin PDF
93
- // may be issue with zlib and PDF files. also, mutiple attachments.
119
+ // console.log('----------------------')
94
120
  for (const i of this.indexItems) {
95
121
  const inData = Buffer.alloc(i.size);
96
122
  this.pstFile.seek(i.fileOffset);
97
123
  this.pstFile.readCompletely(inData);
98
- outputStream = zlib.unzipSync(inData);
124
+ const buf = zlib.unzipSync(inData);
125
+ outputStream = outputStream ? Buffer.concat([outputStream, buf]) : buf;
99
126
  }
100
127
  this.indexItems = [];
101
128
  this.skipPoints = [];
@@ -109,18 +136,18 @@ class PSTNodeInputStream {
109
136
  }
110
137
  }
111
138
  const inData = Buffer.alloc(compressedLength);
112
- this.seek(long.ZERO);
139
+ this.seek(long_1.default.ZERO);
113
140
  this.readCompletely(inData);
114
141
  outputStream = zlib.unzipSync(inData);
115
142
  }
116
143
  this.allData = outputStream;
117
- this.currentLocation = long.ZERO;
144
+ this.currentLocation = long_1.default.ZERO;
118
145
  this.currentBlock = 0;
119
146
  this._length = this.allData
120
- ? long.fromNumber(this.allData.length)
121
- : long.ZERO;
147
+ ? long_1.default.fromNumber(this.allData.length)
148
+ : long_1.default.ZERO;
122
149
  }
123
- this.seek(long.ZERO);
150
+ this.seek(long_1.default.ZERO);
124
151
  }
125
152
  catch (err) {
126
153
  console.error('PSTNodeInputStream::detectZlib Unable to decompress reportedly compressed block\n' +
@@ -159,7 +186,7 @@ class PSTNodeInputStream {
159
186
  this._encrypted = false;
160
187
  }
161
188
  this.allData = data;
162
- this._length = long.fromValue(this.allData.length);
189
+ this._length = long_1.default.fromValue(this.allData.length);
163
190
  }
164
191
  /**
165
192
  * Get block skip points in file.
@@ -201,7 +228,7 @@ class PSTNodeInputStream {
201
228
  // get the details in this block and add it to the list
202
229
  const offsetItem = this.pstFile.getOffsetIndexNode(bid);
203
230
  this.indexItems.push(offsetItem);
204
- this.skipPoints.push(long.fromValue(this.currentLocation));
231
+ this.skipPoints.push(long_1.default.fromValue(this.currentLocation));
205
232
  this.currentLocation = this.currentLocation.add(offsetItem.size);
206
233
  offset += arraySize;
207
234
  }
@@ -395,7 +422,7 @@ class PSTNodeInputStream {
395
422
  */
396
423
  reset() {
397
424
  this.currentBlock = 0;
398
- this._currentLocation = long.ZERO;
425
+ this._currentLocation = long_1.default.ZERO;
399
426
  }
400
427
  /**
401
428
  * Get the offsets (block positions) used in the array
@@ -405,12 +432,12 @@ class PSTNodeInputStream {
405
432
  getBlockOffsets() {
406
433
  const output = [];
407
434
  if (this.skipPoints.length === 0) {
408
- const len = long.fromValue(this.length);
435
+ const len = long_1.default.fromValue(this.length);
409
436
  output.push(len);
410
437
  }
411
438
  else {
412
439
  for (let x = 0; x < this.skipPoints.length; x++) {
413
- const size = long.fromValue(this.indexItems[x].size);
440
+ const size = long_1.default.fromValue(this.indexItems[x].size);
414
441
  output.push(this.skipPoints[x].add(size));
415
442
  }
416
443
  }
@@ -435,7 +462,7 @@ class PSTNodeInputStream {
435
462
  return;
436
463
  }
437
464
  // get us to the right block
438
- let skipPoint = long.ZERO;
465
+ let skipPoint = long_1.default.ZERO;
439
466
  this.currentBlock = 0;
440
467
  if (this.allData == null) {
441
468
  skipPoint = this.skipPoints[this.currentBlock + 1];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import * as long from 'long';
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';
@@ -41,7 +41,7 @@ export declare abstract class PSTObject {
41
41
  * @type {long}
42
42
  * @memberof PSTObject
43
43
  */
44
- get descriptorNodeId(): long;
44
+ get descriptorNodeId(): Long;
45
45
  /**
46
46
  * Get the node type for the descriptor id.
47
47
  * @param {number} [descriptorIdentifier]
@@ -84,7 +84,7 @@ export declare abstract class PSTObject {
84
84
  * @returns {long}
85
85
  * @memberof PSTObject
86
86
  */
87
- protected getLongItem(identifier: number, defaultValue?: long): long;
87
+ protected getLongItem(identifier: number, defaultValue?: Long): Long;
88
88
  /**
89
89
  * Get a string.
90
90
  * @protected
@@ -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
- const long = require("long");
6
+ exports.PSTObject = 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 PSTTableBC_class_1 = require("./PSTTableBC.class");
@@ -37,7 +42,7 @@ class PSTObject {
37
42
  const pstNodeInputStream = new PSTNodeInputStream_class_1.PSTNodeInputStream(this.pstFile, offsetIndexItem);
38
43
  this.pstTableBC = new PSTTableBC_class_1.PSTTableBC(pstNodeInputStream);
39
44
  this.pstTableItems = this.pstTableBC.getItems();
40
- if (descriptorIndexNode.localDescriptorsOffsetIndexIdentifier.notEquals(long.ZERO)) {
45
+ if (descriptorIndexNode.localDescriptorsOffsetIndexIdentifier.notEquals(long_1.default.ZERO)) {
41
46
  this.localDescriptorItems = this.pstFile.getPSTDescriptorItems(descriptorIndexNode.localDescriptorsOffsetIndexIdentifier);
42
47
  }
43
48
  }
@@ -68,10 +73,10 @@ class PSTObject {
68
73
  get descriptorNodeId() {
69
74
  // Prevent null pointer exceptions for embedded messages
70
75
  if (this.descriptorIndexNode != null) {
71
- return long.fromNumber(this.descriptorIndexNode.descriptorIdentifier);
76
+ return long_1.default.fromNumber(this.descriptorIndexNode.descriptorIdentifier);
72
77
  }
73
78
  else {
74
- return long.ZERO;
79
+ return long_1.default.ZERO;
75
80
  }
76
81
  }
77
82
  /**
@@ -163,13 +168,13 @@ class PSTObject {
163
168
  */
164
169
  getLongItem(identifier, defaultValue) {
165
170
  if (defaultValue === undefined) {
166
- defaultValue = long.ZERO;
171
+ defaultValue = long_1.default.ZERO;
167
172
  }
168
173
  if (this.pstTableItems && this.pstTableItems.has(identifier)) {
169
174
  const item = this.pstTableItems.get(identifier);
170
175
  if (item && item.entryValueType == 0x0003) {
171
176
  // we are really just an int
172
- return long.fromNumber(item.entryValueReference);
177
+ return long_1.default.fromNumber(item.entryValueReference);
173
178
  }
174
179
  else if (item && item.entryValueType == 0x0014) {
175
180
  // we are a long
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PSTRecipient = void 0;
4
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
5
  const OutlookProperties_1 = require("./OutlookProperties");
4
6
  const PSTObject_class_1 = require("./PSTObject.class");
5
7
  // Class containing recipient information
@@ -1,4 +1,4 @@
1
- import * as long from 'long';
1
+ import Long from 'long';
2
2
  import { NodeInfo } from './NodeInfo.class';
3
3
  import { PSTNodeInputStream } from './PSTNodeInputStream.class';
4
4
  import { PSTDescriptorItem } from './PSTDescriptorItem.class';
@@ -6,7 +6,7 @@ export declare abstract class PSTTable {
6
6
  protected tableType: string;
7
7
  protected tableTypeByte: number;
8
8
  protected hidUserRoot: number;
9
- protected arrayBlocks: long[];
9
+ protected arrayBlocks: Long[];
10
10
  protected sizeOfItemKey: number;
11
11
  protected sizeOfItemValue: number;
12
12
  protected hidRoot: number;
@@ -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
- const long = require("long");
6
+ exports.PSTTable = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const long_1 = __importDefault(require("long"));
4
9
  const NodeInfo_class_1 = require("./NodeInfo.class");
5
10
  const PSTNodeInputStream_class_1 = require("./PSTNodeInputStream.class");
6
11
  // The PST Table is the workhorse of the whole system.
@@ -26,7 +31,7 @@ class PSTTable {
26
31
  this.arrayBlocks = pstNodeInputStream.getBlockOffsets();
27
32
  // the next two bytes should be the table type (bSig)
28
33
  // 0xEC is HN (Heap-on-Node)
29
- pstNodeInputStream.seek(long.ZERO);
34
+ pstNodeInputStream.seek(long_1.default.ZERO);
30
35
  const headdata = Buffer.alloc(4);
31
36
  pstNodeInputStream.readCompletely(headdata);
32
37
  this.tableTypeByte = headdata[3];
@@ -43,19 +48,19 @@ class PSTTable {
43
48
  headdata[3].toString(16));
44
49
  }
45
50
  this.hidUserRoot = pstNodeInputStream
46
- .seekAndReadLong(long.fromValue(4), 4)
51
+ .seekAndReadLong(long_1.default.fromValue(4), 4)
47
52
  .toNumber(); // hidUserRoot
48
53
  // all tables should have a BTHHEADER at hnid == 0x20
49
54
  const headerNodeInfo = this.getNodeInfo(0x20);
50
55
  if (!headerNodeInfo) {
51
56
  throw new Error('PSTTable::constructor headerNodeInfo is null');
52
57
  }
53
- headerNodeInfo.pstNodeInputStream.seek(long.fromValue(headerNodeInfo.startOffset));
58
+ headerNodeInfo.pstNodeInputStream.seek(long_1.default.fromValue(headerNodeInfo.startOffset));
54
59
  let headerByte = headerNodeInfo.pstNodeInputStream.read() & 0xff;
55
60
  if (headerByte != 0xb5) {
56
- headerNodeInfo.pstNodeInputStream.seek(long.fromValue(headerNodeInfo.startOffset));
61
+ headerNodeInfo.pstNodeInputStream.seek(long_1.default.fromValue(headerNodeInfo.startOffset));
57
62
  headerByte = headerNodeInfo.pstNodeInputStream.read() & 0xff;
58
- headerNodeInfo.pstNodeInputStream.seek(long.fromValue(headerNodeInfo.startOffset));
63
+ headerNodeInfo.pstNodeInputStream.seek(long_1.default.fromValue(headerNodeInfo.startOffset));
59
64
  const tmp = Buffer.alloc(1024);
60
65
  headerNodeInfo.pstNodeInputStream.readCompletely(tmp);
61
66
  throw new Error("PSTTable::constructor Unable to parse table, can't find BTHHEADER header information: " +
@@ -65,7 +70,7 @@ class PSTTable {
65
70
  this.sizeOfItemValue = headerNodeInfo.pstNodeInputStream.read() & 0xff; // Size of value in key table
66
71
  this.numberOfIndexLevels = headerNodeInfo.pstNodeInputStream.read() & 0xff;
67
72
  this.hidRoot = headerNodeInfo
68
- .seekAndReadLong(long.fromValue(4), 4)
73
+ .seekAndReadLong(long_1.default.fromValue(4), 4)
69
74
  .toNumber();
70
75
  }
71
76
  /**
@@ -131,20 +136,20 @@ class PSTTable {
131
136
  }
132
137
  // Get offset of HN page map
133
138
  let iHeapNodePageMap = this.pstNodeInputStream
134
- .seekAndReadLong(long.fromValue(blockOffset), 2)
139
+ .seekAndReadLong(long_1.default.fromValue(blockOffset), 2)
135
140
  .toNumber() + blockOffset;
136
141
  const cAlloc = this.pstNodeInputStream
137
- .seekAndReadLong(long.fromValue(iHeapNodePageMap), 2)
142
+ .seekAndReadLong(long_1.default.fromValue(iHeapNodePageMap), 2)
138
143
  .toNumber();
139
144
  if (index >= cAlloc + 1) {
140
145
  throw new Error("PSTTable::getNodeInfo: node index doesn't exist! nid = " + hnid);
141
146
  }
142
147
  iHeapNodePageMap += 2 * index + 2;
143
148
  const start = this.pstNodeInputStream
144
- .seekAndReadLong(long.fromValue(iHeapNodePageMap), 2)
149
+ .seekAndReadLong(long_1.default.fromValue(iHeapNodePageMap), 2)
145
150
  .toNumber() + blockOffset;
146
151
  const end = this.pstNodeInputStream
147
- .seekAndReadLong(long.fromValue(iHeapNodePageMap + 2), 2)
152
+ .seekAndReadLong(long_1.default.fromValue(iHeapNodePageMap + 2), 2)
148
153
  .toNumber() + blockOffset;
149
154
  return new NodeInfo_class_1.NodeInfo(start, end, this.pstNodeInputStream);
150
155
  }
@@ -1,8 +1,13 @@
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 });
6
+ exports.PSTTable7C = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
8
  /* eslint-disable @typescript-eslint/camelcase */
4
9
  /* eslint-disable @typescript-eslint/no-unused-vars */
5
- const long = require("long");
10
+ const long_1 = __importDefault(require("long"));
6
11
  const PSTFile_class_1 = require("./PSTFile.class");
7
12
  const PSTTable_class_1 = require("./PSTTable.class");
8
13
  const PSTTableItem_class_1 = require("./PSTTableItem.class");
@@ -36,25 +41,25 @@ class PSTTable7C extends PSTTable_class_1.PSTTable {
36
41
  // get the TCINFO header information
37
42
  let offset = 0;
38
43
  this.numColumns = tcHeaderNode
39
- .seekAndReadLong(long.fromNumber(offset + 1), 1)
44
+ .seekAndReadLong(long_1.default.fromNumber(offset + 1), 1)
40
45
  .toNumber();
41
46
  const TCI_4b = tcHeaderNode
42
- .seekAndReadLong(long.fromNumber(offset + 2), 2)
47
+ .seekAndReadLong(long_1.default.fromNumber(offset + 2), 2)
43
48
  .toNumber();
44
49
  const TCI_2b = tcHeaderNode
45
- .seekAndReadLong(long.fromNumber(offset + 4), 2)
50
+ .seekAndReadLong(long_1.default.fromNumber(offset + 4), 2)
46
51
  .toNumber();
47
52
  this.TCI_1b = tcHeaderNode
48
- .seekAndReadLong(long.fromNumber(offset + 6), 2)
53
+ .seekAndReadLong(long_1.default.fromNumber(offset + 6), 2)
49
54
  .toNumber();
50
55
  this.TCI_bm = tcHeaderNode
51
- .seekAndReadLong(long.fromNumber(offset + 8), 2)
56
+ .seekAndReadLong(long_1.default.fromNumber(offset + 8), 2)
52
57
  .toNumber();
53
58
  const hidRowIndex = tcHeaderNode
54
- .seekAndReadLong(long.fromNumber(offset + 10), 4)
59
+ .seekAndReadLong(long_1.default.fromNumber(offset + 10), 4)
55
60
  .toNumber();
56
61
  const hnidRows = tcHeaderNode
57
- .seekAndReadLong(long.fromNumber(offset + 14), 4)
62
+ .seekAndReadLong(long_1.default.fromNumber(offset + 14), 4)
58
63
  .toNumber();
59
64
  // 22... column descriptors
60
65
  offset += 22;
@@ -81,11 +86,11 @@ class PSTTable7C extends PSTTable_class_1.PSTTable {
81
86
  offset = 0;
82
87
  for (let x = 0; x < this.numberOfKeys; x++) {
83
88
  const context = keyTableInfo
84
- .seekAndReadLong(long.fromNumber(offset), this.sizeOfItemKey)
89
+ .seekAndReadLong(long_1.default.fromNumber(offset), this.sizeOfItemKey)
85
90
  .toNumber();
86
91
  offset += this.sizeOfItemKey;
87
92
  const rowIndex = keyTableInfo
88
- .seekAndReadLong(long.fromNumber(offset), this.sizeOfItemValue)
93
+ .seekAndReadLong(long_1.default.fromNumber(offset), this.sizeOfItemValue)
89
94
  .toNumber();
90
95
  offset += this.sizeOfItemValue;
91
96
  this.keyMap.set(context, rowIndex);
@@ -160,14 +165,14 @@ class PSTTable7C extends PSTTable_class_1.PSTTable {
160
165
  }
161
166
  }
162
167
  const bitmap = Buffer.alloc((this.numColumns + 7) / 8);
163
- this.rowNodeInfo.pstNodeInputStream.seek(long.fromNumber(this.rowNodeInfo.startOffset + currentValueArrayStart + this.TCI_1b));
168
+ this.rowNodeInfo.pstNodeInputStream.seek(long_1.default.fromNumber(this.rowNodeInfo.startOffset + currentValueArrayStart + this.TCI_1b));
164
169
  this.rowNodeInfo.pstNodeInputStream.readCompletely(bitmap);
165
- const id = this.rowNodeInfo.seekAndReadLong(long.fromNumber(currentValueArrayStart), 4);
170
+ const id = this.rowNodeInfo.seekAndReadLong(long_1.default.fromNumber(currentValueArrayStart), 4);
166
171
  // Put into the item map as PidTagLtpRowId (0x67F2)
167
172
  let item = new PSTTableItem_class_1.PSTTableItem();
168
173
  item.itemIndex = -1;
169
174
  item.entryValueType = 3;
170
- item.entryType = long.fromNumber(0x67f2);
175
+ item.entryType = long_1.default.fromNumber(0x67f2);
171
176
  item.entryValueReference = id.toNumber();
172
177
  item.isExternalValueReference = true;
173
178
  currentItem.set(item.entryType.toNumber(), item);
@@ -187,26 +192,26 @@ class PSTTable7C extends PSTTable_class_1.PSTTable {
187
192
  item = new PSTTableItem_class_1.PSTTableItem();
188
193
  item.itemIndex = col;
189
194
  item.entryValueType = this.columnDescriptors[col].type;
190
- item.entryType = long.fromNumber(this.columnDescriptors[col].id);
195
+ item.entryType = long_1.default.fromNumber(this.columnDescriptors[col].id);
191
196
  item.entryValueReference = 0;
192
197
  switch (this.columnDescriptors[col].cbData) {
193
198
  case 1: // Single byte data
194
199
  item.entryValueReference =
195
200
  this.rowNodeInfo
196
- .seekAndReadLong(long.fromNumber(currentValueArrayStart + this.columnDescriptors[col].ibData), 1)
201
+ .seekAndReadLong(long_1.default.fromNumber(currentValueArrayStart + this.columnDescriptors[col].ibData), 1)
197
202
  .toNumber() & 0xff;
198
203
  item.isExternalValueReference = true;
199
204
  break;
200
205
  case 2: // Two byte data
201
206
  item.entryValueReference =
202
207
  this.rowNodeInfo
203
- .seekAndReadLong(long.fromNumber(currentValueArrayStart + this.columnDescriptors[col].ibData), 2)
208
+ .seekAndReadLong(long_1.default.fromNumber(currentValueArrayStart + this.columnDescriptors[col].ibData), 2)
204
209
  .toNumber() & 0xffff;
205
210
  item.isExternalValueReference = true;
206
211
  break;
207
212
  case 8: // 8 byte data
208
213
  item.data = Buffer.alloc(8);
209
- this.rowNodeInfo.pstNodeInputStream.seek(long.fromNumber(this.rowNodeInfo.startOffset +
214
+ this.rowNodeInfo.pstNodeInputStream.seek(long_1.default.fromNumber(this.rowNodeInfo.startOffset +
210
215
  currentValueArrayStart +
211
216
  this.columnDescriptors[col].ibData));
212
217
  this.rowNodeInfo.pstNodeInputStream.readCompletely(item.data);
@@ -214,7 +219,7 @@ class PSTTable7C extends PSTTable_class_1.PSTTable {
214
219
  default:
215
220
  // Four byte data
216
221
  item.entryValueReference = this.rowNodeInfo
217
- .seekAndReadLong(long.fromNumber(currentValueArrayStart + this.columnDescriptors[col].ibData), 4)
222
+ .seekAndReadLong(long_1.default.fromNumber(currentValueArrayStart + this.columnDescriptors[col].ibData), 4)
218
223
  .toNumber();
219
224
  if (this.columnDescriptors[col].type == 0x0003 ||
220
225
  this.columnDescriptors[col].type == 0x0004 ||
@@ -237,7 +242,7 @@ class PSTTable7C extends PSTTable_class_1.PSTTable {
237
242
  const entryInfo = this.getNodeInfo(item.entryValueReference);
238
243
  if (entryInfo) {
239
244
  item.data = Buffer.alloc(entryInfo.length());
240
- entryInfo.pstNodeInputStream.seek(long.fromNumber(entryInfo.startOffset));
245
+ entryInfo.pstNodeInputStream.seek(long_1.default.fromNumber(entryInfo.startOffset));
241
246
  entryInfo.pstNodeInputStream.readCompletely(item.data);
242
247
  }
243
248
  }
@@ -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
- const long = require("long");
6
+ exports.PSTTableBC = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const long_1 = __importDefault(require("long"));
4
9
  const PSTTable_class_1 = require("./PSTTable.class");
5
10
  const PSTTableItem_class_1 = require("./PSTTableItem.class");
6
11
  const PSTUtil_class_1 = require("./PSTUtil.class");
@@ -23,11 +28,11 @@ class PSTTableBC extends PSTTable_class_1.PSTTable {
23
28
  throw new Error('PSTTableBC::constructor keyTableInfoNodeInfo is null');
24
29
  }
25
30
  const keyTableInfo = Buffer.alloc(keyTableInfoNodeInfo.length());
26
- keyTableInfoNodeInfo.pstNodeInputStream.seek(long.fromValue(keyTableInfoNodeInfo.startOffset));
31
+ keyTableInfoNodeInfo.pstNodeInputStream.seek(long_1.default.fromValue(keyTableInfoNodeInfo.startOffset));
27
32
  keyTableInfoNodeInfo.pstNodeInputStream.readCompletely(keyTableInfo);
28
33
  this.numberOfKeys = Math.trunc(keyTableInfo.length / (this.sizeOfItemKey + this.sizeOfItemValue));
29
34
  if (this.numberOfKeys == 0) {
30
- debugger;
35
+ // debugger
31
36
  }
32
37
  // Read the key table
33
38
  let offset = 0;
@@ -62,7 +67,7 @@ class PSTTableBC extends PSTTable_class_1.PSTTable {
62
67
  else {
63
68
  // Make a copy of the data
64
69
  const nodeInfo = Buffer.alloc(nodeInfoNodeInfo.length());
65
- nodeInfoNodeInfo.pstNodeInputStream.seek(long.fromValue(nodeInfoNodeInfo.startOffset));
70
+ nodeInfoNodeInfo.pstNodeInputStream.seek(long_1.default.fromValue(nodeInfoNodeInfo.startOffset));
66
71
  nodeInfoNodeInfo.pstNodeInputStream.readCompletely(nodeInfo);
67
72
  item.data = nodeInfo; // should be new array, so just use it
68
73
  item.isExternalValueReference = false;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import * as long from 'long';
2
+ import Long from 'long';
3
3
  export declare class PSTTableItem {
4
4
  static VALUE_TYPE_PT_UNICODE: number;
5
5
  static VALUE_TYPE_PT_STRING8: number;
@@ -8,8 +8,8 @@ export declare class PSTTableItem {
8
8
  set itemIndex(val: number);
9
9
  get itemIndex(): number;
10
10
  private _entryType;
11
- set entryType(val: long);
12
- get entryType(): long;
11
+ set entryType(val: Long);
12
+ get entryType(): Long;
13
13
  private _isExternalValueReference;
14
14
  set isExternalValueReference(val: boolean);
15
15
  get isExternalValueReference(): boolean;
@@ -31,7 +31,7 @@ export declare class PSTTableItem {
31
31
  * @returns
32
32
  * @memberof PSTTableItem
33
33
  */
34
- getLongValue(): long.Long | -1;
34
+ getLongValue(): -1 | Long;
35
35
  /**
36
36
  * Get string value of data.
37
37
  * @param {number} [stringType]
@@ -1,13 +1,18 @@
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
- const long = require("long");
6
+ exports.PSTTableItem = 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
  // Generic table item
6
11
  // Provides some basic string functions
7
12
  class PSTTableItem {
8
13
  constructor() {
9
14
  this._itemIndex = 0;
10
- this._entryType = long.ZERO;
15
+ this._entryType = long_1.default.ZERO;
11
16
  this._isExternalValueReference = false;
12
17
  this._entryValueReference = 0;
13
18
  this._entryValueType = 0;
@@ -3,6 +3,7 @@ import { PSTDescriptorItem } from './PSTDescriptorItem.class';
3
3
  import { PSTMessage } from './PSTMessage.class';
4
4
  import { PSTTableBC } from './PSTTableBC.class';
5
5
  import { PSTFile } from './PSTFile.class';
6
+ import { RecurrencePattern } from './RecurrencePattern.class';
6
7
  export declare class PSTTask extends PSTMessage {
7
8
  /**
8
9
  * Creates an instance of PSTTask.
@@ -108,6 +109,18 @@ export declare class PSTTask extends PSTMessage {
108
109
  * @memberof PSTTask
109
110
  */
110
111
  get isTaskRecurring(): boolean;
112
+ /**
113
+ * https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidtaskrecurrence-canonical-property
114
+ * @type {RecurrencePattern}
115
+ * @memberof PSTTask
116
+ */
117
+ get taskRecurrencePattern(): RecurrencePattern | null;
118
+ /**
119
+ * https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidtaskdeadoccurrence-canonical-property
120
+ * @type {boolean}
121
+ * @memberof PSTTask
122
+ */
123
+ get taskDeadOccurrence(): boolean;
111
124
  /**
112
125
  * Indicates the role of the current user relative to the task.
113
126
  * https://msdn.microsoft.com/en-us/library/office/cc842113.aspx
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PSTTask = void 0;
3
4
  const OutlookProperties_1 = require("./OutlookProperties");
4
5
  const PSTMessage_class_1 = require("./PSTMessage.class");
5
6
  const PSTFile_class_1 = require("./PSTFile.class");
7
+ const RecurrencePattern_class_1 = require("./RecurrencePattern.class");
6
8
  class PSTTask extends PSTMessage_class_1.PSTMessage {
7
9
  /**
8
10
  * Creates an instance of PSTTask.
@@ -134,6 +136,23 @@ class PSTTask extends PSTMessage_class_1.PSTMessage {
134
136
  get isTaskRecurring() {
135
137
  return this.getBooleanItem(this.pstFile.getNameToIdMapItem(OutlookProperties_1.OutlookProperties.PidLidTaskFRecurring, PSTFile_class_1.PSTFile.PSETID_Task));
136
138
  }
139
+ /**
140
+ * https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidtaskrecurrence-canonical-property
141
+ * @type {RecurrencePattern}
142
+ * @memberof PSTTask
143
+ */
144
+ get taskRecurrencePattern() {
145
+ const recurrenceBLOB = this.getBinaryItem(this.pstFile.getNameToIdMapItem(OutlookProperties_1.OutlookProperties.PidLidTaskRecurrence, PSTFile_class_1.PSTFile.PSETID_Task));
146
+ return recurrenceBLOB && new RecurrencePattern_class_1.RecurrencePattern(recurrenceBLOB);
147
+ }
148
+ /**
149
+ * https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidtaskdeadoccurrence-canonical-property
150
+ * @type {boolean}
151
+ * @memberof PSTTask
152
+ */
153
+ get taskDeadOccurrence() {
154
+ return this.getBooleanItem(this.pstFile.getNameToIdMapItem(OutlookProperties_1.OutlookProperties.PidLidTaskDeadOccurrence, PSTFile_class_1.PSTFile.PSETID_Task));
155
+ }
137
156
  /**
138
157
  * Indicates the role of the current user relative to the task.
139
158
  * https://msdn.microsoft.com/en-us/library/office/cc842113.aspx