@hiraokahypertools/pst-extractor 0.1.0-alpha.1

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 (90) hide show
  1. package/dist/BTHeap.d.ts +15 -0
  2. package/dist/BTHeap.js +76 -0
  3. package/dist/CollectionAsyncProvider.d.ts +15 -0
  4. package/dist/CollectionAsyncProvider.js +44 -0
  5. package/dist/KeyedDelay.d.ts +8 -0
  6. package/dist/KeyedDelay.js +37 -0
  7. package/dist/LZFu.class.d.ts +12 -0
  8. package/dist/LZFu.class.js +95 -0
  9. package/dist/NodeMap.class.d.ts +35 -0
  10. package/dist/NodeMap.class.js +86 -0
  11. package/dist/OutlookProperties.d.ts +278 -0
  12. package/dist/OutlookProperties.js +284 -0
  13. package/dist/PAUtil.d.ts +17 -0
  14. package/dist/PAUtil.js +145 -0
  15. package/dist/PHNodeHeap.d.ts +16 -0
  16. package/dist/PHNodeHeap.js +2 -0
  17. package/dist/PHNodeHeapReader.d.ts +6 -0
  18. package/dist/PHNodeHeapReader.js +5 -0
  19. package/dist/PHUtil.d.ts +6 -0
  20. package/dist/PHUtil.js +103 -0
  21. package/dist/PLMisc.d.ts +8 -0
  22. package/dist/PLMisc.js +16 -0
  23. package/dist/PLNode.d.ts +11 -0
  24. package/dist/PLNode.js +5 -0
  25. package/dist/PLStore.d.ts +9 -0
  26. package/dist/PLStore.js +5 -0
  27. package/dist/PLSubNode.d.ts +8 -0
  28. package/dist/PLSubNode.js +5 -0
  29. package/dist/PLUtil.d.ts +29 -0
  30. package/dist/PLUtil.js +683 -0
  31. package/dist/PSTActivity.class.d.ts +103 -0
  32. package/dist/PSTActivity.class.js +144 -0
  33. package/dist/PSTAppointment.class.d.ts +275 -0
  34. package/dist/PSTAppointment.class.js +381 -0
  35. package/dist/PSTAttachment.class.d.ts +168 -0
  36. package/dist/PSTAttachment.class.js +286 -0
  37. package/dist/PSTContact.class.d.ts +900 -0
  38. package/dist/PSTContact.class.js +1253 -0
  39. package/dist/PSTFile.class.d.ts +144 -0
  40. package/dist/PSTFile.class.js +221 -0
  41. package/dist/PSTFolder.class.d.ts +111 -0
  42. package/dist/PSTFolder.class.js +269 -0
  43. package/dist/PSTMessage.class.d.ts +773 -0
  44. package/dist/PSTMessage.class.js +1264 -0
  45. package/dist/PSTMessageStore.class.d.ts +16 -0
  46. package/dist/PSTMessageStore.class.js +18 -0
  47. package/dist/PSTObject.class.d.ts +107 -0
  48. package/dist/PSTObject.class.js +208 -0
  49. package/dist/PSTOpts.d.ts +24 -0
  50. package/dist/PSTOpts.js +2 -0
  51. package/dist/PSTRecipient.class.d.ts +68 -0
  52. package/dist/PSTRecipient.class.js +105 -0
  53. package/dist/PSTTask.class.d.ts +146 -0
  54. package/dist/PSTTask.class.js +206 -0
  55. package/dist/PSTUtil.class.d.ts +134 -0
  56. package/dist/PSTUtil.class.js +804 -0
  57. package/dist/Property.d.ts +38 -0
  58. package/dist/Property.js +2 -0
  59. package/dist/PropertyContext.d.ts +6 -0
  60. package/dist/PropertyContext.js +2 -0
  61. package/dist/PropertyContextUtil.d.ts +4 -0
  62. package/dist/PropertyContextUtil.js +77 -0
  63. package/dist/PropertyTypeObject.d.ts +12 -0
  64. package/dist/PropertyTypeObject.js +21 -0
  65. package/dist/PropertyValueResolver.d.ts +4 -0
  66. package/dist/PropertyValueResolver.js +2 -0
  67. package/dist/PropertyValueResolverV1.d.ts +7 -0
  68. package/dist/PropertyValueResolverV1.js +253 -0
  69. package/dist/RawProperty.d.ts +8 -0
  70. package/dist/RawProperty.js +2 -0
  71. package/dist/RecurrencePattern.class.d.ts +50 -0
  72. package/dist/RecurrencePattern.class.js +120 -0
  73. package/dist/RootProvider.d.ts +12 -0
  74. package/dist/RootProvider.js +2 -0
  75. package/dist/SingleAsyncProvider.d.ts +5 -0
  76. package/dist/SingleAsyncProvider.js +30 -0
  77. package/dist/TableContext.d.ts +4 -0
  78. package/dist/TableContext.js +2 -0
  79. package/dist/TableContextUtil.d.ts +4 -0
  80. package/dist/TableContextUtil.js +147 -0
  81. package/dist/TableRow.d.ts +6 -0
  82. package/dist/TableRow.js +2 -0
  83. package/dist/index.d.ts +15 -0
  84. package/dist/index.js +28 -0
  85. package/dist/msftUuidStringify.d.ts +17 -0
  86. package/dist/msftUuidStringify.js +48 -0
  87. package/dist/openPstFile.d.ts +19 -0
  88. package/dist/openPstFile.js +67 -0
  89. package/package.json +105 -0
  90. package/readme.md +16 -0
@@ -0,0 +1,16 @@
1
+ import { PropertyFinder } from './PAUtil';
2
+ import { PLNode } from './PLNode';
3
+ import { PLSubNode } from './PLSubNode';
4
+ import { PSTObject } from './PSTObject.class';
5
+ import { RootProvider } from './RootProvider';
6
+ export declare class PSTMessageStore extends PSTObject {
7
+ /**
8
+ * Creates an instance of PSTMessageStore.
9
+ * Not much use other than to get the "name" of the PST file.
10
+ * @internal
11
+ * @param {PSTFile} rootProvider
12
+ * @param {DescriptorIndexNode} descriptorIndexNode
13
+ * @memberof PSTMessageStore
14
+ */
15
+ constructor(rootProvider: RootProvider, node: PLNode, subNode: PLSubNode, propertyFinder: PropertyFinder);
16
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PSTMessageStore = void 0;
4
+ const PSTObject_class_1 = require("./PSTObject.class");
5
+ class PSTMessageStore extends PSTObject_class_1.PSTObject {
6
+ /**
7
+ * Creates an instance of PSTMessageStore.
8
+ * Not much use other than to get the "name" of the PST file.
9
+ * @internal
10
+ * @param {PSTFile} rootProvider
11
+ * @param {DescriptorIndexNode} descriptorIndexNode
12
+ * @memberof PSTMessageStore
13
+ */
14
+ constructor(rootProvider, node, subNode, propertyFinder) {
15
+ super(rootProvider, node, subNode, propertyFinder);
16
+ }
17
+ }
18
+ exports.PSTMessageStore = PSTMessageStore;
@@ -0,0 +1,107 @@
1
+ /// <reference types="node" />
2
+ import Long from 'long';
3
+ import { PropertyFinder } from './PAUtil';
4
+ import { PLNode } from './PLNode';
5
+ import { PLSubNode } from './PLSubNode';
6
+ import { Property } from './Property';
7
+ import { RootProvider } from './RootProvider';
8
+ export declare abstract class PSTObject {
9
+ protected _rootProvider: RootProvider;
10
+ protected _node: PLNode;
11
+ protected _subNode: PLSubNode;
12
+ protected _propertyFinder: PropertyFinder;
13
+ /**
14
+ * Creates an instance of PSTObject, the root class of most PST Items.
15
+ * @internal
16
+ * @memberof PSTObject
17
+ */
18
+ constructor(rootProvider: RootProvider, node: PLNode, subNode: PLSubNode, propertyFinder: PropertyFinder);
19
+ /**
20
+ * Get the node type for the descriptor id.
21
+ * @param {number} [descriptorIdentifier]
22
+ * @returns {number}
23
+ * @memberof PSTObject
24
+ */
25
+ protected getNodeType(descriptorIdentifier?: number): number;
26
+ /**
27
+ * @protected
28
+ * @param { number } identifier
29
+ * @param { number } [defaultValue]
30
+ * @returns { number }
31
+ * @memberof PSTObject
32
+ */
33
+ protected getIntItem(identifier: number, defaultValue?: number): number;
34
+ /**
35
+ * Get a boolean.
36
+ * @protected
37
+ * @param {number} identifier
38
+ * @param {boolean} [defaultValue]
39
+ * @returns {boolean}
40
+ * @memberof PSTObject
41
+ */
42
+ protected getBooleanItem(identifier: number, defaultValue?: boolean): boolean;
43
+ /**
44
+ * Get a double.
45
+ * @protected
46
+ * @param {number} identifier
47
+ * @param {number} [defaultValue]
48
+ * @returns {number}
49
+ * @memberof PSTObject
50
+ */
51
+ protected getDoubleItem(identifier: number, defaultValue?: number): number;
52
+ /**
53
+ * Get a long.
54
+ * @protected
55
+ * @param {number} identifier
56
+ * @param {long} [defaultValue]
57
+ * @returns {long}
58
+ * @memberof PSTObject
59
+ */
60
+ protected getLongItem(identifier: number, defaultValue?: Long): Long;
61
+ /**
62
+ * Get a string.
63
+ * @protected
64
+ * @param {number} identifier
65
+ * @param {number} [stringType]
66
+ * @param {string} [codepage]
67
+ * @returns {string}
68
+ * @memberof PSTObject
69
+ */
70
+ protected getStringItem(identifier: number, stringType?: number, codepage?: string): string;
71
+ /**
72
+ * Get a date.
73
+ * @param {number} identifier
74
+ * @returns {Date}
75
+ * @memberof PSTObject
76
+ */
77
+ protected getDateItem(identifier: number): Date | null;
78
+ /**
79
+ * Get a blob.
80
+ * @protected
81
+ * @param {number} identifier
82
+ * @returns {Buffer}
83
+ * @memberof PSTObject
84
+ */
85
+ protected getBinaryItem(identifier: number): Buffer | null;
86
+ /**
87
+ * Get the display name of this object.
88
+ * https://msdn.microsoft.com/en-us/library/office/cc842383.aspx
89
+ * @readonly
90
+ * @type {string}
91
+ * @memberof PSTObject
92
+ */
93
+ get displayName(): string;
94
+ /**
95
+ * Try to get specified property from PropertyContext.
96
+ *
97
+ * @param key `0x3001` is `PR_DISPLAY_NAME` for example
98
+ * @returns The found one will be returned. Otherwise `undefined` is returned.
99
+ */
100
+ getProperty(key: number): Property | undefined;
101
+ /**
102
+ * JSON the object.
103
+ * @returns {string}
104
+ * @memberof PSTObject
105
+ */
106
+ toJSON(): any;
107
+ }
@@ -0,0 +1,208 @@
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.PSTObject = void 0;
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const long_1 = __importDefault(require("long"));
9
+ const OutlookProperties_1 = require("./OutlookProperties");
10
+ class PSTObject {
11
+ /**
12
+ * Creates an instance of PSTObject, the root class of most PST Items.
13
+ * @internal
14
+ * @memberof PSTObject
15
+ */
16
+ constructor(rootProvider, node, subNode, propertyFinder) {
17
+ if (!propertyFinder) {
18
+ console.trace("propertyFinder not defined");
19
+ }
20
+ this._rootProvider = rootProvider;
21
+ this._node = node;
22
+ this._subNode = subNode;
23
+ this._propertyFinder = propertyFinder;
24
+ }
25
+ /**
26
+ * Get the node type for the descriptor id.
27
+ * @param {number} [descriptorIdentifier]
28
+ * @returns {number}
29
+ * @memberof PSTObject
30
+ */
31
+ getNodeType(descriptorIdentifier) {
32
+ if (descriptorIdentifier) {
33
+ return descriptorIdentifier & 0x1f;
34
+ }
35
+ else if (this._node.nodeId) {
36
+ return this._node.nodeId & 0x1f;
37
+ }
38
+ else {
39
+ return -1;
40
+ }
41
+ }
42
+ /**
43
+ * @protected
44
+ * @param { number } identifier
45
+ * @param { number } [defaultValue]
46
+ * @returns { number }
47
+ * @memberof PSTObject
48
+ */
49
+ getIntItem(identifier, defaultValue) {
50
+ if (!defaultValue) {
51
+ defaultValue = 0;
52
+ }
53
+ const property = this._propertyFinder.findByKey(identifier);
54
+ if (property !== undefined) {
55
+ const { value } = property;
56
+ if (typeof value === 'number') {
57
+ return value;
58
+ }
59
+ }
60
+ return defaultValue;
61
+ }
62
+ /**
63
+ * Get a boolean.
64
+ * @protected
65
+ * @param {number} identifier
66
+ * @param {boolean} [defaultValue]
67
+ * @returns {boolean}
68
+ * @memberof PSTObject
69
+ */
70
+ getBooleanItem(identifier, defaultValue) {
71
+ if (defaultValue === undefined) {
72
+ defaultValue = false;
73
+ }
74
+ const property = this._propertyFinder.findByKey(identifier);
75
+ if (property !== undefined) {
76
+ const { value } = property;
77
+ if (typeof value === 'boolean') {
78
+ return value;
79
+ }
80
+ }
81
+ return defaultValue;
82
+ }
83
+ /**
84
+ * Get a double.
85
+ * @protected
86
+ * @param {number} identifier
87
+ * @param {number} [defaultValue]
88
+ * @returns {number}
89
+ * @memberof PSTObject
90
+ */
91
+ getDoubleItem(identifier, defaultValue) {
92
+ if (defaultValue === undefined) {
93
+ defaultValue = 0;
94
+ }
95
+ const property = this._propertyFinder.findByKey(identifier);
96
+ if (property !== undefined) {
97
+ const { value } = property;
98
+ if (typeof value === 'number') {
99
+ return value;
100
+ }
101
+ }
102
+ return defaultValue;
103
+ }
104
+ /**
105
+ * Get a long.
106
+ * @protected
107
+ * @param {number} identifier
108
+ * @param {long} [defaultValue]
109
+ * @returns {long}
110
+ * @memberof PSTObject
111
+ */
112
+ getLongItem(identifier, defaultValue) {
113
+ if (defaultValue === undefined) {
114
+ defaultValue = long_1.default.ZERO;
115
+ }
116
+ const property = this._propertyFinder.findByKey(identifier);
117
+ if (property !== undefined) {
118
+ const { value } = property;
119
+ if (value instanceof long_1.default) {
120
+ return value;
121
+ }
122
+ else if (typeof value === 'number') {
123
+ return new long_1.default(value);
124
+ }
125
+ }
126
+ return defaultValue;
127
+ }
128
+ /**
129
+ * Get a string.
130
+ * @protected
131
+ * @param {number} identifier
132
+ * @param {number} [stringType]
133
+ * @param {string} [codepage]
134
+ * @returns {string}
135
+ * @memberof PSTObject
136
+ */
137
+ getStringItem(identifier, stringType, codepage) {
138
+ const property = this._propertyFinder.findByKey(identifier);
139
+ if (property !== undefined) {
140
+ const { value } = property;
141
+ if (typeof value === 'string') {
142
+ return value;
143
+ }
144
+ }
145
+ return '';
146
+ }
147
+ /**
148
+ * Get a date.
149
+ * @param {number} identifier
150
+ * @returns {Date}
151
+ * @memberof PSTObject
152
+ */
153
+ getDateItem(identifier) {
154
+ const property = this._propertyFinder.findByKey(identifier);
155
+ if (property !== undefined) {
156
+ const { value } = property;
157
+ if (value instanceof Date) {
158
+ return value;
159
+ }
160
+ }
161
+ return null;
162
+ }
163
+ /**
164
+ * Get a blob.
165
+ * @protected
166
+ * @param {number} identifier
167
+ * @returns {Buffer}
168
+ * @memberof PSTObject
169
+ */
170
+ getBinaryItem(identifier) {
171
+ const property = this._propertyFinder.findByKey(identifier);
172
+ if (property !== undefined) {
173
+ const { value } = property;
174
+ if (value instanceof ArrayBuffer) {
175
+ return Buffer.from(value);
176
+ }
177
+ }
178
+ return null;
179
+ }
180
+ /**
181
+ * Get the display name of this object.
182
+ * https://msdn.microsoft.com/en-us/library/office/cc842383.aspx
183
+ * @readonly
184
+ * @type {string}
185
+ * @memberof PSTObject
186
+ */
187
+ get displayName() {
188
+ return this.getStringItem(OutlookProperties_1.OutlookProperties.PR_DISPLAY_NAME);
189
+ }
190
+ /**
191
+ * Try to get specified property from PropertyContext.
192
+ *
193
+ * @param key `0x3001` is `PR_DISPLAY_NAME` for example
194
+ * @returns The found one will be returned. Otherwise `undefined` is returned.
195
+ */
196
+ getProperty(key) {
197
+ return this._propertyFinder.findByKey(key);
198
+ }
199
+ /**
200
+ * JSON the object.
201
+ * @returns {string}
202
+ * @memberof PSTObject
203
+ */
204
+ toJSON() {
205
+ return this;
206
+ }
207
+ }
208
+ exports.PSTObject = PSTObject;
@@ -0,0 +1,24 @@
1
+ export interface PSTOpts {
2
+ /**
3
+ * Specify character encoding usable with `iconv-lite` package.
4
+ *
5
+ * This is used to obtain unicode string from ArrayBuffer of ansiString PT_STRING8.
6
+ *
7
+ * It is rare case that pst/ost files store ansiString,
8
+ * because recent Outlook applications are Unicode based.
9
+ *
10
+ * This applies to pst files generated by older versions of Outlook.
11
+ *
12
+ * And {@link ansiEncoding} is required because ANSI code page depends on
13
+ * Windows's system locale can be acquired by [GetOEMCP](https://docs.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getoemcp) API.
14
+ *
15
+ * OEMCP cannot be obtained from pure JavaScript environment,
16
+ * especially on Web browser environment.
17
+ * Thus you need to specify considered one.
18
+ */
19
+ ansiEncoding?: string;
20
+ /**
21
+ * Otherwise, you can provide your own converter (from ansiString to unicode string).
22
+ */
23
+ convertAnsiString?: (arrayBuffer: ArrayBuffer) => Promise<string>;
24
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,68 @@
1
+ import { PropertyFinder } from './PAUtil';
2
+ import { PLNode } from './PLNode';
3
+ import { PLSubNode } from './PLSubNode';
4
+ import { PSTObject } from './PSTObject.class';
5
+ import { RootProvider } from './RootProvider';
6
+ export declare class PSTRecipient extends PSTObject {
7
+ /**
8
+ * Creates an instance of PSTRecipient.
9
+ * @internal
10
+ * @param {Map<number, PSTTableItem>} recipientDetails
11
+ * @memberof PSTRecipient
12
+ */
13
+ constructor(rootProvider: RootProvider, node: PLNode, subNode: PLSubNode, propertyFinder: PropertyFinder);
14
+ /**
15
+ * Contains the recipient type for a message recipient.
16
+ * https://msdn.microsoft.com/en-us/library/office/cc839620.aspx
17
+ * @readonly
18
+ * @type {number}
19
+ * @memberof PSTMessage
20
+ */
21
+ get recipientType(): number;
22
+ /**
23
+ * Contains the messaging user's e-mail address type, such as SMTP.
24
+ * https://msdn.microsoft.com/en-us/library/office/cc815548.aspx
25
+ * @readonly
26
+ * @type {string}
27
+ * @memberof PSTMessage
28
+ */
29
+ get addrType(): string;
30
+ /**
31
+ * Contains the messaging user's e-mail address.
32
+ * https://msdn.microsoft.com/en-us/library/office/cc842372.aspx
33
+ * @readonly
34
+ * @type {string}
35
+ * @memberof PSTMessage
36
+ */
37
+ get emailAddress(): string;
38
+ /**
39
+ * Specifies a bit field that describes the recipient status.
40
+ * https://msdn.microsoft.com/en-us/library/office/cc815629.aspx
41
+ * @readonly
42
+ * @type {number}
43
+ * @memberof PSTRecipient
44
+ */
45
+ get recipientFlags(): number;
46
+ /**
47
+ * Specifies the location of the current recipient in the recipient table.
48
+ * https://msdn.microsoft.com/en-us/library/ee201359(v=exchg.80).aspx
49
+ * @readonly
50
+ * @type {number}
51
+ * @memberof PSTRecipient
52
+ */
53
+ get recipientOrder(): number;
54
+ /**
55
+ * Contains the SMTP address for the address book object.
56
+ * https://msdn.microsoft.com/en-us/library/office/cc842421.aspx
57
+ * @readonly
58
+ * @type {string}
59
+ * @memberof PSTRecipient
60
+ */
61
+ get smtpAddress(): string;
62
+ /**
63
+ * JSON stringify the object properties.
64
+ * @returns {string}
65
+ * @memberof PSTRecipient
66
+ */
67
+ toJSON(): any;
68
+ }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PSTRecipient = void 0;
4
+ /* eslint-disable @typescript-eslint/no-explicit-any */
5
+ const OutlookProperties_1 = require("./OutlookProperties");
6
+ const PSTObject_class_1 = require("./PSTObject.class");
7
+ // Class containing recipient information
8
+ class PSTRecipient extends PSTObject_class_1.PSTObject {
9
+ /**
10
+ * Creates an instance of PSTRecipient.
11
+ * @internal
12
+ * @param {Map<number, PSTTableItem>} recipientDetails
13
+ * @memberof PSTRecipient
14
+ */
15
+ constructor(rootProvider, node, subNode, propertyFinder) {
16
+ super(rootProvider, node, subNode, propertyFinder);
17
+ }
18
+ /**
19
+ * Contains the recipient type for a message recipient.
20
+ * https://msdn.microsoft.com/en-us/library/office/cc839620.aspx
21
+ * @readonly
22
+ * @type {number}
23
+ * @memberof PSTMessage
24
+ */
25
+ get recipientType() {
26
+ return this.getIntItem(OutlookProperties_1.OutlookProperties.PR_RECIPIENT_TYPE);
27
+ }
28
+ /**
29
+ * Contains the messaging user's e-mail address type, such as SMTP.
30
+ * https://msdn.microsoft.com/en-us/library/office/cc815548.aspx
31
+ * @readonly
32
+ * @type {string}
33
+ * @memberof PSTMessage
34
+ */
35
+ get addrType() {
36
+ return this.getStringItem(OutlookProperties_1.OutlookProperties.PR_ADDRTYPE);
37
+ }
38
+ /**
39
+ * Contains the messaging user's e-mail address.
40
+ * https://msdn.microsoft.com/en-us/library/office/cc842372.aspx
41
+ * @readonly
42
+ * @type {string}
43
+ * @memberof PSTMessage
44
+ */
45
+ get emailAddress() {
46
+ return this.getStringItem(OutlookProperties_1.OutlookProperties.PR_EMAIL_ADDRESS);
47
+ }
48
+ /**
49
+ * Specifies a bit field that describes the recipient status.
50
+ * https://msdn.microsoft.com/en-us/library/office/cc815629.aspx
51
+ * @readonly
52
+ * @type {number}
53
+ * @memberof PSTRecipient
54
+ */
55
+ get recipientFlags() {
56
+ return this.getIntItem(OutlookProperties_1.OutlookProperties.PR_RECIPIENT_FLAGS);
57
+ }
58
+ /**
59
+ * Specifies the location of the current recipient in the recipient table.
60
+ * https://msdn.microsoft.com/en-us/library/ee201359(v=exchg.80).aspx
61
+ * @readonly
62
+ * @type {number}
63
+ * @memberof PSTRecipient
64
+ */
65
+ get recipientOrder() {
66
+ return this.getIntItem(OutlookProperties_1.OutlookProperties.PidTagRecipientOrder);
67
+ }
68
+ /**
69
+ * Contains the SMTP address for the address book object.
70
+ * https://msdn.microsoft.com/en-us/library/office/cc842421.aspx
71
+ * @readonly
72
+ * @type {string}
73
+ * @memberof PSTRecipient
74
+ */
75
+ get smtpAddress() {
76
+ // If the recipient address type is SMTP, we can simply return the recipient address.
77
+ const addressType = this.addrType;
78
+ if (addressType != null && addressType.toLowerCase() === 'smtp') {
79
+ const addr = this.emailAddress;
80
+ if (addr != null && addr.length != 0) {
81
+ return addr;
82
+ }
83
+ }
84
+ // Otherwise, we have to hope the SMTP address is present as the PidTagPrimarySmtpAddress property.
85
+ return this.getStringItem(OutlookProperties_1.OutlookProperties.PR_SMTP_ADDRESS);
86
+ }
87
+ /**
88
+ * JSON stringify the object properties.
89
+ * @returns {string}
90
+ * @memberof PSTRecipient
91
+ */
92
+ toJSON() {
93
+ const clone = Object.assign({
94
+ displayName: this.displayName,
95
+ smtpAddress: this.smtpAddress,
96
+ recipientType: this.recipientType,
97
+ addrType: this.addrType,
98
+ emailAddress: this.emailAddress,
99
+ recipientFlags: this.recipientFlags,
100
+ recipientOrder: this.recipientOrder,
101
+ }, this);
102
+ return clone;
103
+ }
104
+ }
105
+ exports.PSTRecipient = PSTRecipient;
@@ -0,0 +1,146 @@
1
+ import { PSTMessage } from './PSTMessage.class';
2
+ import { RecurrencePattern } from './RecurrencePattern.class';
3
+ import { PLNode } from './PLNode';
4
+ import { PropertyFinder } from './PAUtil';
5
+ import { PLSubNode } from './PLSubNode';
6
+ import { RootProvider } from './RootProvider';
7
+ export declare class PSTTask extends PSTMessage {
8
+ /**
9
+ * Creates an instance of PSTTask.
10
+ * @internal
11
+ * @param {PSTFile} rootProvider
12
+ * @param {DescriptorIndexNode} descriptorIndexNode
13
+ * @param {Map<number, PSTDescriptorItem>} [localDescriptorItems]
14
+ * @memberof PSTTask
15
+ */
16
+ constructor(rootProvider: RootProvider, node: PLNode, subNode: PLSubNode, propertyFinder: PropertyFinder);
17
+ /**
18
+ * Specifies the status of the user's progress on the task.
19
+ * https://msdn.microsoft.com/en-us/library/office/cc842120.aspx
20
+ * @readonly
21
+ * @type {number}
22
+ * @memberof PSTTask
23
+ */
24
+ get taskStatus(): number;
25
+ /**
26
+ * Indicates the progress the user has made on a task.
27
+ * https://msdn.microsoft.com/en-us/library/office/cc839932.aspx
28
+ * @readonly
29
+ * @type {number}
30
+ * @memberof PSTTask
31
+ */
32
+ get percentComplete(): number;
33
+ /**
34
+ * Specifies the date when the user completes the task.
35
+ * https://msdn.microsoft.com/en-us/library/office/cc815753.aspx
36
+ * @readonly
37
+ * @type {Date}
38
+ * @memberof PSTTask
39
+ */
40
+ get taskDateCompleted(): Date | null;
41
+ /**
42
+ * Indicates the number of minutes that the user performed a task.
43
+ * https://msdn.microsoft.com/en-us/library/office/cc842253.aspx
44
+ * @readonly
45
+ * @type {number}
46
+ * @memberof PSTTask
47
+ */
48
+ get taskActualEffort(): number;
49
+ /**
50
+ * Indicates the amount of time, in minutes, that the user expects to perform a task.
51
+ * https://msdn.microsoft.com/en-us/library/office/cc842485.aspx
52
+ * @readonly
53
+ * @type {number}
54
+ * @memberof PSTTask
55
+ */
56
+ get taskEstimatedEffort(): number;
57
+ /**
58
+ * Indicates which copy is the latest update of a task.
59
+ * https://msdn.microsoft.com/en-us/library/office/cc815510.aspx
60
+ * @readonly
61
+ * @type {number}
62
+ * @memberof PSTTask
63
+ */
64
+ get taskVersion(): number;
65
+ /**
66
+ * Indicates the task is complete.
67
+ * https://msdn.microsoft.com/en-us/library/office/cc839514.aspx
68
+ * @readonly
69
+ * @type {boolean}
70
+ * @memberof PSTTask
71
+ */
72
+ get isTaskComplete(): boolean;
73
+ /**
74
+ * Contains the name of the task owner.
75
+ * https://msdn.microsoft.com/en-us/library/office/cc842363.aspx
76
+ * @readonly
77
+ * @type {string}
78
+ * @memberof PSTTask
79
+ */
80
+ get taskOwner(): string;
81
+ /**
82
+ * Names the user who was last assigned the task.
83
+ * https://msdn.microsoft.com/en-us/library/office/cc815865.aspx
84
+ * @readonly
85
+ * @type {string}
86
+ * @memberof PSTTask
87
+ */
88
+ get taskAssigner(): string;
89
+ /**
90
+ * Names the most recent user who was the task owner.
91
+ * https://msdn.microsoft.com/en-us/library/office/cc842278.aspx
92
+ * @readonly
93
+ * @type {string}
94
+ * @memberof PSTTask
95
+ */
96
+ get taskLastUser(): string;
97
+ /**
98
+ * Provides an aid to custom sorting tasks.
99
+ * https://msdn.microsoft.com/en-us/library/office/cc765654.aspx
100
+ * @readonly
101
+ * @type {number}
102
+ * @memberof PSTTask
103
+ */
104
+ get taskOrdinal(): number;
105
+ /**
106
+ * Indicates whether the task includes a recurrence pattern.
107
+ * https://msdn.microsoft.com/en-us/library/office/cc765875.aspx
108
+ * @type {boolean}
109
+ * @memberof PSTTask
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;
124
+ /**
125
+ * Indicates the role of the current user relative to the task.
126
+ * https://msdn.microsoft.com/en-us/library/office/cc842113.aspx
127
+ * @readonly
128
+ * @type {number}
129
+ * @memberof PSTTask
130
+ */
131
+ get taskOwnership(): number;
132
+ /**
133
+ * Indicates the acceptance state of the task.
134
+ * https://msdn.microsoft.com/en-us/library/office/cc839689.aspx
135
+ * @readonly
136
+ * @type {number}
137
+ * @memberof PSTTask
138
+ */
139
+ get acceptanceState(): number;
140
+ /**
141
+ * JSON stringify the object properties.
142
+ * @returns {string}
143
+ * @memberof PSTTask
144
+ */
145
+ toJSON(): any;
146
+ }