@astralibx/email-account-manager 8.0.0 → 8.0.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.
- package/dist/index.cjs +6 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -240,8 +240,7 @@ function createEmailAccountSchema(options) {
|
|
|
240
240
|
status: {
|
|
241
241
|
type: String,
|
|
242
242
|
enum: Object.values(ACCOUNT_STATUS),
|
|
243
|
-
default: ACCOUNT_STATUS.Active
|
|
244
|
-
index: true
|
|
243
|
+
default: ACCOUNT_STATUS.Active
|
|
245
244
|
},
|
|
246
245
|
// WARNING: SMTP/IMAP credentials are stored as plaintext in the database.
|
|
247
246
|
// Consumers MUST encrypt `smtp.pass` and `imap.pass` at the application layer
|
|
@@ -355,8 +354,8 @@ function createEmailAccountSchema(options) {
|
|
|
355
354
|
function createEmailDailyStatsSchema(options) {
|
|
356
355
|
const schema = new mongoose.Schema(
|
|
357
356
|
{
|
|
358
|
-
accountId: { type: mongoose.Schema.Types.ObjectId, required: true
|
|
359
|
-
date: { type: String, required: true
|
|
357
|
+
accountId: { type: mongoose.Schema.Types.ObjectId, required: true },
|
|
358
|
+
date: { type: String, required: true },
|
|
360
359
|
sent: { type: Number, default: 0 },
|
|
361
360
|
failed: { type: Number, default: 0 },
|
|
362
361
|
bounced: { type: Number, default: 0 },
|
|
@@ -405,8 +404,7 @@ function createEmailIdentifierSchema(options) {
|
|
|
405
404
|
status: {
|
|
406
405
|
type: String,
|
|
407
406
|
enum: Object.values(IDENTIFIER_STATUS),
|
|
408
|
-
default: IDENTIFIER_STATUS.Active
|
|
409
|
-
index: true
|
|
407
|
+
default: IDENTIFIER_STATUS.Active
|
|
410
408
|
},
|
|
411
409
|
sentCount: { type: Number, default: 0 },
|
|
412
410
|
bounceCount: { type: Number, default: 0 },
|
|
@@ -487,7 +485,6 @@ function createEmailIdentifierSchema(options) {
|
|
|
487
485
|
}
|
|
488
486
|
);
|
|
489
487
|
schema.index({ email: 1 }, { unique: true });
|
|
490
|
-
schema.index({ status: 1 });
|
|
491
488
|
return schema;
|
|
492
489
|
}
|
|
493
490
|
function createEmailDraftSchema(options) {
|
|
@@ -497,12 +494,11 @@ function createEmailDraftSchema(options) {
|
|
|
497
494
|
subject: { type: String, required: true },
|
|
498
495
|
htmlBody: { type: String, required: true },
|
|
499
496
|
textBody: String,
|
|
500
|
-
accountId: { type: mongoose.Schema.Types.ObjectId, required: true
|
|
497
|
+
accountId: { type: mongoose.Schema.Types.ObjectId, required: true },
|
|
501
498
|
status: {
|
|
502
499
|
type: String,
|
|
503
500
|
enum: Object.values(DRAFT_STATUS),
|
|
504
|
-
default: DRAFT_STATUS.Pending
|
|
505
|
-
index: true
|
|
501
|
+
default: DRAFT_STATUS.Pending
|
|
506
502
|
},
|
|
507
503
|
approvedAt: Date,
|
|
508
504
|
rejectedAt: Date,
|