Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: epfromer/pst-extractor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: datagovsg/pst-extractor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 13 commits
  • 27 files changed
  • 4 contributors

Commits on May 30, 2018

  1. removed winston logger

    Arshad Ali Abdul Samad authored and Arshad Ali Abdul Samad committed May 30, 2018
    Copy the full SHA
    ebc81ee View commit details
  2. removed fs

    Arshad Ali Abdul Samad authored and Arshad Ali Abdul Samad committed May 30, 2018
    Copy the full SHA
    685cd9b View commit details
  3. fixed tests

    Arshad Ali Abdul Samad authored and Arshad Ali Abdul Samad committed May 30, 2018
    Copy the full SHA
    1958e1f View commit details

Commits on Jun 2, 2018

  1. edited package.json so that build would run on github pull

    Arshad Ali Abdul Samad authored and Arshad Ali Abdul Samad committed Jun 2, 2018
    Copy the full SHA
    1dcd313 View commit details

Commits on Jun 7, 2018

  1. Merge pull request #1 from datagovsg/browser-support

    Browser support
    leonardloo authored Jun 7, 2018
    Copy the full SHA
    2795ced View commit details

Commits on Oct 20, 2019

  1. Update packages

    arshadali172 committed Oct 20, 2019
    Copy the full SHA
    fe40b19 View commit details
  2. Merge pull request #2 from datagovsg/update-package

    Update packages
    arshadali172 authored Oct 20, 2019
    Copy the full SHA
    5650b7d View commit details
  3. Copy the full SHA
    3fb85bd View commit details
  4. Merge pull request #3 from datagovsg/revert-2-update-package

    Revert "Update packages"
    arshadali172 authored Oct 20, 2019
    Copy the full SHA
    f2d28cb View commit details
  5. Copy the full SHA
    5787e3d View commit details
  6. Merge pull request #4 from datagovsg/fix-chai-error

    Specify exact chai version
    arshadali172 authored Oct 20, 2019
    Copy the full SHA
    d14f173 View commit details

Commits on Oct 22, 2019

  1. Bump version to 1.3.3

    arshadali172 committed Oct 22, 2019
    Copy the full SHA
    89013cd View commit details
  2. Merge pull request #5 from datagovsg/bump-version

    Bump version to 1.3.3
    arshadali172 authored Oct 22, 2019
    Copy the full SHA
    28a8589 View commit details
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "pst-extractor",
"version": "1.3.2",
"version": "1.3.3",
"description": "Extract objects from MS Outlook/Exchange PST files",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"test": "nyc --reporter=html mocha --opts mocha.opts",
"readme": "node ./node_modules/.bin/node-readme"
"readme": "node ./node_modules/.bin/node-readme",
"prepare": "npm run build"
},
"nyc": {
"extension": [
@@ -39,7 +40,7 @@
},
"homepage": "https://github.com/epfromer/pst-extractor#readme",
"devDependencies": {
"@types/chai": "^4.1.2",
"@types/chai": "4.1.2",
"@types/debug": "0.0.30",
"@types/long": "^4.0.0",
"@types/mocha": "^5.0.0",
@@ -59,7 +60,6 @@
},
"dependencies": {
"long": "^4.0.0",
"uuid-parse": "^1.0.0",
"winston": "^2.4.1"
"uuid-parse": "^1.0.0"
}
}
5 changes: 2 additions & 3 deletions src/LZFu/LZFu.class.ts
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@
* along with pst-extractor. If not, see <http://www.gnu.org/licenses/>.
*/
import { PSTUtil } from '../PSTUtil/PSTUtil.class';
import { Log } from '../Log.class';

// An implementation of the LZFu algorithm to decompress RTF content
export class LZFu {
@@ -60,7 +59,7 @@ export class LZFu {
let bytes: Buffer = Buffer.from(LZFu.LZFU_HEADER); //getBytes("US-ASCII");
PSTUtil.arraycopy(bytes, 0, lzBuffer, 0, LZFu.LZFU_HEADER.length);
} catch (err) {
Log.error('LZFu::decode cant preload buffer\n' + err)
console.error('LZFu::decode cant preload buffer\n' + err)
throw err;
}
let bufferPosition = LZFu.LZFU_HEADER.length;
@@ -90,7 +89,7 @@ export class LZFu {
index %= 4096;
}
} catch (err) {
Log.error('LZFu::decode copy the data from the buffer\n' + err)
console.error('LZFu::decode copy the data from the buffer\n' + err)
throw err;
}
} else {
46 changes: 0 additions & 46 deletions src/Log.class.ts

This file was deleted.

9 changes: 2 additions & 7 deletions src/PSTActivity/PSTActivity.spec.ts
Original file line number Diff line number Diff line change
@@ -3,14 +3,14 @@ import * as chai from 'chai';
import * as mocha from 'mocha';
import { PSTFile } from '../PSTFile/PSTFile.class';
import { PSTFolder } from '../PSTFolder/PSTFolder.class';
import { Log } from '../Log.class';
const resolve = require('path').resolve;
const fs = require("fs")
const expect = chai.expect;
let pstFile: PSTFile;
let folder: PSTFolder;

before(() => {
pstFile = new PSTFile(resolve('./src/testdata/mtnman1965@outlook.com.ost'));
pstFile = new PSTFile(fs.readFileSync('./src/testdata/mtnman1965@outlook.com.ost'));

// get to Journal folder
let childFolders: PSTFolder[] = pstFile.getRootFolder().getSubFolders();
@@ -21,18 +21,13 @@ before(() => {
folder = childFolders[15]; // Journal
});

after(() => {
pstFile.close();
});

describe('PSTActivity tests', () => {
it('should have a Journal folder', () => {
expect(folder.displayName).to.equal('Journal');
});

it('root folder should have a journal entry', () => {
let activity: PSTActivity = folder.getNextChild();
// Log.debug1(JSON.stringify(activity, null, 2));
expect(activity.messageClass).to.equal('IPM.Activity');
expect(activity.subject).to.equal('called Ed');
expect(activity.logTypeDesc).to.equal('Phone call');
10 changes: 2 additions & 8 deletions src/PSTAppointment/PSTAppointment.spec.ts
Original file line number Diff line number Diff line change
@@ -3,14 +3,14 @@ import * as chai from 'chai';
import * as mocha from 'mocha';
import { PSTFile } from '../PSTFile/PSTFile.class';
import { PSTFolder } from '../PSTFolder/PSTFolder.class';
import { Log } from '../Log.class';
const resolve = require('path').resolve;
const fs = require("fs")
const expect = chai.expect;
let pstFile: PSTFile;
let folder: PSTFolder;

before(() => {
pstFile = new PSTFile(resolve('./src/testdata/mtnman1965@outlook.com.ost'));
pstFile = new PSTFile(fs.readFileSync('./src/testdata/mtnman1965@outlook.com.ost'));

// get to Calendar folder
let childFolders: PSTFolder[] = pstFile.getRootFolder().getSubFolders();
@@ -21,26 +21,20 @@ before(() => {
folder = childFolders[11]; // Calendar
});

after(() => {
pstFile.close();
});

describe('PSTAppointment tests', () => {
it('should have a Journal folder', () => {
expect(folder.displayName).to.equal('Calendar');
});

it('should have two calendar items', () => {
let appt: PSTAppointment = folder.getNextChild();
// Log.debug1(JSON.stringify(appt, null, 2));
expect(appt.messageClass).to.equal('IPM.Appointment');
expect(appt.subject).to.equal('get lunch');
expect(appt.startTime).to.eql(new Date("2018-03-04T19:00:00.000Z"));
expect(appt.senderName).to.equal('Mountain Man');
expect(appt.duration).to.equal(60);

appt = folder.getNextChild();
// Log.debug1(JSON.stringify(appt, null, 2));
expect(appt.messageClass).to.equal('IPM.Appointment');
expect(appt.subject).to.equal('workout');
expect(appt.creationTime).to.eql(new Date("2018-03-05T20:26:26.396Z"));
3 changes: 1 addition & 2 deletions src/PSTAttachment/PSTAttachment.class.ts
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@ import { PSTMessage } from '../PSTMessage/PSTMessage.class';
import { PSTNodeInputStream } from '../PSTNodeInputStream/PSTNodeInputStream.class';
import * as long from 'long';
import { PSTTableItem } from '../PSTTableItem/PSTTableItem.class';
import { Log } from '../Log.class';
import { OutlookProperties } from '../OutlookProperties';

// Class containing attachment information.
@@ -144,7 +143,7 @@ export class PSTAttachment extends PSTObject {
return PSTUtil.createAppropriatePSTMessageObject(this.pstFile, this.descriptorIndexNode, attachmentTable, this.localDescriptorItems);
}
} catch (err) {
Log.error('PSTAttachment::embeddedPSTMessage createAppropriatePSTMessageObject failed\n' + err);
console.error('PSTAttachment::embeddedPSTMessage createAppropriatePSTMessageObject failed\n' + err);
throw err;
}
}
15 changes: 2 additions & 13 deletions src/PSTAttachment/PSTAttachment.spec.ts
Original file line number Diff line number Diff line change
@@ -6,14 +6,14 @@ import { PSTContact } from '../PSTContact/PSTContact.class';
import { PSTAttachment } from './PSTAttachment.class';
import { PSTTask } from '../PSTTask/PSTTask.class';
import { PSTMessage } from '../PSTMessage/PSTMessage.class';
import { Log } from '../Log.class';
const resolve = require('path').resolve;
const fs = require("fs")
const expect = chai.expect;
let pstFile: PSTFile;
let subtreeFolder: PSTFolder;

before(() => {
pstFile = new PSTFile(resolve('./src/testdata/mtnman1965@outlook.com.ost'));
pstFile = new PSTFile(fs.readFileSync('./src/testdata/mtnman1965@outlook.com.ost'));

// get to IPM_SUBTREE folder
let childFolders: PSTFolder[] = pstFile.getRootFolder().getSubFolders();
@@ -22,16 +22,11 @@ before(() => {
subtreeFolder = childFolders[4]; // IPM_SUBTREE
});

after(() => {
pstFile.close();
});

describe('PSTAttachment tests', () => {
it('should have a contact with an attachment', () => {
let childFolders = subtreeFolder.getSubFolders();
let folder = childFolders[10]; // Contacts
let contact: PSTContact = folder.getNextChild();
// Log.debug1(JSON.stringify(contact, null, 2));
expect(contact.messageClass).to.equal('IPM.Contact');
expect(contact.hasAttachments).to.be.true;

@@ -43,7 +38,6 @@ describe('PSTAttachment tests', () => {

// second attachment is never gonna give you up
attachment = contact.getAttachment(1);
// Log.debug1(JSON.stringify(attachment, null, 2));
expect(attachment.size).to.equal(8447);
expect(attachment.longFilename).to.equal('rickroll.jpg');
expect(attachment.creationTime).to.eql(new Date("2018-03-07T16:49:32.964Z"));
@@ -53,11 +47,9 @@ describe('PSTAttachment tests', () => {
let childFolders = subtreeFolder.getSubFolders();
let folder = childFolders[17]; // Tasks
let task: PSTTask = folder.getNextChild();
// Log.debug1(JSON.stringify(task, null, 2));
expect(task.messageClass).to.equal('IPM.Task');
expect(task.hasAttachments).to.be.true;
let attachment: PSTAttachment = task.getAttachment(0);
// Log.debug1(JSON.stringify(attachment, null, 2));
expect(attachment.size).to.equal(8447);
expect(attachment.longFilename).to.equal('rickroll.jpg');
expect(attachment.creationTime).to.eql(new Date("2018-03-07T16:49:32.964Z"));
@@ -88,7 +80,6 @@ describe('PSTAttachment tests', () => {
// Email: 2110308 - word attachment
expect(msg.hasAttachments).to.be.true;
let attachment: PSTAttachment = msg.getAttachment(0);
// Log.debug1(JSON.stringify(attachment, null, 2));
expect(attachment.size).to.equal(54044);
expect(attachment.longFilename).to.equal('OBA_2760.doc');
expect(attachment.creationTime).to.eql(new Date("2018-03-07T16:26:20.724Z"));
@@ -105,7 +96,6 @@ describe('PSTAttachment tests', () => {
// Email: 2110724 - excel attachment
expect(msg.hasAttachments).to.be.true;
let attachment: PSTAttachment = msg.getAttachment(0);
// Log.debug1(JSON.stringify(attachment, null, 2));
expect(attachment.size).to.equal(31016);
expect(attachment.longFilename).to.equal('RedRockA.xls');
expect(attachment.creationTime).to.eql(new Date("2018-03-07T16:31:56.075Z"));
@@ -123,7 +113,6 @@ describe('PSTAttachment tests', () => {
// Email: 2111140 - never gonna give you up
expect(msg.hasAttachments).to.be.true;
let attachment: PSTAttachment = msg.getAttachment(0);
// Log.debug1(JSON.stringify(attachment, null, 2));
expect(attachment.size).to.equal(5020);
expect(attachment.longFilename).to.equal('rickroll.jpg');
expect(attachment.creationTime).to.eql(new Date("2018-03-07T16:43:36.995Z"));
9 changes: 2 additions & 7 deletions src/PSTContact/PSTContact.spec.ts
Original file line number Diff line number Diff line change
@@ -3,14 +3,14 @@ import * as mocha from 'mocha';
import { PSTFile } from '../PSTFile/PSTFile.class';
import { PSTFolder } from '../PSTFolder/PSTFolder.class';
import { PSTContact } from './PSTContact.class';
import { Log } from '../Log.class';
const resolve = require('path').resolve;
const fs = require("fs")
const expect = chai.expect;
let pstFile: PSTFile;
let folder: PSTFolder;

before(() => {
pstFile = new PSTFile(resolve('./src/testdata/mtnman1965@outlook.com.ost'));
pstFile = new PSTFile(fs.readFileSync('./src/testdata/mtnman1965@outlook.com.ost'));

// get to Contact folder
let childFolders: PSTFolder[] = pstFile.getRootFolder().getSubFolders();
@@ -21,18 +21,13 @@ before(() => {
folder = childFolders[10]; // Calendar
});

after(() => {
pstFile.close();
});

describe('PSTContact tests', () => {
it('should have a Contact folder', () => {
expect(folder.displayName).to.equal('Contacts');
});

it('should have a contact with several fields', () => {
let contact: PSTContact = folder.getNextChild();
// Log.debug1(JSON.stringify(contact, null, 2));
expect(contact.messageClass).to.equal('IPM.Contact');
expect(contact.subject).to.equal('Ed Pfromer');
expect(contact.importance).to.equal(1);
6 changes: 0 additions & 6 deletions src/PSTFile/NodeMap.class.ts
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with pst-extractor. If not, see <http://www.gnu.org/licenses/>.
*/
import { Log } from '../Log.class';
import * as long from 'long';

/**
@@ -55,11 +54,9 @@ export class NodeMap {
let lkey = this.transformKey(key, idx);
this.nameToId.set(lkey.toString(), propId);
this.idToNumericName.set(propId, lkey);
Log.debug2('NodeMap::setId: propId = ' + propId + ', lkey = ' + lkey.toString());
} else if (typeof key === 'string') {
this.nameToId.set(key, propId);
this.idToStringName.set(propId, key);
Log.debug2('NodeMap::setId: propId = ' + propId + ', key = ' + key);
} else {
throw new Error('NodeMap::setId bad param type ' + typeof key);
}
@@ -95,9 +92,6 @@ export class NodeMap {
*/
public getNumericName(propId: number): long | undefined {
let lkey = this.idToNumericName.get(propId);
if (!lkey) {
Log.debug2("NodeMap::getNumericName Name to Id mapping not found, propId = " + propId);
}
return lkey;
}

Loading