biz-slide-core 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,34 +1,32 @@
1
1
  import { Schema, model, Types } from "mongoose";
2
2
 
3
- interface IImage {
4
- focusPoint : { x: number, y: number };
5
- url: string;
6
- radius: string;
7
- keywords: [string] | null;
8
- title: string;
9
- userId: Types.ObjectId;
10
- createdAt: Date;
11
- updatedAt: Date;
12
- deletedAt: Date;
3
+ export interface IImageSchema {
4
+ focusPoint: { x: number, y: number };
5
+ url: string;
6
+ radius: string;
7
+ keywords: [string] | null;
8
+ title: string;
9
+ userId: Types.ObjectId;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ deletedAt: Date;
13
13
  }
14
14
 
15
- const ImageSchema = new Schema<IImage>(
16
- {
17
- focusPoint: { x: Number, y: Number },
18
- url : { type : String , required: true},
19
- radius: { type : String , required: true},
20
- keywords: { type: [String], default: []},
21
- title: { type : String , required: true},
22
- userId: { type: Schema.Types.ObjectId, ref: "user" },
23
- createdAt: { type: Date, default: Date.now() },
24
- updatedAt: { type: Date, default: Date.now() },
25
- deletedAt: { type: Date, default: null },
26
- },
27
- {
28
- timestamps: true,
29
- }
15
+ const ImageSchema = new Schema<IImageSchema>(
16
+ {
17
+ focusPoint: { x: Number, y: Number },
18
+ url: { type: String, required: true },
19
+ radius: { type: String, required: true },
20
+ keywords: { type: [String], default: [] },
21
+ title: { type: String, required: true },
22
+ userId: { type: Schema.Types.ObjectId, ref: "user" },
23
+ createdAt: { type: Date, default: Date.now() },
24
+ updatedAt: { type: Date, default: Date.now() },
25
+ deletedAt: { type: Date, default: null },
26
+ },
27
+ {
28
+ timestamps: true,
29
+ }
30
30
  );
31
31
 
32
- const ImageModel = model<IImage>("image", ImageSchema);
33
-
34
- export default ImageModel;
32
+ export const ImageModel = model<IImageSchema>("image", ImageSchema);
@@ -0,0 +1,10 @@
1
+ export * from "./image.entity";
2
+ export * from "./png-svg.entity";
3
+ export * from "./ppt-event.entity";
4
+ export * from "./ppt-slide.entity";
5
+ export * from "./ppt.entity";
6
+ export * from "./slide-layout.entity";
7
+ export * from "./slide.entity";
8
+ export * from "./socket.entity";
9
+ export * from "./template.entity";
10
+ export * from "./user.entity";
@@ -31,6 +31,4 @@ const PngSvgSchema = new Schema<IPngSvgSchema>(
31
31
  }
32
32
  );
33
33
 
34
- const PngSvgModel = model<IPngSvgSchema>("png-svg", PngSvgSchema);
35
-
36
- export default PngSvgModel;
34
+ export const PngSvgModel = model<IPngSvgSchema>("png-svg", PngSvgSchema);
@@ -20,6 +20,4 @@ const PPTEventSchema = new Schema<IPPTEventSchema>(
20
20
  }
21
21
  );
22
22
 
23
- const PPTSlideEventModel = model<IPPTEventSchema>("ppt-event", PPTEventSchema);
24
-
25
- export default PPTSlideEventModel;
23
+ export const PPTSlideEventModel = model<IPPTEventSchema>("ppt-event", PPTEventSchema);
@@ -1,6 +1,4 @@
1
1
  import { Schema, model, Types, Document } from "mongoose";
2
-
3
-
4
2
  export interface IPPTSlideSchema extends Document {
5
3
  pptRef: Types.ObjectId;
6
4
  slideRef: Types.ObjectId;
@@ -30,6 +28,4 @@ const PPTSlideSchema = new Schema<IPPTSlideSchema>(
30
28
  }
31
29
  );
32
30
 
33
- const PPTSlideModel = model<IPPTSlideSchema>("ppt-slide", PPTSlideSchema);
34
-
35
- export default PPTSlideModel;
31
+ export const PPTSlideModel = model<IPPTSlideSchema>("ppt-slide", PPTSlideSchema);
@@ -55,6 +55,4 @@ const PPTSchema = new Schema<IPPTSchema>(
55
55
  }
56
56
  );
57
57
 
58
- const PPTModel = model<IPPTSchema>("ppt", PPTSchema);
59
-
60
- export default PPTModel;
58
+ export const PPTModel = model<IPPTSchema>("ppt", PPTSchema);
@@ -21,6 +21,4 @@ const SlideLayoutSchema = new Schema<ISlideLayoutSchema>(
21
21
  }
22
22
  );
23
23
 
24
- const SlideLayoutModel = model<ISlideLayoutSchema>("slide-layout", SlideLayoutSchema);
25
-
26
- export default SlideLayoutModel;
24
+ export const SlideLayoutModel = model<ISlideLayoutSchema>("slide-layout", SlideLayoutSchema);
@@ -44,6 +44,4 @@ const SlideSchema = new Schema<ISlideSchema>(
44
44
  }
45
45
  );
46
46
 
47
- const SlideModel = model<ISlideSchema>("slide", SlideSchema);
48
-
49
- export default SlideModel;
47
+ export const SlideModel = model<ISlideSchema>("slide", SlideSchema);
@@ -19,6 +19,4 @@ const SocketSchema = new Schema<ISocketSchema>(
19
19
  }
20
20
  );
21
21
 
22
- const SocketModel = model<ISocketSchema>("socket", SocketSchema);
23
-
24
- export default SocketModel;
22
+ export const SocketModel = model<ISocketSchema>("socket", SocketSchema);
@@ -21,6 +21,4 @@ const TemplateSchema = new Schema<ITemplateSchema>(
21
21
  }
22
22
  );
23
23
 
24
- const TemplateModel = model<ITemplateSchema>("template", TemplateSchema);
25
-
26
- export default TemplateModel;
24
+ export const TemplateModel = model<ITemplateSchema>("template", TemplateSchema);
@@ -23,6 +23,4 @@ const UserSchema = new Schema<IUser>(
23
23
  }
24
24
  );
25
25
 
26
- const UserModel = model<IUser>("user", UserSchema);
27
-
28
- export default UserModel;
26
+ export const UserModel = model<IUser>("user", UserSchema);
@@ -0,0 +1,3 @@
1
+ export * from "./authentication";
2
+ export * from "./role";
3
+ export * from "./schemaValidate";
@@ -1,5 +1,5 @@
1
- export default {
2
- User: 'User',
3
- Admin: 'Admin'
4
- }
5
-
1
+ export const ROLES = {
2
+ User: 'User',
3
+ Admin: 'Admin',
4
+ SuperAdmin: 'SuperAdmin'
5
+ }
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "build": "tsc",
8
- "publish": "npm publish --access public",
9
8
  "test": "echo \"Error: no test specified\" && exit 1"
10
9
  },
11
10
  "keywords": [],
@@ -1,6 +1,6 @@
1
1
  import { Response } from "express";
2
2
  import IRequest from "./IRequest";
3
3
 
4
- export default interface IController {
4
+ export interface IController {
5
5
  (req: IRequest, res: Response): void;
6
6
  }
package/types/IRequest.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Request } from "express";
2
2
 
3
- export default interface IRequest extends Request {
3
+ export interface IRequest extends Request {
4
4
  user?: any,
5
5
  token?: any,
6
6
  role?: any,