pst-extractor 1.8.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.
@@ -1,8 +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;
4
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
- const long = require("long");
8
+ const long_1 = __importDefault(require("long"));
6
9
  class ColumnDescriptor {
7
10
  /**
8
11
  * Creates an instance of ColumnDescriptor.
@@ -11,12 +14,12 @@ class ColumnDescriptor {
11
14
  * @memberof ColumnDescriptor
12
15
  */
13
16
  constructor(nodeInfo, offset) {
14
- this._type = nodeInfo.seekAndReadLong(long.fromValue(offset), 2).toNumber(); // & 0xFFFF;
17
+ this._type = nodeInfo.seekAndReadLong(long_1.default.fromValue(offset), 2).toNumber(); // & 0xFFFF;
15
18
  this._id = nodeInfo
16
- .seekAndReadLong(long.fromValue(offset + 2), 2)
19
+ .seekAndReadLong(long_1.default.fromValue(offset + 2), 2)
17
20
  .toNumber(); // & 0xFFFF;
18
21
  this._ibData = nodeInfo
19
- .seekAndReadLong(long.fromValue(offset + 4), 2)
22
+ .seekAndReadLong(long_1.default.fromValue(offset + 4), 2)
20
23
  .toNumber(); // & 0xFFFF;
21
24
  this._cbData = nodeInfo.pstNodeInputStream.read(); // & 0xFFFF;
22
25
  this._iBit = nodeInfo.pstNodeInputStream.read(); // & 0xFFFF;
@@ -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 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(): long;
10
+ get localDescriptorsOffsetIndexIdentifier(): Long;
11
11
  private _dataOffsetIndexIdentifier;
12
- get dataOffsetIndexIdentifier(): long;
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,4 +1,4 @@
1
- import * as long from 'long';
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: long, length: number): long;
26
+ seekAndReadLong(offset: Long, length: number): Long;
27
27
  /**
28
28
  * JSON stringify the object properties.
29
29
  * @returns {string}
@@ -1,4 +1,4 @@
1
- import * as long from 'long';
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): long | undefined;
33
+ getNumericName(propId: number): Long | undefined;
34
34
  private transformKey;
35
35
  }
@@ -1,8 +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;
4
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
- const long = require("long");
8
+ const long_1 = __importDefault(require("long"));
6
9
  /**
7
10
  * Stores node names (both alpha and numeric) in node maps for quick lookup.
8
11
  * @export
@@ -74,7 +77,7 @@ class NodeMap {
74
77
  return lkey;
75
78
  }
76
79
  transformKey(key, idx) {
77
- let lidx = long.fromNumber(idx);
80
+ let lidx = long_1.default.fromNumber(idx);
78
81
  lidx = lidx.shiftLeft(32);
79
82
  lidx = lidx.or(key);
80
83
  return lidx;
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
- import * as long from 'long';
2
+ import Long from 'long';
3
3
  export declare class OffsetIndexItem {
4
4
  private _indexIdentifier;
5
- get indexIdentifier(): long;
5
+ get indexIdentifier(): Long;
6
6
  private _fileOffset;
7
- get fileOffset(): long;
7
+ get fileOffset(): Long;
8
8
  private _size;
9
9
  get size(): number;
10
10
  private cRef;
@@ -1,8 +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;
4
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
- const long = require("long");
8
+ const long_1 = __importDefault(require("long"));
6
9
  const OutlookProperties_1 = require("./OutlookProperties");
7
10
  const PSTNodeInputStream_class_1 = require("./PSTNodeInputStream.class");
8
11
  const PSTObject_class_1 = require("./PSTObject.class");
@@ -80,7 +83,7 @@ class PSTAttachment extends PSTObject_class_1.PSTObject {
80
83
  pstNodeInputStream = new PSTNodeInputStream_class_1.PSTNodeInputStream(this.pstFile, descriptorItemNested);
81
84
  if (descriptorItemNested &&
82
85
  descriptorItemNested.subNodeOffsetIndexIdentifier > 0) {
83
- this.localDescriptorItems = this.pstFile.getPSTDescriptorItems(long.fromNumber(descriptorItemNested.subNodeOffsetIndexIdentifier));
86
+ this.localDescriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromNumber(descriptorItemNested.subNodeOffsetIndexIdentifier));
84
87
  }
85
88
  }
86
89
  }
@@ -1,8 +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;
4
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
- const long = require("long");
8
+ const long_1 = __importDefault(require("long"));
6
9
  const PSTUtil_class_1 = require("./PSTUtil.class");
7
10
  const PSTFile_class_1 = require("./PSTFile.class");
8
11
  class PSTDescriptorItem {
@@ -50,7 +53,7 @@ class PSTDescriptorItem {
50
53
  if (this.dataBlockData != null) {
51
54
  return this.dataBlockData;
52
55
  }
53
- const pstNodeInputStream = this._pstFile.readLeaf(long.fromValue(this.offsetIndexIdentifier));
56
+ const pstNodeInputStream = this._pstFile.readLeaf(long_1.default.fromValue(this.offsetIndexIdentifier));
54
57
  const out = Buffer.alloc(pstNodeInputStream.length.toNumber());
55
58
  pstNodeInputStream.readCompletely(out);
56
59
  this.dataBlockData = out;
@@ -67,7 +70,7 @@ class PSTDescriptorItem {
67
70
  return this.dataBlockOffsets;
68
71
  }
69
72
  const offsets = this._pstFile
70
- .readLeaf(long.fromNumber(this.offsetIndexIdentifier))
73
+ .readLeaf(long_1.default.fromNumber(this.offsetIndexIdentifier))
71
74
  .getBlockOffsets();
72
75
  const offsetsOut = [];
73
76
  for (let x = 0; x < offsets.length; x++) {
@@ -82,7 +85,7 @@ class PSTDescriptorItem {
82
85
  * @memberof PSTDescriptorItem
83
86
  */
84
87
  get dataSize() {
85
- return this._pstFile.getLeafSize(long.fromNumber(this.offsetIndexIdentifier));
88
+ return this._pstFile.getLeafSize(long_1.default.fromNumber(this.offsetIndexIdentifier));
86
89
  }
87
90
  /**
88
91
  * JSON stringify the object properties.
@@ -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 { 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): long | undefined;
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: long): PSTNodeInputStream;
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: long): number;
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: long): DescriptorIndexNode;
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: long): OffsetIndexItem;
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: long): Map<number, PSTDescriptorItem>;
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: long): void;
209
+ seek(index: Long): void;
210
210
  /**
211
211
  * JSON stringify the object properties.
212
212
  * @returns {string}
@@ -1,8 +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
29
  exports.PSTFile = void 0;
4
- const fs = require("fs");
5
- const long = require("long");
30
+ const fs = __importStar(require("fs"));
31
+ const long_1 = __importDefault(require("long"));
6
32
  const DescriptorIndexNode_class_1 = require("./DescriptorIndexNode.class");
7
33
  const OffsetIndexItem_class_1 = require("./OffsetIndexItem.class");
8
34
  const PSTDescriptorItem_class_1 = require("./PSTDescriptorItem.class");
@@ -111,7 +137,7 @@ class PSTFile {
111
137
  * @memberof PSTFile
112
138
  */
113
139
  processNameToIDMap() {
114
- const nameToIdMapDescriptorNode = this.getDescriptorIndexNode(long.fromNumber(97));
140
+ const nameToIdMapDescriptorNode = this.getDescriptorIndexNode(long_1.default.fromNumber(97));
115
141
  // get the descriptors if we have them
116
142
  let localDescriptorItems = null;
117
143
  if (nameToIdMapDescriptorNode.localDescriptorsOffsetIndexIdentifier.toNumber() !=
@@ -271,7 +297,7 @@ class PSTFile {
271
297
  * @memberof PSTFile
272
298
  */
273
299
  getMessageStore() {
274
- const messageStoreDescriptor = this.getDescriptorIndexNode(long.fromNumber(PSTFile.MESSAGE_STORE_DESCRIPTOR_IDENTIFIER));
300
+ const messageStoreDescriptor = this.getDescriptorIndexNode(long_1.default.fromNumber(PSTFile.MESSAGE_STORE_DESCRIPTOR_IDENTIFIER));
275
301
  return new PSTMessageStore_class_1.PSTMessageStore(this, messageStoreDescriptor);
276
302
  }
277
303
  /**
@@ -280,7 +306,7 @@ class PSTFile {
280
306
  * @memberof PSTFile
281
307
  */
282
308
  getRootFolder() {
283
- const rootFolderDescriptor = this.getDescriptorIndexNode(long.fromValue(PSTFile.ROOT_FOLDER_DESCRIPTOR_IDENTIFIER));
309
+ const rootFolderDescriptor = this.getDescriptorIndexNode(long_1.default.fromValue(PSTFile.ROOT_FOLDER_DESCRIPTOR_IDENTIFIER));
284
310
  const output = new PSTFolder_class_1.PSTFolder(this, rootFolderDescriptor);
285
311
  return output;
286
312
  }
@@ -323,7 +349,7 @@ class PSTFile {
323
349
  * @memberof PSTFile
324
350
  */
325
351
  extractLEFileOffset(startOffset) {
326
- let offset = long.ZERO;
352
+ let offset = long_1.default.ZERO;
327
353
  if (this._pstFileType == PSTFile.PST_TYPE_ANSI) {
328
354
  this.seek(startOffset);
329
355
  const buffer = Buffer.alloc(4);
@@ -363,15 +389,15 @@ class PSTFile {
363
389
  let fileTypeAdjustment;
364
390
  // first find the starting point for the offset index
365
391
  if (this._pstFileType === PSTFile.PST_TYPE_ANSI) {
366
- btreeStartOffset = this.extractLEFileOffset(long.fromValue(196));
392
+ btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(196));
367
393
  if (descTree) {
368
- btreeStartOffset = this.extractLEFileOffset(long.fromValue(188));
394
+ btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(188));
369
395
  }
370
396
  }
371
397
  else {
372
- btreeStartOffset = this.extractLEFileOffset(long.fromValue(240));
398
+ btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(240));
373
399
  if (descTree) {
374
- btreeStartOffset = this.extractLEFileOffset(long.fromValue(224));
400
+ btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(224));
375
401
  }
376
402
  }
377
403
  // okay, what we want to do is navigate the tree until you reach the bottom....
@@ -558,14 +584,14 @@ class PSTFile {
558
584
  inputStream = this.readLeaf(arg);
559
585
  }
560
586
  // make sure the signature is correct
561
- inputStream.seek(long.ZERO);
587
+ inputStream.seek(long_1.default.ZERO);
562
588
  const sig = inputStream.read();
563
589
  if (sig != 0x2) {
564
590
  throw new Error('PSTFile::getPSTDescriptorItems Unable to process descriptor node, bad signature: ' +
565
591
  sig);
566
592
  }
567
593
  const output = new Map();
568
- const numberOfItems = inputStream.seekAndReadLong(long.fromValue(2), 2);
594
+ const numberOfItems = inputStream.seekAndReadLong(long_1.default.fromValue(2), 2);
569
595
  let offset;
570
596
  if (this._pstFileType === PSTFile.PST_TYPE_ANSI) {
571
597
  offset = 4;
@@ -574,7 +600,7 @@ class PSTFile {
574
600
  offset = 8;
575
601
  }
576
602
  const data = Buffer.alloc(inputStream.length.toNumber());
577
- inputStream.seek(long.ZERO);
603
+ inputStream.seek(long_1.default.ZERO);
578
604
  inputStream.readCompletely(data);
579
605
  for (let x = 0; x < numberOfItems.toNumber(); x++) {
580
606
  const item = new PSTDescriptorItem_class_1.PSTDescriptorItem(data, offset, this);
@@ -596,12 +622,12 @@ class PSTFile {
596
622
  */
597
623
  getChildDescriptorTree() {
598
624
  if (!this.childrenDescriptorTree) {
599
- let btreeStartOffset = long.ZERO;
625
+ let btreeStartOffset = long_1.default.ZERO;
600
626
  if (this._pstFileType === PSTFile.PST_TYPE_ANSI) {
601
- btreeStartOffset = this.extractLEFileOffset(long.fromValue(188));
627
+ btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(188));
602
628
  }
603
629
  else {
604
- btreeStartOffset = this.extractLEFileOffset(long.fromValue(224));
630
+ btreeStartOffset = this.extractLEFileOffset(long_1.default.fromValue(224));
605
631
  }
606
632
  this.childrenDescriptorTree = new Map();
607
633
  this.processDescriptorBTree(btreeStartOffset);
@@ -1,8 +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;
4
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
- const long = require("long");
8
+ const long_1 = __importDefault(require("long"));
6
9
  const OutlookProperties_1 = require("./OutlookProperties");
7
10
  const PSTNodeInputStream_class_1 = require("./PSTNodeInputStream.class");
8
11
  const PSTTable7C_class_1 = require("./PSTTable7C.class");
@@ -53,7 +56,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
53
56
  for (const itemMap of itemMapSet) {
54
57
  const item = itemMap.get(26610);
55
58
  if (item) {
56
- output.push(PSTUtil_class_1.PSTUtil.detectAndLoadPSTObject(this.pstFile, long.fromNumber(item.entryValueReference)));
59
+ output.push(PSTUtil_class_1.PSTUtil.detectAndLoadPSTObject(this.pstFile, long_1.default.fromNumber(item.entryValueReference)));
57
60
  }
58
61
  }
59
62
  }
@@ -80,7 +83,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
80
83
  if (!this.descriptorIndexNode) {
81
84
  throw new Error('PSTFolder::initSubfoldersTable descriptorIndexNode is null');
82
85
  }
83
- const folderDescriptorIndex = long.fromValue(this.descriptorIndexNode.descriptorIdentifier + 11);
86
+ const folderDescriptorIndex = long_1.default.fromValue(this.descriptorIndexNode.descriptorIdentifier + 11);
84
87
  try {
85
88
  const folderDescriptor = this.pstFile.getDescriptorIndexNode(folderDescriptorIndex);
86
89
  let tmp = undefined;
@@ -113,7 +116,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
113
116
  }
114
117
  try {
115
118
  const folderDescriptorIndex = this.descriptorIndexNode.descriptorIdentifier + 12;
116
- const folderDescriptor = this.pstFile.getDescriptorIndexNode(long.fromNumber(folderDescriptorIndex));
119
+ const folderDescriptor = this.pstFile.getDescriptorIndexNode(long_1.default.fromNumber(folderDescriptorIndex));
117
120
  let tmp = undefined;
118
121
  if (folderDescriptor.localDescriptorsOffsetIndexIdentifier.greaterThan(0)) {
119
122
  tmp = this.pstFile.getPSTDescriptorItems(folderDescriptor.localDescriptorsOffsetIndexIdentifier);
@@ -160,7 +163,7 @@ class PSTFolder extends PSTObject_class_1.PSTObject {
160
163
  // no more!
161
164
  return null;
162
165
  }
163
- const childDescriptor = this.pstFile.getDescriptorIndexNode(long.fromNumber(emailRow.entryValueReference));
166
+ const childDescriptor = this.pstFile.getDescriptorIndexNode(long_1.default.fromNumber(emailRow.entryValueReference));
164
167
  const child = PSTUtil_class_1.PSTUtil.detectAndLoadPSTObject(this.pstFile, childDescriptor);
165
168
  this.currentEmailIndex++;
166
169
  return child;
@@ -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';
@@ -531,7 +531,7 @@ export declare class PSTMessage extends PSTObject {
531
531
  * @type {long}
532
532
  * @memberof PSTMessage
533
533
  */
534
- get messageSize(): long;
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
@@ -1,8 +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;
4
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
- const long = require("long");
8
+ const long_1 = __importDefault(require("long"));
6
9
  const OutlookProperties_1 = require("./OutlookProperties");
7
10
  const PSTFile_class_1 = require("./PSTFile.class");
8
11
  const PSTNodeInputStream_class_1 = require("./PSTNodeInputStream.class");
@@ -164,7 +167,7 @@ class PSTMessage extends PSTObject_class_1.PSTObject {
164
167
  const item = this.localDescriptorItems.get(recipientTableKey);
165
168
  let descriptorItems = new Map();
166
169
  if (item && item.subNodeOffsetIndexIdentifier > 0) {
167
- descriptorItems = this.pstFile.getPSTDescriptorItems(long.fromNumber(item.subNodeOffsetIndexIdentifier));
170
+ descriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromNumber(item.subNodeOffsetIndexIdentifier));
168
171
  }
169
172
  this.recipientTable = new PSTTable7C_class_1.PSTTable7C(new PSTNodeInputStream_class_1.PSTNodeInputStream(this.pstFile, item), descriptorItems);
170
173
  }
@@ -396,7 +399,7 @@ class PSTMessage extends PSTObject_class_1.PSTObject {
396
399
  const item = this.localDescriptorItems.get(attachmentTableKey);
397
400
  let descriptorItems = new Map();
398
401
  if (item && item.subNodeOffsetIndexIdentifier > 0) {
399
- descriptorItems = this.pstFile.getPSTDescriptorItems(long.fromValue(item.subNodeOffsetIndexIdentifier));
402
+ descriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromValue(item.subNodeOffsetIndexIdentifier));
400
403
  }
401
404
  this.attachmentTable = new PSTTable7C_class_1.PSTTable7C(new PSTNodeInputStream_class_1.PSTNodeInputStream(this.pstFile, item), descriptorItems);
402
405
  }
@@ -464,7 +467,7 @@ class PSTMessage extends PSTObject_class_1.PSTObject {
464
467
  // so no need to pass it...
465
468
  let attachmentDescriptorItems = new Map();
466
469
  if (descriptorItem.subNodeOffsetIndexIdentifier > 0) {
467
- attachmentDescriptorItems = this.pstFile.getPSTDescriptorItems(long.fromNumber(descriptorItem.subNodeOffsetIndexIdentifier));
470
+ attachmentDescriptorItems = this.pstFile.getPSTDescriptorItems(long_1.default.fromNumber(descriptorItem.subNodeOffsetIndexIdentifier));
468
471
  }
469
472
  return new PSTAttachment_class_1.PSTAttachment(this.pstFile, attachmentDetailsTable, attachmentDescriptorItems);
470
473
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import * as long from 'long';
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(): long;
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(): long[];
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: long): void;
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: long, bytes: number): long;
116
+ seekAndReadLong(location: Long, bytes: number): Long;
117
117
  /**
118
118
  * JSON the object, large buffers excluded.
119
119
  * @returns {*}