dl-commons 0.0.2-testing.16 → 0.0.2-testing.18

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dl-commons",
3
3
  "type": "commonjs",
4
- "version": "0.0.2-testing.16",
4
+ "version": "0.0.2-testing.18",
5
5
  "description": "distance learning commons",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -73,7 +73,7 @@ import { ISMTPAPIConfig } from './models/interfaces/smtp-api-config.interface';
73
73
  import { SMTPService } from './services/smtp.service';
74
74
  import { Time, TimeDocument, TimeSchema } from './models/schemas/embedded/time.schema';
75
75
  import { FileLogInitType, S3FileState } from './models/enums/s3.enum';
76
- import { IS3, ILogInitiator, IS3File, IFileState, IFileRecord, IFileMeta, IFileLog } from './models/interfaces/s3.interface';
76
+ import { IS3, ILogInitiator, IS3File, IFileState, IFileRecord, IFileMeta, IFileLog, IFileEmbedded } from './models/interfaces/s3.interface';
77
77
  import {
78
78
  S3,
79
79
  S3Schema,
@@ -108,6 +108,8 @@ import { IAttachement } from './models/interfaces/attachement.interface';
108
108
  import { Attachement, AttachementDocument, AttachementSchema } from './models/schemas/embedded/attachement.schema';
109
109
  import { Picture, PictureSchema, PictureDocument } from './models/schemas/embedded/picture.schema';
110
110
  import { IPicture } from './models/interfaces/picture.interface';
111
+ import { IAuthor } from './models/interfaces/author.interface';
112
+ import { Author, AuthorDocument, AuthorSchema } from './models/schemas/embedded/author.schema';
111
113
 
112
114
  export {
113
115
  /**
@@ -201,6 +203,8 @@ export {
201
203
  ICropArea,
202
204
  IAttachement,
203
205
  IPicture,
206
+ IAuthor,
207
+ IFileEmbedded,
204
208
 
205
209
  /**
206
210
  * Schemas & Documents
@@ -280,6 +284,9 @@ export {
280
284
  Picture,
281
285
  PictureSchema,
282
286
  PictureDocument,
287
+ Author,
288
+ AuthorSchema,
289
+ AuthorDocument,
283
290
 
284
291
  /**
285
292
  * Filters
@@ -0,0 +1,8 @@
1
+ import { Types } from 'mongoose';
2
+
3
+ export interface IAuthor {
4
+ userId?: Types.ObjectId | string | null | undefined;
5
+ firstName?: string | null | undefined;
6
+ lastName?: string | null | undefined;
7
+ pid?: string | null | undefined;
8
+ }
@@ -0,0 +1,21 @@
1
+ import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
2
+ import { IAuthor } from '../../interfaces/author.interface';
3
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
4
+
5
+ @Schema({ _id: false })
6
+ export class Author implements IAuthor {
7
+ @Prop({ type: MongooseSchema.Types.ObjectId, default: null })
8
+ userId: Types.ObjectId | string | null | undefined;
9
+
10
+ @Prop({ type: String, required: false, default: null })
11
+ pid: string | null | undefined;
12
+
13
+ @Prop({ type: String, required: false, default: null })
14
+ firstName: string | null | undefined;
15
+
16
+ @Prop({ type: String, required: false, default: null })
17
+ lastName: string | null | undefined;
18
+ }
19
+
20
+ export const AuthorSchema = SchemaFactory.createForClass(Author);
21
+ export type AuthorDocument = HydratedDocument<Author>;
@@ -12,10 +12,10 @@ export class Picture implements IPicture {
12
12
  original: IFileEmbedded;
13
13
 
14
14
  @Prop({ type: FileEmbeddedSchema, required: false, default: null })
15
- cropped: IFileEmbedded;
15
+ cropped: IFileEmbedded | null | undefined;
16
16
 
17
17
  @Prop({ type: CropAreaSchema, required: false, default: null })
18
- cropArea: ICropArea;
18
+ cropArea: ICropArea | null | undefined;
19
19
  }
20
20
 
21
21
  export const PictureSchema = SchemaFactory.createForClass(Picture);