biz-email-builder-shared 1.6.30 → 1.6.33
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/bookmark.entity.d.ts +18 -0
- package/dist/entity/bookmark.entity.d.ts.map +1 -0
- package/dist/entity/bookmark.entity.js +14 -0
- package/dist/middleware/authentication.d.ts.map +1 -1
- package/dist/middleware/authentication.js +3 -2
- package/dist/types/IRequest.d.ts +1 -0
- package/dist/types/IRequest.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
export interface IBookmarkTemplate {
|
|
3
|
+
template: Types.ObjectId;
|
|
4
|
+
addedAt?: Date;
|
|
5
|
+
}
|
|
6
|
+
export interface IBookmarkFolder extends Document {
|
|
7
|
+
name: string;
|
|
8
|
+
user: Types.ObjectId;
|
|
9
|
+
templates: IBookmarkTemplate[];
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
updateAt?: Date;
|
|
12
|
+
}
|
|
13
|
+
export declare const BookmarkModel: import("mongoose").Model<IBookmarkFolder, {}, {}, {}, Document<unknown, {}, IBookmarkFolder> & IBookmarkFolder & Required<{
|
|
14
|
+
_id: unknown;
|
|
15
|
+
}> & {
|
|
16
|
+
__v: number;
|
|
17
|
+
}, any>;
|
|
18
|
+
//# sourceMappingURL=bookmark.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookmark.entity.d.ts","sourceRoot":"","sources":["../../src/entity/bookmark.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE,IAAI,CAAA;CAChB;AAcD,eAAO,MAAM,aAAa;;;;OAA2D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookmarkModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const BookmarkTemplateSchema = new mongoose_1.Schema({
|
|
6
|
+
template: { type: mongoose_1.Schema.Types.ObjectId, ref: 'template', required: true, },
|
|
7
|
+
addedAt: { type: Date, default: Date.now, },
|
|
8
|
+
}, { _id: false });
|
|
9
|
+
const BookmarkFolderSchema = new mongoose_1.Schema({
|
|
10
|
+
name: { type: String, required: true, },
|
|
11
|
+
user: { type: mongoose_1.Schema.Types.ObjectId, ref: 'user', required: true, },
|
|
12
|
+
templates: [BookmarkTemplateSchema]
|
|
13
|
+
}, { timestamps: true });
|
|
14
|
+
exports.BookmarkModel = (0, mongoose_1.model)('bookmark', BookmarkFolderSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middleware/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE1D,QAAA,MAAM,SAAS,cACe,QAAQ,OAAO,QAAQ,QAAQ,YAAY,
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middleware/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE1D,QAAA,MAAM,SAAS,cACe,QAAQ,OAAO,QAAQ,QAAQ,YAAY,kBAmDxE,CAAC;AAEF,QAAA,MAAM,eAAe,UAAW,KAAK,EAAE,WACT,QAAQ,OAAO,QAAQ,QAAQ,YAAY,kBAaxE,CAAC;AAEF,QAAA,MAAM,kBAAkB,aAAc,YAAY,EAAE,WACtB,QAAQ,OAAO,QAAQ,QAAQ,YAAY,kBAgBxE,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -38,15 +38,16 @@ const authorize = () => {
|
|
|
38
38
|
if (user.role === undefined || user.role === null || !Object.values(email_builder_utils_1.ROLES).includes(user.role)) {
|
|
39
39
|
throw new resHandler_1.UnauthorizedRequestError(utilities_1.SERVER_MESSAGES.SE_NO_ROLE_ASSIGNED_ROLE_INVALID);
|
|
40
40
|
}
|
|
41
|
-
const { createdAt, updatedAt, deletedAt, password, verificationToken, __v, updateBy
|
|
41
|
+
const { createdAt, updatedAt, deletedAt, password, verificationToken, __v, updateBy } = user, rest = __rest(user, ["createdAt", "updatedAt", "deletedAt", "password", "verificationToken", "__v", "updateBy"]);
|
|
42
42
|
req.user = Object.assign({}, rest);
|
|
43
43
|
if (req.user && user.role === email_builder_utils_1.ROLES.ADMIN) {
|
|
44
44
|
req.user.isAdmin = true;
|
|
45
45
|
req.user.groups.push({ name: "ADMIN_GROUP", features: Object.values(email_builder_utils_1.FEATURE_TYPE).map((value) => ({ name: value })) });
|
|
46
46
|
}
|
|
47
|
-
let currentPlanDetail = await entity_1.PlanHistoryModel.find({ user: user._id.toString(), isTransactionSuccessfull: true }).lean().exec();
|
|
47
|
+
let currentPlanDetail = await entity_1.PlanHistoryModel.find({ user: user._id.toString(), isTransactionSuccessfull: true }).populate({ path: "subscriptionPlanId" }).lean().exec();
|
|
48
48
|
if (currentPlanDetail && currentPlanDetail.length) {
|
|
49
49
|
req.userSubsciptionQuota = currentPlanDetail[0].subscriptionQuota;
|
|
50
|
+
req.currentPlanId = currentPlanDetail[0].subscriptionPlanId;
|
|
50
51
|
if (currentPlanDetail[0].renewalDate) {
|
|
51
52
|
req.isSubscriptionActive = !(currentPlanDetail[0].renewalDate < new Date());
|
|
52
53
|
}
|
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,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,kB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