@socialgouv/archimail-pst-extractor
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -21,2 +21,3 @@ { | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"import/default": "off", | ||
@@ -23,0 +24,0 @@ "no-unused-vars": "off", |
@@ -8,4 +8,5 @@ export { PSTActivity } from "./PSTActivity"; | ||
export { PSTMessage } from "./PSTMessage"; | ||
export { PSTObject } from "./PSTObject"; | ||
export { PSTRecipient } from "./PSTRecipient"; | ||
export { PSTTask } from "./PSTTask"; | ||
export * as PSTUtil from "./PSTUtil"; |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PSTUtil = exports.PSTTask = exports.PSTRecipient = exports.PSTMessage = exports.PSTFolder = exports.PSTFile = exports.PSTContact = exports.PSTAttachment = exports.PSTAppointment = exports.PSTActivity = void 0; | ||
exports.PSTUtil = exports.PSTTask = exports.PSTRecipient = exports.PSTObject = exports.PSTMessage = exports.PSTFolder = exports.PSTFile = exports.PSTContact = exports.PSTAttachment = exports.PSTAppointment = exports.PSTActivity = void 0; | ||
var PSTActivity_1 = require("./PSTActivity"); | ||
@@ -38,2 +38,4 @@ Object.defineProperty(exports, "PSTActivity", { enumerable: true, get: function () { return PSTActivity_1.PSTActivity; } }); | ||
Object.defineProperty(exports, "PSTMessage", { enumerable: true, get: function () { return PSTMessage_1.PSTMessage; } }); | ||
var PSTObject_1 = require("./PSTObject"); | ||
Object.defineProperty(exports, "PSTObject", { enumerable: true, get: function () { return PSTObject_1.PSTObject; } }); | ||
var PSTRecipient_1 = require("./PSTRecipient"); | ||
@@ -40,0 +42,0 @@ Object.defineProperty(exports, "PSTRecipient", { enumerable: true, get: function () { return PSTRecipient_1.PSTRecipient; } }); |
@@ -40,8 +40,9 @@ import type { DescriptorIndexNode } from "./DescriptorIndexNode"; | ||
*/ | ||
getNextChild(): PSTFolder | PSTMessage | null; | ||
getNextChild(): PSTMessage | null; | ||
/** | ||
* Iterate over children in this folder. | ||
*/ | ||
childrenIterator(): Generator<PSTMessage, void>; | ||
/** | ||
* Move the internal folder cursor to the desired position position 0 is before the first record. | ||
* @param {number} newIndex | ||
* @returns | ||
* @memberof PSTFolder | ||
*/ | ||
@@ -64,5 +65,2 @@ moveChildCursorTo(newIndex: number): void; | ||
* Number of emails in this folder | ||
* @readonly | ||
* @type {number} | ||
* @memberof PSTFolder | ||
*/ | ||
@@ -69,0 +67,0 @@ get emailCount(): number; |
@@ -104,6 +104,15 @@ "use strict"; | ||
/** | ||
* Iterate over children in this folder. | ||
*/ | ||
*childrenIterator() { | ||
if (this.contentCount) { | ||
let child = this.getNextChild(); | ||
while (child) { | ||
yield child; | ||
child = this.getNextChild(); | ||
} | ||
} | ||
} | ||
/** | ||
* Move the internal folder cursor to the desired position position 0 is before the first record. | ||
* @param {number} newIndex | ||
* @returns | ||
* @memberof PSTFolder | ||
*/ | ||
@@ -217,5 +226,2 @@ moveChildCursorTo(newIndex) { | ||
* Number of emails in this folder | ||
* @readonly | ||
* @type {number} | ||
* @memberof PSTFolder | ||
*/ | ||
@@ -222,0 +228,0 @@ get emailCount() { |
@@ -10,2 +10,3 @@ /// <reference types="node" /> | ||
import { PSTTableBC } from "./PSTTableBC"; | ||
import type { MessageClass } from "./PSTUtil"; | ||
export declare class PSTMessage extends PSTObject { | ||
@@ -19,2 +20,3 @@ static IMPORTANCE_LOW: number; | ||
private attachmentTable; | ||
private recipients?; | ||
/** | ||
@@ -30,4 +32,6 @@ * Creates an instance of PSTMessage. PST Message contains functions that are common across most MAPI objects. | ||
* Get specific recipient. | ||
* @deprecated | ||
*/ | ||
getRecipient(recipientNumber: number): PSTRecipient | null; | ||
getRecipient(recipientNumber: number): PSTRecipient; | ||
getRecipients(): PSTRecipient[]; | ||
/** | ||
@@ -169,13 +173,7 @@ * Get specific attachment from table using index. | ||
* https://msdn.microsoft.com/en-us/library/office/cc765765.aspx | ||
* @readonly | ||
* @type {string} | ||
* @memberof PSTMessage | ||
*/ | ||
get messageClass(): string; | ||
get messageClass(): MessageClass; | ||
/** | ||
* Contains the full subject of a message. | ||
* https://technet.microsoft.com/en-us/library/cc815720 | ||
* @readonly | ||
* @type {string} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -380,5 +378,2 @@ get subject(): string; | ||
* https://msdn.microsoft.com/en-us/library/office/cc842353.aspx | ||
* @readonly | ||
* @type {boolean} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -389,5 +384,2 @@ get deleteAfterSubmit(): boolean; | ||
* https://msdn.microsoft.com/en-us/library/office/cc765767.aspx | ||
* @readonly | ||
* @type {boolean} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -418,5 +410,2 @@ get responsibility(): boolean; | ||
* https://msdn.microsoft.com/en-us/library/office/cc841961.aspx | ||
* @readonly | ||
* @type {Date} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -525,1 +514,10 @@ get messageDeliveryTime(): Date | null; | ||
} | ||
export declare const enum AcknowledgementMode { | ||
manual = 0, | ||
automatic = 1 | ||
} | ||
export declare const enum Importance { | ||
low = 0, | ||
normal = 1, | ||
high = 2 | ||
} |
@@ -50,19 +50,18 @@ "use strict"; | ||
* Get specific recipient. | ||
* @deprecated | ||
*/ | ||
getRecipient(recipientNumber) { | ||
return this.getRecipients()[recipientNumber]; | ||
} | ||
getRecipients() { | ||
var _a; | ||
this.processRecipients(); | ||
if (!this.recipientTable) { | ||
this.processRecipients(); | ||
return []; | ||
// throw new Error("PSTMessage::getRecipient recipientTable is null"); | ||
} | ||
if (!this.recipientTable) { | ||
throw new Error("PSTMessage::getRecipient recipientTable is null"); | ||
} | ||
if (recipientNumber >= this.numberOfRecipients || | ||
recipientNumber >= this.recipientTable.getItems().length) { | ||
throw new Error(`PSTMessage::getRecipient unable to fetch recipient number ${recipientNumber}`); | ||
} | ||
const recipientDetails = this.recipientTable.getItems()[recipientNumber]; | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
return recipientDetails | ||
? new PSTRecipient_1.PSTRecipient(this.pstFile, recipientDetails) | ||
: null; | ||
return (this.recipients = | ||
(_a = this.recipients) !== null && _a !== void 0 ? _a : this.recipientTable | ||
.getItems() | ||
.map((recipientDetails) => new PSTRecipient_1.PSTRecipient(this.pstFile, recipientDetails))); | ||
} | ||
@@ -288,7 +287,9 @@ /** | ||
processRecipients() { | ||
var _a; | ||
if (this.recipientTable) { | ||
return; | ||
} | ||
try { | ||
const recipientTableKey = 0x0692; | ||
if (this.recipientTable === null && | ||
this.localDescriptorItems !== null && | ||
this.localDescriptorItems.has(recipientTableKey)) { | ||
if ((_a = this.localDescriptorItems) === null || _a === void 0 ? void 0 : _a.has(recipientTableKey)) { | ||
const item = this.localDescriptorItems.get(recipientTableKey); | ||
@@ -311,6 +312,5 @@ let descriptorItems = new Map(); | ||
get numberOfRecipients() { | ||
if (this.recipientTable === null) { | ||
this.processRecipients(); | ||
} | ||
return this.recipientTable ? this.recipientTable.rowCount : 0; | ||
var _a, _b; | ||
this.processRecipients(); | ||
return (_b = (_a = this.recipientTable) === null || _a === void 0 ? void 0 : _a.rowCount) !== null && _b !== void 0 ? _b : 0; | ||
} | ||
@@ -495,5 +495,2 @@ /** | ||
* https://msdn.microsoft.com/en-us/library/office/cc765765.aspx | ||
* @readonly | ||
* @type {string} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -506,5 +503,2 @@ get messageClass() { | ||
* https://technet.microsoft.com/en-us/library/cc815720 | ||
* @readonly | ||
* @type {string} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -798,5 +792,2 @@ get subject() { | ||
* https://msdn.microsoft.com/en-us/library/office/cc842353.aspx | ||
* @readonly | ||
* @type {boolean} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -809,5 +800,2 @@ get deleteAfterSubmit() { | ||
* https://msdn.microsoft.com/en-us/library/office/cc765767.aspx | ||
* @readonly | ||
* @type {boolean} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -848,5 +836,2 @@ get responsibility() { | ||
* https://msdn.microsoft.com/en-us/library/office/cc841961.aspx | ||
* @readonly | ||
* @type {Date} | ||
* @memberof PSTMessage | ||
*/ | ||
@@ -853,0 +838,0 @@ get messageDeliveryTime() { |
@@ -49,1 +49,10 @@ import type { PSTFile } from "./PSTFile"; | ||
} | ||
export declare const enum RecipientType { | ||
originator = 0, | ||
primary = 1, | ||
cc = 2, | ||
bcc = 3 | ||
} | ||
export declare const enum RecipientTags { | ||
sendable = 1 | ||
} |
@@ -8,2 +8,3 @@ /// <reference types="node" /> | ||
import { PSTTableBC } from "./PSTTableBC"; | ||
export declare type MessageClass = "IPM.Activity" | "IPM.Appointment" | "IPM.Contact" | "IPM.DistList" | "IPM.Document" | "IPM.Note.IMC.Notification" | "IPM.Note.Rules.OofTemplate.Microsoft" | "IPM.Note.Rules.ReplyTemplate.Microsoft" | "IPM.Note.Secure.Sign" | "IPM.Note.Secure" | "IPM.Note" | "IPM.OLE.Class" | "IPM.Outlook.Recall" | "IPM.Post" | "IPM.Recall.Report" | "IPM.Remote" | "IPM.Report" | "IPM.Resend" | "IPM.Schedule.Meeting.Canceled" | "IPM.Schedule.Meeting.Request" | "IPM.Schedule.Meeting.Resp.Neg" | "IPM.Schedule.Meeting.Resp.Pos" | "IPM.Schedule.Meeting.Resp.Tent" | "IPM.StickyNote" | "IPM.Task" | "IPM.TaskRequest.Accept" | "IPM.TaskRequest.Decline" | "IPM.TaskRequest.Update" | "IPM.TaskRequest" | "IPM" | "IPM.Note.SMIME.MultipartSigned" | "IPM.Note.Agenda" | "IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}" | "IPM.Schedule.Meeting.Notification.Forward" | "IPM.Post.Rss" | "REPORT.IPM.Note.NDR" | "REPORT.IPM.Note.IPNRN" | "REPORT.IPM.Note.IPNNRN" | "REPORT.IPM.Note.DR"; | ||
export declare const compEnc: number[]; | ||
@@ -10,0 +11,0 @@ export declare const codePages: Map<number, string>; |
@@ -420,6 +420,3 @@ "use strict"; | ||
const item = table.getItems().get(0x001a); | ||
let messageClass = ""; | ||
if (item) { | ||
messageClass = item.getStringValue(); | ||
} | ||
const messageClass = item === null || item === void 0 ? void 0 : item.getStringValue(); | ||
switch (messageClass) { | ||
@@ -480,5 +477,5 @@ case "IPM.Note": | ||
console.error(`[PSTUtil] createAppropriatePSTMessageObject unknown message type: ${messageClass}`); | ||
return new _1.PSTMessage(theFile, folderIndexNode, table, localDescriptorItems); | ||
} | ||
return new _1.PSTMessage(theFile, folderIndexNode, table, localDescriptorItems); | ||
}; | ||
exports.createAppropriatePSTMessageObject = createAppropriatePSTMessageObject; |
{ | ||
"name": "@socialgouv/archimail-pst-extractor", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Extract objects from MS Outlook/Exchange PST files", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -23,3 +23,3 @@ # archimail-pst-extractor | ||
```yarn add pst-extractor``` | ||
```yarn add @socialgouv/archimail-pst-extractor``` | ||
@@ -26,0 +26,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95937741
9857