biz-email-builder-shared 1.6.23 → 1.6.24
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/entity/emailConfiguration.entity.d.ts +8 -0
- package/dist/entity/emailConfiguration.entity.d.ts.map +1 -1
- package/dist/entity/emailConfiguration.entity.js +11 -1
- package/dist/entity/organisation.entity.d.ts +4 -1
- package/dist/entity/organisation.entity.d.ts.map +1 -1
- package/dist/entity/organisation.entity.js +3 -2
- package/dist/entity/planHistory.entity.d.ts +2 -1
- package/dist/entity/planHistory.entity.d.ts.map +1 -1
- package/dist/entity/planHistory.entity.js +3 -2
- package/dist/entity/subscriptionPlan.entity.d.ts +1 -0
- package/dist/entity/subscriptionPlan.entity.d.ts.map +1 -1
- package/dist/entity/subscriptionPlan.entity.js +1 -0
- package/dist/middleware/authentication.js +1 -1
- package/dist/types/IRequest.d.ts +1 -1
- package/dist/types/IRequest.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,12 +3,18 @@ export declare enum CONFIG_METHOD {
|
|
|
3
3
|
SMTP = "SMTP",
|
|
4
4
|
GMAIL = "GMAIL"
|
|
5
5
|
}
|
|
6
|
+
export declare enum ENCRYPTION_METHOD {
|
|
7
|
+
NONE = "NONE",
|
|
8
|
+
SSL = "SSL",
|
|
9
|
+
TLS = "TLS"
|
|
10
|
+
}
|
|
6
11
|
export interface ISMTPConfig {
|
|
7
12
|
host: string;
|
|
8
13
|
port: number;
|
|
9
14
|
secure: boolean;
|
|
10
15
|
userName: string;
|
|
11
16
|
encryptedPassword: string;
|
|
17
|
+
encriptionMethod: ENCRYPTION_METHOD;
|
|
12
18
|
}
|
|
13
19
|
export interface IGmailConfig {
|
|
14
20
|
email: string;
|
|
@@ -19,6 +25,8 @@ export interface IEmailConfiguration extends Document {
|
|
|
19
25
|
method: CONFIG_METHOD;
|
|
20
26
|
smtpConfig?: ISMTPConfig;
|
|
21
27
|
gmailConfig?: IGmailConfig;
|
|
28
|
+
fromName: string;
|
|
29
|
+
fromEmail: string;
|
|
22
30
|
isDeleted: boolean;
|
|
23
31
|
updatedBy: Types.ObjectId;
|
|
24
32
|
createdAt: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailConfiguration.entity.d.ts","sourceRoot":"","sources":["../../src/entity/emailConfiguration.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"emailConfiguration.entity.d.ts","sourceRoot":"","sources":["../../src/entity/emailConfiguration.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,iBAAiB,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAqCD,eAAO,MAAM,uBAAuB;SAAk2F,MAAO,QAAQ;;;OAAnyF,CAAC"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmailConfigurationModel = exports.CONFIG_METHOD = void 0;
|
|
3
|
+
exports.EmailConfigurationModel = exports.ENCRYPTION_METHOD = exports.CONFIG_METHOD = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
var CONFIG_METHOD;
|
|
6
6
|
(function (CONFIG_METHOD) {
|
|
7
7
|
CONFIG_METHOD["SMTP"] = "SMTP";
|
|
8
8
|
CONFIG_METHOD["GMAIL"] = "GMAIL";
|
|
9
9
|
})(CONFIG_METHOD || (exports.CONFIG_METHOD = CONFIG_METHOD = {}));
|
|
10
|
+
var ENCRYPTION_METHOD;
|
|
11
|
+
(function (ENCRYPTION_METHOD) {
|
|
12
|
+
ENCRYPTION_METHOD["NONE"] = "NONE";
|
|
13
|
+
ENCRYPTION_METHOD["SSL"] = "SSL";
|
|
14
|
+
ENCRYPTION_METHOD["TLS"] = "TLS";
|
|
15
|
+
})(ENCRYPTION_METHOD || (exports.ENCRYPTION_METHOD = ENCRYPTION_METHOD = {}));
|
|
16
|
+
// Discuss and Match Fields from UI
|
|
10
17
|
const smtpConfigSchema = new mongoose_1.Schema({
|
|
11
18
|
host: { type: String, required: true },
|
|
12
19
|
port: { type: Number, required: true },
|
|
13
20
|
secure: { type: Boolean, required: true },
|
|
14
21
|
userName: { type: String, required: true },
|
|
15
22
|
encryptedPassword: { type: String, required: true },
|
|
23
|
+
encriptionMethod: { type: String, enum: Object.values(ENCRYPTION_METHOD), required: true }
|
|
16
24
|
}, { _id: false });
|
|
17
25
|
const gmailConfigSchema = new mongoose_1.Schema({
|
|
18
26
|
email: { type: String, required: true },
|
|
@@ -23,6 +31,8 @@ const EmailConfigurationSchema = new mongoose_1.Schema({
|
|
|
23
31
|
method: { type: String, enum: Object.values(CONFIG_METHOD), required: true },
|
|
24
32
|
smtpConfig: { type: smtpConfigSchema, required: false },
|
|
25
33
|
gmailConfig: { type: gmailConfigSchema, required: false },
|
|
34
|
+
fromName: { type: String, required: true },
|
|
35
|
+
fromEmail: { type: String, required: true },
|
|
26
36
|
isDeleted: { type: Boolean, default: false },
|
|
27
37
|
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "user" },
|
|
28
38
|
}, { timestamps: true });
|
|
@@ -2,8 +2,11 @@ import { Types } from "mongoose";
|
|
|
2
2
|
export interface IOrganisation extends Document {
|
|
3
3
|
name: string;
|
|
4
4
|
user: Types.ObjectId;
|
|
5
|
+
websiteURL: string;
|
|
6
|
+
phoneNumber: string;
|
|
7
|
+
industry: string;
|
|
5
8
|
isDisable: boolean;
|
|
6
|
-
deletedAt: Date;
|
|
9
|
+
deletedAt: Date | null;
|
|
7
10
|
updatedBy: Types.ObjectId;
|
|
8
11
|
createdAt: Date;
|
|
9
12
|
updatedAt: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation.entity.d.ts","sourceRoot":"","sources":["../../src/entity/organisation.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"organisation.entity.d.ts","sourceRoot":"","sources":["../../src/entity/organisation.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAcD,eAAO,MAAM,iBAAiB;SAC49H,MAAO,QAAQ;;;OADh7H,CAAC"}
|
|
@@ -5,10 +5,11 @@ const mongoose_1 = require("mongoose");
|
|
|
5
5
|
const OrganisationSchema = new mongoose_1.Schema({
|
|
6
6
|
name: { type: String, required: true },
|
|
7
7
|
user: { type: mongoose_1.Schema.Types.ObjectId, ref: "user", required: true },
|
|
8
|
+
websiteURL: { type: String, required: true },
|
|
9
|
+
phoneNumber: { type: String, required: true },
|
|
10
|
+
industry: { type: String, required: true },
|
|
8
11
|
isDisable: { type: Boolean, default: false },
|
|
9
12
|
deletedAt: { type: Date, default: null },
|
|
10
|
-
createdAt: { type: Date, default: null },
|
|
11
|
-
updatedAt: { type: Date, default: null },
|
|
12
13
|
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "user", required: true },
|
|
13
14
|
}, { timestamps: true });
|
|
14
15
|
exports.OrganisationModel = (0, mongoose_1.model)("organisation", OrganisationSchema);
|
|
@@ -11,6 +11,7 @@ export interface ISubscriptionQuota {
|
|
|
11
11
|
publicTemplateCount: number;
|
|
12
12
|
smtpConfigAllowed: boolean;
|
|
13
13
|
canCreateOrganisation: boolean;
|
|
14
|
+
organisationUserLimit: number;
|
|
14
15
|
}
|
|
15
16
|
export interface IPlanHistory extends Document {
|
|
16
17
|
user: Types.ObjectId;
|
|
@@ -20,7 +21,7 @@ export interface IPlanHistory extends Document {
|
|
|
20
21
|
notifyRenewalDate: Date | null;
|
|
21
22
|
notifyRenewalCount: number;
|
|
22
23
|
quotaResetDate: Date;
|
|
23
|
-
|
|
24
|
+
isTransactionSuccessfull: boolean;
|
|
24
25
|
updatedBy: Types.ObjectId;
|
|
25
26
|
transactionHistory: ITransactionHistory[];
|
|
26
27
|
subscriptionQuota: ISubscriptionQuota;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planHistory.entity.d.ts","sourceRoot":"","sources":["../../src/entity/planHistory.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"planHistory.entity.d.ts","sourceRoot":"","sources":["../../src/entity/planHistory.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC;IACnC,YAAY,EAAE,IAAI,CAAC;IACnB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,iBAAiB,EAAE,IAAI,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,IAAI,CAAC;IACrB,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,kBAAkB,EAAE,mBAAmB,EAAE,CAAC;IAC1C,iBAAiB,EAAE,kBAAkB,CAAC;CACvC;AAED,eAAO,MAAM,wBAAwB;SA+Bo1E,MAAO,QAAQ;;;;SAAf,MAAO,QAAQ;;;EA1Bt3E,CAAC;AAEnB,eAAO,MAAM,uBAAuB;SAwBq1E,MAAO,QAAQ;;;;SAAf,MAAO,QAAQ;;;EAjBt3E,CAAC;AAEnB,eAAO,MAAM,iBAAiB;;;;;;;;EAYN,CAAC;AAEzB,eAAO,MAAM,gBAAgB;;;;OAAyD,CAAC"}
|
|
@@ -13,7 +13,8 @@ exports.SubscriptionQuotaSchema = new mongoose_1.Schema({
|
|
|
13
13
|
publicTemplateCount: { type: Number, required: true },
|
|
14
14
|
privateTemplateCount: { type: Number, required: true },
|
|
15
15
|
smtpConfigAllowed: { type: Boolean, default: false },
|
|
16
|
-
canCreateOrganisation: { type: Boolean, default: false }
|
|
16
|
+
canCreateOrganisation: { type: Boolean, default: false },
|
|
17
|
+
organisationUserLimit: { type: Number, default: null, }
|
|
17
18
|
}, { _id: false });
|
|
18
19
|
exports.PlanHistorySchema = new mongoose_1.Schema({
|
|
19
20
|
user: { type: mongoose_1.Schema.Types.ObjectId, ref: "user", required: true },
|
|
@@ -23,7 +24,7 @@ exports.PlanHistorySchema = new mongoose_1.Schema({
|
|
|
23
24
|
notifyRenewalDate: { type: Date, default: null },
|
|
24
25
|
notifyRenewalCount: { type: Number, required: true },
|
|
25
26
|
quotaResetDate: { type: Date, required: true },
|
|
26
|
-
|
|
27
|
+
isTransactionSuccessfull: { type: Boolean, required: true },
|
|
27
28
|
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "user", required: true },
|
|
28
29
|
transactionHistory: { type: [exports.TransactionHistorySchema], default: [] },
|
|
29
30
|
subscriptionQuota: { type: exports.SubscriptionQuotaSchema, required: true },
|
|
@@ -10,6 +10,7 @@ export interface ISubscriptionPlan extends Document {
|
|
|
10
10
|
updatedBy: mongoose.Types.ObjectId;
|
|
11
11
|
deletedAt: Date;
|
|
12
12
|
isDefault: boolean;
|
|
13
|
+
userLimit: number;
|
|
13
14
|
}
|
|
14
15
|
export declare const SubscriptionPlanModel: mongoose.Model<ISubscriptionPlan, {}, {}, {}, mongoose.Document<unknown, {}, ISubscriptionPlan> & ISubscriptionPlan & {
|
|
15
16
|
_id: mongoose.Types.ObjectId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptionPlan.entity.d.ts","sourceRoot":"","sources":["../../src/entity/subscriptionPlan.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subscriptionPlan.entity.d.ts","sourceRoot":"","sources":["../../src/entity/subscriptionPlan.entity.ts"],"names":[],"mappings":"AACA,OAAO,QAA2B,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;IACnC,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAkBD,eAAO,MAAM,qBAAqB;;;;OAAwE,CAAC"}
|
|
@@ -42,6 +42,7 @@ const SubscriptionPlanSchema = new mongoose_1.Schema({
|
|
|
42
42
|
publicTemplateLimit: { type: Number, required: true },
|
|
43
43
|
smtpConfigAllowed: { type: Boolean, required: true },
|
|
44
44
|
canCreateOrganisation: { type: Boolean, default: false },
|
|
45
|
+
userLimit: { type: Number, default: null },
|
|
45
46
|
isDeleted: { type: Boolean, default: false },
|
|
46
47
|
updatedBy: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "user", required: true },
|
|
47
48
|
deletedAt: { type: Date, default: null },
|
|
@@ -47,7 +47,7 @@ const authorize = () => {
|
|
|
47
47
|
let currentPlanDetail = await entity_1.PlanHistoryModel.find({ user: user._id.toString() }).lean();
|
|
48
48
|
// req.subExpired
|
|
49
49
|
if (currentPlanDetail && currentPlanDetail.length && currentPlanDetail[0].renewalDate) {
|
|
50
|
-
req.
|
|
50
|
+
req.userSubscriptionQuota = currentPlanDetail[0].subscriptionQuota;
|
|
51
51
|
req.isSubscriptionActive = !(currentPlanDetail[0].renewalDate < new Date());
|
|
52
52
|
}
|
|
53
53
|
next();
|
package/dist/types/IRequest.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRequest.d.ts","sourceRoot":"","sources":["../../src/types/IRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,UAAU,EAAE,cAAc,CAAC;IAC3B,MAAM,EAAE,KAAK,CAAC;QACV,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,YAAY,CAAA;SAAE,CAAC,CAAA;KAC1C,CAAC,CAAA;IACF,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAS,SAAQ,OAAO;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"IRequest.d.ts","sourceRoot":"","sources":["../../src/types/IRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,UAAU,EAAE,cAAc,CAAC;IAC3B,MAAM,EAAE,KAAK,CAAC;QACV,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,YAAY,CAAA;SAAE,CAAC,CAAA;KAC1C,CAAC,CAAA;IACF,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAS,SAAQ,OAAO;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,qBAAqB,CAAC,EAAE,kBAAkB,CAAC;IAC3C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,IAAI,CAAC,EAAE,GAAG,CAAC;CACd"}
|