biz-email-builder-shared 1.0.15 → 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.
@@ -1,5 +1,5 @@
1
- import { IEmailLayout } from "../types";
2
- export declare const EmailTemplate: import("mongoose").Model<IEmailLayout, {}, {}, {}, import("mongoose").Document<unknown, {}, IEmailLayout> & Omit<IEmailLayout & {
1
+ import { IEmailTemplateLayout } from "../types";
2
+ export declare const EmailTemplate: import("mongoose").Model<IEmailTemplateLayout, {}, {}, {}, import("mongoose").Document<unknown, {}, IEmailTemplateLayout> & Omit<IEmailTemplateLayout & {
3
3
  _id: import("mongoose").Types.ObjectId;
4
4
  }, never>, any>;
5
5
  //# sourceMappingURL=emailTemplate.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emailTemplate.entity.d.ts","sourceRoot":"","sources":["../../src/entity/emailTemplate.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAE,MAAM,UAAU,CAAC;AAwDnD,eAAO,MAAM,aAAa;;eAA2D,CAAC"}
1
+ {"version":3,"file":"emailTemplate.entity.d.ts","sourceRoot":"","sources":["../../src/entity/emailTemplate.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAwD3D,eAAO,MAAM,aAAa;;eAAqE,CAAC"}
@@ -25,12 +25,12 @@ const BlockSchema = new mongoose_1.Schema({
25
25
  },
26
26
  data: BlockDataSchema,
27
27
  }, { _id: false });
28
- const EmailLayoutSchema = new mongoose_1.Schema({
29
- templateName: {
28
+ const EmailTemplateSchema = new mongoose_1.Schema({
29
+ name: {
30
30
  type: String,
31
31
  required: true
32
32
  },
33
- blocks: {
33
+ layout: {
34
34
  type: Map,
35
35
  of: BlockSchema,
36
36
  required: true,
@@ -42,4 +42,4 @@ const EmailLayoutSchema = new mongoose_1.Schema({
42
42
  user: { type: mongoose_1.Schema.Types.ObjectId, ref: 'user' },
43
43
  deletedAt: Date
44
44
  }, { timestamps: true });
45
- exports.EmailTemplate = (0, mongoose_1.model)("email-template", EmailLayoutSchema);
45
+ exports.EmailTemplate = (0, mongoose_1.model)("email-template", EmailTemplateSchema);
@@ -1,5 +1,5 @@
1
1
  export * from "./user.entity";
2
- export * from "./emailTemplate.entity";
2
+ export * from "./template.entity";
3
3
  export * from "./role.entitty";
4
4
  export * from "./feature.entitiy";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,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"}
@@ -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("./emailTemplate.entity"), exports);
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);
@@ -30,10 +30,10 @@ export interface IBlockData {
30
30
  childrenIds: string[];
31
31
  };
32
32
  }
33
- export interface IEmailLayout {
34
- templateName: string;
33
+ export interface ITemplateLayout {
34
+ name: string;
35
35
  user: string;
36
- blocks: Map<string, IBlockData>;
36
+ layout: Map<string, IBlockData>;
37
37
  isDeleted: boolean;
38
38
  createdAt: Date;
39
39
  updatedAt: Date;
@@ -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;Q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AE,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"}
@@ -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 = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-email-builder-shared",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [