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.
- package/dist/ColumnDescriptor.class.js +7 -4
- package/dist/DescriptorIndexNode.class.d.ts +3 -3
- package/dist/NodeInfo.class.d.ts +2 -2
- package/dist/NodeMap.class.d.ts +2 -2
- package/dist/NodeMap.class.js +5 -2
- package/dist/OffsetIndexItem.class.d.ts +3 -3
- package/dist/PSTAttachment.class.js +5 -2
- package/dist/PSTDescriptorItem.class.js +7 -4
- package/dist/PSTFile.class.d.ts +8 -8
- package/dist/PSTFile.class.js +42 -16
- package/dist/PSTFolder.class.js +8 -5
- package/dist/PSTMessage.class.d.ts +2 -2
- package/dist/PSTMessage.class.js +7 -4
- package/dist/PSTNodeInputStream.class.d.ts +5 -5
- package/dist/PSTNodeInputStream.class.js +44 -18
- package/dist/PSTObject.class.d.ts +3 -3
- package/dist/PSTObject.class.js +9 -6
- package/dist/PSTTable.class.d.ts +2 -2
- package/dist/PSTTable.class.js +14 -11
- package/dist/PSTTable7C.class.js +22 -19
- package/dist/PSTTableBC.class.js +6 -3
- package/dist/PSTTableItem.class.d.ts +4 -4
- package/dist/PSTTableItem.class.js +5 -2
- package/dist/PSTUtil.class.d.ts +5 -5
- package/dist/PSTUtil.class.js +14 -9
- package/example/package.json +7 -7
- package/example/test-min.ts +31 -12
- package/example/{test-mem.ts → test.ts} +38 -30
- package/example/testdata/output.txt +278 -0
- package/example/testdata/outputBody.txt +3404 -0
- package/example/yarn.lock +51 -40
- package/junit.xml +68 -68
- package/package.json +24 -23
- package/example/test-max.ts +0 -251
package/example/yarn.lock
CHANGED
|
@@ -7,42 +7,47 @@
|
|
|
7
7
|
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
|
|
8
8
|
integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==
|
|
9
9
|
|
|
10
|
-
"@cspotcode/source-map-support@0.
|
|
11
|
-
version "0.
|
|
12
|
-
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.
|
|
13
|
-
integrity sha512-
|
|
10
|
+
"@cspotcode/source-map-support@0.7.0":
|
|
11
|
+
version "0.7.0"
|
|
12
|
+
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5"
|
|
13
|
+
integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==
|
|
14
14
|
dependencies:
|
|
15
15
|
"@cspotcode/source-map-consumer" "0.8.0"
|
|
16
16
|
|
|
17
17
|
"@tsconfig/node10@^1.0.7":
|
|
18
|
-
version "1.0.
|
|
19
|
-
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.
|
|
20
|
-
integrity sha512-
|
|
18
|
+
version "1.0.8"
|
|
19
|
+
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
|
|
20
|
+
integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==
|
|
21
21
|
|
|
22
22
|
"@tsconfig/node12@^1.0.7":
|
|
23
|
-
version "1.0.
|
|
24
|
-
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.
|
|
25
|
-
integrity sha512
|
|
23
|
+
version "1.0.9"
|
|
24
|
+
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c"
|
|
25
|
+
integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==
|
|
26
26
|
|
|
27
27
|
"@tsconfig/node14@^1.0.0":
|
|
28
|
-
version "1.0.
|
|
29
|
-
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.
|
|
30
|
-
integrity sha512-
|
|
28
|
+
version "1.0.1"
|
|
29
|
+
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2"
|
|
30
|
+
integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==
|
|
31
31
|
|
|
32
32
|
"@tsconfig/node16@^1.0.2":
|
|
33
33
|
version "1.0.2"
|
|
34
34
|
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
|
|
35
35
|
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==
|
|
36
36
|
|
|
37
|
+
"@types/node@^17.0.22":
|
|
38
|
+
version "17.0.22"
|
|
39
|
+
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.22.tgz#38b6c4b9b2f3ed9f2e376cce42a298fb2375251e"
|
|
40
|
+
integrity sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw==
|
|
41
|
+
|
|
37
42
|
acorn-walk@^8.1.1:
|
|
38
|
-
version "8.
|
|
39
|
-
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.
|
|
40
|
-
integrity sha512-
|
|
43
|
+
version "8.2.0"
|
|
44
|
+
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
|
|
45
|
+
integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
|
|
41
46
|
|
|
42
47
|
acorn@^8.4.1:
|
|
43
|
-
version "8.
|
|
44
|
-
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.
|
|
45
|
-
integrity sha512-
|
|
48
|
+
version "8.7.0"
|
|
49
|
+
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
|
|
50
|
+
integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==
|
|
46
51
|
|
|
47
52
|
arg@^4.1.0:
|
|
48
53
|
version "4.1.3"
|
|
@@ -59,15 +64,15 @@ diff@^4.0.1:
|
|
|
59
64
|
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
|
|
60
65
|
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
|
|
61
66
|
|
|
62
|
-
eslint-config-prettier@^8.
|
|
63
|
-
version "8.
|
|
64
|
-
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.
|
|
65
|
-
integrity sha512-
|
|
67
|
+
eslint-config-prettier@^8.5.0:
|
|
68
|
+
version "8.5.0"
|
|
69
|
+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
|
|
70
|
+
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
|
|
66
71
|
|
|
67
|
-
eslint-plugin-prettier@^
|
|
68
|
-
version "
|
|
69
|
-
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-
|
|
70
|
-
integrity sha512-
|
|
72
|
+
eslint-plugin-prettier@^4.0.0:
|
|
73
|
+
version "4.0.0"
|
|
74
|
+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0"
|
|
75
|
+
integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==
|
|
71
76
|
dependencies:
|
|
72
77
|
prettier-linter-helpers "^1.0.0"
|
|
73
78
|
|
|
@@ -93,21 +98,21 @@ prettier-linter-helpers@^1.0.0:
|
|
|
93
98
|
dependencies:
|
|
94
99
|
fast-diff "^1.1.2"
|
|
95
100
|
|
|
96
|
-
prettier@^2.
|
|
97
|
-
version "2.
|
|
98
|
-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.
|
|
99
|
-
integrity sha512-
|
|
101
|
+
prettier@^2.6.0:
|
|
102
|
+
version "2.6.0"
|
|
103
|
+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.0.tgz#12f8f504c4d8ddb76475f441337542fa799207d4"
|
|
104
|
+
integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==
|
|
100
105
|
|
|
101
106
|
"pst-extractor@link:..":
|
|
102
107
|
version "0.0.0"
|
|
103
108
|
uid ""
|
|
104
109
|
|
|
105
|
-
ts-node@^10.
|
|
106
|
-
version "10.
|
|
107
|
-
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.
|
|
108
|
-
integrity sha512-
|
|
110
|
+
ts-node@^10.7.0:
|
|
111
|
+
version "10.7.0"
|
|
112
|
+
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5"
|
|
113
|
+
integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==
|
|
109
114
|
dependencies:
|
|
110
|
-
"@cspotcode/source-map-support" "0.
|
|
115
|
+
"@cspotcode/source-map-support" "0.7.0"
|
|
111
116
|
"@tsconfig/node10" "^1.0.7"
|
|
112
117
|
"@tsconfig/node12" "^1.0.7"
|
|
113
118
|
"@tsconfig/node14" "^1.0.0"
|
|
@@ -118,18 +123,24 @@ ts-node@^10.2.0:
|
|
|
118
123
|
create-require "^1.1.0"
|
|
119
124
|
diff "^4.0.1"
|
|
120
125
|
make-error "^1.1.1"
|
|
126
|
+
v8-compile-cache-lib "^3.0.0"
|
|
121
127
|
yn "3.1.1"
|
|
122
128
|
|
|
123
|
-
typescript@^4.
|
|
124
|
-
version "4.
|
|
125
|
-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.
|
|
126
|
-
integrity sha512-
|
|
129
|
+
typescript@^4.6.2:
|
|
130
|
+
version "4.6.2"
|
|
131
|
+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4"
|
|
132
|
+
integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==
|
|
127
133
|
|
|
128
134
|
uuid-parse@^1.1.0:
|
|
129
135
|
version "1.1.0"
|
|
130
136
|
resolved "https://registry.yarnpkg.com/uuid-parse/-/uuid-parse-1.1.0.tgz#7061c5a1384ae0e1f943c538094597e1b5f3a65b"
|
|
131
137
|
integrity sha512-OdmXxA8rDsQ7YpNVbKSJkNzTw2I+S5WsbMDnCtIWSQaosNAcWtFuI/YK1TjzUI6nbkgiqEyh8gWngfcv8Asd9A==
|
|
132
138
|
|
|
139
|
+
v8-compile-cache-lib@^3.0.0:
|
|
140
|
+
version "3.0.0"
|
|
141
|
+
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz#0582bcb1c74f3a2ee46487ceecf372e46bce53e8"
|
|
142
|
+
integrity sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==
|
|
143
|
+
|
|
133
144
|
yn@3.1.1:
|
|
134
145
|
version "3.1.1"
|
|
135
146
|
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
|
package/junit.xml
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<testsuites name="jest tests" tests="22" failures="0" errors="0" time="
|
|
3
|
-
<testsuite name="
|
|
4
|
-
<testcase classname="
|
|
5
|
-
</testcase>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<testcase classname="
|
|
13
|
-
</testcase>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<testcase classname="
|
|
19
|
-
</testcase>
|
|
20
|
-
</testsuite>
|
|
21
|
-
<testsuite name="
|
|
22
|
-
<testcase classname="
|
|
23
|
-
</testcase>
|
|
24
|
-
<testcase classname="
|
|
25
|
-
</testcase>
|
|
26
|
-
</testsuite>
|
|
27
|
-
<testsuite name="
|
|
28
|
-
<testcase classname="
|
|
29
|
-
</testcase>
|
|
30
|
-
<testcase classname="
|
|
31
|
-
</testcase>
|
|
32
|
-
</testsuite>
|
|
33
|
-
<testsuite name="
|
|
34
|
-
<testcase classname="
|
|
35
|
-
</testcase>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<testcase classname="
|
|
43
|
-
</testcase>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<testcase classname="
|
|
49
|
-
</testcase>
|
|
50
|
-
</testsuite>
|
|
51
|
-
<testsuite name="
|
|
52
|
-
<testcase classname="
|
|
53
|
-
</testcase>
|
|
54
|
-
<testcase classname="
|
|
55
|
-
</testcase>
|
|
56
|
-
</testsuite>
|
|
57
|
-
<testsuite name="PSTAttachment tests" errors="0" failures="0" skipped="0" timestamp="
|
|
58
|
-
<testcase classname="PSTAttachment tests should have a contact with an attachment" name="PSTAttachment tests should have a contact with an attachment" time="0.
|
|
59
|
-
</testcase>
|
|
60
|
-
<testcase classname="PSTAttachment tests should have a task with an attachment" name="PSTAttachment tests should have a task with an attachment" time="0.
|
|
61
|
-
</testcase>
|
|
62
|
-
<testcase classname="PSTAttachment tests should have email with word attachment" name="PSTAttachment tests should have email with word attachment" time="0.
|
|
63
|
-
</testcase>
|
|
64
|
-
<testcase classname="PSTAttachment tests should have email with excel attachment" name="PSTAttachment tests should have email with excel attachment" time="0.
|
|
65
|
-
</testcase>
|
|
66
|
-
<testcase classname="PSTAttachment tests should have email with jpg attachment" name="PSTAttachment tests should have email with jpg attachment" time="0.
|
|
67
|
-
</testcase>
|
|
68
|
-
</testsuite>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<testsuites name="jest tests" tests="22" failures="0" errors="0" time="7.714">
|
|
3
|
+
<testsuite name="PSTfile tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.376" tests="1">
|
|
4
|
+
<testcase classname="PSTfile tests should open the file" name="PSTfile tests should open the file" time="0.015">
|
|
5
|
+
</testcase>
|
|
6
|
+
</testsuite>
|
|
7
|
+
<testsuite name="PSTObject tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.487" tests="1">
|
|
8
|
+
<testcase classname="PSTObject tests should have basic attributes" name="PSTObject tests should have basic attributes" time="0.144">
|
|
9
|
+
</testcase>
|
|
10
|
+
</testsuite>
|
|
11
|
+
<testsuite name="PSTFolder tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.482" tests="2">
|
|
12
|
+
<testcase classname="PSTFolder tests should have a root folder" name="PSTFolder tests should have a root folder" time="0.012">
|
|
13
|
+
</testcase>
|
|
14
|
+
<testcase classname="PSTFolder tests root folder should have sub folders" name="PSTFolder tests root folder should have sub folders" time="0.114">
|
|
15
|
+
</testcase>
|
|
16
|
+
</testsuite>
|
|
17
|
+
<testsuite name="PSTRecipient tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.533" tests="1">
|
|
18
|
+
<testcase classname="PSTRecipient tests should have email messages" name="PSTRecipient tests should have email messages" time="0.179">
|
|
19
|
+
</testcase>
|
|
20
|
+
</testsuite>
|
|
21
|
+
<testsuite name="PSTMessage tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.625" tests="2">
|
|
22
|
+
<testcase classname="PSTMessage tests should have email messages" name="PSTMessage tests should have email messages" time="0.098">
|
|
23
|
+
</testcase>
|
|
24
|
+
<testcase classname="PSTMessage tests should have email message which uses block skip points" name="PSTMessage tests should have email message which uses block skip points" time="0.055">
|
|
25
|
+
</testcase>
|
|
26
|
+
</testsuite>
|
|
27
|
+
<testsuite name="PSTActivity tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.827" tests="2">
|
|
28
|
+
<testcase classname="PSTActivity tests should have a Journal folder" name="PSTActivity tests should have a Journal folder" time="0.002">
|
|
29
|
+
</testcase>
|
|
30
|
+
<testcase classname="PSTActivity tests root folder should have a journal entry" name="PSTActivity tests root folder should have a journal entry" time="0.015">
|
|
31
|
+
</testcase>
|
|
32
|
+
</testsuite>
|
|
33
|
+
<testsuite name="PSTTask tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.833" tests="2">
|
|
34
|
+
<testcase classname="PSTTask tests should have a Tasks folder" name="PSTTask tests should have a Tasks folder" time="0.002">
|
|
35
|
+
</testcase>
|
|
36
|
+
<testcase classname="PSTTask tests should have two tasks" name="PSTTask tests should have two tasks" time="0.026">
|
|
37
|
+
</testcase>
|
|
38
|
+
</testsuite>
|
|
39
|
+
<testsuite name="PSTAppointment tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.835" tests="2">
|
|
40
|
+
<testcase classname="PSTAppointment tests should have a Calendar folder" name="PSTAppointment tests should have a Calendar folder" time="0.003">
|
|
41
|
+
</testcase>
|
|
42
|
+
<testcase classname="PSTAppointment tests should have two calendar items" name="PSTAppointment tests should have two calendar items" time="0.024">
|
|
43
|
+
</testcase>
|
|
44
|
+
</testsuite>
|
|
45
|
+
<testsuite name="PSTContact tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.85" tests="2">
|
|
46
|
+
<testcase classname="PSTContact tests should have a Contact folder" name="PSTContact tests should have a Contact folder" time="0.002">
|
|
47
|
+
</testcase>
|
|
48
|
+
<testcase classname="PSTContact tests should have a contact with several fields" name="PSTContact tests should have a contact with several fields" time="0.041">
|
|
49
|
+
</testcase>
|
|
50
|
+
</testsuite>
|
|
51
|
+
<testsuite name="RecurrencePattern tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="4.864" tests="2">
|
|
52
|
+
<testcase classname="RecurrencePattern tests should have a Calendar folder" name="RecurrencePattern tests should have a Calendar folder" time="0.002">
|
|
53
|
+
</testcase>
|
|
54
|
+
<testcase classname="RecurrencePattern tests should have repeating events" name="RecurrencePattern tests should have repeating events" time="0.046">
|
|
55
|
+
</testcase>
|
|
56
|
+
</testsuite>
|
|
57
|
+
<testsuite name="PSTAttachment tests" errors="0" failures="0" skipped="0" timestamp="2022-04-06T14:15:05" time="5.325" tests="5">
|
|
58
|
+
<testcase classname="PSTAttachment tests should have a contact with an attachment" name="PSTAttachment tests should have a contact with an attachment" time="0.246">
|
|
59
|
+
</testcase>
|
|
60
|
+
<testcase classname="PSTAttachment tests should have a task with an attachment" name="PSTAttachment tests should have a task with an attachment" time="0.115">
|
|
61
|
+
</testcase>
|
|
62
|
+
<testcase classname="PSTAttachment tests should have email with word attachment" name="PSTAttachment tests should have email with word attachment" time="0.119">
|
|
63
|
+
</testcase>
|
|
64
|
+
<testcase classname="PSTAttachment tests should have email with excel attachment" name="PSTAttachment tests should have email with excel attachment" time="0.123">
|
|
65
|
+
</testcase>
|
|
66
|
+
<testcase classname="PSTAttachment tests should have email with jpg attachment" name="PSTAttachment tests should have email with jpg attachment" time="0.123">
|
|
67
|
+
</testcase>
|
|
68
|
+
</testsuite>
|
|
69
69
|
</testsuites>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pst-extractor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Extract objects from MS Outlook/Exchange PST files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,39 +18,40 @@
|
|
|
18
18
|
"author": "Ed Pfromer (epfromer@gmail.com)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@babel/core": "^7.
|
|
22
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
23
|
-
"@babel/preset-env": "^7.
|
|
24
|
-
"@babel/preset-typescript": "^7.
|
|
21
|
+
"@babel/core": "^7.17.8",
|
|
22
|
+
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
23
|
+
"@babel/preset-env": "^7.16.11",
|
|
24
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
25
25
|
"@types/debug": "4.1.7",
|
|
26
|
-
"@types/jest": "^
|
|
26
|
+
"@types/jest": "^27.4.1",
|
|
27
27
|
"@types/long": "^4.0.1",
|
|
28
|
-
"@types/node": "^
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
30
|
-
"@typescript-eslint/parser": "^
|
|
28
|
+
"@types/node": "^17.0.23",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
|
30
|
+
"@typescript-eslint/parser": "^5.18.0",
|
|
31
31
|
"babel-eslint": "^10.1.0",
|
|
32
|
-
"babel-jest": "^27.
|
|
32
|
+
"babel-jest": "^27.5.1",
|
|
33
33
|
"cross-env": "^7.0.3",
|
|
34
|
-
"debug": "^4.3.
|
|
35
|
-
"eslint": "^
|
|
36
|
-
"eslint-config-prettier": "^8.
|
|
34
|
+
"debug": "^4.3.4",
|
|
35
|
+
"eslint": "^8.12.0",
|
|
36
|
+
"eslint-config-prettier": "^8.5.0",
|
|
37
37
|
"eslint-config-standard": "^16.0.3",
|
|
38
|
-
"eslint-plugin-import": "^2.
|
|
38
|
+
"eslint-plugin-import": "^2.26.0",
|
|
39
39
|
"eslint-plugin-node": "^11.1.0",
|
|
40
|
-
"eslint-plugin-prettier": "^
|
|
41
|
-
"eslint-plugin-promise": "^
|
|
40
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
41
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
42
42
|
"eslint-plugin-standard": "^5.0.0",
|
|
43
|
-
"jest": "^27.
|
|
44
|
-
"jest-junit": "^
|
|
43
|
+
"jest": "^27.5.1",
|
|
44
|
+
"jest-junit": "^13.1.0",
|
|
45
45
|
"npm-run-all": "^4.1.5",
|
|
46
|
-
"prettier": "^2.
|
|
46
|
+
"prettier": "^2.6.2",
|
|
47
47
|
"rimraf": "^3.0.2",
|
|
48
|
-
"source-map-support": "^0.5.
|
|
49
|
-
"ts-node": "^10.
|
|
50
|
-
"typescript": "^4.3
|
|
48
|
+
"source-map-support": "^0.5.21",
|
|
49
|
+
"ts-node": "^10.7.0",
|
|
50
|
+
"typescript": "^4.6.3"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"
|
|
53
|
+
"iconv-lite": "^0.6.3",
|
|
54
|
+
"long": "^5.2.0",
|
|
54
55
|
"uuid-parse": "^1.1.0"
|
|
55
56
|
},
|
|
56
57
|
"eslintConfig": {
|
package/example/test-max.ts
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs'
|
|
2
|
-
import { PSTAttachment } from '../src/PSTAttachment.class'
|
|
3
|
-
import { PSTFile } from '../src/PSTFile.class'
|
|
4
|
-
import { PSTFolder } from '../src/PSTFolder.class'
|
|
5
|
-
import { PSTMessage } from '../src/PSTMessage.class'
|
|
6
|
-
|
|
7
|
-
// TODO - location of pst files
|
|
8
|
-
const pstFolder = 'C:/github/testdata/'
|
|
9
|
-
// TODO - if saveToFS true, location to store extracted files
|
|
10
|
-
const saveToFS = true
|
|
11
|
-
const topOutputFolder = 'C:/github/testdataoutput/'
|
|
12
|
-
|
|
13
|
-
const verbose = true
|
|
14
|
-
const displaySender = true
|
|
15
|
-
const displayBody = false
|
|
16
|
-
const displayBodyRTF = false
|
|
17
|
-
const displayBodyHTML = true
|
|
18
|
-
let outputFolder = ''
|
|
19
|
-
let depth = -1
|
|
20
|
-
let col = 0
|
|
21
|
-
|
|
22
|
-
// make a top level folder to hold content
|
|
23
|
-
try {
|
|
24
|
-
if (saveToFS) {
|
|
25
|
-
fs.mkdirSync(topOutputFolder)
|
|
26
|
-
}
|
|
27
|
-
} catch (err) {
|
|
28
|
-
console.error(err)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const directoryListing = fs.readdirSync(pstFolder)
|
|
32
|
-
directoryListing.forEach((filename) => {
|
|
33
|
-
console.log(pstFolder + filename)
|
|
34
|
-
|
|
35
|
-
// time for performance comparison to Java and improvement
|
|
36
|
-
const start = Date.now()
|
|
37
|
-
const pstFile = new PSTFile(pstFolder + filename)
|
|
38
|
-
|
|
39
|
-
// make a sub folder for each PST
|
|
40
|
-
try {
|
|
41
|
-
if (saveToFS) {
|
|
42
|
-
outputFolder = topOutputFolder + filename + '/'
|
|
43
|
-
fs.mkdirSync(outputFolder)
|
|
44
|
-
}
|
|
45
|
-
} catch (err) {
|
|
46
|
-
console.error(err)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
console.log(pstFile.getMessageStore().displayName)
|
|
50
|
-
processFolder(pstFile.getRootFolder())
|
|
51
|
-
|
|
52
|
-
const end = Date.now()
|
|
53
|
-
console.log('processed in ' + (end - start) + ' ms')
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Walk the folder tree recursively and process emails.
|
|
58
|
-
* @param {PSTFolder} folder
|
|
59
|
-
*/
|
|
60
|
-
function processFolder(folder: PSTFolder) {
|
|
61
|
-
depth++
|
|
62
|
-
|
|
63
|
-
// the root folder doesn't have a display name
|
|
64
|
-
if (depth > 0) {
|
|
65
|
-
console.log(getDepth(depth) + folder.displayName)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// go through the folders...
|
|
69
|
-
if (folder.hasSubfolders) {
|
|
70
|
-
const childFolders: PSTFolder[] = folder.getSubFolders()
|
|
71
|
-
for (const childFolder of childFolders) {
|
|
72
|
-
processFolder(childFolder)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// and now the emails for this folder
|
|
77
|
-
if (folder.contentCount > 0) {
|
|
78
|
-
depth++
|
|
79
|
-
let email: PSTMessage = folder.getNextChild()
|
|
80
|
-
while (email != null) {
|
|
81
|
-
if (verbose) {
|
|
82
|
-
console.log(
|
|
83
|
-
getDepth(depth) +
|
|
84
|
-
'Email: ' +
|
|
85
|
-
email.descriptorNodeId +
|
|
86
|
-
' - ' +
|
|
87
|
-
email.subject
|
|
88
|
-
)
|
|
89
|
-
} else {
|
|
90
|
-
printDot()
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// sender
|
|
94
|
-
const sender = getSender(email)
|
|
95
|
-
|
|
96
|
-
// recipients
|
|
97
|
-
const recipients = getRecipients(email)
|
|
98
|
-
|
|
99
|
-
// display body?
|
|
100
|
-
if (displayBody) console.log(email.body)
|
|
101
|
-
if (displayBodyRTF) console.log(email.bodyRTF)
|
|
102
|
-
if (displayBodyHTML) console.log(email.bodyHTML.length)
|
|
103
|
-
|
|
104
|
-
// save content to fs?
|
|
105
|
-
if (saveToFS) {
|
|
106
|
-
// create date string in format YYYY-MM-DD
|
|
107
|
-
let strDate = ''
|
|
108
|
-
let d = email.clientSubmitTime
|
|
109
|
-
if (!d && email.creationTime) {
|
|
110
|
-
d = email.creationTime
|
|
111
|
-
}
|
|
112
|
-
if (d) {
|
|
113
|
-
const month = ('0' + (d.getMonth() + 1)).slice(-2)
|
|
114
|
-
const day = ('0' + d.getDate()).slice(-2)
|
|
115
|
-
strDate = d.getFullYear() + '-' + month + '-' + day
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// create a folder for each day (client submit time)
|
|
119
|
-
const emailFolder = outputFolder + strDate + '/'
|
|
120
|
-
if (!fs.existsSync(emailFolder)) {
|
|
121
|
-
try {
|
|
122
|
-
fs.mkdirSync(emailFolder)
|
|
123
|
-
} catch (err) {
|
|
124
|
-
console.error(err)
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
doSaveToFS(email, emailFolder, sender, recipients)
|
|
129
|
-
}
|
|
130
|
-
email = folder.getNextChild()
|
|
131
|
-
}
|
|
132
|
-
depth--
|
|
133
|
-
}
|
|
134
|
-
depth--
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Save items to filesystem.
|
|
139
|
-
* @param {PSTMessage} msg
|
|
140
|
-
* @param {string} emailFolder
|
|
141
|
-
* @param {string} sender
|
|
142
|
-
* @param {string} recipients
|
|
143
|
-
*/
|
|
144
|
-
function doSaveToFS(
|
|
145
|
-
msg: PSTMessage,
|
|
146
|
-
emailFolder: string,
|
|
147
|
-
sender: string,
|
|
148
|
-
recipients: string
|
|
149
|
-
) {
|
|
150
|
-
try {
|
|
151
|
-
// save the msg as a txt file
|
|
152
|
-
const filename = emailFolder + msg.descriptorNodeId + '.txt'
|
|
153
|
-
if (verbose) {
|
|
154
|
-
console.log('saving msg to ' + filename)
|
|
155
|
-
}
|
|
156
|
-
const fd = fs.openSync(filename, 'w')
|
|
157
|
-
fs.writeSync(fd, msg.clientSubmitTime + '\r\n')
|
|
158
|
-
fs.writeSync(fd, 'Type: ' + msg.messageClass + '\r\n')
|
|
159
|
-
fs.writeSync(fd, 'From: ' + sender + '\r\n')
|
|
160
|
-
fs.writeSync(fd, 'To: ' + recipients + '\r\n')
|
|
161
|
-
fs.writeSync(fd, 'Subject: ' + msg.subject)
|
|
162
|
-
fs.writeSync(fd, msg.body)
|
|
163
|
-
fs.closeSync(fd)
|
|
164
|
-
} catch (err) {
|
|
165
|
-
console.error(err)
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// walk list of attachments and save to fs
|
|
169
|
-
for (let i = 0; i < msg.numberOfAttachments; i++) {
|
|
170
|
-
const attachment: PSTAttachment = msg.getAttachment(i)
|
|
171
|
-
// Log.debug1(JSON.stringify(activity, null, 2));
|
|
172
|
-
if (attachment.filename) {
|
|
173
|
-
const filename =
|
|
174
|
-
emailFolder + msg.descriptorNodeId + '-' + attachment.longFilename
|
|
175
|
-
if (verbose) {
|
|
176
|
-
console.log('saving attachment to ' + filename)
|
|
177
|
-
}
|
|
178
|
-
try {
|
|
179
|
-
const fd = fs.openSync(filename, 'w')
|
|
180
|
-
const attachmentStream = attachment.fileInputStream
|
|
181
|
-
if (attachmentStream) {
|
|
182
|
-
const bufferSize = 8176
|
|
183
|
-
const buffer = Buffer.alloc(bufferSize)
|
|
184
|
-
let bytesRead
|
|
185
|
-
do {
|
|
186
|
-
bytesRead = attachmentStream.read(buffer)
|
|
187
|
-
fs.writeSync(fd, buffer, 0, bytesRead)
|
|
188
|
-
} while (bytesRead == bufferSize)
|
|
189
|
-
fs.closeSync(fd)
|
|
190
|
-
}
|
|
191
|
-
} catch (err) {
|
|
192
|
-
console.error(err)
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Get the sender and display.
|
|
200
|
-
* @param {PSTMessage} email
|
|
201
|
-
* @returns {string}
|
|
202
|
-
*/
|
|
203
|
-
function getSender(email: PSTMessage): string {
|
|
204
|
-
let sender = email.senderName
|
|
205
|
-
if (sender !== email.senderEmailAddress) {
|
|
206
|
-
sender += ' (' + email.senderEmailAddress + ')'
|
|
207
|
-
}
|
|
208
|
-
if (verbose && displaySender && email.messageClass === 'IPM.Note') {
|
|
209
|
-
console.log(getDepth(depth) + ' sender: ' + sender)
|
|
210
|
-
}
|
|
211
|
-
return sender
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Get the recipients and display.
|
|
216
|
-
* @param {PSTMessage} email
|
|
217
|
-
* @returns {string}
|
|
218
|
-
*/
|
|
219
|
-
function getRecipients(email: PSTMessage): string {
|
|
220
|
-
// could walk recipients table, but be fast and cheap
|
|
221
|
-
return email.displayTo
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Print a dot representing a message.
|
|
226
|
-
*/
|
|
227
|
-
function printDot() {
|
|
228
|
-
process.stdout.write('.')
|
|
229
|
-
if (col++ > 100) {
|
|
230
|
-
console.log('')
|
|
231
|
-
col = 0
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Returns a string with visual indicattion of depth in tree.
|
|
237
|
-
* @param {number} depth
|
|
238
|
-
* @returns {string}
|
|
239
|
-
*/
|
|
240
|
-
function getDepth(depth: number): string {
|
|
241
|
-
let sdepth = ''
|
|
242
|
-
if (col > 0) {
|
|
243
|
-
col = 0
|
|
244
|
-
sdepth += '\n'
|
|
245
|
-
}
|
|
246
|
-
for (let x = 0; x < depth - 1; x++) {
|
|
247
|
-
sdepth += ' | '
|
|
248
|
-
}
|
|
249
|
-
sdepth += ' |- '
|
|
250
|
-
return sdepth
|
|
251
|
-
}
|