biz-email-builder-shared 1.0.16 → 1.0.17
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/index.d.ts +1 -1
- package/dist/entity/index.d.ts.map +1 -1
- package/dist/entity/index.js +1 -1
- package/dist/entity/template.entity.d.ts +5 -0
- package/dist/entity/template.entity.d.ts.map +1 -0
- package/dist/entity/template.entity.js +45 -0
- package/dist/entity/templateShare.entity.d.ts +19 -0
- package/dist/entity/templateShare.entity.d.ts.map +1 -0
- package/dist/entity/templateShare.entity.js +18 -0
- package/dist/types/ITemplate.d.ts +1 -1
- package/dist/types/ITemplate.d.ts.map +1 -1
- package/dist/utilities/index.d.ts +6 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +8 -1
- package/package.json +1 -1
package/dist/entity/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
package/dist/entity/index.js
CHANGED
|
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./user.entity"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./template.entity"), exports);
|
|
19
19
|
__exportStar(require("./role.entitty"), exports);
|
|
20
20
|
__exportStar(require("./feature.entitiy"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ITemplateLayout } from "../types";
|
|
2
|
+
export declare const TemplateModel: import("mongoose").Model<ITemplateLayout, {}, {}, {}, import("mongoose").Document<unknown, {}, ITemplateLayout> & Omit<ITemplateLayout & {
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}, never>, any>;
|
|
5
|
+
//# sourceMappingURL=template.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.entity.d.ts","sourceRoot":"","sources":["../../src/entity/template.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,eAAe,EAAE,MAAM,UAAU,CAAC;AAwDtD,eAAO,MAAM,aAAa;;eAAqD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TemplateModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const BlockDataPropsSchema = new mongoose_1.Schema({
|
|
7
|
+
imageUrl: { type: String, default: "" },
|
|
8
|
+
text: { type: String, default: "" },
|
|
9
|
+
rows: { type: Number, default: 0 },
|
|
10
|
+
columns: { type: Number, default: 0 },
|
|
11
|
+
navigateToUrl: { type: String, default: "" },
|
|
12
|
+
altText: { type: String, default: "" },
|
|
13
|
+
cellWidths: { type: [Number], default: [] },
|
|
14
|
+
}, { _id: false });
|
|
15
|
+
const BlockDataSchema = new mongoose_1.Schema({
|
|
16
|
+
style: { type: mongoose_1.Schema.Types.Mixed },
|
|
17
|
+
props: { type: BlockDataPropsSchema },
|
|
18
|
+
childrenIds: { type: [String], default: [] },
|
|
19
|
+
}, { _id: false });
|
|
20
|
+
const BlockSchema = new mongoose_1.Schema({
|
|
21
|
+
type: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
enum: Object.values(types_1.BlockType),
|
|
25
|
+
},
|
|
26
|
+
data: BlockDataSchema,
|
|
27
|
+
}, { _id: false });
|
|
28
|
+
const TemplateSchema = new mongoose_1.Schema({
|
|
29
|
+
name: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
layout: {
|
|
34
|
+
type: Map,
|
|
35
|
+
of: BlockSchema,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
isDeleted: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
user: { type: mongoose_1.Schema.Types.ObjectId, ref: 'user' },
|
|
43
|
+
deletedAt: Date
|
|
44
|
+
}, { timestamps: true });
|
|
45
|
+
exports.TemplateModel = (0, mongoose_1.model)("template", TemplateSchema);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
import { OWNERSHIP_TYPE } from "../utilities";
|
|
3
|
+
interface ITemplateShare {
|
|
4
|
+
sharedBy: Types.ObjectId;
|
|
5
|
+
sharedTo: Types.ObjectId;
|
|
6
|
+
templateId: Types.ObjectId;
|
|
7
|
+
accessType: OWNERSHIP_TYPE;
|
|
8
|
+
comment: string;
|
|
9
|
+
isRevoked: boolean;
|
|
10
|
+
revokedAt: Date;
|
|
11
|
+
revokedBy: Types.ObjectId;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare const TemplateShareModel: import("mongoose").Model<ITemplateShare, {}, {}, {}, import("mongoose").Document<unknown, {}, ITemplateShare> & Omit<ITemplateShare & {
|
|
16
|
+
_id: Types.ObjectId;
|
|
17
|
+
}, never>, any>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=templateShare.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateShare.entity.d.ts","sourceRoot":"","sources":["../../src/entity/templateShare.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAS,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,cAAc;IACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC3B,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAkBD,eAAO,MAAM,kBAAkB;SACwlH,MAAO,QAAQ;eADxiH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TemplateShareModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const utilities_1 = require("../utilities");
|
|
6
|
+
const TemplateShareSchema = new mongoose_1.Schema({
|
|
7
|
+
sharedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'user', required: true },
|
|
8
|
+
sharedTo: { type: mongoose_1.Schema.Types.ObjectId, ref: 'user', required: true },
|
|
9
|
+
templateId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'email-template', required: true },
|
|
10
|
+
accessType: { type: String, enum: Object.values(utilities_1.OWNERSHIP_TYPE), required: true },
|
|
11
|
+
comment: { type: String, default: "" },
|
|
12
|
+
isRevoked: { type: Boolean, default: false },
|
|
13
|
+
revokedAt: { type: Date, default: null },
|
|
14
|
+
revokedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'user', required: true }
|
|
15
|
+
}, {
|
|
16
|
+
timestamps: true,
|
|
17
|
+
});
|
|
18
|
+
exports.TemplateShareModel = (0, mongoose_1.model)("template-share", TemplateShareSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITemplate.d.ts","sourceRoot":"","sources":["../../src/types/ITemplate.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACpB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC3B;AAED,UAAU,MAAM;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,UAAU,MAAM;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;CACF;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ITemplate.d.ts","sourceRoot":"","sources":["../../src/types/ITemplate.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACpB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC3B;AAED,UAAU,MAAM;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,UAAU,MAAM;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;CACF;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CAChB"}
|
|
@@ -11,4 +11,10 @@ export declare enum RECORD_TYPE {
|
|
|
11
11
|
ARCHIVE = "ARCHIVE",
|
|
12
12
|
NON_ARCHIVE = "NON_ARCHIVE"
|
|
13
13
|
}
|
|
14
|
+
export declare enum OWNERSHIP_TYPE {
|
|
15
|
+
OWNER = "OWNER",
|
|
16
|
+
CO_OWNER = "CO_OWNER",
|
|
17
|
+
VIEWER = "VIEWER",
|
|
18
|
+
EDITOR = "EDITOR"
|
|
19
|
+
}
|
|
14
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,oBAAY,KAAK;IACf,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC5B"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,oBAAY,KAAK;IACf,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB"}
|
package/dist/utilities/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.RECORD_TYPE = exports.ROLES = void 0;
|
|
17
|
+
exports.OWNERSHIP_TYPE = exports.RECORD_TYPE = exports.ROLES = void 0;
|
|
18
18
|
__exportStar(require("./callWithRetries"), exports);
|
|
19
19
|
__exportStar(require("./createFolder"), exports);
|
|
20
20
|
__exportStar(require("./encryptionUtils"), exports);
|
|
@@ -30,3 +30,10 @@ var RECORD_TYPE;
|
|
|
30
30
|
RECORD_TYPE["ARCHIVE"] = "ARCHIVE";
|
|
31
31
|
RECORD_TYPE["NON_ARCHIVE"] = "NON_ARCHIVE";
|
|
32
32
|
})(RECORD_TYPE || (exports.RECORD_TYPE = RECORD_TYPE = {}));
|
|
33
|
+
var OWNERSHIP_TYPE;
|
|
34
|
+
(function (OWNERSHIP_TYPE) {
|
|
35
|
+
OWNERSHIP_TYPE["OWNER"] = "OWNER";
|
|
36
|
+
OWNERSHIP_TYPE["CO_OWNER"] = "CO_OWNER";
|
|
37
|
+
OWNERSHIP_TYPE["VIEWER"] = "VIEWER";
|
|
38
|
+
OWNERSHIP_TYPE["EDITOR"] = "EDITOR";
|
|
39
|
+
})(OWNERSHIP_TYPE || (exports.OWNERSHIP_TYPE = OWNERSHIP_TYPE = {}));
|